UNPKG

froala-editor

Version:

The next generation Javascript WYSIWYG HTML rich text editor made by devs for devs. High performance and modern design make it easy to use for developers and loved by users.

7 lines (6 loc) 520 kB
/*! * froala_editor v5.0.1 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2026 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).FroalaEditor=t()}(this,function(){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function O(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(o,r)}function P(e,t){var n,o,r,i,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return r=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){r=!0,n=e},f:function(){try{o||null==a["return"]||a["return"]()}finally{if(r)throw n}}};if(Array.isArray(e)||(a=s(e))||t)return a&&(e=a),i=0,{s:t=function(){},n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(e,t,n){(t=function(e){e=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0===n)return("string"===t?String:Number)(e);e=n.call(e,t);if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:e+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}function H(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0!==t)for(;!(l=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw r}}return s}}function R(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function x(){var u,g,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function o(e,t,n,o){var r,i,a,s,l,c,d,f,p,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype);return b(t,"_invoke",(r=e,i=n,d=o||[],f=!1,p={p:c=0,n:0,v:u,a:h,f:h.bind(u,4),d:function(e,t){return a=e,s=0,l=u,p.n=t,C}},function(e,t,n){if(1<c)throw TypeError("Generator is already running");for(f&&1===t&&h(t,n),s=t,l=n;(g=s<2?u:l)||!f;){a||(s?s<3?(1<s&&(p.n=-1),h(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(g=a[e=s?e:"next"]){if(!(g=g.call(a,l)))throw TypeError("iterator result is not an object");if(!g.done)return g;l=g.value,s<2&&(s=0)}else 1===s&&(g=a["return"])&&g.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);a=u}else if((g=(f=p.n<0)?l:r.call(i,p))!==C)break}catch(g){a=u,s=1,l=g}finally{c=1}}return{value:g,done:f}}),!0),t;function h(e,t){for(s=e,l=t,g=0;!f&&c&&!n&&g<d.length;g++){var n,o=d[g],r=p.p,i=o[2];3<e?(n=i===t)&&(l=o[(s=o[4])?5:s=3],o[4]=o[5]=u):o[0]<=r&&((n=e<2&&r<o[1])?(s=0,p.v=t,p.n=o[1]):r<i&&(n=e<3||o[0]>t||i<t)&&(o[4]=e,o[5]=t,p.n=i,s=0))}if(n||1<e)return C;throw f=!0,t}}var C={};function m(){}function r(){}function i(){}g=Object.getPrototypeOf;var e=[][t]?g(g([][t]())):(b(g={},t,function(){return this}),g),a=i.prototype=m.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,i):(e.__proto__=i,b(e,n,"GeneratorFunction")),e.prototype=Object.create(a),e}return b(a,"constructor",r.prototype=i),b(i,"constructor",r),b(i,n,r.displayName="GeneratorFunction"),b(a),b(a,n,"Generator"),b(a,t,function(){return this}),b(a,"toString",function(){return"[object Generator]"}),(x=function(){return{w:o,m:s}})()}function b(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}(b=function(e,t,n,o){function r(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(r("next",0),r("throw",1),r("return",2))})(e,t,n,o)}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||H(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return(h="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)}function s(e,t){var n;if(e)return"string"==typeof e?o(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}if(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))do{if(t.matches(e))return t}while(null!==(t=t.parentElement||t.parentNode)&&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<n}),Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),o=1;o<arguments.length;o++){var r=arguments[o];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n},writable:!0,configurable:!0}),function(){var i=/^\s*:scope/gi,a=/,\s*:scope/gi,s=document.createElement("div");function e(e,t){var r=e[t];e[t]=function(e){var t,n=!1,o=!1;return e&&!Array.isArray(e)&&(e.match(i)||e.match(a))?(this.parentNode||(s.appendChild(this),o=!0),t=this.parentNode,this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=r.call(t,e.replace(i,"#".concat(this.id)).replace(a,",#".concat(this.id))),n&&(this.id=""),o&&s.removeChild(this),t):r.call(this,e)}}try{var t=s.querySelectorAll(":scope *");if(!t||Array.isArray(t))throw"error"}catch(n){e(Element.prototype,"querySelector"),e(Element.prototype,"querySelectorAll"),e(HTMLElement.prototype,"querySelector"),e(HTMLElement.prototype,"querySelectorAll")}}(),"document"in self){var e;if(!("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))))if("Element"in(e=self)){var i,t="classList",n="prototype",e=e.Element[n],r=Object,z=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},F=Array[n].indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(t in this&&this[t]===e)return t;return-1},a=function a(e,t){this.name=e,this.code=DOMException[e],this.message=t},l=function l(e,t){if(""===t)throw new a("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","The token must not contain space characters.");return F.call(e,t)},c=(i=function i(e){for(var t=z.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],o=0,r=n.length;o<r;o++)this.push(n[o]);this._updateClassName=function(){e.setAttribute("class",this.toString())}})[n]=[],d=function d(){return new i(this)};if(a[n]=Error[n],c.item=function(e){return this[e]||null},c.contains=function(e){return~l(this,e+"")},c.add=function(){for(var e,t=arguments,n=0,o=t.length,r=!1;~l(this,e=t[n]+"")||(this.push(e),r=!0),++n<o;);r&&this._updateClassName()},c.remove=function(){var e,t,n=arguments,o=0,r=n.length,i=!1;do{for(t=l(this,e=n[o]+"");~t;)this.splice(t,1),i=!0,t=l(this,e)}while(++o<r);i&&this._updateClassName()},c.toggle=function(e,t){var n=this.contains(e),o=n?!0!==t&&"remove":!1!==t&&"add";return o&&this[o](e),!0===t||!1===t?t:!n},c.replace=function(e,t){e=l(e+"");~e&&(this.splice(e,1,t),this._updateClassName())},c.toString=function(){return this.join(" ")},r.defineProperty){c={get:d,enumerable:!0,configurable:!0};try{r.defineProperty(e,t,c)}catch(k){void 0!==k.number&&-2146823252!==k.number||(c.enumerable=!1,r.defineProperty(e,t,c))}}else r[n].__defineGetter__&&e.__defineGetter__(t,d)}(c=document.createElement("_")).classList.add("c1","c2"),c.classList.contains("c2")||((f=function f(e){var f=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){for(var t=arguments.length,n=0;n<t;n++)f.call(this,arguments[n])}})("add"),f("remove")),c.classList.toggle("c3",!1),c.classList.contains("c3")&&(Z=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:Z.call(this,e)}),"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(" "),e=n.indexOf(e+"");~e&&(n=n.slice(e),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))})}var f,Z,p,n=-1;if("Microsoft Internet Explorer"===navigator.appName?(p=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(p)&&(n=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(p=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(p))&&(n=parseFloat(RegExp.$1)),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||n<0)){var u,g,C=!1;try{var K=document.createElement("div");K.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),K.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!=typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return C=!1;C=!0}}))}catch(J){}HTMLElement.prototype.nativeFocus!==undefined||C||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,u=function u(e){for(var t=e.parentNode,n=[],o=document.scrollingElement||document.documentElement;t&&t!==o;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return n.push([t=o,t.scrollTop,t.scrollLeft]),n},g=function g(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2]},HTMLElement.prototype.focus=function ee(e){var t,n;e&&e.preventScroll?(t=u(this),"function"==typeof setTimeout?(n=this,setTimeout(function(){n.nativeFocus(),g(t)},0)):(this.nativeFocus(),g(t))):this.nativeFocus()})}function I(e,t,n){if("string"!=typeof e)return new I.Bootstrap(e,t,n);for(var o=document.querySelectorAll(e),r=(t&&t.iframe_document&&(o=t.iframe_document.querySelectorAll(e)),[]),i=0;i<o.length;i++){var a=o[i]["data-froala.editor"];r.push(a||new I.Bootstrap(o[i],t,n))}return 1==r.length?r[0]:r}I.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(I)},Object.assign(I,{DEFAULTS:{allowStylingOnNonEditable:!1,initOnClick:!1,pluginsEnabled:null,pluginsDisabled:null},MODULES:{},PLUGINS:{},VERSION:"5.0.1",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),I.MODULES.node=function(a){var n=a.$;function s(e){return e&&"IFRAME"!==e.tagName?Array.prototype.slice.call(e.childNodes||[]):[]}function l(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&0<=I.BLOCK_TAGS.indexOf(e.tagName.toLowerCase())}function c(e){var t={},n=e.attributes;if(n)for(var o=0;o<n.length;o++){var r=n[o];t[r.nodeName]=r.value}return t}function t(e){for(var t="",n=c(e),o=Object.keys(n),r=0;r<o.length;r++){var i=o[r],a=n[i];a.indexOf("'")<0&&0<=a.indexOf('"')?t+=" ".concat(i,"='").concat(a,"'"):(0<=a.indexOf('"')&&0<=a.indexOf("'")&&(a=a.replace(/"/g,"&quot;")),t+=" ".concat(i,'="').concat(a,'"'))}return t}function o(e){return e===a.el}return{isBlock:l,isEmpty:function(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;for(var n=s(e),o=(1===n.length&&l(n[0])&&(n=s(n[0])),!1),r=0;r<n.length;r++){var i=n[r];if((!t||!a.node.hasClass(i,"fr-marker"))&&(i.nodeType!==Node.TEXT_NODE||0!==i.textContent.length)){if("BR"!==i.tagName&&0<(i.textContent||"").replace(/\u200B/gi,"").replace(/\n/g,"").length)return!1;if(o)return!1;"BR"===i.tagName&&(o=!0)}}return!(e.querySelectorAll(I.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(a.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(I.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(a.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function(e){for(;e&&e.parentNode!==a.el&&(!e.parentNode||!a.node.hasClass(e.parentNode,"fr-inner"));)if(l(e=e.parentNode))return e;return null},deepestParent:function(e,t,n){if(void 0===n&&(n=!0),(t=void 0===t?[]:t).push(a.el),0<=t.indexOf(e.parentNode)||e.parentNode&&a.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=I.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)&&n)return null;for(;t.indexOf(e.parentNode)<0&&e.parentNode&&!a.node.hasClass(e.parentNode,"fr-inner")&&(I.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)<0||!n)&&(!l(e)||l(e.parentNode))&&(!l(e)||!l(e.parentNode)||!n);)e=e.parentNode;return e},rawAttributes:c,attributes:t,clearAttributes:function(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var o=t[n];e.removeAttribute(o.nodeName)}},openTagString:function(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function r(e,t){void 0===t&&(t=!0);for(var n=e.previousSibling;n&&t&&a.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&r(n)},isLastSibling:function i(e,t){void 0===t&&(t=!0);for(var n=e.nextSibling;n&&t&&a.node.hasClass(n,"fr-marker");)n=n.nextSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&i(n)},isList:function(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:o,contents:s,isVoid:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=I.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function(e){return e===a.doc.activeElement&&(!a.doc.hasFocus||a.doc.hasFocus())&&Boolean(o(e)||e.type||e.href||~e.tabIndex)},isEditable:function(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0&&!(e.viewportElement&&"svg"===e.viewportElement.tagName)},isDeletable:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function(e,t){return(e=e instanceof n?e.get(0):e)&&e.classList&&e.classList.contains(t)},filter:function(e){return a.browser.msie?e:{acceptNode:e}}}},Object.assign(I.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,preserveTabSpaces:!1,fullPage:!1}),I.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},I.MODULES.clean=function(w){var m,b,v,E,k=w.$;function r(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker")||["TABLE","TBODY","THEAD","TFOOT","TR","TD","TH"].includes(e.nodeName))return!1;for(var t=w.node.contents(e),n=[],o=0;o<t.length;o++)t[o].nodeType!==Node.ELEMENT_NODE||w.node.isVoid(t[o])?t[o].nodeType===Node.TEXT_NODE&&(t[o].textContent=t[o].textContent.replace(/\u200b/g,"")):t[o].textContent.replace(/\u200b/g,"").length!==t[o].textContent.length&&r(t[o]);if(e.nodeType===Node.ELEMENT_NODE&&!w.node.isVoid(e)&&(e.normalize(),t=w.node.contents(e),n=e.querySelectorAll(".fr-marker"),t.length-n.length==0)){for(o=0;o<t.length;o++)if(t[o].nodeType===Node.ELEMENT_NODE&&(t[o].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(o=0;o<n.length;o++)e.parentNode.insertBefore(n[o].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}var a=[];function L(e){e=e.replace(/;;/gi,";");return";"!==(e=e.replace(/^;/gi,"")).charAt(e.length)&&(e+=";"),e}function s(e){var t,n,o;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n=t.match(v),o=null,"style"===t&&w.opts.htmlAllowedStyleProps.length&&(o=e[t].match(E)),n&&o?e[t]=L(o.join(";")):n&&("style"!==t||o)||delete e[t]);for(var r="",i=Object.keys(e).sort(),a=0;a<i.length;a++)e[t=i[a]].indexOf('"')<0?r+=" ".concat(t,'="').concat(e[t],'"'):r+=" ".concat(t,"='").concat(e[t],"'");return r}function l(e,t){var n=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV"),e=e.replace(/(<col[^>]*>)&nbsp;/g,"$1"),o=(k(n).append(e),"");if(n){for(var r=w.node.contents(n),i=0;i<r.length;i++)t(r[i]);for(r=w.node.contents(n),i=0;i<r.length;i++)o+=function s(e,t){if(e.nodeType===Node.COMMENT_NODE)return"\x3c!--".concat(e.nodeValue,"--\x3e");if(e.nodeType===Node.TEXT_NODE)return t?e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):w.opts.preserveTabSpaces?e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/g," ".repeat(w.opts.tabSpaces)||" ".repeat(4)):e.textContent.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/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;var n,o;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName)return n=document.createElement("div"),o=e.cloneNode(!0),n.appendChild(o),n.innerHTML;if("IFRAME"===e.tagName)return e.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">");var r=e.childNodes;if(0===r.length)return e.outerHTML;for(var i="",a=0;a<r.length;a++)"PRE"===e.tagName&&(t=!0),i+=s(r[a],t);return w.node.openTagString(e)+i+w.node.closeTagString(e)}(r[i])}return o}function c(e,t,n){a=[];var o,r=e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return a.push(e),"[FROALA.EDITOR.SCRIPT ".concat(a.length-1,"]")}).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return a.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(a.length-1,"]")}).replace(/<meta((?:[\w\W]*?)) http-equiv="/g,'<meta$1 data-fr-http-equiv="').replace(/<img((?:[\w\W]*?)) src="/g,'<img$1 data-fr-src="'),i=null,i=(w.opts.fullPage&&(r=w.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n)&&(i=w.html.extractNode(e,"head")||""),r=l(r,t),i=i&&l(i,t),n=r,t=i,r=e,w.opts.fullPage?(i=w.html.extractDoctype(r),e=s(w.html.extractNodeAttrs(r,"html")),t=null===t?w.html.extractNode(r,"head")||"<title></title>":t,o=s(w.html.extractNodeAttrs(r,"head")),r=s(w.html.extractNodeAttrs(r,"body")),"".concat(i,"<html").concat(e,"><head").concat(o,">").concat(t,"</head><body").concat(r,">").concat(n,"</body></html>")):n);return i.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=w.opts.htmlRemoveTags.indexOf("script")?"":a[parseInt(t,10)]}).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){var n,o;return 0<=w.opts.htmlRemoveTags.indexOf("noscript")?"":(t=a[parseInt(t,10)].replace(/&lt;/g,"<").replace(/&gt;/g,">"),(n=k(t))&&n.length&&(o=l(n.html(),N),n.html(o),t=n.get(0).outerHTML),t)}).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}function y(e){var t=w.doc.createElement("DIV");return t.innerText=e,t.textContent}function N(e){for(var t,n,o=w.node.contents(e),r=0;r<o.length;r++)o[r].nodeType!==Node.TEXT_NODE&&N(o[r]);var i=e;if(!("SPAN"===i.tagName&&0<=(i.getAttribute("class")||"").indexOf("fr-marker")))if("PRE"===i.tagName&&0<=(n=(t=i).innerHTML).indexOf("\n")&&(t.innerHTML=n.replace(/\n/g,"<br>")),i.nodeType===Node.ELEMENT_NODE&&(i.getAttribute("data-fr-src")&&0!==i.getAttribute("data-fr-src").indexOf("blob:")&&i.setAttribute("data-fr-src",w.helpers.sanitizeURL(y(i.getAttribute("data-fr-src")))),i.getAttribute("href")&&i.setAttribute("href",w.helpers.sanitizeURL(y(i.getAttribute("href")))),i.getAttribute("src")&&i.setAttribute("src",w.helpers.sanitizeURL(y(i.getAttribute("src")))),i.getAttribute("srcdoc")&&i.setAttribute("srcdoc",w.clean.html(i.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(i.tagName))&&(i.innerHTML=i.innerHTML.trim()),!w.opts.pasteAllowLocalImages&&i.nodeType===Node.ELEMENT_NODE&&"IMG"===i.tagName&&i.getAttribute("data-fr-src")&&0===i.getAttribute("data-fr-src").indexOf("file://"))i.parentNode.removeChild(i);else if(i.nodeType===Node.ELEMENT_NODE&&I.HTML5Map[i.tagName]&&""===w.node.attributes(i)&&(t=I.HTML5Map[i.tagName],n="<".concat(t,">").concat(i.innerHTML,"</").concat(t,">"),i.insertAdjacentHTML("beforebegin",n),(i=i.previousSibling).parentNode.removeChild(i.nextSibling)),w.opts.htmlAllowComments||i.nodeType!==Node.COMMENT_NODE)if(i.tagName&&i.tagName.match(b)){if("STYLE"==i.tagName&&w.helpers.isMac()){for(var a,s=i.innerHTML.trim(),l=[],c=/{([^}]+)}/g,s=s.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");a=c.exec(s);)l.push(a[1]);for(var d=function d(t){var e=s.substring(0,s.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&i.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",l[t])}),s=s.substring(s.indexOf("}")+1)},f=0;-1!=s.indexOf("{");f++)d(f)}i.parentNode.removeChild(i)}else if(i.tagName&&!i.tagName.match(m))"svg"===i.tagName?i.parentNode.removeChild(i):w.browser.safari&&"path"===i.tagName&&i.parentNode&&"svg"===i.parentNode.tagName||(i.outerHTML=i.innerHTML);else{var p=i.attributes;if(p)for(var h=p.length-1;0<=h;h--){var u=p[h],g=u.nodeName.match(v),C=null;"style"===u.nodeName&&w.opts.htmlAllowedStyleProps.length&&(C=u.value.match(E)),g&&C?u.value=L(C.join(";")):g&&("style"!==u.nodeName||C)||i.removeAttribute(u.nodeName)}}else 0!==i.data.indexOf("[FROALA.EDITOR")&&i.parentNode.removeChild(i)}function D(){var e,t=[];do{if(t.length){var n=t[0],o=w.doc.createElement("ul");n.parentNode.insertBefore(o,n);do{var r=n,n=n.nextSibling}while(o.appendChild(r),n&&"LI"===n.tagName)}for(var t=[],i=w.el.querySelectorAll("li"),a=0;a<i.length;a++)e=i[a],w.node.isList(e.parentNode)||t.push(i[a])}while(0<t.length)}function $(){var e;do{for(var t=!1,n=w.el.querySelectorAll("li:empty"),o=0;o<n.length;o++)n[o].parentNode.removeChild(n[o]);var r=w.el.querySelectorAll("ul, ol");for(o=0;o<r.length;o++)(e=r[o]).querySelector("LI")||(t=!0,e.parentNode.removeChild(e))}while(!0===t)}return{_init:function(){w.opts.fullPage&&k.merge(w.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function(e,t,n,o){void 0===t&&(t=[]),void 0===n&&(n=[]),0<=e.indexOf("<plaintext>")&&(e=e.replace(/<plaintext>/g,"").replace(/<\/plaintext>/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\u00A0/g,"&nbsp;").replace(/\t/g,w.opts.preserveTabSpaces?" ".repeat(w.opts.tabSpaces||4):""),a=w.html.defaultTag(),w.opts.enter!=I.ENTER_BR)&&(e="<".concat(a,">").concat(e,"</").concat(a,">"));for(var r=k.merge([],w.opts.htmlAllowedTags),i=0;i<t.length;i++)0<=r.indexOf(t[i])&&r.splice(r.indexOf(t[i]),1);var a,s=k.merge([],w.opts.htmlAllowedAttrs);for(i=0;i<n.length;i++)0<=s.indexOf(n[i])&&s.splice(s.indexOf(n[i]),1);return s.push("data-fr-.*"),s.push("fr-.*"),m=new RegExp("^".concat(r.join("$|^"),"$"),"gi"),v=new RegExp("^".concat(s.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(w.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),E=w.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(w.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=c(e,N,!0),"undefined"!=typeof w.opts.DOMPurify&&(a={ALLOW_UNKNOWN_PROTOCOLS:!0},1===w.opts.htmlAllowedTags.length&&".*"===w.opts.htmlAllowedTags[0]||(a.ALLOWED_TAGS=w.opts.htmlAllowedTags),1===w.opts.htmlAllowedAttrs.length&&".*"===w.opts.htmlAllowedAttrs[0]||(a.ALLOWED_ATTR=w.opts.htmlAllowedAttrs),e=w.opts.DOMPurify.sanitize(e,a)),e},toHTML5:function(){var e=w.el.querySelectorAll(Object.keys(I.HTML5Map).join(","));if(e.length){var t=!1;w.el.querySelector(".fr-marker")||(w.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===w.node.attributes(e[n])&&k(e[n]).replaceWith("<".concat(I.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(I.HTML5Map[e[n].tagName],">"));t&&w.selection.restore()}},tables:function(){for(var e=w.el.querySelectorAll("tr"),t=0,n=0;n<e.length;n++){for(var o,r,i=e[n].outerHTML.match(/rowspan="([0-9]+)"/),a=(i&&(t+=Number(i[1])-1),e[n].children),s=!0,l=0;l<a.length;l++)if("TH"!==a[l].tagName){s=!1;break}!1!==s&&0!==a.length&&(1===a.length&&"TH"===a[0].tagName&&t?t--:(o=(i=e[n]).closest("table"))&&((r=o.querySelector("thead"))||(r=w.doc.createElement("THEAD"),o.insertBefore(r,o.firstChild)),r.contains(i)||r.appendChild(i)))}for(var c=w.$el.find("td[width]"),d=0;d<c.length;d++){var f=k(c[d]),p=f.attr("width");p&&(f.css("width",p),f.removeAttr("width"))}},lists:function(){D();for(var e=w.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(w.node.isList(n.previousSibling)&&w.node.openTagString(n)===w.node.openTagString(n.previousSibling)){for(var o=w.node.contents(n),r=0;r<o.length;r++)n.previousSibling.appendChild(o[r]);n.parentNode.removeChild(n)}}for(var i=w.el.querySelectorAll("ul, ol"),a=0;a<i.length;a++)for(var s=w.node.contents(i[a]),l=null,c=s.length-1;0<=c;c--)(s[c].tagName||!w.opts.htmlUntouched)&&"LI"!==s[c].tagName&&"UL"!=s[c].tagName&&"OL"!=s[c].tagName?"BR"==s[c].tagName?k(s[c]).remove():(l||(l=k(w.doc.createElement("LI"))).insertBefore(s[c]),l.prepend(s[c])):l=null;$();for(var d=w.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),f=0;f<d.length;f++){var p=d[f],h=p.previousSibling;h&&("LI"===h.tagName?h.appendChild(p):k(p).wrap("<li></li>"))}for(var u=w.el.querySelectorAll("li > ul, li > ol"),g=0;g<u.length;g++){var C=u[g];if(C.nextSibling)for(var m=C.nextSibling;0<m.childNodes.length;)C.append(m.childNodes[0])}for(var b=w.el.querySelectorAll("li > ul, li > ol"),v=0;v<b.length;v++){var E=b[v];if(w.node.isFirstSibling(E)&&"none"!=E.parentNode.style.listStyleType)k(E).before("<br/>");else if(E.previousSibling&&"BR"===E.previousSibling.tagName){for(var L=E.previousSibling.previousSibling;L&&w.node.hasClass(L,"fr-marker");)L=L.previousSibling;L&&"BR"!==L.tagName&&k(E.previousSibling).remove()}}for(var y=w.el.querySelectorAll("li:empty"),N=0;N<y.length;N++)k(y[N]).remove();for(var T=w.el.querySelectorAll("ul, ol"),S=0;S<T.length;S++)for(var A=T[S],M=w.node.contents(A),O=function O(){var e=M[x],t=w.node.contents(e);if(e.nodeType!==Node.ELEMENT_NODE)return 0;var n=e.querySelectorAll("ul, ol");if(0<n.length&&1==t.length&&t[0].nodeType===Node.ELEMENT_NODE){t=n[0],n=M[x-1];if(!n)return 0;var r=k(n).data("tracking")&&w.opts.trackChangesEnabled;_(t.querySelectorAll("li")).reverse().forEach(function(e){var t,n,o;r&&(t="pending-".concat(w.id,"-").concat(w.track_changes.getPendingChanges().length),n=w.opts.showChangesEnabled?'class="fr-highlight-change"':"",o=e.innerHTML,e.innerHTML='<span data-tracking="true" data-track-id="'.concat(t,'" ').concat(n,">").concat(o,"</span>"),w.track_changes.pushChange(t))}),n.append(t),e.remove()}},x=0;x<M.length;x++)O()},invisibleSpaces:function(e){return e.replace(/\u200b/g,"").length===e.length?e:w.clean.exec(e,r)},exec:c}},I.XS=0,I.SM=1,I.MD=2,I.LG=3;I.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),I.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-zA-Z0-9\\u00a1-\\uffff@\\[\\]\\(\\)\\{\\}.,:;!?%&$^=*+~#_\\-`'\"\\\\\\/|]*)|())",I.LinkRegExTLD="((".concat(I.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev|in|fr|it)))"),I.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(I.LinkRegExCommon,")"),I.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(I.LinkRegExCommon,")"),I.LinkRegExWWW="(www\\.".concat(I.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),I.LinkRegEx="(".concat(I.LinkRegExTLD,"|").concat(I.LinkRegExHTTP,"|").concat(I.LinkRegExWWW,"|").concat(I.LinkRegExAuth,")").concat(I.LinkRegExEnd),I.LinkProtocols=["mailto","tel","sms","notes","data"],I.MAIL_REGEX=/.+@.+\..+/i,I.MODULES.helpers=function(i){var r,a=i.$;function e(){var e,t,n={},o=(e=-1,"Microsoft Internet Explorer"===navigator.appName?(o=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(o)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(o=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(o))&&(e=parseFloat(RegExp.$1)),e);return 0<o?n.msie=!0:(e=navigator.userAgent.toLowerCase(),t=(e=/(edge)[ /]([\w.]+)/.exec(e)||/(chrome)[ /]([\w.]+)/.exec(e)||/(webkit)[ /]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[])[1]||"",e[1]&&(n[t]=!0),n.chrome?n.webkit=!0:n.webkit&&(n.safari=!0)),n.msie&&(n.version=o),n}function t(){return(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||n())&&!l()}function n(){return navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/.test(navigator.userAgent)}function o(){return/(Android)/g.test(navigator.userAgent)&&!l()}function s(){return/(Blackberry)/g.test(navigator.userAgent)}function l(){return/(Windows Phone)/gi.test(navigator.userAgent)}var c=null;function d(e){return window.pageYOffset+e.get(0).getBoundingClientRect().top}return{_init:function(){i.browser=e()},isIOS:t,isMac:function(){return c=null===c?0<=navigator.platform.toUpperCase().indexOf("MAC"):c},isIpadOS:n,getIOSVersion:function(){var e;return t()&&(e=navigator.userAgent.match(/OS (\d)?\d_\d(_\d)?/i)||navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/))&&e.length&&Math.abs(e[0].split("_")[0].replace("OS ",""))||NaN},getSafariVersion:function(){var e=navigator.userAgent;if(-1!==e.indexOf("Safari")){e=e.match(/Version\/(\d+\.\d+)/);if(e)return parseInt(e[1])}return null},getImagePopupPosition:function(e){var t=e&&d(e),n=e.offset().left+e.outerWidth()/2,o=0,r=(r=i.$wp&&d(i.$wp))||t;return i.opts.iframe?(o=(o=i.$wp.scrollTop())<e.get(0).getBoundingClientRect().top?e.get(0).getBoundingClientRect().top:o)>e.get(0).getBoundingClientRect().top+e.height()&&(o=e.get(0).getBoundingClientRect().top+e.height()):o=r<=t?t:i.$wp&&t+e.height()<r+i.$wp.height()?t+e.height():r,{top:o,left:n}},isAndroid:o,isBlackberry:s,isWindowsPhone:l,isMobile:function(){return o()||t()||s()},isEmail:function(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&I.MAIL_REGEX.test(e)},requestAnimationFrame:function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function(e){return parseInt(e,10)||0},screenSize:function(e){try{var t=0;return(t=(e?i.$box:i.$sc).width())<768?I.XS:768<=t&&t<992?I.SM:992<=t&&t<1200?I.MD:1200<=t?I.LG:void 0}catch(n){return I.LG}},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function(e){var t;return i.opts.DOMPurify&&(t={ALLOW_UNKNOWN_PROTOCOLS:!0,ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.]+(?:[^a-z+.\-:]|$))/i},1===i.opts.htmlAllowedTags.length&&".*"===i.opts.htmlAllowedTags[0]||(t.ALLOWED_TAGS=i.opts.htmlAllowedTags),1===i.opts.htmlAllowedAttrs.length&&".*"===i.opts.htmlAllowedAttrs[0]||(t.ALLOWED_ATTR=i.opts.htmlAllowedAttrs),e=i.opts.DOMPurify.sanitize(e,t)),e=e.replace(/(["'/]|\s+)on\w+=(?:"[^"]*"|'[^']*'|[^>\s]+)/gi,""),e=/^(https?:|ftps?:|)\/\//i.test(e)||/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)||new RegExp("^(".concat(I.LinkProtocols.join("|"),"):"),"i").test(e)?e:encodeURIComponent(e).replace(/%23/g,"#").replace(/%2F/g,"/").replace(/%25/g,"%").replace(/mailto%3A/gi,"mailto:").replace(/file%3A/gi,"file:").replace(/sms%3A/gi,"sms:").replace(/tel%3A/gi,"tel:").replace(/notes%3A/gi,"notes:").replace(/data%3Aimage/gi,"data:image").replace(/blob%3A/gi,"blob:").replace(/%3A(\d)/gi,":$1").replace(/webkit-fake-url%3A/gi,"webkit-fake-url:").replace(/%3F/g,"?").replace(/%3D/g,"=").replace(/%26/g,"&").replace(/&amp;/g,"&").replace(/%2C/g,",").replace(/%3B/g,";").replace(/%2B/g,"+").replace(/%40/g,"@").replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/%7B/g,"{").replace(/%7D/g,"}").replace(/%[0-1]+[0-9]+|%[0-1]+[A-F]+/g,"")},isArray:function(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===h(e)&&"number"==typeof e.length},RGBToHex:function(e){function t(e){return"0".concat(parseInt(e,10).toString(16)).slice(-2)}try{var n;return e&&"transparent"!==e?/^#[0-9A-F]{6}$/i.test(e)||/^#[0-9A-F]{8}$/i.test(e)?e.toUpperCase():(n=e.match(/^rgb\(\s*(\d+),\s*(\d+),\s*(\d+)\s*\)$/i))?"#".concat(t(n[1])).concat(t(n[2])).concat(t(n[3])).toUpperCase():(n=e.match(/^rgba\(\s*(\d+),\s*(\d+),\s*(\d+),\s*(\d*\.?\d+)\s*\)$/i))?"#".concat(t(n[1])).concat(t(n[2])).concat(t(n[3])).concat(t(Math.round(255*parseFloat(n[4])))).toUpperCase():void 0:""}catch(o){return null}},HEXtoRGB:function(e){if(e=e.replace(/^#/,""),/^rgba?\(\d+,\s*\d+,\s*\d+(,\s*(0|1|0?\.\d+))?\)$/i.test(e))return e;if(6===(e=3!==e.length&&4!==e.length?e:e.split("").map(function(e){return e+e}).join("")).length)return(o=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?"rgb(".concat(parseInt(o[1],16),", ").concat(parseInt(o[2],16),", ").concat(parseInt(o[3],16),")"):"";if(8===e.length){var t,n,o=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(o)return e=parseInt(o[1],16),t=parseInt(o[2],16),n=parseInt(o[3],16),o=parseInt(o[4],16)/255,"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(o.toFixed(2),")")}return""},isURL:function(e){return!!/^(https?:|ftps?:|)\/\//i.test(e)&&(e=String(e).replace(/</g,"%3C").replace(/>/g,"%3E").replace(/"/g,"%22").replace(/ /g,"%20"),new RegExp("^".concat(I.LinkRegExHTTP).concat(I.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function(e){var t,n,o,e=((e=e.css?e:a(e)).css("text-align")||"").replace(/-(.*)-/g,"");return["left","right","justify","center"].indexOf(e)<0&&(r||(t=a('<div dir="'.concat("rtl"===i.opts.direction?"rtl":"auto",'" style="text-align: ').concat(i.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>')),a("body").first().append(t),n=t.find("#s1").get(0).getBoundingClientRect().left,o=t.find("#s2").get(0).getBoundingClientRect().left,t.remove(),r=n<o?"left":"right"),e=r),e},scrollTop:function(){return i.o_win.pageYOffset||(i.o_doc.documentElement&&i.o_doc.documentElement.scrollTop?i.o_doc.documentElement.scrollTop:i.o_doc.body.scrollTop||0)},scrollLeft:function(){return i.o_win.pageXOffset||(i.o_doc.documentElement&&i.o_doc.documentElement.scrollLeft?i.o_doc.documentElement.scrollLeft:i.o_doc.body.scrollLeft||0)},isInViewPort:function(e){return e=e.getBoundingClientRect(),0<=(e={top:Math.round(e.top),bottom:Math.round(e.bottom)}).top&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)||e.top<=0&&e.bottom>=(window.innerHeight||document.documentElement.clientHeight)},isValidHexColor:function(e){return/^#([0-9A-F]{3}|[0-9A-F]{6})$/i.test(e)},isRGBColor:function(e){return/^rgba?\(\d+,\s*\d+,\s*\d+(,\s*\d+\.?\d*)?\)$/i.test(e)},selectionBlocks:function(){var n=0<arguments.length&&arguments[0]!==undefined?arguments[0]:[];return((1<arguments.length?arguments[1]:undefined)||i.selection.blocks()).filter(function(e){var t=a(e);return!n.some(function(e){return 0<t.closest(e).length||0<t.parents(e).length})})}}},I.MODULES.events=function(d){var t,f=d.$,a={};function e(e,t,n){u(e,t,n)}function n(e){if(e.originalEvent&&"insertReplacementText"===e.originalEvent.inputType){e=d.selection.get();if(e&&0!==e.rangeCount){for(var t=e.getRangeAt(0),n=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset;n;){for(var a=n.textContent,s=o-1;0<=s&&p(a[s]);)s--;if(s<=o-1){o=s+1;break}o=(n=function(e){for(;e;)if((!(e=e.previousSibling)||!f(e).hasClass("fr-marker"))&&e&&e.nodeType===Node.TEXT_NODE&&e.textContent.trim())return e;return null}(n))?n.textContent.length:0}for(;r;){for(var l=r.textContent,c=i;c<l.length&&p(l[c]);)c++;if(r!==n&&"'"===l&&0===i)break;if(i<c){i=c;break}r=function(e){for(;e;)if((!(e=e.nextSibling)||!f(e).hasClass("fr-marker"))&&e&&e.nodeType===Node.TEXT_NODE&&e.textContent.trim())return e;return null}(r),i=0}n&&r&&((t=document.createRange()).setStart(n,o),t.setEnd(r,i),e.removeAllRanges(),e.addRange(t))}}}function p(e){return/[\w']/i.test(e)}function o(e){var t;if(void 0===e&&(e=!0),!d.$wp)return!1;if(d.helpers.isIOS()&&d.$win.get(0).focus(),d.core.hasFocus())return!1;if(!d.core.hasFocus()&&e){var e=d.$win.scrollTop();if(d.browser.msie&&d.$box&&d.$box.css("position","fixed"),d.browser.msie&&d.$wp&&d.$wp.css("overflow","visible"),d.browser.msie&&d.$sc&&d.$sc.css("position","fixed"),d.browser.msie||(s(),d.el.focus(),d.events.trigger("focus"),i()),d.browser.msie&&d.$sc&&d.$sc.css("position",""),d.browser.msie&&d.$box&&d.$box.css("position",""),d.browser.msie&&d.$wp&&d.$wp.css("overflow","auto"),e!==d.$win.scrollTop()&&d.$win.scrollTop(e),!d.selection.info(d.el).atStart)return!1}if(!d.core.hasFocus()||0<d.$el.find(".fr-marker").length)return!1;d.selection.info(d.el).atStart&&d.selection.isCollapsed()&&null!==d.html.defaultTag()&&((e=d.markers.insert())&&!d.node.blockParent(e)?(f(e).remove(),(t=d.$el.find(d.html.blockTagsQuery()).get(0))&&(f(t).prepend(I.MARKERS),d.selection.restore())):e&&f(e).remove())}var r=!1;function i(){t=!0}function s(){t=!1}function l(){return t}function c(e,t,n){var o=e.split(" ");if(1<o.length){for(var r=0;r<o.length;r++)c(o[r],t,n);return!0}void 0===n&&(n=!1),e=(0!==e.indexOf("shared.")?(a[e]=a[e]||[],a):(d.shared._events[e]=d.shared._events[e]||[],d.shared._events))[e],n?e.unshift(t):e.push(t)}var h=[];function u(e,t,n,o,r){"function"==typeof n&&(r=o,o=n,n=!1);var i=r?d.shared.$_events:h,r=r?d.sid:d.id,t="".concat(t.trim().split(" ").join(".ed".concat(r," ")),".ed").concat(r);n?e.on(t,n,o):e.on(t,o),i.push([e,t])}function g(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function C(e,t,n){if(!d.edit.isDisabled()||n){var o,r;if(0!==e.indexOf("shared."))o=a[e];else{if(0<d.shared.count)return!1;o=d.shared._events[e]}if(o)for(var i=0;i<o.length;i++)if(!1===(r=o[i].apply(d,t)))return!1;return d.opts.events&&d.opts.events[e]&&!1===(r=d.opts.events[e].apply(d,t))?!1:r}}function m(){for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&delete a[e]}function b(){for(var e in d.shared._events)Object.prototype.hasOwnProperty.call(d.shared._events,e)&&delete d.shared._events[e]}function v(e){var e=e.currentTarget,t=d.opts.toolbarButtonsEnabledOnEditorOff;return 0!==t.length&&(t.includes(e.getAttribute("data-cmd"))||e.hasAttribute("data-group-name"))}return{_init:function(){d.shared.$_events=d.shared.$_events||[],d.shared._events={},d.helpers.isMobile()?(d._mousedown="touchstart",d._mouseup="touchend",d._move="touchmove",d._mousemove="touchmove"):(d._mousedown="mousedown",d._mouseup="mouseup",d._move="",d._mousemove="mousemove"),e(d.$el,"click mouseup mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){C(e.type,[e])}),c("mousedown",function(){for(var e=0;e<I.INSTANCES.length;e++)I.INSTANCES[e]!==d&&I.INSTANCES[e].popups&&I.INSTANCES[e].popups.areVisible()&&I.INSTANCES[e].$el.find(".fr-marker").remove()}),e(d.$win,d._mousedown,function(e){C("window.mousedown",[e]),i()}),e(d.$win,"touchend"===d._mouseup?"touchend mouseup":"mouseup",function(e){C("window.mouseup",[e])}),e(d.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){C("window.".concat(e.type),[e])}),e(d.$doc,"dragend drop",function(e){C("document.".concat(e.type),[e])}),e(d.$el,"beforeinput keydown keypress keyup input",function(e){C(e.type,[e])}),e(d.$el,"focus",function(e){t&&(o(!1),!1===r)&&(C(e.type,[e]),d.helpers.isMobile())&&s()}),e(d.$el,"blur",function(e){t&&!0===r&&(C(e.type,[e]),d.helpers.isMobile()&&d.opts.toolbarContainer&&(d.shared.selected_editor=d.id),i())}),u(d.$el,"mousedown",'[contenteditable="true"]',function(){s(),d.$el.blur()}),c("focus",function(){r=!0}),c("blur",function(){r=!1}),i(),e(d.$el,"cut copy paste beforepaste",function(e){C(e.type,[e])}),c("destroy",m),c("shared.destroy",b),c("beforeinput",n)},on:c,trigger:C,bindClick:function(t,n,r){u(t,d._mousedown,n,function(e){var t;d.edit.isDisabled()&&!v(e)||(t=f((e=e).currentTarget),!d.edit.isDisabled()&&!d.node.hasClass(t.get(0),"fr-disabled")||v(e)?"mousedown"===e.type&&1!==e.which||(d.helpers.isMobile()||e.preventDefault(),(d.helpers.isAndroid()||d.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),d.events.trigger("commands.mousedown",[t])):e.preventDefault())},!0),u(t,"".concat(d._mouseup," ").concat(d._move),n,function(e){var t,n,o;d.edit.isDisabled()&&!v(e)||(d.helpers.isIOS()&&null!==d.selection.get().focusNode&&d.selection.save(),t=r,o=f((e=e).currentTarget),!d.edit.isDisabled()&&!d.node.hasClass(o.get(0),"fr-disabled")||v(e)?"mouseup"===e.type&&1!==e.which||d.button.getButtons(".fr-selected",!0).get(0)==o.get(0)&&!d.node.hasClass(o.get(0),"fr-selected")||("touchmove"!==e.type?(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),d.node.hasClass(o.get(0),"fr-selected")?(d.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),o.data("dragging")||o.attr("disabled")?o.removeData("dragging"):((n=o.data("timeout"))&&(clearTimeout(n),o.removeData("timeout")),t.apply(d,[e]))):d.button.getButtons(".fr-selected",!0).removeClass("fr-selected")):o.data("timeout")||o.data("timeout",setTimeout(function(){o.data("dragging",!0)},100))):e.preventDefault())},!0),u(t,"mouseup",n,function(e){d.helpers.isIpadOS()&&(!d.edit.isDisabled()||v(e))&&d.helpers.isMobile()&&"touchend"==d._mouseup&&(r.apply(d,[e]),e.stopPropagation(),e.preventDefault())},!0),u(t,"mousedown click mouseup",n,function(e){d.edit.isDisabled()&&!v(e)||e.stopPropagation()},!0),c("window.mouseup",function(e){d.edit.isDisabled()&&!v(e)||(t.find(n).removeClass("fr-selected"),i())}),u(t,"mouseover",n,function(){f(this).hasClass("fr-options")&&f(this).prev(".fr-btn").addClass("fr-btn-hover"),f(this).next(".fr-btn").hasClass("fr-options")&&f(this).next(".fr-btn").addClass("fr-btn-hover")}),u(t,"mouseout",n,function(){f(this).hasClass("fr-options")&&f(this).prev(".fr-btn").removeClass("fr-btn-hover"),f(this).next(".fr-btn").hasClass("fr-options")&&f(this).next(".fr-btn").removeClass("fr-btn-hover")})},disableBlur:s,enableBlur:i,blurActive:l,focus:o,chainTrigger:function(e,t,n){if(!d.edit.isDisabled()||n){var o,r;if(0!==e.indexOf("shared."))o=a[e];else{if(0<d.shared.count)return!1;o=d.shared._events[e]}if(o)for(var i=0;i<o.length;i++)void 0!==(r=o[i].apply(d,[t]))&&(t=r);return t=d.opts.events&&d.opts.events[e]&&void 0!==(r=d.opts.events[e].apply(d,[t]))?r:t}},$on:u,$off:function(){g(h),h=[],0===d.shared.count&&(g(d.shared.$_events),d.shared.$_events=[])}}},Object.assign(I.DEFAULTS,{indentMargin:20}),I.COMMANDS={bold:{title:"Bold",toggle:!0,refresh:function(e){var t=this.format.is("strong");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},italic:{title:"Italic",toggle:!0,refresh:function(e){var t=this.format.is("em");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},underline:{title:"Underline",toggle:!0,refresh:function(e){var t=this.format.is("u");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},strikeThrough:{title:"Strikethrough",toggle:!0,refresh:function(e){var t=this.format.is("s");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},subscript:{title:"Subscript",toggle:!0,refresh:function(e){var t=this.format.is("sub");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},superscript:{title:"Superscript",toggle:!0,refresh:function(e){var t=this.format.is("sup");e.toggleClass("fr-active",t).attr("aria-pressed",t)}},outdent:{title:"Decrease Indent"},indent:{title:"Increase Indent"},undo:{title:"Undo",undo:!1,forcedRefresh:!0,disabled:!0},redo:{title:"Redo",undo:!1,forcedRefresh:!0,disabled:!0},insertHR:{title:"Insert Horizontal Line"},clearFormatting:{title:"Clear Formatting"},selectAll:{title:"Select All",undo:!1},moreText:{title:"More Text",undo:!1},moreParagraph:{title:"More Paragraph",undo:!1},moreRich:{title:"More Rich",undo:!1},moreMisc:{title:"More Misc",undo:!1}},I.RegisterCommand=function(e,t){I.COMMANDS[e]=t},I.MODULES.commands=function(s){var l=s.$;function i(e){return e=s.html.defaultTag()?"<".concat(s.html.defaultTag(),">").concat(e,"</").concat(s.html.defaultTag(),">"):e}var a={bold:function(){e(0,"strong")},subscript:function(){s.format.is("sup")&&s.format.remove("sup"),e(0,"sub")},superscript:function(){s.format.is("sub")&&s.format.remove("sub"),e(0,"sup")},italic:function(){e(0,"em")},strikeThrough:function(){e(0,"s")},underline:function(){e(0,"u")},undo:function(){s.undo.run()},redo:function(){s.undo.redo()},indent:function(){o(1)},outdent:function(){o(-1)},show:function(){s.opts.toolbarInline&&s.toolbar.showInline(null,!0)},insertHR:function(){s.selection.remove();var e,t,n="",o=(s.core.isEmpty()&&(n=i(n="<br>")),'<hr id="fr-just" class="fr-just">'.concat(n)),o=(s.opts.trackChangesEnabled&&(o=s.track_changes.wrapInTracking(l(o),"hrWrapper").get(0).outerHTML),s.html.insert(o),s.$el.find("hr#fr-just").length?s.$el.find("hr#fr-just"):s.$el.find(".fr-just")),r=(o.removeAttr("id"),o.removeAttr("class"),s.opts.trackChangesEnabled&&"SPAN"===o[0].parentNode.tagName&&"P"===o[0].parentNode.parentNode.tagName);0===o.next().length&&((t=s.html.defaultTag())&&!r?o.after(l(s.doc.createElement(t)).append("<br>").get(0)):r?o[0].parentNode.after(l(s.doc.createElement(t)).append("<br>").get(0)):o.after("<br>")),o.prev().is("hr")?e=s.selection.setAfter(o.get(0),!1):o.next().is("hr")?e=s.selection.setBefore(o.get(0),!1):r||s.selection.setAfter(o.get(0),!1)?s.selection.setAfter(o[0].parentNode,!1):s.selection.setBefore(o.get(0),!1),e||void 0===e||(n=i(n="".concat(I.MARKERS,"<br>")),o.after(n)),s.selection.restore()},clearFormatting:function(){s.format.remove()},selectAll:function(){s.doc.execCommand("selectAll",!1,!1);var e=null,t=null,n=null,o=null,r=!0===s.opts.iframe,i=l(".fr-iframe")[0],a=r?l(i.contentWindow.document.body):s.$el;o=(r&&i?(r=i.contentWindow,n=r.document.createRange.bind(r.document),r):(n=document.createRange.bind(document),window)).getSelection(),s.selection.isCollapsed()&&(o.removeAllRanges(),i=a.contents(),e=i.first()[0],t=i.last()[0],e)&&t&&((r=n()).setStart(e,0),r.setEnd(t,(t.nodeType===Node.TEXT_NODE?t.textContent:t.childNodes).length),o.addRange(r),s.selection.save())},moreText:function(e){t(e)},moreParagraph:function(e){t(e)},moreRich:function(e){t(e)},moreMisc:function(e){t(e)},moreTrackChanges:function(){t("trackChanges")}};function t(e){var e=s.$tb.find("[data-cmd=".concat(e,"]")),t=s.$tb.find("[data-cmd=html]"),n=(s.edit.isDisabled()||(s.opts.trackChangesEnabled||s.markdown&&s.markdown.isEnabled()?t&&t.addClass("fr-disabled"):t&&t.removeClass("fr-disabled")),e),t=(s.helpers.isMobile()&&s.opts.toolbarInline&&s.events.disableBlur(),s.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("data-group-name"),'"]')));"trackChanges"===n.data("cmd")&&(t=s.$tb.find('.fr-more-toolbar[data-name="'.concat(n.attr("id"),'"]'))),s.$tb.find(".fr-open").not(n).not('[data-cmd="trackChanges"]').removeClass("fr-open").attr