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) • 1.32 MB
JavaScript
/*!
* 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 S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function _(e,t,n,a,r,o,i){try{var s=e[o](i),l=s.value}catch(e){return n(e)}s.done?t(l):Promise.resolve(l).then(a,r)}function k(s){return function(){var e=this,i=arguments;return new Promise(function(t,n){var a=s.apply(e,i);function r(e){_(a,t,n,r,o,"next",e)}function o(e){_(a,t,n,r,o,"throw",e)}r(void 0)})}}function Le(e,t){var n,a,r,o,i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return r=!(a=!0),{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,n=e},f:function(){try{a||null==i["return"]||i["return"]()}finally{if(r)throw n}}};if(Array.isArray(e)||(i=D(e))||t)return i&&(e=i),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},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 M(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 O(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,r,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0!==t)for(;!(l=(a=o.call(n)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n["return"]&&(i=n["return"](),Object(i)!==i))return}finally{if(c)throw r}}return s}}function I(t,e){var n,a=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,n)),a}function x(){var g,h,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function a(e,t,n,a){var r,o,i,s,l,c,d,f,p,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return b(t,"_invoke",(r=e,o=n,d=a||[],f=!1,p={p:c=0,n:0,v:g,a:u,f:u.bind(g,4),d:function(e,t){return i=e,s=0,l=g,p.n=t,m}},function(e,t,n){if(1<c)throw TypeError("Generator is already running");for(f&&1===t&&u(t,n),s=t,l=n;(h=s<2?g:l)||!f;){i||(s?s<3?(1<s&&(p.n=-1),u(s,l)):p.n=l:p.v=l);try{if(c=2,i){if(h=i[e=s?e:"next"]){if(!(h=h.call(i,l)))throw TypeError("iterator result is not an object");if(!h.done)return h;l=h.value,s<2&&(s=0)}else 1===s&&(h=i["return"])&&h.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),s=1);i=g}else if((h=(f=p.n<0)?l:r.call(o,p))!==m)break}catch(h){i=g,s=1,l=h}finally{c=1}}return{value:h,done:f}}),!0),t;function u(e,t){for(s=e,l=t,h=0;!f&&c&&!n&&h<d.length;h++){var n,a=d[h],r=p.p,o=a[2];3<e?(n=o===t)&&(l=a[(s=a[4])?5:s=3],a[4]=a[5]=g):a[0]<=r&&((n=e<2&&r<a[1])?(s=0,p.v=t,p.n=a[1]):r<o&&(n=e<3||a[0]>t||o<t)&&(a[4]=e,a[5]=t,p.n=o,s=0))}if(n||1<e)return m;throw f=!0,t}}var m={};function v(){}function r(){}function o(){}h=Object.getPrototypeOf;var e=[][t]?h(h([][t]())):(b(h={},t,function(){return this}),h),i=o.prototype=v.prototype=Object.create(e);function s(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,b(e,n,"GeneratorFunction")),e.prototype=Object.create(i),e}return b(i,"constructor",r.prototype=o),b(o,"constructor",r),b(o,n,r.displayName="GeneratorFunction"),b(i),b(i,n,"Generator"),b(i,t,function(){return this}),b(i,"toString",function(){return"[object Generator]"}),(x=function(){return{w:a,m:s}})()}function b(e,t,n,a){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(b=function(e,t,n,a){function r(t,n){b(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!a,configurable:!a,writable:!a}):e[t]=n:(r("next",0),r("throw",1),r("return",2))})(e,t,n,a)}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||O(e,t)||D(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 Se(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||D(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 ct(e){return(ct="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 D(e,t){var n;if(e)return"string"==typeof e?S(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)?S(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),a=1;a<arguments.length;a++){var r=arguments[a];if(null!=r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},writable:!0,configurable:!0}),function(){var o=/^\s*:scope/gi,i=/,\s*:scope/gi,s=document.createElement("div");function e(e,t){var r=e[t];e[t]=function(e){var t,n=!1,a=!1;return e&&!Array.isArray(e)&&(e.match(o)||e.match(i))?(this.parentNode||(s.appendChild(this),a=!0),t=this.parentNode,this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=r.call(t,e.replace(o,"#".concat(this.id)).replace(i,",#".concat(this.id))),n&&(this.id=""),a&&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 B,P="classList",t="prototype",e=e.Element[t],n=Object,F=String[t].trim||function(){return this.replace(/^\s+|\s+$/g,"")},$=Array[t].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},i=function i(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 $.call(e,t)},r=(B=function B(e){for(var t=F.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],a=0,r=n.length;a<r;a++)this.push(n[a]);this._updateClassName=function(){e.setAttribute("class",this.toString())}})[t]=[],U=function U(){return new B(this)};if(a[t]=Error[t],r.item=function(e){return this[e]||null},r.contains=function(e){return~i(this,e+"")},r.add=function(){for(var e,t=arguments,n=0,a=t.length,r=!1;~i(this,e=t[n]+"")||(this.push(e),r=!0),++n<a;);r&&this._updateClassName()},r.remove=function(){var e,t,n=arguments,a=0,r=n.length,o=!1;do{for(t=i(this,e=n[a]+"");~t;)this.splice(t,1),o=!0,t=i(this,e)}while(++a<r);o&&this._updateClassName()},r.toggle=function(e,t){var n=this.contains(e),a=n?!0!==t&&"remove":!1!==t&&"add";return a&&this[a](e),!0===t||!1===t?t:!n},r.replace=function(e,t){e=i(e+"");~e&&(this.splice(e,1,t),this._updateClassName())},r.toString=function(){return this.join(" ")},n.defineProperty){r={get:U,enumerable:!0,configurable:!0};try{n.defineProperty(e,P,r)}catch(A){void 0!==A.number&&-2146823252!==A.number||(r.enumerable=!1,n.defineProperty(e,P,r))}}else n[t].__defineGetter__&&e.__defineGetter__(P,U)}(r=document.createElement("_")).classList.add("c1","c2"),r.classList.contains("c2")||((o=function o(e){var o=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){for(var t=arguments.length,n=0;n<t;n++)o.call(this,arguments[n])}})("add"),o("remove")),r.classList.toggle("c3",!1),r.classList.contains("c3")&&(V=DOMTokenList.prototype.toggle,DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:V.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 o,V,s,t=-1;if("Microsoft Internet Explorer"===navigator.appName?(s=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(s)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(s=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(s))&&(t=parseFloat(RegExp.$1)),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||t<0)){var z,l,K=!1;try{var W=document.createElement("div");W.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),W.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!=typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return K=!1;K=!0}}))}catch(he){}HTMLElement.prototype.nativeFocus!==undefined||K||(HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus,z=function z(e){for(var t=e.parentNode,n=[],a=document.scrollingElement||document.documentElement;t&&t!==a;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return n.push([t=a,t.scrollTop,t.scrollLeft]),n},l=function l(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 me(e){var t,n;e&&e.preventScroll?(t=z(this),"function"==typeof setTimeout?(n=this,setTimeout(function(){n.nativeFocus(),l(t)},0)):(this.nativeFocus(),l(t))):this.nativeFocus()})}function dt(e,t,n){if("string"!=typeof e)return new dt.Bootstrap(e,t,n);for(var a=document.querySelectorAll(e),r=(t&&t.iframe_document&&(a=t.iframe_document.querySelectorAll(e)),[]),o=0;o<a.length;o++){var i=a[o]["data-froala.editor"];r.push(i||new dt.Bootstrap(a[o],t,n))}return 1==r.length?r[0]:r}dt.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(dt)},Object.assign(dt,{DEFAULTS:{allowStylingOnNonEditable:!1,initOnClick:!1,pluginsEnabled:null,pluginsDisabled:null},MODULES:{},PLUGINS:{},VERSION:"5.0.1",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),dt.MODULES.node=function(i){var n=i.$;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<=dt.BLOCK_TAGS.indexOf(e.tagName.toLowerCase())}function c(e){var t={},n=e.attributes;if(n)for(var a=0;a<n.length;a++){var r=n[a];t[r.nodeName]=r.value}return t}function t(e){for(var t="",n=c(e),a=Object.keys(n),r=0;r<a.length;r++){var o=a[r],i=n[o];i.indexOf("'")<0&&0<=i.indexOf('"')?t+=" ".concat(o,"='").concat(i,"'"):(0<=i.indexOf('"')&&0<=i.indexOf("'")&&(i=i.replace(/"/g,""")),t+=" ".concat(o,'="').concat(i,'"'))}return t}function a(e){return e===i.el}return{isBlock:l,isEmpty:function(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;for(var n=s(e),a=(1===n.length&&l(n[0])&&(n=s(n[0])),!1),r=0;r<n.length;r++){var o=n[r];if((!t||!i.node.hasClass(o,"fr-marker"))&&(o.nodeType!==Node.TEXT_NODE||0!==o.textContent.length)){if("BR"!==o.tagName&&0<(o.textContent||"").replace(/\u200B/gi,"").replace(/\n/g,"").length)return!1;if(a)return!1;"BR"===o.tagName&&(a=!0)}}return!(e.querySelectorAll(dt.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(i.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(dt.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(i.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function(e){for(;e&&e.parentNode!==i.el&&(!e.parentNode||!i.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(i.el),0<=t.indexOf(e.parentNode)||e.parentNode&&i.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=dt.SIMPLE_ENTER_TAGS.indexOf(e.parentNode.tagName)&&n)return null;for(;t.indexOf(e.parentNode)<0&&e.parentNode&&!i.node.hasClass(e.parentNode,"fr-inner")&&(dt.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 a=t[n];e.removeAttribute(a.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&&i.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&r(n)},isLastSibling:function o(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&&o(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:a,contents:s,isVoid:function(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=dt.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function(e){return e===i.doc.activeElement&&(!i.doc.hasFocus||i.doc.hasFocus())&&Boolean(a(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 i.browser.msie?e:{acceptNode:e}}}},Object.assign(dt.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}),dt.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},dt.MODULES.clean=function(R){var v,b,C,E,N=R.$;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=R.node.contents(e),n=[],a=0;a<t.length;a++)t[a].nodeType!==Node.ELEMENT_NODE||R.node.isVoid(t[a])?t[a].nodeType===Node.TEXT_NODE&&(t[a].textContent=t[a].textContent.replace(/\u200b/g,"")):t[a].textContent.replace(/\u200b/g,"").length!==t[a].textContent.length&&r(t[a]);if(e.nodeType===Node.ELEMENT_NODE&&!R.node.isVoid(e)&&(e.normalize(),t=R.node.contents(e),n=e.querySelectorAll(".fr-marker"),t.length-n.length==0)){for(a=0;a<t.length;a++)if(t[a].nodeType===Node.ELEMENT_NODE&&(t[a].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(a=0;a<n.length;a++)e.parentNode.insertBefore(n[a].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}var i=[];function y(e){e=e.replace(/;;/gi,";");return";"!==(e=e.replace(/^;/gi,"")).charAt(e.length)&&(e+=";"),e}function s(e){var t,n,a;for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n=t.match(C),a=null,"style"===t&&R.opts.htmlAllowedStyleProps.length&&(a=e[t].match(E)),n&&a?e[t]=y(a.join(";")):n&&("style"!==t||a)||delete e[t]);for(var r="",o=Object.keys(e).sort(),i=0;i<o.length;i++)e[t=o[i]].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[^>]*>) /g,"$1"),a=(N(n).append(e),"");if(n){for(var r=R.node.contents(n),o=0;o<r.length;o++)t(r[o]);for(r=R.node.contents(n),o=0;o<r.length;o++)a+=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,"&").replace(/</g,"<").replace(/>/g,">"):R.opts.preserveTabSpaces?e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\t/g," ".repeat(R.opts.tabSpaces)||" ".repeat(4)):e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").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,a;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName)return n=document.createElement("div"),a=e.cloneNode(!0),n.appendChild(a),n.innerHTML;if("IFRAME"===e.tagName)return e.outerHTML.replace(/</g,"<").replace(/>/g,">");var r=e.childNodes;if(0===r.length)return e.outerHTML;for(var o="",i=0;i<r.length;i++)"PRE"===e.tagName&&(t=!0),o+=s(r[i],t);return R.node.openTagString(e)+o+R.node.closeTagString(e)}(r[o])}return a}function c(e,t,n){i=[];var a,r=e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return i.push(e),"[FROALA.EDITOR.SCRIPT ".concat(i.length-1,"]")}).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return i.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(i.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="'),o=null,o=(R.opts.fullPage&&(r=R.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n)&&(o=R.html.extractNode(e,"head")||""),r=l(r,t),o=o&&l(o,t),n=r,t=o,r=e,R.opts.fullPage?(o=R.html.extractDoctype(r),e=s(R.html.extractNodeAttrs(r,"html")),t=null===t?R.html.extractNode(r,"head")||"<title></title>":t,a=s(R.html.extractNodeAttrs(r,"head")),r=s(R.html.extractNodeAttrs(r,"body")),"".concat(o,"<html").concat(e,"><head").concat(a,">").concat(t,"</head><body").concat(r,">").concat(n,"</body></html>")):n);return o.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=R.opts.htmlRemoveTags.indexOf("script")?"":i[parseInt(t,10)]}).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){var n,a;return 0<=R.opts.htmlRemoveTags.indexOf("noscript")?"":(t=i[parseInt(t,10)].replace(/</g,"<").replace(/>/g,">"),(n=N(t))&&n.length&&(a=l(n.html(),w),n.html(a),t=n.get(0).outerHTML),t)}).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}function A(e){var t=R.doc.createElement("DIV");return t.innerText=e,t.textContent}function w(e){for(var t,n,a=R.node.contents(e),r=0;r<a.length;r++)a[r].nodeType!==Node.TEXT_NODE&&w(a[r]);var o=e;if(!("SPAN"===o.tagName&&0<=(o.getAttribute("class")||"").indexOf("fr-marker")))if("PRE"===o.tagName&&0<=(n=(t=o).innerHTML).indexOf("\n")&&(t.innerHTML=n.replace(/\n/g,"<br>")),o.nodeType===Node.ELEMENT_NODE&&(o.getAttribute("data-fr-src")&&0!==o.getAttribute("data-fr-src").indexOf("blob:")&&o.setAttribute("data-fr-src",R.helpers.sanitizeURL(A(o.getAttribute("data-fr-src")))),o.getAttribute("href")&&o.setAttribute("href",R.helpers.sanitizeURL(A(o.getAttribute("href")))),o.getAttribute("src")&&o.setAttribute("src",R.helpers.sanitizeURL(A(o.getAttribute("src")))),o.getAttribute("srcdoc")&&o.setAttribute("srcdoc",R.clean.html(o.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(o.tagName))&&(o.innerHTML=o.innerHTML.trim()),!R.opts.pasteAllowLocalImages&&o.nodeType===Node.ELEMENT_NODE&&"IMG"===o.tagName&&o.getAttribute("data-fr-src")&&0===o.getAttribute("data-fr-src").indexOf("file://"))o.parentNode.removeChild(o);else if(o.nodeType===Node.ELEMENT_NODE&&dt.HTML5Map[o.tagName]&&""===R.node.attributes(o)&&(t=dt.HTML5Map[o.tagName],n="<".concat(t,">").concat(o.innerHTML,"</").concat(t,">"),o.insertAdjacentHTML("beforebegin",n),(o=o.previousSibling).parentNode.removeChild(o.nextSibling)),R.opts.htmlAllowComments||o.nodeType!==Node.COMMENT_NODE)if(o.tagName&&o.tagName.match(b)){if("STYLE"==o.tagName&&R.helpers.isMac()){for(var i,s=o.innerHTML.trim(),l=[],c=/{([^}]+)}/g,s=s.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");i=c.exec(s);)l.push(i[1]);for(var d=function d(t){var e=s.substring(0,s.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&o.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)}o.parentNode.removeChild(o)}else if(o.tagName&&!o.tagName.match(v))"svg"===o.tagName?o.parentNode.removeChild(o):R.browser.safari&&"path"===o.tagName&&o.parentNode&&"svg"===o.parentNode.tagName||(o.outerHTML=o.innerHTML);else{var p=o.attributes;if(p)for(var u=p.length-1;0<=u;u--){var g=p[u],h=g.nodeName.match(C),m=null;"style"===g.nodeName&&R.opts.htmlAllowedStyleProps.length&&(m=g.value.match(E)),h&&m?g.value=y(m.join(";")):h&&("style"!==g.nodeName||m)||o.removeAttribute(g.nodeName)}}else 0!==o.data.indexOf("[FROALA.EDITOR")&&o.parentNode.removeChild(o)}function O(){var e,t=[];do{if(t.length){var n=t[0],a=R.doc.createElement("ul");n.parentNode.insertBefore(a,n);do{var r=n,n=n.nextSibling}while(a.appendChild(r),n&&"LI"===n.tagName)}for(var t=[],o=R.el.querySelectorAll("li"),i=0;i<o.length;i++)e=o[i],R.node.isList(e.parentNode)||t.push(o[i])}while(0<t.length)}function M(){var e;do{for(var t=!1,n=R.el.querySelectorAll("li:empty"),a=0;a<n.length;a++)n[a].parentNode.removeChild(n[a]);var r=R.el.querySelectorAll("ul, ol");for(a=0;a<r.length;a++)(e=r[a]).querySelector("LI")||(t=!0,e.parentNode.removeChild(e))}while(!0===t)}return{_init:function(){R.opts.fullPage&&N.merge(R.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function(e,t,n,a){void 0===t&&(t=[]),void 0===n&&(n=[]),0<=e.indexOf("<plaintext>")&&(e=e.replace(/<plaintext>/g,"").replace(/<\/plaintext>/g,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\t/g,R.opts.preserveTabSpaces?" ".repeat(R.opts.tabSpaces||4):""),i=R.html.defaultTag(),R.opts.enter!=dt.ENTER_BR)&&(e="<".concat(i,">").concat(e,"</").concat(i,">"));for(var r=N.merge([],R.opts.htmlAllowedTags),o=0;o<t.length;o++)0<=r.indexOf(t[o])&&r.splice(r.indexOf(t[o]),1);var i,s=N.merge([],R.opts.htmlAllowedAttrs);for(o=0;o<n.length;o++)0<=s.indexOf(n[o])&&s.splice(s.indexOf(n[o]),1);return s.push("data-fr-.*"),s.push("fr-.*"),v=new RegExp("^".concat(r.join("$|^"),"$"),"gi"),C=new RegExp("^".concat(s.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(R.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),E=R.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(R.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=c(e,w,!0),"undefined"!=typeof R.opts.DOMPurify&&(i={ALLOW_UNKNOWN_PROTOCOLS:!0},1===R.opts.htmlAllowedTags.length&&".*"===R.opts.htmlAllowedTags[0]||(i.ALLOWED_TAGS=R.opts.htmlAllowedTags),1===R.opts.htmlAllowedAttrs.length&&".*"===R.opts.htmlAllowedAttrs[0]||(i.ALLOWED_ATTR=R.opts.htmlAllowedAttrs),e=R.opts.DOMPurify.sanitize(e,i)),e},toHTML5:function(){var e=R.el.querySelectorAll(Object.keys(dt.HTML5Map).join(","));if(e.length){var t=!1;R.el.querySelector(".fr-marker")||(R.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===R.node.attributes(e[n])&&N(e[n]).replaceWith("<".concat(dt.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(dt.HTML5Map[e[n].tagName],">"));t&&R.selection.restore()}},tables:function(){for(var e=R.el.querySelectorAll("tr"),t=0,n=0;n<e.length;n++){for(var a,r,o=e[n].outerHTML.match(/rowspan="([0-9]+)"/),i=(o&&(t+=Number(o[1])-1),e[n].children),s=!0,l=0;l<i.length;l++)if("TH"!==i[l].tagName){s=!1;break}!1!==s&&0!==i.length&&(1===i.length&&"TH"===i[0].tagName&&t?t--:(a=(o=e[n]).closest("table"))&&((r=a.querySelector("thead"))||(r=R.doc.createElement("THEAD"),a.insertBefore(r,a.firstChild)),r.contains(o)||r.appendChild(o)))}for(var c=R.$el.find("td[width]"),d=0;d<c.length;d++){var f=N(c[d]),p=f.attr("width");p&&(f.css("width",p),f.removeAttr("width"))}},lists:function(){O();for(var e=R.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(R.node.isList(n.previousSibling)&&R.node.openTagString(n)===R.node.openTagString(n.previousSibling)){for(var a=R.node.contents(n),r=0;r<a.length;r++)n.previousSibling.appendChild(a[r]);n.parentNode.removeChild(n)}}for(var o=R.el.querySelectorAll("ul, ol"),i=0;i<o.length;i++)for(var s=R.node.contents(o[i]),l=null,c=s.length-1;0<=c;c--)(s[c].tagName||!R.opts.htmlUntouched)&&"LI"!==s[c].tagName&&"UL"!=s[c].tagName&&"OL"!=s[c].tagName?"BR"==s[c].tagName?N(s[c]).remove():(l||(l=N(R.doc.createElement("LI"))).insertBefore(s[c]),l.prepend(s[c])):l=null;M();for(var d=R.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),f=0;f<d.length;f++){var p=d[f],u=p.previousSibling;u&&("LI"===u.tagName?u.appendChild(p):N(p).wrap("<li></li>"))}for(var g=R.el.querySelectorAll("li > ul, li > ol"),h=0;h<g.length;h++){var m=g[h];if(m.nextSibling)for(var v=m.nextSibling;0<v.childNodes.length;)m.append(v.childNodes[0])}for(var b=R.el.querySelectorAll("li > ul, li > ol"),C=0;C<b.length;C++){var E=b[C];if(R.node.isFirstSibling(E)&&"none"!=E.parentNode.style.listStyleType)N(E).before("<br/>");else if(E.previousSibling&&"BR"===E.previousSibling.tagName){for(var y=E.previousSibling.previousSibling;y&&R.node.hasClass(y,"fr-marker");)y=y.previousSibling;y&&"BR"!==y.tagName&&N(E.previousSibling).remove()}}for(var A=R.el.querySelectorAll("li:empty"),w=0;w<A.length;w++)N(A[w]).remove();for(var T=R.el.querySelectorAll("ul, ol"),L=0;L<T.length;L++)for(var S=T[L],_=R.node.contents(S),k=function k(){var e=_[x],t=R.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=_[x-1];if(!n)return 0;var r=N(n).data("tracking")&&R.opts.trackChangesEnabled;Se(t.querySelectorAll("li")).reverse().forEach(function(e){var t,n,a;r&&(t="pending-".concat(R.id,"-").concat(R.track_changes.getPendingChanges().length),n=R.opts.showChangesEnabled?'class="fr-highlight-change"':"",a=e.innerHTML,e.innerHTML='<span data-tracking="true" data-track-id="'.concat(t,'" ').concat(n,">").concat(a,"</span>"),R.track_changes.pushChange(t))}),n.append(t),e.remove()}},x=0;x<_.length;x++)k()},invisibleSpaces:function(e){return e.replace(/\u200b/g,"").length===e.length?e:R.clean.exec(e,r)},exec:c}},dt.XS=0,dt.SM=1,dt.MD=2,dt.LG=3;dt.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),dt.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-zA-Z0-9\\u00a1-\\uffff@\\[\\]\\(\\)\\{\\}.,:;!?%&$^=*+~#_\\-`'\"\\\\\\/|]*)|())",dt.LinkRegExTLD="((".concat(dt.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev|in|fr|it)))"),dt.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(dt.LinkRegExCommon,")"),dt.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(dt.LinkRegExCommon,")"),dt.LinkRegExWWW="(www\\.".concat(dt.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),dt.LinkRegEx="(".concat(dt.LinkRegExTLD,"|").concat(dt.LinkRegExHTTP,"|").concat(dt.LinkRegExWWW,"|").concat(dt.LinkRegExAuth,")").concat(dt.LinkRegExEnd),dt.LinkProtocols=["mailto","tel","sms","notes","data"],dt.MAIL_REGEX=/.+@.+\..+/i,dt.MODULES.helpers=function(o){var r,i=o.$;function e(){var e,t,n={},a=(e=-1,"Microsoft Internet Explorer"===navigator.appName?(a=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(a)&&(e=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(a=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(a))&&(e=parseFloat(RegExp.$1)),e);return 0<a?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=a),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 a(){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(){o.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,a=0,r=(r=o.$wp&&d(o.$wp))||t;return o.opts.iframe?(a=(a=o.$wp.scrollTop())<e.get(0).getBoundingClientRect().top?e.get(0).getBoundingClientRect().top:a)>e.get(0).getBoundingClientRect().top+e.height()&&(a=e.get(0).getBoundingClientRect().top+e.height()):a=r<=t?t:o.$wp&&t+e.height()<r+o.$wp.height()?t+e.height():r,{top:a,left:n}},isAndroid:a,isBlackberry:s,isWindowsPhone:l,isMobile:function(){return a()||t()||s()},isEmail:function(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&dt.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?o.$box:o.$sc).width())<768?dt.XS:768<=t&&t<992?dt.SM:992<=t&&t<1200?dt.MD:1200<=t?dt.LG:void 0}catch(n){return dt.LG}},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function(e){var t;return o.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===o.opts.htmlAllowedTags.length&&".*"===o.opts.htmlAllowedTags[0]||(t.ALLOWED_TAGS=o.opts.htmlAllowedTags),1===o.opts.htmlAllowedAttrs.length&&".*"===o.opts.htmlAllowedAttrs[0]||(t.ALLOWED_ATTR=o.opts.htmlAllowedAttrs),e=o.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(dt.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(/&/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"===ct(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(a){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(a=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e))?"rgb(".concat(parseInt(a[1],16),", ").concat(parseInt(a[2],16),", ").concat(parseInt(a[3],16),")"):"";if(8===e.length){var t,n,a=/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(a)return e=parseInt(a[1],16),t=parseInt(a[2],16),n=parseInt(a[3],16),a=parseInt(a[4],16)/255,"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(a.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(dt.LinkRegExHTTP).concat(dt.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function(e){var t,n,a,e=((e=e.css?e:i(e)).css("text-align")||"").replace(/-(.*)-/g,"");return["left","right","justify","center"].indexOf(e)<0&&(r||(t=i('<div dir="'.concat("rtl"===o.opts.direction?"rtl":"auto",'" style="text-align: ').concat(o.$el.css("text-align"),'; position: fixed; left: -3000px;"><span id="s1">.</span><span id="s2">.</span></div>')),i("body").first().append(t),n=t.find("#s1").get(0).getBoundingClientRect().left,a=t.find("#s2").get(0).getBoundingClientRect().left,t.remove(),r=n<a?"left":"right"),e=r),e},scrollTop:function(){return o.o_win.pageYOffset||(o.o_doc.documentElement&&o.o_doc.documentElement.scrollTop?o.o_doc.documentElement.scrollTop:o.o_doc.body.scrollTop||0)},scrollLeft:function(){return o.o_win.pageXOffset||(o.o_doc.documentElement&&o.o_doc.documentElement.scrollLeft?o.o_doc.documentElement.scrollLeft:o.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)||o.selection.blocks()).filter(function(e){var t=i(e);return!n.some(function(e){return 0<t.closest(e).length||0<t.parents(e).length})})}}},dt.MODULES.events=function(d){var t,f=d.$,i={};function e(e,t,n){g(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,a=t.startOffset,r=t.endContainer,o=t.endOffset;n;){for(var i=n.textContent,s=a-1;0<=s&&p(i[s]);)s--;if(s<=a-1){a=s+1;break}a=(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=o;c<l.length&&p(l[c]);)c++;if(r!==n&&"'"===l&&0===o)break;if(o<c){o=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),o=0}n&&r&&((t=document.createRange()).setStart(n,a),t.setEnd(r,o),e.removeAllRanges(),e.addRange(t))}}}function p(e){return/[\w']/i.test(e)}function a(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"),o()),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(dt.MARKERS),d.selection.restore())):e&&f(e).remove())}var r=!1;function o(){t=!0}function s(){t=!1}function l(){return t}function c(e,t,n){var a=e.split(" ");if(1<a.length){for(var r=0;r<a.length;r++)c(a[r],t,n);return!0}void 0===n&&(n=!1),e=(0!==e.indexOf("shared.")?(i[e]=i[e]||[],i):(d.shared._events[e]=d.shared._events[e]||[],d.shared._events))[e],n?e.unshift(t):e.push(t)}var u=[];function g(e,t,n,a,r){"function"==typeof n&&(r=a,a=n,n=!1);var o=r?d.shared.$_events:u,r=r?d.sid:d.id,t="".concat(t.trim().split(" ").join(".ed".concat(r," ")),".ed").concat(r);n?e.on(t,n,a):e.on(t,a),o.push([e,t])}function h(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function m(e,t,n){if(!d.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=i[e];else{if(0<d.shared.count)return!1;a=d.shared._events[e]}if(a)for(var o=0;o<a.length;o++)if(!1===(r=a[o].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 v(){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&delete i[e]}function b(){for(var e in d.shared._events)Object.prototype.hasOwnProperty.call(d.shared._events,e)&&delete d.shared._events[e]}function C(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){m(e.type,[e])}),c("mousedown",function(){for(var e=0;e<dt.INSTANCES.length;e++)dt.INSTANCES[e]!==d&&dt.INSTANCES[e].popups&&dt.INSTANCES[e].popups.areVisible()&&dt.INSTANCES[e].$el.find(".fr-marker").remove()}),e(d.$win,d._mousedown,function(e){m("window.mousedown",[e]),o()}),e(d.$win,"touchend"===d._mouseup?"touchend mouseup":"mouseup",function(e){m("window.mouseup",[e])}),e(d.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){m("window.".concat(e.type),[e])}),e(d.$doc,"dragend drop",function(e){m("document.".concat(e.type),[e])}),e(d.$el,"beforeinput keydown keypress keyup input",function(e){m(e.type,[e])}),e(d.$el,"focus",function(e){t&&(a(!1),!1===r)&&(m(e.type,[e]),d.helpers.isMobile())&&s()}),e(d.$el,"blur",function(e){t&&!0===r&&(m(e.type,[e]),d.helpers.isMobile()&&d.opts.toolbarContainer&&(d.shared.selected_editor=d.id),o())}),g(d.$el,"mousedown",'[contenteditable="true"]',function(){s(),d.$el.blur()}),c("focus",function(){r=!0}),c("blur",function(){r=!1}),o(),e(d.$el,"cut copy paste beforepaste",function(e){m(e.type,[e])}),c("destroy",v),c("shared.destroy",b),c("beforeinput",n)},on:c,trigger:m,bindClick:function(t,n,r){g(t,d._mousedown,n,function(e){var t;d.edit.isDisabled()&&!C(e)||(t=f((e=e).currentTarget),!d.edit.isDisabled()&&!d.node.hasClass(t.get(0),"fr-disabled")||C(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),g(t,"".concat(d._mouseup," ").concat(d._move),n,function(e){var t,n,a;d.edit.isDisabled()&&!C(e)||(d.helpers.isIOS()&&null!==d.selection.get().focusNode&&d.selection.save(),t=r,a=f((e=e).currentTarget),!d.edit.isDisabled()&&!d.node.hasClass(a.get(0),"fr-disabled")||C(e)?"mouseup"===e.type&&1!==e.which||d.button.getButtons(".fr-selected",!0).get(0)==a.get(0)&&!d.node.hasClass(a.get(0),"fr-selected")||("touchmove"!==e.type?(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),d.node.hasClass(a.get(0),"fr-selected")?(d.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),a.data("dragging")||a.attr("disabled")?a.removeData("dragging"):((n=a.data("timeout"))&&(clearTimeout(n),a.removeData("timeout")),t.apply(d,[e]))):d.button.getButtons(".fr-selected",!0).removeClass("fr-selected")):a.data("timeout")||a.data("timeout",setTimeout(function(){a.data("dragging",!0)},100))):e.preventDefault())},!0),g(t,"mouseup",n,function(e){d.helpers.isIpadOS()&&(!d.edit.isDisabled()||C(e))&&d.helpers.isMobile()&&"touchend"==d._mouseup&&(r.apply(d,[e]),e.stopPropagation(),e.preventDefault())},!0),g(t,"mousedown click mouseup",n,function(e){d.edit.isDisabled()&&!C(e)||e.stopPropagation()},!0),c("window.mouseup",function(e){d.edit.isDisabled()&&!C(e)||(t.find(n).removeClass("fr-selected"),o())}),g(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")}),g(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:o,blurActive:l,focus:a,chainTrigger:function(e,t,n){if(!d.edit.isDisabled()||n){var a,r;if(0!==e.indexOf("shared."))a=i[e];else{if(0<d.shared.count)return!1;a=d.shared._events[e]}if(a)for(var o=0;o<a.length;o++)void 0!==(r=a[o].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:g,$off:function(){h(u),u=[],0===d.shared.count&&(h(d.shared.$_events),d.shared.$_events=[])}}},Object.assign(dt.DEFAULTS,{indentMargin:20}),dt.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}},dt.RegisterCommand=function(e,t){dt.COMMANDS[e]=t},dt.MODULES.commands=function(s){var l=s.$;function o(e){return e=s.html.defaultTag()?"<".concat(s.html.defaultTag(),">").concat(e,"</").concat(s.html.defaultTag(),">"):e}var i={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(){a(1)},outdent:function(){a(-1)},show:function(){s.opts.toolbarInline&&s.toolbar.showInline(null,!0)},insertHR:function(){s.selection.remove();var e,t,n="",a=(s.core.isEmpty()&&(n=o(n="<br>")),'<hr id="fr-just" class="fr-just">'.concat(n)),a=(s.opts.trackChangesEnabled&&(a=s.track_changes.wrapInTracking(l(a),"hrWrapper").get(0).outerHTML),s.html.insert(a),s.$el.find("hr#fr-just").length?s.$el.find("hr#fr-just"):s.$el.find(".fr-just")),r=(a.removeAttr("id"),a.removeAttr("class"),s.opts.trackChangesEnabled&&"SPAN"===a[0].parentNode.tagName&&"P"===a[0].parentNode.parentNode.tagName);0===a.next().length&&((t=s.html.defaultTag())&&!r?a.after(l(s.doc.createElement(t)).append("<br>").get(0)):r?a[0].parentNode.after(l(s.doc.createElement(t)).append("<br>").get(0)):a.after("<br>")),a.prev().is("hr")?e=s.selection.setAfter(a.get(0),!1):a.next().is("hr")?e=s.selection.setBefore(a.get(0),!1):r||s.selection.setAfter(a.get(0),!1)?s.selection.setAfter(a[0].parentNode,!1):s.selection.setBefore(a.get(0),!1),e||void 0===e||(n=o(n="".concat(dt.MARKERS,"<br>")),a.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,a=null,r=!0===s.opts.iframe,o=l(".fr-iframe")[0],i=r?l(o.contentWindow.document.body):s.$el;a=(r&&o?(r=o.contentWindow,n=r.document.createRange.bind(r.document),r):(n=document.createRange.bind(document),window)).getSelection(),s.selection.isCollapsed()&&(a.removeAllRanges(),o=i.contents(),e=o.first()[0],t=o.last()[0],e)&&t&&((r=n()).setStart(e,0),r.setEnd(t,(t.nodeType===Node.TEXT_NODE?t.textContent:t.childNodes).length),a.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(