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) • 487 kB
JavaScript
/*!
* froala_editor v4.5.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2025 Froala Labs
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.FroalaEditor=t()}(this,function(){"use strict";function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function E(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n["return"]||n["return"]()}finally{if(s)throw i}}}}function D(){D=function(){return a};var d,a={},e=Object.prototype,f=e.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},i=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function o(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{o({},"")}catch(d){o=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var o=t&&t.prototype instanceof v?t:v,i=Object.create(o.prototype),a=new w(r||[]);return s(i,"_invoke",{value:function c(i,a,s){var l=u;return function(e,t){if(l===g)throw Error("Generator is already running");if(l===C){if("throw"===e)throw t;return{value:d,done:!0}}for(s.method=e,s.arg=t;;){var n=s.delegate;if(n){var r=M(n,s);if(r){if(r===m)continue;return r}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(l===u)throw l=C,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);l=g;var o=p(i,a,s);if("normal"===o.type){if(l=s.done?C:h,o.arg===m)continue;return{value:o.arg,done:s.done}}"throw"===o.type&&(l=C,s.method="throw",s.arg=o.arg)}}}(e,n,a)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=l;var u="suspendedStart",h="suspendedYield",g="executing",C="completed",m={};function v(){}function c(){}function b(){}var L={};o(L,i,function(){return this});var E=Object.getPrototypeOf,y=E&&E(E(O([])));y&&y!==e&&f.call(y,i)&&(L=y);var S=b.prototype=v.prototype=Object.create(L);function N(e){["next","throw","return"].forEach(function(t){o(e,t,function(e){return this._invoke(t,e)})})}function T(l,c){var t;s(this,"_invoke",{value:function(n,r){function e(){return new c(function(e,t){!function s(e,t,n,r){var o=p(l[e],l,t);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==typeof a&&f.call(a,"__await")?c.resolve(a.__await).then(function(e){s("next",e,n,r)},function(e){s("throw",e,n,r)}):c.resolve(a).then(function(e){i.value=e,n(i)},function(e){return s("throw",e,n,r)})}r(o.arg)}(n,r,e,t)})}return t=t?t.then(e,e):e()}})}function M(e,t){var n=t.method,r=e.iterator[n];if(r===d)return t.delegate=null,"throw"===n&&e.iterator["return"]&&(t.method="return",t.arg=d,M(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=p(r,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,m;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=d),t.delegate=null,m):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,m)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function O(e){if(e||""===e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function o(){for(;++n<e.length;)if(f.call(e,n))return o.value=e[n],o.done=!1,o;return o.value=d,o.done=!0,o};return r.next=r}}throw new TypeError(typeof e+" is not iterable")}return s(S,"constructor",{value:c.prototype=b,configurable:!0}),s(b,"constructor",{value:c,configurable:!0}),c.displayName=o(b,r,"GeneratorFunction"),a.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===c||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,o(e,r,"GeneratorFunction")),e.prototype=Object.create(S),e},a.awrap=function(e){return{__await:e}},N(T.prototype),o(T.prototype,n,function(){return this}),a.AsyncIterator=T,a.async=function(e,t,n,r,o){void 0===o&&(o=Promise);var i=new T(l(e,t,n,r),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},N(S),o(S,r,"Generator"),o(S,i,function(){return this}),o(S,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function o(){for(;n.length;){var e=n.pop();if(e in t)return o.value=e,o.done=!1,o}return o.done=!0,o}},a.values=O,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=d,this.done=!1,this.delegate=null,this.method="next",this.arg=d,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&f.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=d)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function e(e,t){return i.type="throw",i.arg=n,r.next=e,t&&(r.method="next",r.arg=d),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=f.call(o,"catchLoc"),s=f.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&f.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),m}},"catch":function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=d),m}},a}function y(e,t){return function n(e){if(Array.isArray(e))return e}(e)||function d(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n["return"]&&(a=n["return"](),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||l(e,t)||function r(){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 S(e){return function t(e){if(Array.isArray(e))return o(e)}(e)||function n(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function r(){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 x(e){return(x="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 l(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(!document.documentElement.contains(t))return null;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<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),r=1;r<arguments.length;r++){var o=arguments[r];if(null!=o)for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])}return n},writable:!0,configurable:!0}),function(){var a=/^\s*:scope/gi,s=/,\s*:scope/gi,l=document.createElement("div");function e(e,t){var i=e[t];e[t]=function(e){var t,n=!1,r=!1;if(!e||Array.isArray(e)||!e.match(a)&&!e.match(s))return i.call(this,e);this.parentNode||(l.appendChild(this),r=!0);var o=this.parentNode;return this.id||(this.id="rootedQuerySelector_id_".concat((new Date).getTime()),n=!0),t=i.call(o,e.replace(a,"#".concat(this.id)).replace(s,",#".concat(this.id))),n&&(this.id=""),r&&l.removeChild(this),t}}try{var t=l.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&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){if("Element"in e){var t="classList",n="prototype",r=e.Element[n],o=Object,i=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},a=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},s=function s(e,t){this.name=e,this.code=DOMException[e],this.message=t},l=function l(e,t){if(""===t)throw new s("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","The token must not contain space characters.");return a.call(e,t)},c=function c(e){for(var t=i.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],r=0,o=n.length;r<o;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},d=c[n]=[],f=function f(){return new c(this)};if(s[n]=Error[n],d.item=function(e){return this[e]||null},d.contains=function(e){return~l(this,e+"")},d.add=function(){for(var e,t=arguments,n=0,r=t.length,o=!1;e=t[n]+"",~l(this,e)||(this.push(e),o=!0),++n<r;);o&&this._updateClassName()},d.remove=function(){var e,t,n=arguments,r=0,o=n.length,i=!1;do{for(e=n[r]+"",t=l(this,e);~t;)this.splice(t,1),i=!0,t=l(this,e)}while(++r<o);i&&this._updateClassName()},d.toggle=function(e,t){var n=this.contains(e),r=n?!0!==t&&"remove":!1!==t&&"add";return r&&this[r](e),!0===t||!1===t?t:!n},d.replace=function(e,t){var n=l(e+"");~n&&(this.splice(n,1,t),this._updateClassName())},d.toString=function(){return this.join(" ")},o.defineProperty){var p={get:f,enumerable:!0,configurable:!0};try{o.defineProperty(r,t,p)}catch(u){void 0!==u.number&&-2146823252!==u.number||(p.enumerable=!1,o.defineProperty(r,t,p))}}else o[n].__defineGetter__&&r.__defineGetter__(t,f)}}(self),function(){var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function Dg(e){var Dg=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var t,n=arguments.length;for(t=0;t<n;t++)e=arguments[t],Dg.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:n.call(this,e)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(e,t){var n=this.toString().split(" "),r=n.indexOf(e+"");~r&&(n=n.slice(r),this.remove.apply(this,n),this.add(t),this.add.apply(this,n.slice(1)))}),e=null}()),function(){var e,t=-1;if("Microsoft Internet Explorer"===navigator.appName?(e=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))),!("undefined"==typeof window||"undefined"==typeof document||"undefined"==typeof HTMLElement||t<0)){var n=!1;try{var r=document.createElement("div");r.addEventListener("focus",function(e){e.preventDefault(),e.stopPropagation()},!0),r.focus(Object.defineProperty({},"preventScroll",{get:function(){if(navigator&&"undefined"!=typeof navigator.userAgent&&navigator.userAgent&&navigator.userAgent.match(/Edge\/1[7-8]/))return n=!1;n=!0}}))}catch(s){}if(HTMLElement.prototype.nativeFocus===undefined&&!n){HTMLElement.prototype.nativeFocus=HTMLElement.prototype.focus;var o=function o(e){for(var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;t&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push([t,t.scrollTop,t.scrollLeft]),t=t.parentNode;return t=r,n.push([t,t.scrollTop,t.scrollLeft]),n},i=function i(e){for(var t=0;t<e.length;t++)e[t][0].scrollTop=e[t][1],e[t][0].scrollLeft=e[t][2];e=[]},a=function a(e){if(e&&e.preventScroll){var t=o(this);if("function"==typeof setTimeout){var n=this;setTimeout(function(){n.nativeFocus(),i(t)},0)}else this.nativeFocus(),i(t)}else this.nativeFocus()};HTMLElement.prototype.focus=a}}}();function _(e,t,n){if("string"!=typeof e)return new _.Bootstrap(e,t,n);var r=document.querySelectorAll(e);t&&t.iframe_document&&(r=t.iframe_document.querySelectorAll(e));for(var o=[],i=0;i<r.length;i++){var a=r[i]["data-froala.editor"];a?o.push(a):o.push(new _.Bootstrap(r[i],t,n))}return 1==o.length?o[0]:o}_.RegisterPlugins=function(e){for(var t=0;t<e.length;t++)e[t].call(_)},Object.assign(_,{DEFAULTS:{allowStylingOnNonEditable:!1,initOnClick:!1,pluginsEnabled:null,pluginsDisabled:null},MODULES:{},PLUGINS:{},VERSION:"4.5.1",INSTANCES:[],OPTS_MAPPING:{},SHARED:{},ID:0}),_.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<=_.BLOCK_TAGS.indexOf(e.tagName.toLowerCase()))}function c(e){var t={},n=e.attributes;if(n)for(var r=0;r<n.length;r++){var o=n[r];t[o.nodeName]=o.value}return t}function t(e){for(var t="",n=c(e),r=Object.keys(n),o=0;o<r.length;o++){var i=r[o],a=n[i];a.indexOf("'")<0&&0<=a.indexOf('"')?t+=" ".concat(i,"='").concat(a,"'"):(0<=a.indexOf('"')&&0<=a.indexOf("'")&&(a=a.replace(/"/g,""")),t+=" ".concat(i,'="').concat(a,'"'))}return t}function r(e){return e===a.el}return{isBlock:l,isEmpty:function d(e,t){if(!e)return!0;if(e.querySelector("table"))return!1;var n=s(e);1===n.length&&l(n[0])&&(n=s(n[0]));for(var r=!1,o=0;o<n.length;o++){var i=n[o];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(r)return!1;"BR"===i.tagName&&(r=!0)}}return!(e.querySelectorAll(_.VOID_ELEMENTS.join(",")).length-e.querySelectorAll("br").length||e.querySelector("".concat(a.opts.htmlAllowedEmptyTags.join(":not(.fr-marker),"),":not(.fr-marker)"))||1<e.querySelectorAll(_.BLOCK_TAGS.join(",")).length||e.querySelector("".concat(a.opts.htmlDoNotWrapTags.join(":not(.fr-marker),"),":not(.fr-marker)")))},blockParent:function o(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 i(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=!0),t.push(a.el),0<=t.indexOf(e.parentNode)||e.parentNode&&a.node.hasClass(e.parentNode,"fr-inner")||e.parentNode&&0<=_.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")&&(_.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 f(e){for(var t=e.attributes,n=t.length-1;0<=n;n--){var r=t[n];e.removeAttribute(r.nodeName)}},openTagString:function p(e){return"<".concat(e.tagName.toLowerCase()).concat(t(e),">")},closeTagString:function u(e){return"</".concat(e.tagName.toLowerCase(),">")},isFirstSibling:function h(e,t){void 0===t&&(t=!0);for(var n=e.previousSibling;n&&t&&a.node.hasClass(n,"fr-marker");)n=n.previousSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&h(n)},isLastSibling:function g(e,t){void 0===t&&(t=!0);for(var n=e.nextSibling;n&&t&&a.node.hasClass(n,"fr-marker");)n=n.nextSibling;return!n||n.nodeType===Node.TEXT_NODE&&""===n.textContent&&g(n)},isList:function C(e){return!!e&&0<=["UL","OL"].indexOf(e.tagName)},isLink:function m(e){return!!e&&e.nodeType===Node.ELEMENT_NODE&&"a"===e.tagName.toLowerCase()},isElement:r,contents:s,isVoid:function v(e){return e&&e.nodeType===Node.ELEMENT_NODE&&0<=_.VOID_ELEMENTS.indexOf((e.tagName||"").toLowerCase())},hasFocus:function b(e){return e===a.doc.activeElement&&(!a.doc.hasFocus||a.doc.hasFocus())&&Boolean(r(e)||e.type||e.href||~e.tabIndex)},isEditable:function L(e){return(!e.getAttribute||"false"!==e.getAttribute("contenteditable"))&&["STYLE","SCRIPT"].indexOf(e.tagName)<0},isDeletable:function E(e){return e&&e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=(e.getAttribute("class")||"").indexOf("fr-deletable")},hasClass:function y(e,t){return e instanceof n&&(e=e.get(0)),e&&e.classList&&e.classList.contains(t)},filter:function S(e){return a.browser.msie?e:{acceptNode:e}}}},Object.assign(_.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}),_.HTML5Map={B:"STRONG",I:"EM",STRIKE:"S"},_.MODULES.clean=function(C){var m,v,b,L,f=C.$;function o(e){if(e.nodeType===Node.ELEMENT_NODE&&e.getAttribute("class")&&0<=e.getAttribute("class").indexOf("fr-marker"))return!1;var t,n=C.node.contents(e),r=[];for(t=0;t<n.length;t++)n[t].nodeType!==Node.ELEMENT_NODE||C.node.isVoid(n[t])?n[t].nodeType===Node.TEXT_NODE&&(n[t].textContent=n[t].textContent.replace(/\u200b/g,"")):n[t].textContent.replace(/\u200b/g,"").length!==n[t].textContent.length&&o(n[t]);if(e.nodeType===Node.ELEMENT_NODE&&!C.node.isVoid(e)&&(e.normalize(),n=C.node.contents(e),r=e.querySelectorAll(".fr-marker"),n.length-r.length==0)){for(t=0;t<n.length;t++)if(n[t].nodeType===Node.ELEMENT_NODE&&(n[t].getAttribute("class")||"").indexOf("fr-marker")<0)return!1;for(t=0;t<r.length;t++)e.parentNode.insertBefore(r[t].cloneNode(!0),e);return e.parentNode.removeChild(e),!1}}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,">"):C.opts.preserveTabSpaces?e.textContent.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\u00A0/g," ").replace(/\t/g," ".repeat(C.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;if(e.nodeType===Node.ELEMENT_NODE&&"svg"===e.tagName){var n=document.createElement("div"),r=e.cloneNode(!0);return n.appendChild(r),n.innerHTML}if("IFRAME"===e.tagName)return e.outerHTML.replace(/</g,"<").replace(/>/g,">");var o=e.childNodes;if(0===o.length)return e.outerHTML;for(var i="",a=0;a<o.length;a++)"PRE"===e.tagName&&(t=!0),i+=s(o[a],t);return C.node.openTagString(e)+i+C.node.closeTagString(e)}var l=[];function E(e){var t=e.replace(/;;/gi,";");return";"!==(t=t.replace(/^;/gi,"")).charAt(t.length)&&(t+=";"),t}function c(e){var t;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=t.match(b),r=null;"style"===t&&C.opts.htmlAllowedStyleProps.length&&(r=e[t].match(L)),n&&r?e[t]=E(r.join(";")):n&&("style"!==t||r)||delete e[t]}for(var o="",i=Object.keys(e).sort(),a=0;a<i.length;a++)e[t=i[a]].indexOf('"')<0?o+=" ".concat(t,'="').concat(e[t],'"'):o+=" ".concat(t,"='").concat(e[t],"'");return o}function d(e,t){var n,r=document.implementation.createHTMLDocument("Froala DOC").createElement("DIV");f(r).append(e);var o="";if(r){var i=C.node.contents(r);for(n=0;n<i.length;n++)t(i[n]);for(i=C.node.contents(r),n=0;n<i.length;n++)o+=s(i[n])}return o}function p(e,t,n){var r=e=function i(e){return l=[],e=(e=(e=(e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,function(e){return l.push(e),"[FROALA.EDITOR.SCRIPT ".concat(l.length-1,"]")})).replace(/<noscript\b[^<]*(?:(?!<\/noscript>)<[^<]*)*<\/noscript>/gi,function(e){return l.push(e),"[FROALA.EDITOR.NOSCRIPT ".concat(l.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="')}(e),o=null;return C.opts.fullPage&&(r=C.html.extractNode(e,"body")||(0<=e.indexOf("<body")?"":e),n&&(o=C.html.extractNode(e,"head")||"")),r=d(r,t),o&&(o=d(o,t)),function a(e){return e=(e=(e=e.replace(/\[FROALA\.EDITOR\.SCRIPT ([\d]*)\]/gi,function(e,t){return 0<=C.opts.htmlRemoveTags.indexOf("script")?"":l[parseInt(t,10)]})).replace(/\[FROALA\.EDITOR\.NOSCRIPT ([\d]*)\]/gi,function(e,t){if(0<=C.opts.htmlRemoveTags.indexOf("noscript"))return"";var n=l[parseInt(t,10)].replace(/</g,"<").replace(/>/g,">"),r=f(n);if(r&&r.length){var o=d(r.html(),u);r.html(o),n=r.get(0).outerHTML}return n})).replace(/<img((?:[\w\W]*?)) data-fr-src="/g,'<img$1 src="')}(function s(e,t,n){if(C.opts.fullPage){var r=C.html.extractDoctype(n),o=c(C.html.extractNodeAttrs(n,"html"));t=null===t?C.html.extractNode(n,"head")||"<title></title>":t;var i=c(C.html.extractNodeAttrs(n,"head")),a=c(C.html.extractNodeAttrs(n,"body"));return"".concat(r,"<html").concat(o,"><head").concat(i,">").concat(t,"</head><body").concat(a,">").concat(e,"</body></html>")}return e}(r,o,e))}function y(e){var t=C.doc.createElement("DIV");return t.innerText=e,t.textContent}function u(e){for(var t=C.node.contents(e),n=0;n<t.length;n++)t[n].nodeType!==Node.TEXT_NODE&&u(t[n]);!function g(n){if("SPAN"===n.tagName&&0<=(n.getAttribute("class")||"").indexOf("fr-marker"))return!1;if("PRE"===n.tagName&&function h(e){var t=e.innerHTML;0<=t.indexOf("\n")&&(e.innerHTML=t.replace(/\n/g,"<br>"))}(n),n.nodeType===Node.ELEMENT_NODE&&(n.getAttribute("data-fr-src")&&0!==n.getAttribute("data-fr-src").indexOf("blob:")&&n.setAttribute("data-fr-src",C.helpers.sanitizeURL(y(n.getAttribute("data-fr-src")))),n.getAttribute("href")&&n.setAttribute("href",C.helpers.sanitizeURL(y(n.getAttribute("href")))),n.getAttribute("src")&&n.setAttribute("src",C.helpers.sanitizeURL(y(n.getAttribute("src")))),n.getAttribute("srcdoc")&&n.setAttribute("srcdoc",C.clean.html(n.getAttribute("srcdoc"))),0<=["TABLE","TBODY","TFOOT","TR"].indexOf(n.tagName)&&(n.innerHTML=n.innerHTML.trim())),!C.opts.pasteAllowLocalImages&&n.nodeType===Node.ELEMENT_NODE&&"IMG"===n.tagName&&n.getAttribute("data-fr-src")&&0===n.getAttribute("data-fr-src").indexOf("file://"))return n.parentNode.removeChild(n),!1;if(n.nodeType===Node.ELEMENT_NODE&&_.HTML5Map[n.tagName]&&""===C.node.attributes(n)){var e=_.HTML5Map[n.tagName],t="<".concat(e,">").concat(n.innerHTML,"</").concat(e,">");n.insertAdjacentHTML("beforebegin",t),(n=n.previousSibling).parentNode.removeChild(n.nextSibling)}if(C.opts.htmlAllowComments||n.nodeType!==Node.COMMENT_NODE)if(n.tagName&&n.tagName.match(v)){if("STYLE"==n.tagName&&C.helpers.isMac()){var r,o=n.innerHTML.trim(),i=[],a=/{([^}]+)}/g;for(o=o.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/,"");r=a.exec(o);)i.push(r[1]);for(var s=function s(t){var e=o.substring(0,o.indexOf("{")).trim();0==!/^[a-z_-][a-z\d_-]*$/i.test(e)&&n.parentNode.querySelectorAll(e).forEach(function(e){e.removeAttribute("class"),e.setAttribute("style",i[t])}),o=o.substring(o.indexOf("}")+1)},l=0;-1!=o.indexOf("{");l++)s(l)}n.parentNode.removeChild(n)}else if(n.tagName&&!n.tagName.match(m))"svg"===n.tagName?n.parentNode.removeChild(n):C.browser.safari&&"path"===n.tagName&&n.parentNode&&"svg"===n.parentNode.tagName||(n.outerHTML=n.innerHTML);else{var c=n.attributes;if(c)for(var d=c.length-1;0<=d;d--){var f=c[d],p=f.nodeName.match(b),u=null;"style"===f.nodeName&&C.opts.htmlAllowedStyleProps.length&&(u=f.value.match(L)),p&&u?f.value=E(u.join(";")):p&&("style"!==f.nodeName||u)||n.removeAttribute(f.nodeName)}}else 0!==n.data.indexOf("[FROALA.EDITOR")&&n.parentNode.removeChild(n)}(e)}return{_init:function e(){C.opts.fullPage&&f.merge(C.opts.htmlAllowedTags,["head","title","style","link","base","body","html","meta"])},html:function h(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=!1);var o,i=f.merge([],C.opts.htmlAllowedTags);for(o=0;o<t.length;o++)0<=i.indexOf(t[o])&&i.splice(i.indexOf(t[o]),1);var a=f.merge([],C.opts.htmlAllowedAttrs);for(o=0;o<n.length;o++)0<=a.indexOf(n[o])&&a.splice(a.indexOf(n[o]),1);if(a.push("data-fr-.*"),a.push("fr-.*"),m=new RegExp("^".concat(i.join("$|^"),"$"),"gi"),b=new RegExp("^".concat(a.join("$|^"),"$"),"gi"),v=new RegExp("^".concat(C.opts.htmlRemoveTags.join("$|^"),"$"),"gi"),L=C.opts.htmlAllowedStyleProps.length?new RegExp("((^|;|\\s)".concat(C.opts.htmlAllowedStyleProps.join(":.+?(?=;|$))|((^|;|\\s)"),":.+?(?=(;)|$))"),"gi"):null,e=p(e,u,!0),"undefined"!=typeof C.opts.DOMPurify){var s={ALLOW_UNKNOWN_PROTOCOLS:!0};1===C.opts.htmlAllowedTags.length&&".*"===C.opts.htmlAllowedTags[0]||(s.ALLOWED_TAGS=C.opts.htmlAllowedTags),1===C.opts.htmlAllowedAttrs.length&&".*"===C.opts.htmlAllowedAttrs[0]||(s.ALLOWED_ATTR=C.opts.htmlAllowedAttrs),e=C.opts.DOMPurify.sanitize(e,s)}return e},toHTML5:function r(){var e=C.el.querySelectorAll(Object.keys(_.HTML5Map).join(","));if(e.length){var t=!1;C.el.querySelector(".fr-marker")||(C.selection.save(),t=!0);for(var n=0;n<e.length;n++)""===C.node.attributes(e[n])&&f(e[n]).replaceWith("<".concat(_.HTML5Map[e[n].tagName],">").concat(e[n].innerHTML,"</").concat(_.HTML5Map[e[n].tagName],">"));t&&C.selection.restore()}},tables:function t(){!function d(){for(var e=C.el.querySelectorAll("tr"),t=0,n=0;n<e.length;n++){var r=e[n].outerHTML.match(/rowspan="([0-9]+)"/);r&&(t+=Number(r[1])-1);for(var o=e[n].children,i=!0,a=0;a<o.length;a++)if("TH"!==o[a].tagName){i=!1;break}if(!1!==i&&0!==o.length)if(1===o.length&&"TH"===o[0].tagName&&t)t--;else{var s=e[n],l=s.closest("table");if(l){var c=l.querySelector("thead");c||(c=C.doc.createElement("THEAD"),l.insertBefore(c,l.firstChild)),c.contains(s)||c.appendChild(s)}}}}(),function s(){for(var e=C.$el.find("table[style]"),t=0;t<e.length;t++){var n=f(e[t]);n.attr("style").indexOf("width")<0&&n.css("width","100%")}for(var r=C.$el.find("td[width]"),o=0;o<r.length;o++){var i=f(r[o]),a=i.attr("width");a&&(i.css("width",a),i.removeAttr("width"))}}()},lists:function g(){!function s(){var e,t=[];do{if(t.length){var n=t[0],r=C.doc.createElement("ul");n.parentNode.insertBefore(r,n);do{var o=n;n=n.nextSibling,r.appendChild(o)}while(n&&"LI"===n.tagName)}t=[];for(var i=C.el.querySelectorAll("li"),a=0;a<i.length;a++)e=i[a],C.node.isList(e.parentNode)||t.push(i[a])}while(0<t.length)}(),function i(){for(var e=C.el.querySelectorAll("ol + ol, ul + ul"),t=0;t<e.length;t++){var n=e[t];if(C.node.isList(n.previousSibling)&&C.node.openTagString(n)===C.node.openTagString(n.previousSibling)){for(var r=C.node.contents(n),o=0;o<r.length;o++)n.previousSibling.appendChild(r[o]);n.parentNode.removeChild(n)}}}(),function a(){for(var e=C.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=C.node.contents(e[t]),r=null,o=n.length-1;0<=o;o--)!n[o].tagName&&C.opts.htmlUntouched||"LI"===n[o].tagName||"UL"==n[o].tagName||"OL"==n[o].tagName?r=null:"BR"==n[o].tagName?f(n[o]).remove():(r||(r=f(C.doc.createElement("LI"))).insertBefore(n[o]),r.prepend(n[o]))}(),function l(){var e,t,n;do{t=!1;var r=C.el.querySelectorAll("li:empty");for(e=0;e<r.length;e++)r[e].parentNode.removeChild(r[e]);var o=C.el.querySelectorAll("ul, ol");for(e=0;e<o.length;e++)(n=o[e]).querySelector("LI")||(t=!0,n.parentNode.removeChild(n))}while(!0===t)}(),function o(){for(var e=C.el.querySelectorAll("ul > ul, ol > ol, ul > ol, ol > ul"),t=0;t<e.length;t++){var n=e[t],r=n.previousSibling;r&&("LI"===r.tagName?r.appendChild(n):f(n).wrap("<li></li>"))}}(),function c(){for(var e=C.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(n.nextSibling)for(var r=n.nextSibling;0<r.childNodes.length;)n.append(r.childNodes[0])}}(),function d(){for(var e=C.el.querySelectorAll("li > ul, li > ol"),t=0;t<e.length;t++){var n=e[t];if(C.node.isFirstSibling(n)&&"none"!=n.parentNode.style.listStyleType)f(n).before("<br/>");else if(n.previousSibling&&"BR"===n.previousSibling.tagName){for(var r=n.previousSibling.previousSibling;r&&C.node.hasClass(r,"fr-marker");)r=r.previousSibling;r&&"BR"!==r.tagName&&f(n.previousSibling).remove()}}}(),function n(){for(var e=C.el.querySelectorAll("li:empty"),t=0;t<e.length;t++)f(e[t]).remove()}(),function r(){for(var e=C.el.querySelectorAll("ul, ol"),t=0;t<e.length;t++)for(var n=e[t],a=C.node.contents(n),s=function s(){var e=a[l],t=C.node.contents(e),n=e.querySelectorAll("ul, ol");if(0<n.length&&1==t.length&&t[0].nodeType===Node.ELEMENT_NODE){var r=n[0],o=a[l-1];if(!o)return 1;var i=f(o).data("tracking")&&C.opts.trackChangesEnabled;S(r.querySelectorAll("li")).reverse().forEach(function(e){if(i){var t="pending-".concat(C.id,"-").concat(C.track_changes.getPendingChanges().length),n=C.opts.showChangesEnabled?'class="fr-highlight-change"':"",r=e.innerHTML;e.innerHTML='<span data-tracking="true" data-track-id="'.concat(t,'" ').concat(n,">").concat(r,"</span>"),C.track_changes.pushChange(t)}}),o.append(r),e.remove()}},l=0;l<a.length;l++)s()}()},invisibleSpaces:function n(e){return e.replace(/\u200b/g,"").length===e.length?e:C.clean.exec(e,o)},exec:p}},_.XS=0,_.SM=1,_.MD=2,_.LG=3;_.LinkRegExCommon="[".concat("a-z\\u0080-\\u009f\\u00a1-\\uffff0-9-_\\.","]{1,}"),_.LinkRegExEnd="((:[0-9]{1,5})|)(((\\/|\\?|#)[a-z\\u00a1-\\uffff0-9@?\\|!^=%&\\/~+#-\\'*-_{}]*)|())",_.LinkRegExTLD="((".concat(_.LinkRegExCommon,")(\\.(com|net|org|edu|mil|gov|co|biz|info|me|dev)))"),_.LinkRegExHTTP="((ftp|http|https):\\/\\/".concat(_.LinkRegExCommon,")"),_.LinkRegExAuth="((ftp|http|https):\\/\\/[\\u0021-\\uffff]{1,}@".concat(_.LinkRegExCommon,")"),_.LinkRegExWWW="(www\\.".concat(_.LinkRegExCommon,"\\.[a-z0-9-]{2,24})"),_.LinkRegEx="(".concat(_.LinkRegExTLD,"|").concat(_.LinkRegExHTTP,"|").concat(_.LinkRegExWWW,"|").concat(_.LinkRegExAuth,")").concat(_.LinkRegExEnd),_.LinkProtocols=["mailto","tel","sms","notes","data"],_.MAIL_REGEX=/.+@.+\..+/i,_.MODULES.helpers=function(i){var a,s=i.$;function e(){var e={},t=function i(){var e,t=-1;return"Microsoft Internet Explorer"===navigator.appName?(e=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))):"Netscape"===navigator.appName&&(e=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))),t}();if(0<t)e.msie=!0;else{var n=navigator.userAgent.toLowerCase(),r=/(edge)[ /]([\w.]+)/.exec(n)||/(chrome)[ /]([\w.]+)/.exec(n)||/(webkit)[ /]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ /]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[],o=r[1]||"";r[2];r[1]&&(e[o]=!0),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0)}return e.msie&&(e.version=t),e}function t(){return(/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||function e(){return navigator.maxTouchPoints&&2<navigator.maxTouchPoints&&/Macintosh/.test(navigator.userAgent)}())&&!o()}function n(){return/(Android)/g.test(navigator.userAgent)&&!o()}function r(){return/(Blackberry)/g.test(navigator.userAgent)}function o(){return/(Windows Phone)/gi.test(navigator.userAgent)}var l=null;return{_init:function c(){i.browser=e()},isIOS:t,isMac:function d(){return null===l&&(l=0<=navigator.platform.toUpperCase().indexOf("MAC")),l},getIOSVersion:function f(){if(t()){var e=navigator.userAgent.match(/OS (\d)?\d_\d(_\d)?/i)||navigator.userAgent.match(/\b[0-9]+_[0-9]+(?:_[0-9]+)?\b/);return e&&e.length&&Math.abs(e[0].split("_")[0].replace("OS ",""))||NaN}return NaN},getSafariVersion:function p(){var e=navigator.userAgent;if(-1!==e.indexOf("Safari")){var t=e.match(/Version\/(\d+\.\d+)/);if(t)return parseInt(t[1])}return null},isAndroid:n,isBlackberry:r,isWindowsPhone:o,isMobile:function u(){return n()||t()||r()},isEmail:function h(e){return!/^(https?:|ftps?:|)\/\//i.test(e)&&_.MAIL_REGEX.test(e)},requestAnimationFrame:function g(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}},getPX:function C(e){return parseInt(e,10)||0},screenSize:function m(e){try{var t=0;if((t=e?i.$box.width():i.$sc.width())<768)return _.XS;if(768<=t&&t<992)return _.SM;if(992<=t&&t<1200)return _.MD;if(1200<=t)return _.LG}catch(n){return _.LG}},isTouch:function v(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch},sanitizeURL:function b(e){if(i.opts.DOMPurify){var 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)}return e=e.replace(/(["'/]|\s+)on\w+=(?:"[^"]*"|'[^']*'|[^>\s]+)/gi,""),/^(https?:|ftps?:|)\/\//i.test(e)?e:/^([A-Za-z]:(\\){1,2}|[A-Za-z]:((\\){1,2}[^\\]+)+)(\\)?$/i.test(e)?e:new RegExp("^(".concat(_.LinkProtocols.join("|"),"):"),"i").test(e)?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 L(e){return e&&!Object.prototype.propertyIsEnumerable.call(e,"length")&&"object"===x(e)&&"number"==typeof e.length},RGBToHex:function E(e){function t(e){return"0".concat(parseInt(e,10).toString(16)).slice(-2)}try{return e&&"transparent"!==e?/^#[0-9A-F]{6}$/i.test(e)?e:(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/),"#".concat(t(e[1])).concat(t(e[2])).concat(t(e[3])).toUpperCase()):""}catch(n){return null}},HEXtoRGB:function y(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,n,r){return t+t+n+n+r+r});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?"rgb(".concat(parseInt(t[1],16),", ").concat(parseInt(t[2],16),", ").concat(parseInt(t[3],16),")"):""},isURL:function S(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(_.LinkRegExHTTP).concat(_.LinkRegExEnd,"$"),"gi").test(e))},getAlignment:function N(e){e.css||(e=s(e));var t=(e.css("text-align")||"").replace(/-(.*)-/g,"");if(["left","right","justify","center"].indexOf(t)<0){if(!a){var n=s('<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>'));s("body").first().append(n);var r=n.find("#s1").get(0).getBoundingClientRect().left,o=n.find("#s2").get(0).getBoundingClientRect().left;n.remove(),a=r<o?"left":"right"}t=a}return t},scrollTop:function T(){return i.o_win.pageYOffset?i.o_win.pageYOffset:i.o_doc.documentElement&&i.o_doc.documentElement.scrollTop?i.o_doc.documentElement.scrollTop:i.o_doc.body.scrollTop?i.o_doc.body.scrollTop:0},scrollLeft:function M(){return i.o_win.pageXOffset?i.o_win.pageXOffset:i.o_doc.documentElement&&i.o_doc.documentElement.scrollLeft?i.o_doc.documentElement.scrollLeft:i.o_doc.body.scrollLeft?i.o_doc.body.scrollLeft:0},isInViewPort:function A(e){var t=e.getBoundingClientRect();return 0<=(t={top:Math.round(t.top),bottom:Math.round(t.bottom)}).top&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)||t.top<=0&&t.bottom>=(window.innerHeight||document.documentElement.clientHeight)}}},_.MODULES.events=function(l){var e,i=l.$,a={};function s(e,t,n){C(e,t,n)}function c(e){if(void 0===e&&(e=!0),!l.$wp)return!1;if(l.helpers.isIOS()&&l.$win.get(0).focus(),l.core.hasFocus())return!1;if(!l.core.hasFocus()&&e){var t=l.$win.scrollTop();if(l.browser.msie&&l.$box&&l.$box.css("position","fixed"),l.browser.msie&&l.$wp&&l.$wp.css("overflow","visible"),l.browser.msie&&l.$sc&&l.$sc.css("position","fixed"),l.browser.msie||(p(),l.el.focus(),l.events.trigger("focus"),f()),l.browser.msie&&l.$sc&&l.$sc.css("position",""),l.browser.msie&&l.$box&&l.$box.css("position",""),l.browser.msie&&l.$wp&&l.$wp.css("overflow","auto"),t!==l.$win.scrollTop()&&l.$win.scrollTop(t),!l.selection.info(l.el).atStart)return!1}if(!l.core.hasFocus()||0<l.$el.find(".fr-marker").length)return!1;if(l.selection.info(l.el).atStart&&l.selection.isCollapsed()&&null!==l.html.defaultTag()){var n=l.markers.insert();if(n&&!l.node.blockParent(n)){i(n).remove();var r=l.$el.find(l.html.blockTagsQuery()).get(0);r&&(i(r).prepend(_.MARKERS),l.selection.restore())}else n&&i(n).remove()}}var d=!1;function f(){e=!0}function p(){e=!1}function u(){return e}function h(e,t,n){var r,o=e.split(" ");if(1<o.length){for(var i=0;i<o.length;i++)h(o[i],t,n);return!0}void 0===n&&(n=!1),r=0!==e.indexOf("shared.")?(a[e]=a[e]||[],a[e]):(l.shared._events[e]=l.shared._events[e]||[],l.shared._events[e]),n?r.unshift(t):r.push(t)}var g=[];function C(e,t,n,r,o){"function"==typeof n&&(o=r,r=n,n=!1);var i=o?l.shared.$_events:g,a=o?l.sid:l.id,s="".concat(t.trim().split(" ").join(".ed".concat(a," ")),".ed").concat(a);n?e.on(s,n,r):e.on(s,r),i.push([e,s])}function t(e){for(var t=0;t<e.length;t++)e[t][0].off(e[t][1])}function m(e,t,n){if(!l.edit.isDisabled()||n){var r,o;if(0!==e.indexOf("shared."))r=a[e];else{if(0<l.shared.count)return!1;r=l.shared._events[e]}if(r)for(var i=0;i<r.length;i++)if(!1===(o=r[i].apply(l,t)))return!1;return(!l.opts.events||!l.opts.events[e]||!1!==(o=l.opts.events[e].apply(l,t)))&&o}}function v(){for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&delete a[e]}function b(){for(var e in l.shared._events)Object.prototype.hasOwnProperty.call(l.shared._events,e)&&delete l.shared._events[e]}return{_init:function L(){l.shared.$_events=l.shared.$_events||[],l.shared._events={},function e(){l.helpers.isMobile()?(l._mousedown="touchstart",l._mouseup="touchend",l._move="touchmove",l._mousemove="touchmove"):(l._mousedown="mousedown",l._mouseup="mouseup",l._move="",l._mousemove="mousemove")}(),function t(){s(l.$el,"click mouseup mousemove mousedown touchstart touchend dragenter dragover dragleave dragend drop dragstart",function(e){m(e.type,[e])}),h("mousedown",function(){for(var e=0;e<_.INSTANCES.length;e++)_.INSTANCES[e]!==l&&_.INSTANCES[e].popups&&_.INSTANCES[e].popups.areVisible()&&_.INSTANCES[e].$el.find(".fr-marker").remove()})}(),function n(){s(l.$win,l._mousedown,function(e){m("window.mousedown",[e]),f()}),s(l.$win,l._mouseup,function(e){m("window.mouseup",[e])}),s(l.$win,"beforeinput cut copy keydown keyup touchmove touchend",function(e){m("window.".concat(e.type),[e])})}(),function r(){s(l.$doc,"dragend drop",function(e){m("document.".concat(e.type),[e])})}(),function o(){s(l.$el,"beforeinput keydown keypress keyup input",function(e){m(e.type,[e])})}(),function i(){s(l.$el,"focus",function(e){u()&&(c(!1),!1===d&&(m(e.type,[e]),l.helpers.isMobile()&&p()))}),s(l.$el,"blur",function(e){u()&&!0===d&&(m(e.type,[e]),l.helpers.isMobile()&&l.opts.toolbarContainer&&(l.shared.selected_editor=l.id),f())}),C(l.$el,"mousedown",'[contenteditable="true"]',function(){p(),l.$el.blur()}),h("focus",function(){d=!0}),h("blur",function(){d=!1})}(),f(),function a(){s(l.$el,"cut copy paste beforepaste",function(e){m(e.type,[e])})}(),h("destroy",v),h("shared.destroy",b)},on:h,trigger:m,bindClick:function r(e,t,n){C(e,l._mousedown,t,function(e){l.edit.isDisabled()||function n(e){var t=i(e.currentTarget);return l.edit.isDisabled()||l.node.hasClass(t.get(0),"fr-disabled")?(e.preventDefault(),!1):"mousedown"===e.type&&1!==e.which||(l.helpers.isMobile()||e.preventDefault(),(l.helpers.isAndroid()||l.helpers.isWindowsPhone())&&0===t.parents(".fr-dropdown-menu").length&&(e.preventDefault(),e.stopPropagation()),t.addClass("fr-selected"),void l.events.trigger("commands.mousedown",[t]))}(e)},!0),C(e,"".concat(l._mouseup," ").concat(l._move),t,function(e){l.edit.isDisabled()||(l.helpers.isIOS()&&null!==l.selection.get().focusNode&&l.selection.save(),function o(e,t){var n=i(e.currentTarget);if(l.edit.isDisabled()||l.node.hasClass(n.get(0),"fr-disabled"))return e.preventDefault(),!1;if("mouseup"===e.type&&1!==e.which)return!0;if(l.button.getButtons(".fr-selected",!0).get(0)==n.get(0)&&!l.node.hasClass(n.get(0),"fr-selected"))return!0;if("touchmove"!==e.type){if(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!l.node.hasClass(n.get(0),"fr-selected"))return l.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),!1;if(l.button.getButtons(".fr-selected",!0).removeClass("fr-selected"),n.data("dragging")||n.attr("disabled"))return n.removeData("dragging"),!1;var r=n.data("timeout");r&&(clearTimeout(r),n.removeData("timeout")),t.apply(l,[e])}else n.data("timeout")||n.data("timeout",setTimeout(function(){n.data("dragging",!0)},100))}(e,n))},!0),C(e,"mousedown click mouseup",t,function(e){l.edit.isDisabled()||e.stopPropagation()},!0),h("window.mouseup",function(){l.edit.isDisabled()||(e.find(t).removeClass("fr-selected"),f())}),C(e,"mouseover",t,function(){i(this).hasClass("fr-options")&&i(this).prev(".fr-btn").addClass("fr-btn-hover"),i(this).next(".fr-btn").hasClass("fr-options")&&i(this).next(".fr-btn").addClass("fr-btn-hover")}),C(e,"mouseout",t,function(){i(this).hasClass("fr-options")&&i(this).prev(".fr-btn").removeClass("fr-btn-hover"),i(this).next(".fr-btn").hasClass("fr-options")&&i(this).next(".fr-btn").removeClass("fr-btn-hover")})},disableBlur:p,enableBlur:f,blurActive:u,focus:c,chainTrigger:function E(e,t,n){if(!l.edit.isDisabled()||n){var r,o;if(0!==e.indexOf("shared."))r=a[e];else{if(0<l.shared.count)return!1;r=l.shared._events[e]}if(r)for(var i=0;i<r.length;i++)void 0!==(o=r[i].apply(l,[t]))&&(t=o);return l.opts.events&&l.opts.events[e]&&void 0!==(o=l.opts.events[e].apply(l,[t]))&&(t=o),t}},$on:C,$off:function n(){t(g),g=[],0===l.shared.count&&(t(l.shared.$_events),l.shared.$_events=[])}}},Object.assign(_.DEFAULTS,{indentMargin:20}),_.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}},_.RegisterCommand=function(e,t){_.COMMANDS[e]=t},_.MODULES.commands=function(f){var p=f.$;function a(e){return f.html.defaultTag()&&(e="<".concat(f.html.defaultTag(),">").concat(e,"</").concat(f.html.defaultTag(),">")),e}var s={bold:function(){e("bold","strong")},subscript:function(){f.format.is("sup")&&f.format.remove("sup"),e("subscript","sub")},superscript:function(){f.format.is("sub")&&f.format.remove("sub"),e("superscript","sup")},italic:function(){e("italic","em")},strikeThrough:function(){e("strikeThrough","s")},underline:function(){e("underline","u")},undo:function(){f.undo.run()},redo:function(){f.undo.redo()},indent:function(){r(1)},outdent:function(){r(-1)},show:function(){f.opts.toolbarInline&&f.toolbar.showInline(null,!0)},insertHR:function(){f.selection.remove();var e="";f.core.isEmpty()&&(e=a(e="<br>"));var t='<hr id="fr-just" class="fr-just">'.concat(e);f.opts.trackChangesEnabled&&(t=f.track_changes.wrapInTracking(p(t),"hrWrapper").get(0).outerHTML);f.html.insert(t);var n,r=f.$el.find("hr#fr-just").length?f.$el.find("hr#fr-just"):f.$el.find(".fr-just");r.removeAttr("id"),r.removeAttr("class");var o=f.opts.trackChangesEnabled&&"SPAN"===r[0].parentNode.tagName&&"P"===r[0].parentNode.parentNode.tagName;if(0===r.next().length){var i=f.html.defaultTag();i&&!o?r.after(p(f.doc.createElement(i)).append("<br>").get(0)):o?r[0].parentNode.after(p(f.doc.createElement(i)).append("<br>").get(0)):r.after("<br>")}r.prev().is("hr")?n=f.selection.setAfter(r.get(0),!1):r.next().is("hr")?n=f.selection.setBefore(r.g