All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.frontend.tinymce_addon.tinymce.tinymce.min.js Maven / Gradle / Ivy

/**
 * TinyMCE version 6.6.1 (2023-08-02)
 */
!function(){"use strict";var e=function(e){if(null===e)return"null";if(void 0===e)return"undefined";var t=typeof e;return"object"===t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"===t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},n=t((function(e,t){return e===t})),o=function(e){return t((function(t,n){if(t.length!==n.length)return!1;for(var o=t.length,r=0;r{var o;return!!n(e,t.prototype)||(null===(o=e.constructor)||void 0===o?void 0:o.name)===t.name},l=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&i(e,String,((e,t)=>t.isPrototypeOf(e)))?"string":t})(t)===e,d=e=>t=>typeof t===e,c=e=>t=>e===t,u=(e,t)=>f(e)&&i(e,t,((e,t)=>a(e)===t)),m=l("string"),f=l("object"),g=e=>u(e,Object),p=l("array"),h=c(null),b=d("boolean"),v=c(void 0),y=e=>null==e,C=e=>!y(e),w=d("function"),x=d("number"),k=(e,t)=>{if(p(e)){for(let n=0,o=e.length;n{},S=(e,t)=>(...n)=>e(t.apply(null,n)),_=(e,t)=>n=>e(t(n)),N=e=>()=>e,R=e=>e,A=(e,t)=>e===t;function O(e,...t){return(...n)=>{const o=t.concat(n);return e.apply(null,o)}}const T=e=>t=>!e(t),B=e=>()=>{throw new Error(e)},D=e=>e(),P=e=>{e()},L=N(!1),M=N(!0);class I{constructor(e,t){this.tag=e,this.value=t}static some(e){return new I(!0,e)}static none(){return I.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?I.some(e(this.value)):I.none()}bind(e){return this.tag?e(this.value):I.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:I.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return C(e)?I.some(e):I.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}I.singletonNone=new I(!1);const F=Array.prototype.slice,U=Array.prototype.indexOf,z=Array.prototype.push,j=(e,t)=>U.call(e,t),H=(e,t)=>j(e,t)>-1,$=(e,t)=>{for(let n=0,o=e.length;n{const n=e.length,o=new Array(n);for(let r=0;r{for(let n=0,o=e.length;n{for(let n=e.length-1;n>=0;n--)t(e[n],n)},K=(e,t)=>{const n=[],o=[];for(let r=0,s=e.length;r{const n=[];for(let o=0,r=e.length;o(W(e,((e,o)=>{n=t(n,e,o)})),n),X=(e,t,n)=>(q(e,((e,o)=>{n=t(n,e,o)})),n),Q=(e,t,n)=>{for(let o=0,r=e.length;oQ(e,t,L),Z=(e,t)=>{for(let n=0,o=e.length;n{const t=[];for(let n=0,o=e.length;nee(V(e,t)),ne=(e,t)=>{for(let n=0,o=e.length;n{const t=F.call(e,0);return t.reverse(),t},re=(e,t)=>G(e,(e=>!H(t,e))),se=(e,t)=>{const n={};for(let o=0,r=e.length;o{const n=F.call(e,0);return n.sort(t),n},ie=(e,t)=>t>=0&&tie(e,0),de=e=>ie(e,e.length-1),ce=w(Array.from)?Array.from:e=>F.call(e),ue=(e,t)=>{for(let n=0;n{const n=me(e);for(let o=0,r=n.length;ohe(e,((e,n)=>({k:n,v:t(e,n)}))),he=(e,t)=>{const n={};return ge(e,((e,o)=>{const r=t(e,o);n[r.k]=r.v})),n},be=e=>(t,n)=>{e[n]=t},ve=(e,t,n,o)=>{ge(e,((e,r)=>{(t(e,r)?n:o)(e,r)}))},ye=(e,t)=>{const n={};return ve(e,t,be(n),E),n},Ce=(e,t)=>{const n=[];return ge(e,((e,o)=>{n.push(t(e,o))})),n},we=e=>Ce(e,R),xe=(e,t)=>ke(e,t)?I.from(e[t]):I.none(),ke=(e,t)=>fe.call(e,t),Ee=(e,t)=>ke(e,t)&&void 0!==e[t]&&null!==e[t],Se=e=>{const t={};return q(e,(e=>{t[e]={}})),me(t)},_e=e=>void 0!==e.length,Ne=Array.isArray,Re=(e,t,n)=>{if(!e)return!1;if(n=n||e,_e(e)){for(let o=0,r=e.length;o{const n=[];return Re(e,((o,r)=>{n.push(t(o,r,e))})),n},Oe=(e,t)=>{const n=[];return Re(e,((o,r)=>{t&&!t(o,r,e)||n.push(o)})),n},Te=(e,t,n,o)=>{let r=v(n)?e[0]:n;for(let n=0;n{for(let o=0,r=e.length;oe[e.length-1],Pe=e=>{let t,n=!1;return(...o)=>(n||(n=!0,t=e.apply(null,o)),t)},Le=()=>Me(0,0),Me=(e,t)=>({major:e,minor:t}),Ie={nu:Me,detect:(e,t)=>{const n=String(t).toLowerCase();return 0===e.length?Le():((e,t)=>{const n=((e,t)=>{for(let n=0;nNumber(t.replace(n,"$"+e));return Me(o(1),o(2))})(e,n)},unknown:Le},Fe=(e,t)=>{const n=String(t).toLowerCase();return J(e,(e=>e.search(n)))},Ue=(e,t,n)=>""===t||e.length>=t.length&&e.substr(n,n+t.length)===t,ze=(e,t)=>He(e,t)?((e,t)=>e.substring(t))(e,t.length):e,je=(e,t,n=0,o)=>{const r=e.indexOf(t,n);return-1!==r&&(!!v(o)||r+t.length<=o)},He=(e,t)=>Ue(e,t,0),$e=(e,t)=>Ue(e,t,e.length-t.length),Ve=e=>t=>t.replace(e,""),qe=Ve(/^\s+|\s+$/g),We=Ve(/^\s+/g),Ke=Ve(/\s+$/g),Ge=e=>e.length>0,Ye=e=>!Ge(e),Xe=(e,t=10)=>{const n=parseInt(e,t);return isNaN(n)?I.none():I.some(n)},Qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Je=e=>t=>je(t,e),Ze=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:e=>je(e,"edge/")&&je(e,"chrome")&&je(e,"safari")&&je(e,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Qe],search:e=>je(e,"chrome")&&!je(e,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:e=>je(e,"msie")||je(e,"trident")},{name:"Opera",versionRegexes:[Qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Je("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Je("firefox")},{name:"Safari",versionRegexes:[Qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:e=>(je(e,"safari")||je(e,"mobile/"))&&je(e,"applewebkit")}],et=[{name:"Windows",search:Je("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:e=>je(e,"iphone")||je(e,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Je("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Je("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Je("linux"),versionRegexes:[]},{name:"Solaris",search:Je("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Je("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Je("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],tt={browsers:N(Ze),oses:N(et)},nt="Edge",ot="Chromium",rt="Opera",st="Firefox",at="Safari",it=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isEdge:o(nt),isChromium:o(ot),isIE:o("IE"),isOpera:o(rt),isFirefox:o(st),isSafari:o(at)}},lt=()=>it({current:void 0,version:Ie.unknown()}),dt=it,ct=(N(nt),N(ot),N("IE"),N(rt),N(st),N(at),"Windows"),ut="Android",mt="Linux",ft="macOS",gt="Solaris",pt="FreeBSD",ht="ChromeOS",bt=e=>{const t=e.current,n=e.version,o=e=>()=>t===e;return{current:t,version:n,isWindows:o(ct),isiOS:o("iOS"),isAndroid:o(ut),isMacOS:o(ft),isLinux:o(mt),isSolaris:o(gt),isFreeBSD:o(pt),isChromeOS:o(ht)}},vt=()=>bt({current:void 0,version:Ie.unknown()}),yt=bt,Ct=(N(ct),N("iOS"),N(ut),N(mt),N(ft),N(gt),N(pt),N(ht),e=>window.matchMedia(e).matches);let wt=Pe((()=>((e,t,n)=>{const o=tt.browsers(),r=tt.oses(),s=t.bind((e=>((e,t)=>ue(t.brands,(t=>{const n=t.brand.toLowerCase();return J(e,(e=>{var t;return n===(null===(t=e.brand)||void 0===t?void 0:t.toLowerCase())})).map((e=>({current:e.name,version:Ie.nu(parseInt(t.version,10),0)})))})))(o,e))).orThunk((()=>((e,t)=>Fe(e,t).map((e=>{const n=Ie.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(o,e))).fold(lt,dt),a=((e,t)=>Fe(e,t).map((e=>{const n=Ie.detect(e.versionRegexes,t);return{current:e.name,version:n}})))(r,e).fold(vt,yt),i=((e,t,n,o)=>{const r=e.isiOS()&&!0===/ipad/i.test(n),s=e.isiOS()&&!r,a=e.isiOS()||e.isAndroid(),i=a||o("(pointer:coarse)"),l=r||!s&&a&&o("(min-device-width:768px)"),d=s||a&&!l,c=t.isSafari()&&e.isiOS()&&!1===/safari/i.test(n),u=!d&&!l&&!c;return{isiPad:N(r),isiPhone:N(s),isTablet:N(l),isPhone:N(d),isTouch:N(i),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:N(c),isDesktop:N(u)}})(a,s,e,n);return{browser:s,os:a,deviceType:i}})(navigator.userAgent,I.from(navigator.userAgentData),Ct)));const xt=()=>wt(),kt=navigator.userAgent,Et=xt(),St=Et.browser,_t=Et.os,Nt=Et.deviceType,Rt=-1!==kt.indexOf("Windows Phone"),At={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:St.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!St.isIE(),windowsPhone:Rt,browser:{current:St.current,version:St.version,isChromium:St.isChromium,isEdge:St.isEdge,isFirefox:St.isFirefox,isIE:St.isIE,isOpera:St.isOpera,isSafari:St.isSafari},os:{current:_t.current,version:_t.version,isAndroid:_t.isAndroid,isChromeOS:_t.isChromeOS,isFreeBSD:_t.isFreeBSD,isiOS:_t.isiOS,isLinux:_t.isLinux,isMacOS:_t.isMacOS,isSolaris:_t.isSolaris,isWindows:_t.isWindows},deviceType:{isDesktop:Nt.isDesktop,isiPad:Nt.isiPad,isiPhone:Nt.isiPhone,isPhone:Nt.isPhone,isTablet:Nt.isTablet,isTouch:Nt.isTouch,isWebView:Nt.isWebView}},Ot=/^\s*|\s*$/g,Tt=e=>y(e)?"":(""+e).replace(Ot,""),Bt=function(e,t,n,o){o=o||this,e&&(n&&(e=e[n]),Re(e,((e,r)=>!1!==t.call(o,e,r,n)&&(Bt(e,t,n,o),!0))))},Dt={trim:Tt,isArray:Ne,is:(e,t)=>t?!("array"!==t||!Ne(e))||typeof e===t:void 0!==e,toArray:e=>{if(Ne(e))return e;{const t=[];for(let n=0,o=e.length;n{const o=m(e)?e.split(t||","):e||[];let r=o.length;for(;r--;)n[o[r]]={};return n},each:Re,map:Ae,grep:Oe,inArray:(e,t)=>{if(e)for(let n=0,o=e.length;n{for(let n=0;n{const n=e.split(".");for(let e=0,o=n.length;ep(e)?e:""===e?[]:Ae(e.split(t||","),Tt),_addCacheSuffix:e=>{const t=At.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Pt=(e,t,n=A)=>e.exists((e=>n(e,t))),Lt=(e,t,n)=>e.isSome()&&t.isSome()?I.some(n(e.getOrDie(),t.getOrDie())):I.none(),Mt=(e,t)=>e?I.some(t):I.none(),It="undefined"!=typeof window?window:Function("return this;")(),Ft=(e,t)=>((e,t)=>{let n=null!=t?t:It;for(let t=0;t{const t=Ft("ownerDocument.defaultView",e);return f(e)&&((e=>((e,t)=>{const n=((e,t)=>Ft(e,t))(e,t);if(null==n)throw new Error(e+" not available on this browser");return n})("HTMLElement",e))(t).prototype.isPrototypeOf(e)||/^HTML\w*Element$/.test(Ut(e).constructor.name))},jt=e=>e.dom.nodeName.toLowerCase(),Ht=e=>e.dom.nodeType,$t=e=>t=>Ht(t)===e,Vt=e=>qt(e)&&zt(e.dom),qt=$t(1),Wt=$t(3),Kt=$t(9),Gt=$t(11),Yt=e=>t=>qt(t)&&jt(t)===e,Xt=(e,t,n)=>{if(!(m(n)||b(n)||x(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},Qt=(e,t,n)=>{Xt(e.dom,t,n)},Jt=(e,t)=>{const n=e.dom;ge(t,((e,t)=>{Xt(n,t,e)}))},Zt=(e,t)=>{const n=e.dom.getAttribute(t);return null===n?void 0:n},en=(e,t)=>I.from(Zt(e,t)),tn=(e,t)=>{const n=e.dom;return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},nn=(e,t)=>{e.dom.removeAttribute(t)},on=e=>X(e.dom.attributes,((e,t)=>(e[t.name]=t.value,e)),{}),rn=(e,t)=>{const n=Zt(e,t);return void 0===n||""===n?[]:n.split(" ")},sn=e=>void 0!==e.dom.classList,an=e=>rn(e,"class"),ln=(e,t)=>((e,t,n)=>{const o=rn(e,t).concat([n]);return Qt(e,t,o.join(" ")),!0})(e,"class",t),dn=(e,t)=>((e,t,n)=>{const o=G(rn(e,t),(e=>e!==n));return o.length>0?Qt(e,t,o.join(" ")):nn(e,t),!1})(e,"class",t),cn=(e,t)=>{sn(e)?e.dom.classList.add(t):ln(e,t)},un=e=>{0===(sn(e)?e.dom.classList:an(e)).length&&nn(e,"class")},mn=(e,t)=>{sn(e)?e.dom.classList.remove(t):dn(e,t),un(e)},fn=(e,t)=>sn(e)&&e.dom.classList.contains(t),gn=e=>{if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}},pn=(e,t)=>{const n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||n.childNodes.length>1){const t="HTML does not have a single root node";throw console.error(t,e),new Error(t)}return gn(n.childNodes[0])},hn=(e,t)=>{const n=(t||document).createElement(e);return gn(n)},bn=(e,t)=>{const n=(t||document).createTextNode(e);return gn(n)},vn=gn,yn=(e,t,n)=>I.from(e.dom.elementFromPoint(t,n)).map(gn),Cn=(e,t)=>{const n=[],o=e=>(n.push(e),t(e));let r=t(e);do{r=r.bind(o)}while(r.isSome());return n},wn=(e,t)=>{const n=e.dom;if(1!==n.nodeType)return!1;{const e=n;if(void 0!==e.matches)return e.matches(t);if(void 0!==e.msMatchesSelector)return e.msMatchesSelector(t);if(void 0!==e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(void 0!==e.mozMatchesSelector)return e.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}},xn=e=>1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType||0===e.childElementCount,kn=(e,t)=>e.dom===t.dom,En=(e,t)=>{const n=e.dom,o=t.dom;return n!==o&&n.contains(o)},Sn=e=>vn(e.dom.ownerDocument),_n=e=>Kt(e)?e:Sn(e),Nn=e=>vn(_n(e).dom.defaultView),Rn=e=>I.from(e.dom.parentNode).map(vn),An=e=>I.from(e.dom.parentElement).map(vn),On=(e,t)=>{const n=w(t)?t:L;let o=e.dom;const r=[];for(;null!==o.parentNode&&void 0!==o.parentNode;){const e=o.parentNode,t=vn(e);if(r.push(t),!0===n(t))break;o=e}return r},Tn=e=>I.from(e.dom.previousSibling).map(vn),Bn=e=>I.from(e.dom.nextSibling).map(vn),Dn=e=>oe(Cn(e,Tn)),Pn=e=>Cn(e,Bn),Ln=e=>V(e.dom.childNodes,vn),Mn=(e,t)=>{const n=e.dom.childNodes;return I.from(n[t]).map(vn)},In=e=>Mn(e,0),Fn=e=>Mn(e,e.dom.childNodes.length-1),Un=e=>e.dom.childNodes.length,zn=e=>Gt(e)&&C(e.dom.host),jn=w(Element.prototype.attachShadow)&&w(Node.prototype.getRootNode),Hn=N(jn),$n=jn?e=>vn(e.dom.getRootNode()):_n,Vn=e=>zn(e)?e:(e=>{const t=e.dom.head;if(null==t)throw new Error("Head is not available yet");return vn(t)})(_n(e)),qn=e=>vn(e.dom.host),Wn=e=>{if(Hn()&&C(e.target)){const t=vn(e.target);if(qt(t)&&Kn(t)&&e.composed&&e.composedPath){const t=e.composedPath();if(t)return le(t)}}return I.from(e.target)},Kn=e=>C(e.dom.shadowRoot),Gn=e=>{const t=Wt(e)?e.dom.parentNode:e.dom;if(null==t||null===t.ownerDocument)return!1;const n=t.ownerDocument;return(e=>{const t=$n(e);return zn(t)?I.some(t):I.none()})(vn(t)).fold((()=>n.body.contains(t)),_(Gn,qn))};var Yn=(e,t,n,o,r)=>e(n,o)?I.some(n):w(r)&&r(n)?I.none():t(n,o,r);const Xn=(e,t,n)=>{let o=e.dom;const r=w(n)?n:L;for(;o.parentNode;){o=o.parentNode;const e=vn(o);if(t(e))return I.some(e);if(r(e))break}return I.none()},Qn=(e,t,n)=>Yn(((e,t)=>t(e)),Xn,e,t,n),Jn=(e,t,n)=>Xn(e,(e=>wn(e,t)),n),Zn=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return xn(n)?I.none():I.from(n.querySelector(e)).map(vn)})(t,e),eo=(e,t,n)=>Yn(((e,t)=>wn(e,t)),Jn,e,t,n),to=(e,t=!1)=>{return Gn(e)?e.dom.isContentEditable:(n=e,eo(n,"[contenteditable]")).fold(N(t),(e=>"true"===no(e)));var n},no=e=>e.dom.contentEditable,oo=e=>void 0!==e.style&&w(e.style.getPropertyValue),ro=(e,t,n)=>{if(!m(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);oo(e)&&e.style.setProperty(t,n)},so=(e,t,n)=>{const o=e.dom;ro(o,t,n)},ao=(e,t)=>{const n=e.dom;ge(t,((e,t)=>{ro(n,t,e)}))},io=(e,t)=>{const n=e.dom,o=window.getComputedStyle(n).getPropertyValue(t);return""!==o||Gn(e)?o:lo(n,t)},lo=(e,t)=>oo(e)?e.style.getPropertyValue(t):"",co=(e,t)=>{const n=e.dom,o=lo(n,t);return I.from(o).filter((e=>e.length>0))},uo=e=>{const t={},n=e.dom;if(oo(n))for(let e=0;e{((e,t)=>{oo(e)&&e.style.removeProperty(t)})(e.dom,t),Pt(en(e,"style").map(qe),"")&&nn(e,"style")},fo=(e,t)=>{Rn(e).each((n=>{n.dom.insertBefore(t.dom,e.dom)}))},go=(e,t)=>{Bn(e).fold((()=>{Rn(e).each((e=>{ho(e,t)}))}),(e=>{fo(e,t)}))},po=(e,t)=>{In(e).fold((()=>{ho(e,t)}),(n=>{e.dom.insertBefore(t.dom,n.dom)}))},ho=(e,t)=>{e.dom.appendChild(t.dom)},bo=(e,t)=>{fo(e,t),ho(t,e)},vo=(e,t)=>{q(t,(t=>{ho(e,t)}))},yo=e=>{e.dom.textContent="",q(Ln(e),(e=>{Co(e)}))},Co=e=>{const t=e.dom;null!==t.parentNode&&t.parentNode.removeChild(t)},wo=e=>{const t=Ln(e);var n,o;t.length>0&&(n=e,q(o=t,((e,t)=>{const r=0===t?n:o[t-1];go(r,e)}))),Co(e)},xo=e=>V(e,vn),ko=e=>e.dom.innerHTML,Eo=(e,t)=>{const n=Sn(e).dom,o=vn(n.createDocumentFragment()),r=((e,t)=>{const n=(t||document).createElement("div");return n.innerHTML=e,Ln(vn(n))})(t,n);vo(o,r),yo(e),ho(e,o)},So=(e,t,n,o)=>((e,t,n,o,r)=>{const s=((e,t)=>n=>{e(n)&&t((e=>{const t=vn(Wn(e).getOr(e.target)),n=()=>e.stopPropagation(),o=()=>e.preventDefault(),r=S(o,n);return((e,t,n,o,r,s,a)=>({target:e,x:t,y:n,stop:o,prevent:r,kill:s,raw:a}))(t,e.clientX,e.clientY,n,o,r,e)})(n))})(n,o);return e.dom.addEventListener(t,s,false),{unbind:O(_o,e,t,s,false)}})(e,t,n,o),_o=(e,t,n,o)=>{e.dom.removeEventListener(t,n,o)},No=(e,t)=>({left:e,top:t,translate:(n,o)=>No(e+n,t+o)}),Ro=No,Ao=(e,t)=>void 0!==e?e:void 0!==t?t:0,Oo=e=>{const t=e.dom,n=t.ownerDocument.body;return n===t?Ro(n.offsetLeft,n.offsetTop):Gn(e)?(e=>{const t=e.getBoundingClientRect();return Ro(t.left,t.top)})(t):Ro(0,0)},To=e=>{const t=void 0!==e?e.dom:document,n=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return Ro(n,o)},Bo=(e,t)=>{xt().browser.isSafari()&&w(e.dom.scrollIntoViewIfNeeded)?e.dom.scrollIntoViewIfNeeded(!1):e.dom.scrollIntoView(t)},Do=(e,t,n,o)=>({x:e,y:t,width:n,height:o,right:e+n,bottom:t+o}),Po=e=>{const t=void 0===e?window:e,n=t.document,o=To(vn(n));return(e=>{const t=void 0===e?window:e;return xt().browser.isFirefox()?I.none():I.from(t.visualViewport)})(t).fold((()=>{const e=t.document.documentElement,n=e.clientWidth,r=e.clientHeight;return Do(o.left,o.top,n,r)}),(e=>Do(Math.max(e.pageLeft,o.left),Math.max(e.pageTop,o.top),e.width,e.height)))},Lo=(e,t)=>{let n=[];return q(Ln(e),(e=>{t(e)&&(n=n.concat([e])),n=n.concat(Lo(e,t))})),n},Mo=(e,t)=>((e,t)=>{const n=void 0===t?document:t.dom;return xn(n)?[]:V(n.querySelectorAll(e),vn)})(t,e),Io=(e,t,n)=>Jn(e,t,n).isSome();class Fo{constructor(e,t){this.node=e,this.rootNode=t,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(e){return this.node=this.findSibling(this.node,"firstChild","nextSibling",e),this.node}prev(e){return this.node=this.findSibling(this.node,"lastChild","previousSibling",e),this.node}prev2(e){return this.node=this.findPreviousNode(this.node,e),this.node}findSibling(e,t,n,o){if(e){if(!o&&e[t])return e[t];if(e!==this.rootNode){let t=e[n];if(t)return t;for(let o=e.parentNode;o&&o!==this.rootNode;o=o.parentNode)if(t=o[n],t)return t}}}findPreviousNode(e,t){if(e){const n=e.previousSibling;if(this.rootNode&&n===this.rootNode)return;if(n){if(!t)for(let e=n.lastChild;e;e=e.lastChild)if(!e.lastChild)return e;return n}const o=e.parentNode;if(o&&o!==this.rootNode)return o}}}const Uo=e=>t=>!!t&&t.nodeType===e,zo=e=>!!e&&!Object.getPrototypeOf(e),jo=Uo(1),Ho=e=>{const t=e.toLowerCase();return e=>C(e)&&e.nodeName.toLowerCase()===t},$o=e=>{const t=e.map((e=>e.toLowerCase()));return e=>{if(e&&e.nodeName){const n=e.nodeName.toLowerCase();return H(t,n)}return!1}},Vo=(e,t)=>{const n=t.toLowerCase().split(" ");return t=>{if(jo(t)){const o=t.ownerDocument.defaultView;if(o)for(let r=0;rt=>jo(t)&&t.hasAttribute(e),Wo=e=>jo(e)&&e.hasAttribute("data-mce-bogus"),Ko=e=>jo(e)&&"TABLE"===e.tagName,Go=e=>t=>{if(jo(t)){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1},Yo=$o(["textarea","input"]),Xo=Uo(3),Qo=Uo(4),Jo=Uo(7),Zo=Uo(8),er=Uo(9),tr=Uo(11),nr=Ho("br"),or=Ho("img"),rr=Go("true"),sr=Go("false"),ar=$o(["td","th"]),ir=$o(["td","th","caption"]),lr=$o(["video","audio","object","embed"]),dr=Ho("li"),cr=Ho("details"),ur=Ho("summary"),mr="\ufeff",fr="\xa0",gr=e=>e===mr,pr=((e,t)=>{const n=t=>e(t)?I.from(t.dom.nodeValue):I.none();return{get:t=>{if(!e(t))throw new Error("Can only get text value of a text node");return n(t).getOr("")},getOption:n,set:(t,n)=>{if(!e(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=n}}})(Wt),hr=e=>pr.get(e),br=e=>pr.getOption(e),vr=["pre"].concat(["h1","h2","h3","h4","h5","h6"]),yr=e=>{let t;return n=>(t=t||se(e,M),ke(t,jt(n)))},Cr=yr(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),wr=e=>qt(e)&&!Cr(e),xr=e=>qt(e)&&"br"===jt(e),kr=yr(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),Er=yr(["ul","ol","dl"]),Sr=yr(["li","dd","dt"]),_r=yr(["thead","tbody","tfoot"]),Nr=yr(["td","th"]),Rr=yr(["pre","script","textarea","style"]),Ar=yr(vr),Or=e=>Ar(e)||wr(e),Tr=()=>{const e=hn("br");return Qt(e,"data-mce-bogus","1"),e},Br=e=>{yo(e),ho(e,Tr())},Dr=e=>{Fn(e).each((t=>{Tn(t).each((n=>{Cr(e)&&xr(t)&&Cr(n)&&Co(t)}))}))},Pr=mr,Lr=gr,Mr=e=>e.replace(/\uFEFF/g,""),Ir=jo,Fr=Xo,Ur=e=>(Fr(e)&&(e=e.parentNode),Ir(e)&&e.hasAttribute("data-mce-caret")),zr=e=>Fr(e)&&Lr(e.data),jr=e=>Ur(e)||zr(e),Hr=e=>e.firstChild!==e.lastChild||!nr(e.firstChild),$r=e=>{const t=e.container();return!!Xo(t)&&(t.data.charAt(e.offset())===Pr||e.isAtStart()&&zr(t.previousSibling))},Vr=e=>{const t=e.container();return!!Xo(t)&&(t.data.charAt(e.offset()-1)===Pr||e.isAtEnd()&&zr(t.nextSibling))},qr=e=>Fr(e)&&e.data[0]===Pr,Wr=e=>Fr(e)&&e.data[e.data.length-1]===Pr,Kr=e=>e&&e.hasAttribute("data-mce-caret")?((e=>{var t;const n=e.getElementsByTagName("br"),o=n[n.length-1];Wo(o)&&(null===(t=o.parentNode)||void 0===t||t.removeChild(o))})(e),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("data-mce-style"),e.removeAttribute("_moz_abspos"),e):null,Gr=e=>Ur(e.startContainer),Yr=rr,Xr=sr,Qr=nr,Jr=Xo,Zr=$o(["script","style","textarea"]),es=$o(["img","input","textarea","hr","iframe","video","audio","object","embed"]),ts=$o(["table"]),ns=jr,os=e=>!ns(e)&&(Jr(e)?!Zr(e.parentNode):es(e)||Qr(e)||ts(e)||rs(e)),rs=e=>!(e=>jo(e)&&"true"===e.getAttribute("unselectable"))(e)&&Xr(e),ss=(e,t)=>os(e)&&((e,t)=>{for(let n=e.parentNode;n&&n!==t;n=n.parentNode){if(rs(n))return!1;if(Yr(n))return!0}return!0})(e,t),as=/^[ \t\r\n]*$/,is=e=>as.test(e),ls=e=>{for(const t of e)if(!gr(t))return!1;return!0},ds=e=>"\n"===e||"\r"===e,cs=(e,t=4,n=!0,o=!0)=>{const r=((e,t)=>t<=0?"":new Array(t+1).join(" "))(0,t),s=e.replace(/\t/g,r),a=X(s,((e,t)=>(e=>-1!==" \f\t\v".indexOf(e))(t)||t===fr?e.pcIsSpace||""===e.str&&n||e.str.length===s.length-1&&o||((e,t)=>t=0&&ds(e[t]))(s,e.str.length+1)?{pcIsSpace:!1,str:e.str+fr}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:ds(t),str:e.str+t}),{pcIsSpace:!1,str:""});return a.str},us=(e,t)=>os(e)&&!((e,t)=>Xo(e)&&is(e.data)&&!((e,t)=>{const n=vn(t),o=vn(e);return Io(o,"pre,code",O(kn,n))})(e,t))(e,t)||(e=>jo(e)&&"A"===e.nodeName&&!e.hasAttribute("href")&&(e.hasAttribute("name")||e.hasAttribute("id")))(e)||ms(e),ms=qo("data-mce-bookmark"),fs=qo("data-mce-bogus"),gs=("data-mce-bogus","all",e=>jo(e)&&"all"===e.getAttribute("data-mce-bogus"));const ps=(e,t=!0)=>((e,t)=>{let n=0;if(us(e,e))return!1;{let o=e.firstChild;if(!o)return!0;const r=new Fo(o,e);do{if(t){if(gs(o)){o=r.next(!0);continue}if(fs(o)){o=r.next();continue}}if(nr(o))n++,o=r.next();else{if(us(o,e))return!1;o=r.next()}}while(o);return n<=1}})(e.dom,t),hs="data-mce-block",bs=e=>(e=>G(me(e),(e=>!/[A-Z]/.test(e))))(e).join(","),vs=(e,t)=>C(t.querySelector(e))?(t.setAttribute(hs,"true"),"inline-boundary"===t.getAttribute("data-mce-selected")&&t.removeAttribute("data-mce-selected"),!0):(t.removeAttribute(hs),!1),ys=(e,t)=>{const n=bs(e.getTransparentElements()),o=bs(e.getBlockElements());return G(t.querySelectorAll(n),(e=>vs(o,e)))},Cs=(e,t)=>{var n;const o=t?"lastChild":"firstChild";for(let t=e[o];t;t=t[o])if(ps(vn(t)))return void(null===(n=t.parentNode)||void 0===n||n.removeChild(t))},ws=(e,t,n)=>{const o=e.getBlockElements(),r=vn(t),s=e=>jt(e)in o,a=e=>kn(e,r);q(xo(n),(t=>{Xn(t,s,a).each((n=>{const o=((t,o)=>G(Ln(t),(t=>s(t)&&!e.isValidChild(jt(n),jt(t)))))(t);if(o.length>0){const t=An(n);q(o,(e=>{Xn(e,s,a).each((t=>{((e,t)=>{const n=document.createRange(),o=e.parentNode;if(o){n.setStartBefore(e),n.setEndBefore(t);const r=n.extractContents();Cs(r,!0),n.setStartAfter(t),n.setEndAfter(e);const s=n.extractContents();Cs(s,!1),ps(vn(r))||o.insertBefore(r,e),ps(vn(t))||o.insertBefore(t,e),ps(vn(s))||o.insertBefore(s,e),o.removeChild(e)}})(t.dom,e.dom)}))})),t.each((t=>ys(e,t.dom)))}}))}))},xs=(e,t)=>{const n=ys(e,t);ws(e,t,n),((e,t,n)=>{q([...n,...Ns(e,t)?[t]:[]],(t=>q(Mo(vn(t),t.nodeName.toLowerCase()),(t=>{Rs(e,t.dom)&&wo(t)}))))})(e,t,n)},ks=(e,t)=>{if(_s(e,t)){const n=bs(e.getBlockElements());vs(n,t)}},Es=e=>e.hasAttribute(hs),Ss=(e,t)=>ke(e.getTransparentElements(),t),_s=(e,t)=>jo(t)&&Ss(e,t.nodeName),Ns=(e,t)=>_s(e,t)&&Es(t),Rs=(e,t)=>_s(e,t)&&!Es(t),As=(e,t)=>1===t.type&&Ss(e,t.name)&&m(t.attr(hs)),Os=xt().browser,Ts=e=>J(e,qt),Bs=(e,t)=>e.children&&H(e.children,t),Ds=(e,t={})=>{let n=0;const o={},r=vn(e),s=_n(r),a=e=>new Promise(((a,i)=>{let l;const d=Dt._addCacheSuffix(e),c=(e=>xe(o,e).getOrThunk((()=>({id:"mce-u"+n++,passed:[],failed:[],count:0}))))(d);o[d]=c,c.count++;const u=(e,t)=>{q(e,P),c.status=t,c.passed=[],c.failed=[],l&&(l.onload=null,l.onerror=null,l=null)},m=()=>u(c.passed,2),f=()=>u(c.failed,3);if(a&&c.passed.push(a),i&&c.failed.push(i),1===c.status)return;if(2===c.status)return void m();if(3===c.status)return void f();c.status=1;const g=hn("link",s.dom);var p;Jt(g,{rel:"stylesheet",type:"text/css",id:c.id}),t.contentCssCors&&Qt(g,"crossOrigin","anonymous"),t.referrerPolicy&&Qt(g,"referrerpolicy",t.referrerPolicy),l=g.dom,l.onload=m,l.onerror=f,p=g,ho(Vn(r),p),Qt(g,"href",d)})),i=e=>{const t=Dt._addCacheSuffix(e);xe(o,t).each((e=>{0==--e.count&&(delete o[t],(e=>{const t=Vn(r);Zn(t,"#"+e).each(Co)})(e.id))}))};return{load:a,loadAll:e=>Promise.allSettled(V(e,(e=>a(e).then(N(e))))).then((e=>{const t=K(e,(e=>"fulfilled"===e.status));return t.fail.length>0?Promise.reject(V(t.fail,(e=>e.reason))):V(t.pass,(e=>e.value))})),unload:i,unloadAll:e=>{q(e,(e=>{i(e)}))},_setReferrerPolicy:e=>{t.referrerPolicy=e},_setContentCssCors:e=>{t.contentCssCors=e}}},Ps=(()=>{const e=new WeakMap;return{forElement:(t,n)=>{const o=$n(t).dom;return I.from(e.get(o)).getOrThunk((()=>{const t=Ds(o,n);return e.set(o,t),t}))}}})(),Ls=(e,t)=>C(e)&&(us(e,t)||wr(vn(e))),Ms=e=>(e=>"span"===e.nodeName.toLowerCase())(e)&&"bookmark"===e.getAttribute("data-mce-type"),Is=(e,t,n)=>{var o;const r=n||t;if(jo(t)&&Ms(t))return t;const s=t.childNodes;for(let t=s.length-1;t>=0;t--)Is(e,s[t],r);if(jo(t)){const e=t.childNodes;1===e.length&&Ms(e[0])&&(null===(o=t.parentNode)||void 0===o||o.insertBefore(e[0],t))}return(e=>tr(e)||er(e))(t)||us(t,r)||(e=>!!jo(e)&&e.childNodes.length>0)(t)||((e,t)=>Xo(e)&&e.data.length>0&&((e,t)=>{const n=new Fo(e,t).prev(!1),o=new Fo(e,t).next(!1),r=v(n)||Ls(n,t),s=v(o)||Ls(o,t);return r&&s})(e,t))(t,r)||e.remove(t),t},Fs=Dt.makeMap,Us=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,zs=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,js=/[<>&\"\']/g,Hs=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,$s={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"},Vs={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},qs={"<":"<",">":">","&":"&",""":'"',"'":"'"},Ws=(e,t)=>{const n={};if(e){const o=e.split(",");t=t||10;for(let e=0;ee.replace(t?Us:zs,(e=>Vs[e]||e)),Ys=(e,t)=>e.replace(t?Us:zs,(e=>e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":Vs[e]||"&#"+e.charCodeAt(0)+";")),Xs=(e,t,n)=>{const o=n||Ks;return e.replace(t?Us:zs,(e=>Vs[e]||o[e]||e))},Qs={encodeRaw:Gs,encodeAllRaw:e=>(""+e).replace(js,(e=>Vs[e]||e)),encodeNumeric:Ys,encodeNamed:Xs,getEncodeFunc:(e,t)=>{const n=Ws(t)||Ks,o=Fs(e.replace(/\+/g,","));return o.named&&o.numeric?(e,t)=>e.replace(t?Us:zs,(e=>void 0!==Vs[e]?Vs[e]:void 0!==n[e]?n[e]:e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";")):o.named?t?(e,t)=>Xs(e,t,n):Xs:o.numeric?Ys:Gs},decode:e=>e.replace(Hs,((e,t)=>t?(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))>65535?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):$s[t]||String.fromCharCode(t):qs[e]||Ks[e]||(e=>{const t=hn("div").dom;return t.innerHTML=e,t.textContent||t.innerText||e})(e)))},Js={},Zs={},ea={},ta=Dt.makeMap,na=Dt.each,oa=Dt.extend,ra=Dt.explode,sa=Dt.inArray,aa=(e,t)=>(e=Dt.trim(e))?e.split(t||" "):[],ia=(e,t={})=>{const n=ta(e," ",ta(e.toUpperCase()," "));return oa(n,t)},la=e=>ia("td th li dt dd figcaption caption details summary",e.getTextBlockElements()),da=(e,t)=>{if(e){const n={};return m(e)&&(e={"*":e}),na(e,((e,o)=>{n[o]=n[o.toUpperCase()]="map"===t?ta(e,/[, ]/):ra(e,/[, ]/)})),n}},ca=(e={})=>{var t;const n={},o={};let r=[];const s={},a={},i=(t,n,o)=>{const r=e[t];if(r)return ta(r,/[, ]/,ta(r.toUpperCase(),/[, ]/));{let e=Zs[t];return e||(e=ia(n,o),Zs[t]=e),e}},l=null!==(t=e.schema)&&void 0!==t?t:"html5",d=(e=>{const t={};let n,o,r,s;const a=(e,o="",r="")=>{const s=aa(r),a=aa(e);let i=a.length;for(;i--;){const e=aa([n,o].join(" "));t[a[i]]={attributes:se(e,(()=>({}))),attributesOrder:e,children:se(s,N(ea))}}},i=(e,n)=>{const o=aa(e),r=aa(n);let s=o.length;for(;s--;){const e=t[o[s]];for(let t=0,n=r.length;t