@editora/core 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  `}),n+=`
9
9
  `}),n}getShortcutCategory(e){return e.includes("toggle")&&(e.includes("Bold")||e.includes("Italic")||e.includes("Underline")||e.includes("Strike")||e.includes("Code")||e.includes("Super")||e.includes("Sub"))?"Text Formatting":e.includes("Heading")||e.includes("Paragraph")?"Block Formatting":e.includes("List")||e.includes("Checklist")?"Lists":e.includes("Alignment")||e.includes("Indent")?"Alignment & Indentation":e.includes("undo")||e.includes("redo")?"History":e.includes("insert")?"Insert":e.includes("find")||e.includes("replace")?"Find & Replace":e.includes("Accessibility")||e.includes("spell")?"Tools":"Other"}}function PO(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ade(t){if(Array.isArray(t))return t}function pde(t,e){var r=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,a,s=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,e!==0)for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function mde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
10
10
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gde(t,e){return Ade(t)||pde(t,e)||bde(t,e)||mde()}function bde(t,e){if(t){if(typeof t=="string")return PO(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?PO(t,e):void 0}}const HO=Object.entries,zO=Object.setPrototypeOf,vde=Object.isFrozen,yde=Object.getPrototypeOf,wde=Object.getOwnPropertyDescriptor;let fo=Object.freeze,Io=Object.seal,Zm=Object.create,$O=typeof Reflect!="undefined"&&Reflect,u8=$O.apply,d8=$O.construct;fo||(fo=function(e){return e}),Io||(Io=function(e){return e}),u8||(u8=function(e,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return e.apply(r,i)}),d8||(d8=function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return new e(...n)});const WA=ji(Array.prototype.forEach),xde=ji(Array.prototype.lastIndexOf),QO=ji(Array.prototype.pop),Fb=ji(Array.prototype.push),Ede=ji(Array.prototype.splice),Jm=Array.isArray,Ub=ji(String.prototype.toLowerCase),h8=ji(String.prototype.toString),qO=ji(String.prototype.match),Nb=ji(String.prototype.replace),jO=ji(String.prototype.indexOf),Cde=ji(String.prototype.trim),Tde=ji(Number.prototype.toString),kde=ji(Boolean.prototype.toString),WO=typeof BigInt=="undefined"?null:ji(BigInt.prototype.toString),KO=typeof Symbol=="undefined"?null:ji(Symbol.prototype.toString),hs=ji(Object.prototype.hasOwnProperty),Rb=ji(Object.prototype.toString),pa=ji(RegExp.prototype.test),Jh=Sde(TypeError);function ji(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return u8(t,e,n)}}function Sde(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return d8(t,r)}}function Wr(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ub;if(zO&&zO(t,null),!Jm(e))return t;let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const o=r(i);o!==i&&(vde(e)||(e[n]=o),i=o)}t[i]=!0}return t}function Bde(t){for(let e=0;e<t.length;e++)hs(t,e)||(t[e]=null);return t}function $s(t){const e=Zm(null);for(const n of HO(t)){var r=gde(n,2);const i=r[0],o=r[1];hs(t,i)&&(Jm(o)?e[i]=Bde(o):o&&typeof o=="object"&&o.constructor===Object?e[i]=$s(o):e[i]=o)}return e}function Dde(t){switch(typeof t){case"string":return t;case"number":return Tde(t);case"boolean":return kde(t);case"bigint":return WO?WO(t):"0";case"symbol":return KO?KO(t):"Symbol()";case"undefined":return Rb(t);case"function":case"object":{if(t===null)return Rb(t);const e=t,r=ml(e,"toString");if(typeof r=="function"){const n=r(e);return typeof n=="string"?n:Rb(n)}return Rb(t)}default:return Rb(t)}}function ml(t,e){for(;t!==null;){const n=wde(t,e);if(n){if(n.get)return ji(n.get);if(typeof n.value=="function")return ji(n.value)}t=yde(t)}function r(){return null}return r}function _de(t){try{return pa(t,""),!0}catch(e){return!1}}const VO=fo(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),f8=fo(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),A8=fo(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Lde=fo(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),p8=fo(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ide=fo(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),GO=fo(["#text"]),XO=fo(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),m8=fo(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),YO=fo(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ww=fo(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Fde=Io(/{{[\w\W]*|^[\w\W]*}}/g),Ude=Io(/<%[\w\W]*|^[\w\W]*%>/g),Nde=Io(/\${[\w\W]*/g),Rde=Io(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mde=Io(/^aria-[\-\w]+$/),ZO=Io(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ode=Io(/^(?:\w+script|data):/i),Pde=Io(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hde=Io(/^html$/i),zde=Io(/^[a-z][.\w]*(-[.\w]+)+$/i),JO=Io(/<[/\w!]/g),e3=Io(/<[/\w]/g),$de=Io(/<\/no(script|embed|frames)/i),Qde=Io(/\/>/i),Qs={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},t3=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],qde=fo(Wr({},t3)),jde=(function(){const t={};return WA(t3,e=>{t[e]=Io(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),fo(t)})(),Wde=function(){return typeof window=="undefined"?null:window},Kde=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(n=r.getAttribute(i));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch(a){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},r3=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ef=function(e,r,n,i){return hs(e,r)&&Jm(e[r])?Wr(i.base?$s(i.base):{},e[r],i.transform):n},g8=function(e,r,n){const i=hs(e,r)?e[r]:void 0;return i&&typeof i=="object"?$s(i):n()};function n3(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wde();const e=Ge=>n3(Ge);if(e.version="3.4.16",e.removed=[],!t||!t.document||t.document.nodeType!==Qs.document||!t.Element)return e.isSupported=!1,e;let r=t.document;const n=r,i=n.currentScript;t.DocumentFragment;const o=t.HTMLTemplateElement,a=t.Node,s=t.Element,l=t.NodeFilter;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const c=t.DOMParser,u=t.trustedTypes,d=s.prototype,h=ml(d,"cloneNode"),f=ml(d,"remove"),A=ml(d,"removeAttributeNode"),p=ml(d,"nextSibling"),g=ml(d,"childNodes"),m=ml(d,"parentNode"),b=ml(d,"shadowRoot"),v=ml(d,"attributes"),w=a&&a.prototype?ml(a.prototype,"nodeType"):null,x=a&&a.prototype?ml(a.prototype,"nodeName"):null,T=a&&a.prototype?ml(a.prototype,"ownerDocument"):null,E=function(Z){return w?w(Z):Z.nodeType},D=function(Z){return x?x(Z):Z.nodeName};if(typeof o=="function"){const Ge=r.createElement("template");Ge.content&&Ge.content.ownerDocument&&(r=Ge.content.ownerDocument)}let S,F="",U,C=!1,I=0;const y=function(){if(I>0)throw Jh('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},P=function(Z){y(),I++;try{return S.createHTML(Z)}finally{I--}},W=function(Z){y(),I++;try{return S.createScriptURL(Z)}finally{I--}},j=function(){return C||(U=Kde(u,i),C=!0),U},ae=r,te=ae.implementation,ue=ae.createNodeIterator,M=ae.createDocumentFragment,_=ae.getElementsByTagName,z=n.importNode;let $=r3();e.isSupported=typeof HO=="function"&&typeof m=="function"&&te&&te.createHTMLDocument!==void 0;const re=Fde,G=Ude,se=Nde,de=Rde,Ae=Mde,ye=Ode,ee=Pde,q=zde;let J=ZO,L=null;const le=Wr({},[...VO,...f8,...A8,...p8,...GO]);let Y=null;const he=Wr({},[...XO,...m8,...YO,...Ww]);let oe=Object.seal(Zm(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),fe=null,Ie=null;const Ne=Object.seal(Zm(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let _e=!0,Te=!0,N=!1,H=!0,V=!1,pe=!0,Ce=!1,Ue=!1,Pe=null,Ye=null,Je=!1,Le=!1,We=!1,ot=!1,dt=!0,Bt=!1;const Dt="user-content-";let tr=!0,Vt=!1,Jt={},Gt=null;const gr=Wr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let It=null;const ar=Wr({},["audio","video","img","source","image","track"]);let Ai=null;const Or=Wr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ve="http://www.w3.org/1998/Math/MathML",ke="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let rt=Fe,ht=!1,Et=null;const ut=Wr({},[ve,ke,Fe],h8),Mt=fo(["mi","mo","mn","ms","mtext"]);let sr=Wr({},Mt);const Vr=fo(["annotation-xml"]);let jr=Wr({},Vr);const yn=Wr({},["title","style","font","a","script"]);let Cr=null;const _r=["application/xhtml+xml","text/html"],Rn="text/html";let $t=null,Ir=null;const Mn=r.createElement("form"),wr=function(Z){return Z instanceof RegExp||Z instanceof Function},Ft=function(){let Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ir&&Ir===Z)return;(!Z||typeof Z!="object")&&(Z={}),Z=$s(Z),Cr=_r.indexOf(Z.PARSER_MEDIA_TYPE)===-1?Rn:Z.PARSER_MEDIA_TYPE,$t=Cr==="application/xhtml+xml"?h8:Ub,L=ef(Z,"ALLOWED_TAGS",le,{transform:$t}),Y=ef(Z,"ALLOWED_ATTR",he,{transform:$t}),Et=ef(Z,"ALLOWED_NAMESPACES",ut,{transform:h8}),Ai=ef(Z,"ADD_URI_SAFE_ATTR",Or,{transform:$t,base:Or}),It=ef(Z,"ADD_DATA_URI_TAGS",ar,{transform:$t,base:ar}),Gt=ef(Z,"FORBID_CONTENTS",gr,{transform:$t}),fe=ef(Z,"FORBID_TAGS",$s({}),{transform:$t}),Ie=ef(Z,"FORBID_ATTR",$s({}),{transform:$t}),Jt=hs(Z,"USE_PROFILES")?Z.USE_PROFILES&&typeof Z.USE_PROFILES=="object"?$s(Z.USE_PROFILES):Z.USE_PROFILES:!1,_e=Z.ALLOW_ARIA_ATTR!==!1,Te=Z.ALLOW_DATA_ATTR!==!1,N=Z.ALLOW_UNKNOWN_PROTOCOLS||!1,H=Z.ALLOW_SELF_CLOSE_IN_ATTR!==!1,V=Z.SAFE_FOR_TEMPLATES||!1,pe=Z.SAFE_FOR_XML!==!1,Ce=Z.WHOLE_DOCUMENT||!1,Le=Z.RETURN_DOM||!1,We=Z.RETURN_DOM_FRAGMENT||!1,ot=Z.RETURN_TRUSTED_TYPE||!1,Je=Z.FORCE_BODY||!1,dt=Z.SANITIZE_DOM!==!1,Bt=Z.SANITIZE_NAMED_PROPS||!1,tr=Z.KEEP_CONTENT!==!1,Vt=Z.IN_PLACE||!1,J=_de(Z.ALLOWED_URI_REGEXP)?Z.ALLOWED_URI_REGEXP:ZO,rt=typeof Z.NAMESPACE=="string"?Z.NAMESPACE:Fe,sr=g8(Z,"MATHML_TEXT_INTEGRATION_POINTS",()=>Wr({},Mt)),jr=g8(Z,"HTML_INTEGRATION_POINTS",()=>Wr({},Vr));const Ee=g8(Z,"CUSTOM_ELEMENT_HANDLING",()=>Zm(null));if(oe=Zm(null),hs(Ee,"tagNameCheck")&&wr(Ee.tagNameCheck)&&(oe.tagNameCheck=Ee.tagNameCheck),hs(Ee,"attributeNameCheck")&&wr(Ee.attributeNameCheck)&&(oe.attributeNameCheck=Ee.attributeNameCheck),hs(Ee,"allowCustomizedBuiltInElements")&&typeof Ee.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=Ee.allowCustomizedBuiltInElements),Io(oe),V&&(Te=!1),We&&(Le=!0),Jt&&(L=Wr({},GO),Y=Zm(null),Jt.html===!0&&(Wr(L,VO),Wr(Y,XO)),Jt.svg===!0&&(Wr(L,f8),Wr(Y,m8),Wr(Y,Ww)),Jt.svgFilters===!0&&(Wr(L,A8),Wr(Y,m8),Wr(Y,Ww)),Jt.mathMl===!0&&(Wr(L,p8),Wr(Y,YO),Wr(Y,Ww))),Ne.tagCheck=null,Ne.attributeCheck=null,hs(Z,"ADD_TAGS")&&(typeof Z.ADD_TAGS=="function"?Ne.tagCheck=Z.ADD_TAGS:Jm(Z.ADD_TAGS)&&(L===le&&(L=$s(L)),Wr(L,Z.ADD_TAGS,$t))),hs(Z,"ADD_ATTR")&&(typeof Z.ADD_ATTR=="function"?Ne.attributeCheck=Z.ADD_ATTR:Jm(Z.ADD_ATTR)&&(Y===he&&(Y=$s(Y)),Wr(Y,Z.ADD_ATTR,$t))),hs(Z,"ADD_FORBID_CONTENTS")&&Jm(Z.ADD_FORBID_CONTENTS)&&(Gt===gr&&(Gt=$s(Gt)),Wr(Gt,Z.ADD_FORBID_CONTENTS,$t)),tr&&(L["#text"]=!0),Ce&&Wr(L,["html","head","body"]),L.table&&(Wr(L,["tbody"]),delete fe.tbody),Z.TRUSTED_TYPES_POLICY){if(typeof Z.TRUSTED_TYPES_POLICY.createHTML!="function")throw Jh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Z.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Jh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const je=S;S=Z.TRUSTED_TYPES_POLICY;try{F=P("")}catch(et){throw S=je,et}}else Z.TRUSTED_TYPES_POLICY===null?(S=void 0,F=""):(S===void 0&&(S=j()),S&&typeof F=="string"&&(F=P("")));fo&&fo(Z),Ir=Z},$e=Wr({},[...f8,...A8,...Lde]),gt=Wr({},[...p8,...Ide]),St=function(Z,Ee,je){return Ee.namespaceURI===Fe?Z==="svg":Ee.namespaceURI===ve?Z==="svg"&&(je==="annotation-xml"||sr[je]):!!$e[Z]},hr=function(Z,Ee,je){return Ee.namespaceURI===Fe?Z==="math":Ee.namespaceURI===ke?Z==="math"&&jr[je]:!!gt[Z]},An=function(Z,Ee,je){return Ee.namespaceURI===ke&&!jr[je]||Ee.namespaceURI===ve&&!sr[je]?!1:!gt[Z]&&(yn[Z]||!$e[Z])},Nr=function(Z){let Ee=m(Z);(!Ee||!Ee.tagName)&&(Ee={namespaceURI:rt,tagName:"template"});const je=Ub(Z.tagName),et=Ub(Ee.tagName);return Et[Z.namespaceURI]?Z.namespaceURI===ke?St(je,Ee,et):Z.namespaceURI===ve?hr(je,Ee,et):Z.namespaceURI===Fe?An(je,Ee,et):!!(Cr==="application/xhtml+xml"&&Et[Z.namespaceURI]):!1},Ar=function(Z){Fb(e.removed,{element:Z});try{m(Z).removeChild(Z)}catch(Ee){if(f(Z),!m(Z))throw Jh("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},On=function(Z,Ee,je){try{A(Z,Ee)}catch(et){try{Z.removeAttribute(je)}catch(at){}}},Lr=function(Z){Oa(Z);const Ee=g(Z);if(Ee){const et=[];WA(Ee,at=>{Fb(et,at)}),WA(et,at=>{try{f(at)}catch(Lt){}})}const je=v(Z);if(je)for(let et=je.length-1;et>=0;--et){const at=je[et],Lt=at&&at.name;typeof Lt=="string"&&On(Z,at,Lt)}},jn=function(Z,Ee,je){if(!je)try{je=Ee.getAttributeNode(Z)}catch(et){je=null}Fb(e.removed,{attribute:je||null,from:Ee});try{je?A(Ee,je):Ee.removeAttribute(Z)}catch(et){try{Ee.removeAttribute(Z)}catch(at){}}if(Z==="is")if(Le||We)try{Ar(Ee)}catch(et){}else try{Ee.setAttribute(Z,"")}catch(et){}},ll=function(Z){const Ee=v(Z);if(Ee)for(let je=Ee.length-1;je>=0;--je){const et=Ee[je],at=et&&et.name;typeof at!="string"||Y[$t(at)]||On(Z,et,at)}},Oa=function(Z){const Ee=[Z];for(;Ee.length>0;){const je=Ee.pop();E(je)===Qs.element&&ll(je);const et=g(je);if(et)for(let at=et.length-1;at>=0;--at)Ee.push(et[at])}},Us=function(Z,Ee){return pe?Z==="patchsrc"?!0:Z==="for"&&Ee!=="label"&&Ee!=="output":!1},Dh=function(Z){if(!pe)return;const Ee=[Z];for(;Ee.length>0;){const je=Ee.pop(),et=E(je);if(et===Qs.processingInstruction||et===Qs.comment&&pa(e3,je.data)){try{f(je)}catch(Lt){}continue}if(et===Qs.element){const Lt=je,Rt=$t(D(je));try{Lt.hasAttribute&&Lt.hasAttribute("patchsrc")&&Lt.removeAttribute("patchsrc"),Lt.hasAttribute&&Lt.hasAttribute("for")&&Us("for",Rt)&&Lt.removeAttribute("for")}catch(Xt){}}const at=g(je);if(at)for(let Lt=at.length-1;Lt>=0;--Lt)Ee.push(at[Lt])}},pn=function(Z){let Ee=null,je=null;if(Je)Z="<remove></remove>"+Z;else{const Lt=qO(Z,/^[\r\n\t ]+/);je=Lt&&Lt[0]}Cr==="application/xhtml+xml"&&rt===Fe&&(Z='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Z+"</body></html>");const et=S?P(Z):Z;if(rt===Fe)try{Ee=new c().parseFromString(et,Cr)}catch(Lt){}if(!Ee||!Ee.documentElement){Ee=te.createDocument(rt,"template",null);try{Ee.documentElement.innerHTML=ht?F:et}catch(Lt){}}const at=Ee.body||Ee.documentElement;return Z&&je&&at.insertBefore(r.createTextNode(je),at.childNodes[0]||null),rt===Fe?_.call(Ee,Ce?"html":"body")[0]:Ce?Ee.documentElement:at},nc=function(Z){const Ee=T?T(Z):Z.ownerDocument;return ue.call(Ee||Z,Z,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Pa=function(Z){return Z=Nb(Z,re," "),Z=Nb(Z,G," "),Z=Nb(Z,se," "),Z},Ns=function(Z){var Ee;Z.normalize();const je=T?T(Z):Z.ownerDocument,et=ue.call(je||Z,Z,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let at=et.nextNode();for(;at;)at.data=Pa(at.data),at=et.nextNode();const Lt=(Ee=Z.querySelectorAll)===null||Ee===void 0?void 0:Ee.call(Z,"template");Lt&&WA(Lt,Rt=>{So(Rt.content)&&Ns(Rt.content)})},aa=function(Z){const Ee=x?x(Z):null;return typeof Ee!="string"||$t(Ee)!=="form"?!1:typeof Z.nodeName!="string"||typeof Z.textContent!="string"||typeof Z.removeChild!="function"||Z.attributes!==v(Z)||typeof Z.removeAttribute!="function"||typeof Z.removeAttributeNode!="function"||typeof Z.getAttributeNode!="function"||typeof Z.setAttribute!="function"||typeof Z.namespaceURI!="string"||typeof Z.insertBefore!="function"||typeof Z.hasChildNodes!="function"||Z.nodeType!==w(Z)||Z.childNodes!==g(Z)},So=function(Z){if(!w||typeof Z!="object"||Z===null)return!1;try{return w(Z)===Qs.documentFragment}catch(Ee){return!1}},Wn=function(Z){if(!w||typeof Z!="object"||Z===null)return!1;try{return typeof w(Z)=="number"}catch(Ee){return!1}};function cn(Ge,Z,Ee){Ge.length!==0&&WA(Ge,je=>{je.call(e,Z,Ee,Ir)})}const lo=function(Z,Ee){return!!(pe&&Z.hasChildNodes()&&!Wn(Z.firstElementChild)&&pa(JO,Z.textContent)&&pa(JO,Z.innerHTML)||pe&&Z.namespaceURI===Fe&&qde[Ee]&&(Wn(Z.firstElementChild)||typeof Z.textContent=="string"&&pa(jde[Ee],Z.textContent))||Z.nodeType===Qs.processingInstruction||pe&&Z.nodeType===Qs.comment&&pa(e3,Z.data))},sa=function(Z,Ee){if(Z instanceof RegExp)return pa(Z,Ee);if(Z instanceof Function){for(var je=arguments.length,et=new Array(je>2?je-2:0),at=2;at<je;at++)et[at-2]=arguments[at];return!!Z(Ee,...et)}return!1},cd=function(Z,Ee,je){if(!fe[Ee]&&cl(Ee)&&sa(oe.tagNameCheck,Ee))return!1;if(tr&&!Gt[Ee]){const et=m(Z),at=g(Z);if(at&&et){const Lt=at.length;for(let Rt=Lt-1;Rt>=0;--Rt){const Xt=Z===je?h(at[Rt],!0):at[Rt];et.insertBefore(Xt,p(Z))}}}return Ar(Z),!0},Wc=function(Z,Ee,je,et){return Z.length===0?Ee:Ee===je||Ee===et?$s(Ee):Ee},co=function(Z,Ee){return Z===Ee||m(Z)!==null?!1:(Vt&&Oa(Z),!0)},Kc=function(Z,Ee){if(cn($.beforeSanitizeElements,Z,null),co(Z,Ee))return!0;if(aa(Z))return Ar(Z),!0;const je=$t(D(Z));if(L=Wc($.uponSanitizeElement,L,le,Pe),cn($.uponSanitizeElement,Z,{tagName:je,allowedTags:L}),co(Z,Ee))return!0;if(lo(Z,je))return Ar(Z),!0;if(fe[je]||!(Ne.tagCheck instanceof Function&&Ne.tagCheck(je))&&!L[je]){const et=cd(Z,je,Ee);return et===!1&&(cn($.afterSanitizeElements,Z,null),co(Z,Ee))?!0:et}if(E(Z)===Qs.element&&!Nr(Z)||(je==="noscript"||je==="noembed"||je==="noframes")&&pa($de,Z.innerHTML))return Ar(Z),!0;if(V&&Z.nodeType===Qs.text){const et=Pa(Z.textContent);Z.textContent!==et&&(Fb(e.removed,{element:Z.cloneNode()}),Z.textContent=et)}return cn($.afterSanitizeElements,Z,null),co(Z,Ee)},ic=function(Z,Ee,je){if(Ie[Ee]||Us(Ee,Z)||dt&&(Ee==="id"||Ee==="name")&&(je in r||je in Mn))return!1;const et=Y[Ee]||Ne.attributeCheck instanceof Function&&Ne.attributeCheck(Ee,Z);return Te&&pa(de,Ee)||_e&&pa(Ae,Ee)?!0:et?Ai[Ee]||pa(J,Nb(je,ee,""))||(Ee==="src"||Ee==="xlink:href"||Ee==="href")&&Z!=="script"&&jO(je,"data:")===0&&It[Z]||N&&!pa(ye,Nb(je,ee,""))?!0:!je:cl(Z)&&sa(oe.tagNameCheck,Z)&&sa(oe.attributeNameCheck,Ee,Z)||Ee==="is"&&oe.allowCustomizedBuiltInElements&&sa(oe.tagNameCheck,je)},_h=Wr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),cl=function(Z){return!_h[Ub(Z)]&&pa(q,Z)},Lh=function(Z,Ee,je,et){if(S&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!je)switch(u.getAttributeType(Z,Ee)){case"TrustedHTML":return P(et);case"TrustedScriptURL":return W(et)}return et},Ih=function(Z,Ee,je,et){try{return je?Z.setAttributeNS(je,Ee,et):Z.setAttribute(Ee,et),aa(Z)?(Ar(Z),!1):!0}catch(at){return jn(Ee,Z),!1}},Vc=function(Z,Ee){if(cn($.beforeSanitizeAttributes,Z,null),co(Z,Ee))return;const je=Z.attributes;if(!je||aa(Z))return;Y=Wc($.uponSanitizeAttribute,Y,he,Ye);const et={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let at=je.length;const Lt=$t(Z.nodeName);for(;at--;){const Rt=je[at],Xt=Rt.name,Zr=Rt.namespaceURI,Hr=Rt.value,Bi=$t(Xt),Ha=Hr;let Rr=Xt==="value"?Ha:Cde(Ha),Gc=!1;if(et.attrName=Bi,et.attrValue=Rr,et.keepAttr=!0,et.forceKeepAttr=void 0,cn($.uponSanitizeAttribute,Z,et),Rr=et.attrValue,Bt&&(Bi==="id"||Bi==="name")&&jO(Rr,Dt)!==0&&(jn(Xt,Z,Rt),Rr=Dt+Rr,Gc=!0),pe&&pa(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Rr)){jn(Xt,Z,Rt);continue}if(Bi==="attributename"&&qO(Rr,"href")){jn(Xt,Z,Rt);continue}if(!et.forceKeepAttr){if(!et.keepAttr){jn(Xt,Z,Rt);continue}if(!H&&pa(Qde,Rr)){jn(Xt,Z,Rt);continue}if(V&&(Rr=Pa(Rr)),!ic(Lt,Bi,Rr)){jn(Xt,Z,Rt);continue}Rr=Lh(Lt,Bi,Zr,Rr),Rr!==Ha&&Ih(Z,Xt,Zr,Rr)&&Gc&&QO(e.removed)}}cn($.afterSanitizeAttributes,Z,null),co(Z,Ee)},$i=function(Z){let Ee=null;const je=nc(Z);for(cn($.beforeSanitizeShadowDOM,Z,null);Ee=je.nextNode();)if(cn($.uponSanitizeShadowNode,Ee,null),Kc(Ee,Z),Vc(Ee,Z),So(Ee.content)&&$i(Ee.content),E(Ee)===Qs.element){const et=b(Ee);So(et)&&(la(et),$i(et))}cn($.afterSanitizeShadowDOM,Z,null)},la=function(Z){const Ee=[{node:Z,shadow:null}];for(;Ee.length>0;){const je=Ee.pop();if(je.shadow){$i(je.shadow);continue}const et=je.node,at=E(et)===Qs.element,Lt=g(et);if(Lt)for(let Rt=Lt.length-1;Rt>=0;--Rt)Ee.push({node:Lt[Rt],shadow:null});if(at){const Rt=x?x(et):null;if(typeof Rt=="string"&&$t(Rt)==="template"){const Xt=et.content;So(Xt)&&Ee.push({node:Xt,shadow:null})}}if(at){const Rt=b(et);So(Rt)&&Ee.push({node:null,shadow:Rt},{node:Rt,shadow:null})}}};return e.sanitize=function(Ge){let Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee=null,je=null,et=null,at=null;if(ht=!Ge,ht&&(Ge="<!-->"),typeof Ge!="string"&&!Wn(Ge)&&(Ge=Dde(Ge),typeof Ge!="string"))throw Jh("dirty is not a string, aborting");if(!e.isSupported)return Ge;Ue?(L=Pe,Y=Ye):Ft(Z),($.uponSanitizeElement.length>0||$.uponSanitizeAttribute.length>0)&&(L=$s(L)),$.uponSanitizeAttribute.length>0&&(Y=$s(Y)),e.removed=[];const Lt=Vt&&typeof Ge!="string"&&Wn(Ge);if(Lt){Dh(Ge);const Zr=D(Ge);if(typeof Zr=="string"){const Hr=$t(Zr);if(!L[Hr]||fe[Hr])throw Lr(Ge),Jh("root node is forbidden and cannot be sanitized in-place")}if(aa(Ge))throw Lr(Ge),Jh("root node is clobbered and cannot be sanitized in-place");try{la(Ge)}catch(Hr){throw Lr(Ge),Hr}}else if(Wn(Ge))Ee=pn("<!---->"),je=Ee.ownerDocument.importNode(Ge,!0),je.nodeType===Qs.element&&je.nodeName==="BODY"||je.nodeName==="HTML"?Ee=je:Ee.appendChild(je),la(Ee);else{if(!Le&&!V&&!Ce&&Ge.indexOf("<")===-1)return S&&ot?P(Ge):Ge;if(Ee=pn(Ge),!Ee)return Le?null:ot?F:""}Ee&&Je&&Ar(Ee.firstChild);const Rt=Lt?Ge:Ee;try{const Zr=nc(Rt);for(;et=Zr.nextNode();)Kc(et,Rt),Vc(et,Rt),So(et.content)&&$i(et.content)}catch(Zr){throw Lt&&(Lr(Ge),WA(e.removed,Hr=>{Hr.element&&Oa(Hr.element)})),Zr}if(Lt){let Zr=!1;if(WA(e.removed,Hr=>{Hr.element&&(Hr.element===Ge&&(Zr=!0),Oa(Hr.element))}),Zr)throw Jh("a node selected for removal could not be safely returned; refusing to sanitize in place");return V&&Ns(Ge),Ge}if(Le){if(V&&Ns(Ee),We)for(at=M.call(Ee.ownerDocument);Ee.firstChild;)at.appendChild(Ee.firstChild);else at=Ee;return(Y.shadowroot||Y.shadowrootmode)&&(at=z.call(n,at,!0)),at}let Xt=Ce?Ee.outerHTML:Ee.innerHTML;return Ce&&L["!doctype"]&&Ee.ownerDocument&&Ee.ownerDocument.doctype&&Ee.ownerDocument.doctype.name&&pa(Hde,Ee.ownerDocument.doctype.name)&&(Xt="<!DOCTYPE "+Ee.ownerDocument.doctype.name+`>
11
- `+Xt),V&&(Xt=Pa(Xt)),S&&ot?P(Xt):Xt},e.setConfig=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ge),Ue=!0,Pe=L,Ye=Y},e.clearConfig=function(){Ir=null,Ue=!1,Pe=null,Ye=null,S=U,F=""},e.isValidAttribute=function(Ge,Z,Ee){Ir||Ft({});const je=$t(Ge),et=$t(Z);return ic(je,et,Ee)},e.addHook=function(Ge,Z){typeof Z=="function"&&hs($,Ge)&&Fb($[Ge],Z)},e.removeHook=function(Ge,Z){if(hs($,Ge)){if(Z!==void 0){const Ee=xde($[Ge],Z);return Ee===-1?void 0:Ede($[Ge],Ee,1)[0]}return QO($[Ge])}},e.removeHooks=function(Ge){hs($,Ge)&&($[Ge]=[])},e.removeAllHooks=function(){$=r3()},e}var Kw=n3();const Vde=["p","br","strong","em","u","s","strike","del","b","i","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","video","audio","table","thead","tbody","tr","th","td","blockquote","pre","code","span","div","section","figure","figcaption","sup","sub","hr"],Gde={"*":["class","style","id","data-*","role","aria-*","tabindex","contenteditable","spellcheck","dir","lang"],a:["href","target","rel","title"],img:["src","alt","width","height","loading"],video:["src","controls","width","height","autoplay","loop","muted"],audio:["src","controls","autoplay","loop","muted"],ol:["start","reversed"],table:["border","cellpadding","cellspacing"],td:["colspan","rowspan","align","valign"],th:["colspan","rowspan","align","valign"],iframe:["src","width","height","name","title","frameborder","scrolling","allowfullscreen","longdesc","allow"]},Xde="data-editora-embed";function Yde(t){if(!t||/\s/.test(t.trim()))return!1;try{const e=new URL(t.trim());return(e.protocol==="https:"||e.protocol==="http:")&&e.hostname.length>0}catch(e){return!1}}function i3(t,e,r,n){if((e==null?void 0:e.sanitize)===!1)return t;const i=e!=null&&e.allowedTags&&e.allowedTags.length>0?e.allowedTags:Vde,o=r!=null&&r.length?Array.from(new Set([...i,...r])):i,s=!!(e!=null&&e.allowedAttributes)&&Object.keys(e.allowedAttributes).length>0?e.allowedAttributes:Gde,l=new Set;for(const d of Object.values(s))for(const h of d)l.add(h);const c={ALLOWED_TAGS:o,ALLOWED_ATTR:Array.from(l)};if(!n)return Kw.sanitize(t,c);const u=o.includes("iframe");Kw.addHook("uponSanitizeElement",(d,h)=>{var A;if(h.tagName!=="iframe")return;const f=d;h.allowedTags.iframe=u||((A=f.getAttribute)==null?void 0:A.call(f,Xde))==="true"&&Yde(f.getAttribute("src"))});try{return Kw.sanitize(t,c)}finally{Kw.removeHook("uponSanitizeElement")}}function Zde(t,e,r,n){return i3(t,e,n,!1)}function Jde(t,e,r){return(r==null?void 0:r.sanitizeOnPaste)===!1?t:Zde(t,e)}function o3(t,e,r,n){return(r==null?void 0:r.sanitizeOnInput)===!1?t:i3(t,e,n,!0)}const ehe=".resize-handle, .table-resize-handle, [data-rte-media-pending]",the=/resize-handle|data-rte-media-pending|rte-media/;function a3(t){if(!t||!the.test(t))return t;const e=document.createElement("template");e.innerHTML=t;const r=new Set;return e.content.querySelectorAll(ehe).forEach(n=>{const i=n.parentElement;i&&(i.tagName==="TD"||i.tagName==="TH")&&r.add(i),n.remove()}),r.forEach(n=>{var i;n.style.position==="relative"&&(n.style.removeProperty("position"),(i=n.getAttribute("style"))!=null&&i.trim()||n.removeAttribute("style"))}),e.content.querySelectorAll("figure.rte-media").forEach(n=>{var o;n.removeAttribute("contenteditable");const i=n.querySelector(":scope > figcaption");i&&(i.removeAttribute("contenteditable"),!((o=i.textContent)!=null&&o.trim())&&!i.querySelector("img, video, a")&&i.remove())}),e.innerHTML}function Mb(t){return t?a3(t.innerHTML):""}const Rk=class Rk{static resolve(e){const r={};if(Object.assign(r,this.EDITOR_DEFAULTS),e.pluginDefaults&&Object.assign(r,e.pluginDefaults),e.attributes){const n=this.parseAttributes(e.attributes);Object.assign(r,n)}return e.jsConfig&&Object.assign(r,e.jsConfig),this.normalizeConfig(r)}static normalizeConfig(e){const r={...e};if(r.toolbarFloating!==void 0||r.toolbarSticky!==void 0){const a=typeof r.toolbar=="object"&&r.toolbar?{...r.toolbar}:typeof r.toolbar=="string"?{items:r.toolbar}:{};r.toolbarFloating!==void 0&&(a.floating=!!r.toolbarFloating),r.toolbarSticky!==void 0&&(a.sticky=!!r.toolbarSticky),r.toolbar=a}if(r.toolbarItems!==void 0&&typeof r.toolbar=="object"&&r.toolbar&&(r.toolbar.items=r.toolbarItems),r.autosaveEnabled!==void 0||r.autosaveIntervalMs!==void 0||r.autosaveStorageKey!==void 0||r.autosaveProvider!==void 0||r.autosaveApiUrl!==void 0){const a=typeof r.autosave=="object"&&r.autosave?{...r.autosave}:{};r.autosaveEnabled!==void 0&&(a.enabled=!!r.autosaveEnabled),r.autosaveIntervalMs!==void 0&&(a.intervalMs=Number(r.autosaveIntervalMs)),r.autosaveStorageKey!==void 0&&(a.storageKey=r.autosaveStorageKey),r.autosaveProvider!==void 0&&(a.provider=r.autosaveProvider),r.autosaveApiUrl!==void 0&&(a.apiUrl=r.autosaveApiUrl),r.autosave=a}const n={enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage",apiUrl:""};if(typeof r.autosave=="boolean")r.autosave={...n,enabled:r.autosave};else if(typeof r.autosave=="object"&&r.autosave){const a={...n,...r.autosave};a.intervalMs===void 0&&a.interval!==void 0&&(a.intervalMs=Number(a.interval)),a.enabled===void 0&&(a.enabled=!0),(!Number.isFinite(a.intervalMs)||a.intervalMs<=0)&&(a.intervalMs=n.intervalMs),r.autosave=a}else r.autosave=n;if(r.languageLocale!==void 0||r.languageDirection!==void 0){const a=typeof r.language=="object"&&r.language?{...r.language}:{};r.languageLocale!==void 0&&(a.locale=r.languageLocale),r.languageDirection!==void 0&&(a.direction=r.languageDirection),r.language=a}const i={locale:"en",direction:"ltr"};if(typeof r.language=="string"?r.language={locale:r.language,direction:i.direction}:typeof r.language=="object"&&r.language?r.language={...i,...r.language}:r.language=i,r.spellcheckEnabled!==void 0||r.spellcheckProvider!==void 0||r.spellcheckApiUrl!==void 0){const a=typeof r.spellcheck=="object"&&r.spellcheck?{...r.spellcheck}:{};r.spellcheckEnabled!==void 0&&(a.enabled=!!r.spellcheckEnabled),r.spellcheckProvider!==void 0&&(a.provider=r.spellcheckProvider),r.spellcheckApiUrl!==void 0&&(a.apiUrl=r.spellcheckApiUrl),r.spellcheck=a}const o={enabled:!1,provider:"browser",apiUrl:""};if(typeof r.spellcheck=="boolean")r.spellcheck={...o,enabled:r.spellcheck};else if(typeof r.spellcheck=="object"&&r.spellcheck){const a={...o,...r.spellcheck};!a.provider&&a.mode&&(a.provider=a.mode==="local"?"browser":"api"),a.enabled===void 0&&(a.enabled=!!(a.mode||a.provider||a.apiUrl)),r.spellcheck=a}else r.spellcheck=o;return r.contextMenuEnabled!==void 0&&(r.contextMenu={enabled:!!r.contextMenuEnabled}),typeof r.contextMenu=="boolean"?r.contextMenu={enabled:r.contextMenu}:typeof r.contextMenu=="object"&&r.contextMenu?r.contextMenu={enabled:r.contextMenu.enabled!==!1}:r.contextMenu={enabled:!0},(r.pasteClean!==void 0||r.pasteKeepFormatting!==void 0||r.pasteConvertWord!==void 0)&&(r.paste={...r.paste||{},...r.pasteClean!==void 0?{clean:!!r.pasteClean}:{},...r.pasteKeepFormatting!==void 0?{keepFormatting:!!r.pasteKeepFormatting}:{},...r.pasteConvertWord!==void 0?{convertWord:!!r.pasteConvertWord}:{}}),r.paste={clean:!0,keepFormatting:!1,convertWord:!0,...r.paste||{}},r.contentConfig={allowedTags:[],allowedAttributes:{},sanitize:!0,...r.contentConfig||{}},(r.securitySanitizeOnPaste!==void 0||r.securitySanitizeOnInput!==void 0)&&(r.security={...r.security||{},...r.securitySanitizeOnPaste!==void 0?{sanitizeOnPaste:!!r.securitySanitizeOnPaste}:{},...r.securitySanitizeOnInput!==void 0?{sanitizeOnInput:!!r.securitySanitizeOnInput}:{}}),r.security={sanitizeOnPaste:!0,sanitizeOnInput:!0,...r.security||{}},(r.accessibilityEnableAria!==void 0||r.accessibilityKeyboardNavigation!==void 0||r.accessibilityChecker!==void 0)&&(r.accessibility={...r.accessibility||{},...r.accessibilityEnableAria!==void 0?{enableARIA:!!r.accessibilityEnableAria}:{},...r.accessibilityKeyboardNavigation!==void 0?{keyboardNavigation:!!r.accessibilityKeyboardNavigation}:{},...r.accessibilityChecker!==void 0?{checker:!!r.accessibilityChecker}:{}}),typeof r.accessibility=="boolean"&&(r.accessibility={enableARIA:r.accessibility,keyboardNavigation:r.accessibility,checker:!1}),r.accessibility={enableARIA:!0,keyboardNavigation:!0,checker:!1,...r.accessibility||{}},(r.performanceDebounceInputMs!==void 0||r.performanceViewportOnlyScan!==void 0)&&(r.performance={...r.performance||{},...r.performanceDebounceInputMs!==void 0?{debounceInputMs:Number(r.performanceDebounceInputMs)}:{},...r.performanceViewportOnlyScan!==void 0?{viewportOnlyScan:!!r.performanceViewportOnlyScan}:{}}),typeof r.performance=="boolean"&&(r.performance={debounceInputMs:100,viewportOnlyScan:r.performance}),r.performance={debounceInputMs:100,viewportOnlyScan:!0,...r.performance||{}},(typeof r.performance.debounceInputMs!="number"||!Number.isFinite(r.performance.debounceInputMs)||r.performance.debounceInputMs<0)&&(r.performance.debounceInputMs=100),r}static parseAttributes(e){const r={};for(const[n,i]of Object.entries(e)){const o=this.kebabToCamel(n);r[o]=this.BOOLEAN_ATTRIBUTES.has(n)&&(i===""||i===n)?!0:this.parseAttributeValue(i)}return r}static parseAttributeValue(e){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(r){return e}return e}static kebabToCamel(e){return e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase())}static validate(e){const r=[];return e.height!==void 0&&typeof e.height=="number"&&e.height<0&&r.push("height must be a positive number"),e.width!==void 0&&typeof e.width=="number"&&e.width<0&&r.push("width must be a positive number"),e.plugins!==void 0&&!Array.isArray(e.plugins)&&typeof e.plugins!="string"&&r.push("plugins must be an array or string"),e.theme!==void 0&&typeof e.theme!="string"&&r.push("theme must be a string"),{valid:r.length===0,errors:r}}static getDefaults(){return{...this.EDITOR_DEFAULTS}}static merge(...e){const r={};for(const n of e)for(const[i,o]of Object.entries(n))o!=null&&(typeof o=="object"&&!Array.isArray(o)&&r[i]?r[i]=this.merge(r[i],o):r[i]=o);return r}};Rk.EDITOR_DEFAULTS={height:400,width:"100%",readonly:!1,disabled:!1,menubar:!0,toolbar:!0,plugins:[],theme:"light",content:"",placeholder:"Start typing...",autofocus:!1,autosave:!1,accessibility:{enableARIA:!0,keyboardNavigation:!0,checker:!1},performance:{debounceInputMs:100,viewportOnlyScan:!0},spellcheck:{enabled:!1,provider:"browser",apiUrl:""},language:{locale:"en",direction:"ltr"},contextMenu:{enabled:!0},contentConfig:{allowedTags:[],allowedAttributes:{},sanitize:!0},paste:{clean:!0,keepFormatting:!1,convertWord:!0},security:{sanitizeOnPaste:!0,sanitizeOnInput:!0},statusbar:!1},Rk.BOOLEAN_ATTRIBUTES=new Set(["readonly","disabled","autofocus","statusbar","toolbar-floating","toolbar-sticky","autosave-enabled","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance-viewport-only-scan","spellcheck-enabled","context-menu-enabled","paste-clean","paste-keep-formatting","paste-convert-word","security-sanitize-on-paste","security-sanitize-on-input"]);let b8=Rk;const rhe='.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';let Vw;const nhe="__editoraCommandEditorRoot",ihe="__editoraLastCommandButton",s3="editora-editor, [data-editora-editor], .rte-editor, .editora-editor",l3=".rte-content, .editora-content",ohe="Rich text editor",v8=new Set;let tf=null,c3=!1,y8=null,w8=null;function u3(t){if(!(t instanceof HTMLElement))return!1;const e=t;return typeof e.execCommand=="function"&&(e.tagName.toLowerCase()==="editora-editor"||e.classList.contains("editora-editor")||e.hasAttribute("data-editora-editor"))}function ahe(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Ob(t){if(!t)return null;if(u3(t))return t;const e=t.matches(s3)?t:t.closest(s3);return!e||!u3(e)?null:e}function she(){var i;if(typeof window=="undefined")return null;const t=window[nhe];if(t instanceof HTMLElement){const o=Ob(t);if(o)return o;const a=t.matches(l3)?t:t.querySelector(l3);if(a){const s=Ob(a);if(s)return s}}const e=window[ihe];if(e instanceof HTMLElement){const o=Ob(e);if(o)return o}const r=document.activeElement;if(r){const o=Ob(r);if(o)return o}const n=(i=window.getSelection)==null?void 0:i.call(window);if(n&&n.rangeCount>0){const o=Ob(ahe(n.getRangeAt(0).startContainer));if(o)return o}if(tf&&tf.isConnected)return tf;for(const o of v8)if(o.isConnected)return o;return null}function lhe(){if(typeof window=="undefined"||c3)return;y8=typeof window.executeEditorCommand=="function"?window.executeEditorCommand.bind(window):null,w8=typeof window.execEditorCommand=="function"?window.execEditorCommand.bind(window):null;const t=(e,...r)=>{const n=she();return n?n.execCommand(e,...r):y8?y8(e,...r):w8?w8(e,...r):!1};window.executeEditorCommand=t,window.execEditorCommand=t,c3=!0}function che(){const t="editora-webcomponent-styles";if(!document.getElementById(t)){const e=document.createElement("style");e.id=t,e.textContent=rhe,document.head.appendChild(e)}}function uhe(){if(!Vw){const t=gl.__globalPluginLoader;t?Vw=t:Vw=new jA}return Vw}class gl extends HTMLElement{constructor(){if(super(),this.pluginLoader=uhe(),this.config={},this.isInitialized=!1,this.keyboardShortcutManager=new fde,this.lastAutosavedContent="",this.preservedContent=null,this.loadedPlugins=[],this.lastBeforeInputType=null,this.pendingHistorySnapshot=null,che(),!this.hasAttribute("data-initial-content")){const e=this.innerHTML.trim();e&&this.setAttribute("data-initial-content",e)}}static get observedAttributes(){return["height","width","menubar","plugins","toolbar","toolbar-items","toolbar-floating","toolbar-sticky","readonly","disabled","theme","placeholder","aria-label","autofocus","autosave","autosave-enabled","autosave-interval-ms","autosave-storage-key","autosave-provider","autosave-api-url","accessibility","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance","performance-debounce-input-ms","performance-viewport-only-scan","language","language-locale","language-direction","spellcheck","spellcheck-enabled","spellcheck-provider","context-menu","context-menu-enabled","paste","paste-clean","paste-keep-formatting","paste-convert-word","security","security-sanitize-on-paste","security-sanitize-on-input","statusbar"]}connectedCallback(){this.config=this.resolveConfig(),this.waitForPluginLoader().then(()=>{setTimeout(async()=>{await this.initialize()},0)})}async waitForPluginLoader(){if(gl.__globalPluginLoader){this.pluginLoader=gl.__globalPluginLoader;return}return new Promise(e=>{const r=()=>{gl.__globalPluginLoader?(this.pluginLoader=gl.__globalPluginLoader,e()):setTimeout(r,0)};r()})}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,r,n){r!==n&&(this.config=this.resolveConfig(),this.handleAttributeChange(e,n))}async setConfig(e){this.jsConfig=e,this.config=this.resolveConfig(),this.isConnected&&(this.destroy(),await this.waitForPluginLoader(),await this.initialize())}async initialize(){var i;if(this.querySelector(".editora-toolbar")||this.isInitialized)return;this.setAttribute("data-editora-editor","true"),v8.add(this),tf||(tf=this),lhe(),this.config.height&&(this.style.height=typeof this.config.height=="number"?`${this.config.height}px`:this.config.height),this.config.width&&(this.style.width=typeof this.config.width=="number"?`${this.config.width}px`:this.config.width),this.classList.add("editora-editor"),this.config.theme&&this.classList.add(`editora-theme-${this.config.theme}`);const e=await this.loadPlugins();if(this.loadedPlugins=e,e.forEach(o=>{if(o.init&&typeof o.init=="function")try{o.init({editorElement:this})}catch(a){console.error(`[RichTextEditor] Error initializing plugin ${o.name}:`,a)}}),!this.hasAttribute("data-initial-content")&&!this.contentElement){const o=this.innerHTML.trim();o&&this.setAttribute("data-initial-content",o)}const r=this.preservedContent;this.preservedContent=null;const n=this.sanitizeLoadedContent((i=r!=null?r:this.restoreAutosavedContent())!=null?i:this.getAttribute("data-initial-content")||"");this.engine=new ide({content:n,plugins:e,readonly:this.config.readonly}),this.createUI(e,n),this.setupEventListeners(),this.startAutosave(),this.isInitialized=!0,this.dispatchEvent(new CustomEvent("editor-ready",{detail:{api:this.getAPI()},bubbles:!0}))}getInitialContent(){if(this.config.content)return this.config.content;const e=this.querySelector("[slot]");return e?e.innerHTML:this.hasChildNodes()?Array.from(this.childNodes).map(n=>n.nodeType===Node.TEXT_NODE?n.textContent:n.nodeType===Node.ELEMENT_NODE?n.outerHTML:"").join("").trim():""}async loadPlugins(){this.pluginLoader||await this.waitForPluginLoader();const e=[],r=this.config.plugins&&(typeof this.config.plugins=="string"&&this.config.plugins.length>0||Array.isArray(this.config.plugins)&&this.config.plugins.length>0),i=this.getAccessibilityConfig().checker===!0;if(r){if(typeof this.config.plugins=="string"){const o=this.config.plugins.split(/\s+/).filter(Boolean);i&&!o.includes("a11yChecker")&&o.push("a11yChecker");for(const a of o){const s=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));s&&e.push(s)}}else if(Array.isArray(this.config.plugins)){for(const o of this.config.plugins)if(typeof o=="string"){const a=await this.pluginLoader.load(o,this.getPluginLoadConfig(o));a&&e.push(a)}else e.push(o);if(i&&!e.some(o=>(o==null?void 0:o.name)==="a11yChecker")){const o=await this.pluginLoader.load("a11yChecker",this.getPluginLoadConfig("a11yChecker"));o&&e.push(o)}}}else{const o=this.pluginLoader.getRegisteredPluginNames();for(const a of o){const s=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));s&&e.push(s)}}return e}resolveToolbarItems(){const e=this.config.toolbarItems;if(typeof e=="string")return e;if(Array.isArray(e))return e.join(" ");const r=this.config.toolbar;if(typeof r=="string")return r;if(!r||typeof r!="object")return;const n=r.items;if(typeof n=="string")return n;if(Array.isArray(n))return n.join(" ")}isToolbarStickyEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.sticky}isToolbarFloatingEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.floating}isStatusbarEnabled(){const e=this.config.statusbar;return typeof e=="boolean"?e:e&&typeof e=="object"?e.enabled!==!1:!1}getStatusbarPosition(){const e=this.config.statusbar;return e&&typeof e=="object"&&e.position==="top"?"top":"bottom"}getLanguageConfig(){const e=this.config.language;return typeof e=="string"?{locale:e,direction:"ltr"}:e&&typeof e=="object"?{locale:e.locale||"en",direction:e.direction==="rtl"?"rtl":"ltr"}:{locale:"en",direction:"ltr"}}getAccessibilityConfig(){const e=this.config.accessibility;return typeof e=="boolean"?{enableARIA:e,keyboardNavigation:e,checker:!1}:e&&typeof e=="object"?{enableARIA:e.enableARIA!==!1,keyboardNavigation:e.keyboardNavigation!==!1,checker:!!e.checker}:{enableARIA:!0,keyboardNavigation:!0,checker:!1}}getPerformanceConfig(){var r;const e=this.config.performance;if(typeof e=="boolean")return{debounceInputMs:100,viewportOnlyScan:e};if(e&&typeof e=="object"){const n=Number((r=e.debounceInputMs)!=null?r:100);return{debounceInputMs:Number.isFinite(n)&&n>=0?n:100,viewportOnlyScan:e.viewportOnlyScan!==!1}}return{debounceInputMs:100,viewportOnlyScan:!0}}isEditorInViewport(){if(!this.contentElement||typeof window=="undefined")return!0;const e=this.contentElement.getBoundingClientRect();return e.bottom>=0&&e.top<=window.innerHeight}applyAccessibilitySettings(){var r;if(!this.contentElement)return;const e=this.getAccessibilityConfig();if(e.enableARIA){this.contentElement.setAttribute("role","textbox"),this.contentElement.setAttribute("aria-multiline","true"),this.contentElement.setAttribute("aria-disabled",this.config.readonly?"true":"false");const n=(r=this.getAttribute("aria-label"))==null?void 0:r.trim(),i=typeof this.config.placeholder=="string"?this.config.placeholder.trim():"";this.contentElement.setAttribute("aria-label",n||i||ohe)}else this.contentElement.removeAttribute("role"),this.contentElement.removeAttribute("aria-multiline"),this.contentElement.removeAttribute("aria-disabled"),this.contentElement.removeAttribute("aria-label");this.contentElement.tabIndex=e.keyboardNavigation?0:-1}applyLanguageSettings(){if(!this.contentElement)return;const e=this.getLanguageConfig();this.contentElement.setAttribute("lang",e.locale),this.contentElement.setAttribute("dir",e.direction)}getSpellcheckConfig(){const e=this.config.spellcheck;if(typeof e=="boolean")return{enabled:e,provider:"browser"};if(e&&typeof e=="object"){const r=e.provider||"browser";return{enabled:!!e.enabled,provider:r,mode:e.mode}}return{enabled:!1,provider:"browser"}}applySpellcheckSettings(){if(!this.contentElement)return;const e=this.getSpellcheckConfig(),r=e.enabled&&e.provider==="browser";this.contentElement.spellcheck=r,this.contentElement.setAttribute("spellcheck",r?"true":"false")}executeCommand(e,...r){var o;typeof window!="undefined"&&(window.__editoraCommandEditorRoot=this);const n={editorElement:this,contentElement:this.contentElement,toolbarElement:this.toolbarElement},i=this.loadedPlugins.find(a=>a.commands&&a.commands[e]);if(i&&i.commands){const a=i.commands[e];if(typeof a=="function")try{return e==="toggleFullscreen"?a(this,n):a(...r,n),!0}catch(s){return console.error(`[RichTextEditor] Error executing native command ${e}:`,s),!1}}return((o=this.engine)==null?void 0:o.execCommand(e,...r))||!1}getPluginLoadConfig(e){const r=this.config.pluginConfig;if(r&&typeof r=="object"){const o=r[e];if(o&&typeof o=="object")return o}const n={spellCheck:["spellcheck","spellCheck"],trackChanges:["trackchanges","track-changes","trackChanges"],versionDiff:["versiondiff","version-diff","versionDiff"],"version-diff":["versiondiff","version-diff","versionDiff"],conditionalContent:["conditionalcontent","conditional-content","conditionalContent"],"conditional-content":["conditionalcontent","conditional-content","conditionalContent"],dataBinding:["databinding","data-binding","dataBinding"],"data-binding":["databinding","data-binding","dataBinding"],contentRules:["contentrules","content-rules","contentRules"],"content-rules":["contentrules","content-rules","contentRules"],mentions:["mention","mentions"],mention:["mention","mentions"],slashCommands:["slashcommands","slash-commands","slashCommands"],"slash-commands":["slashcommands","slash-commands","slashCommands"],formatPainter:["formatpainter","format-painter","formatPainter"],"format-painter":["formatpainter","format-painter","formatPainter"]},i=[e,e.toLowerCase(),...n[e]||[]];for(const o of i){const a=this.config[o];if(a&&typeof a=="object"&&!Array.isArray(a))return a}}getContentSanitizeConfig(){const e=this.config.contentConfig;return e&&typeof e=="object"?e:{sanitize:!0}}getSecurityConfig(){const e=this.config.security;return e&&typeof e=="object"?e:{sanitizeOnPaste:!0,sanitizeOnInput:!0}}sanitizeLoadedContent(e){return o3(e,this.getContentSanitizeConfig(),this.getSecurityConfig())}getAutosaveConfig(){var r,n;const e=this.config.autosave;if(typeof e=="boolean")return{enabled:e,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"};if(e&&typeof e=="object"){const i=Number((n=(r=e.intervalMs)!=null?r:e.interval)!=null?n:3e4);return{enabled:!!e.enabled,intervalMs:Number.isFinite(i)&&i>0?i:3e4,storageKey:String(e.storageKey||"rte-autosave"),provider:e.provider||"localStorage",apiUrl:e.apiUrl}}return{enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"}}persistAutosave(e){const r=this.getAutosaveConfig();if(r.enabled&&e!==this.lastAutosavedContent){if(this.lastAutosavedContent=e,r.provider==="localStorage"){try{localStorage.setItem(r.storageKey,e),localStorage.setItem(`${r.storageKey}-timestamp`,Date.now().toString())}catch(n){console.error("[RichTextEditor] Failed to save autosave content to localStorage:",n)}return}r.provider==="api"&&r.apiUrl&&fetch(r.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,timestamp:Date.now()})}).catch(n=>{console.error("[RichTextEditor] Failed to save autosave content to API:",n)})}}restoreAutosavedContent(){const e=this.getAutosaveConfig();if(!e.enabled||e.provider!=="localStorage")return null;try{const r=localStorage.getItem(e.storageKey);if(r)return this.lastAutosavedContent=r,r}catch(r){console.error("[RichTextEditor] Failed to restore autosaved content:",r)}return null}stopAutosave(){this.autosaveTimer&&(clearInterval(this.autosaveTimer),this.autosaveTimer=void 0)}startAutosave(){this.stopAutosave();const e=this.getAutosaveConfig();!e.enabled||!this.contentElement||(this.autosaveTimer=setInterval(()=>{this.persistAutosave(Mb(this.contentElement))},e.intervalMs))}insertHTMLAtSelection(e){if(!this.contentElement)return;const r=window.getSelection();if(r&&r.rangeCount>0){const n=r.getRangeAt(0);n.deleteContents();const i=document.createElement("div");i.innerHTML=e;const o=document.createDocumentFragment();for(;i.firstChild;)o.appendChild(i.firstChild);n.insertNode(o),n.collapse(!1),r.removeAllRanges(),r.addRange(n)}else this.contentElement.focus(),document.execCommand("insertHTML",!1,e)}createUI(e,r){const n=this.querySelector('[slot="toolbar"]'),i=this.querySelector('[slot="statusbar"]');this.innerHTML="",this.config.toolbar!==!1&&!n?(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.appendChild(this.toolbarElement),this.toolbar=new ode({items:this.resolveToolbarItems(),sticky:this.isToolbarStickyEnabled(),position:"top"},e,this.pluginLoader),this.toolbar.setCommandHandler((o,a)=>{var s;if(this.contentElement){this.contentElement.focus();const l=window.getSelection();if(!l||l.rangeCount===0||!this.contentElement.contains(l.anchorNode)){const c=document.createRange(),u=this.contentElement.lastChild||this.contentElement;u.nodeType===Node.TEXT_NODE?c.setStart(u,((s=u.textContent)==null?void 0:s.length)||0):u.nodeType===Node.ELEMENT_NODE?(c.selectNodeContents(u),c.collapse(!1)):c.setStart(this.contentElement,0),c.collapse(!0),l==null||l.removeAllRanges(),l==null||l.addRange(c)}}return this.executeCommand(o,a)}),this.toolbar.render(this.toolbarElement)):n&&this.appendChild(n),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content rte-content",this.contentElement.contentEditable=this.config.readonly?"false":"true",this.applyLanguageSettings(),this.applyAccessibilitySettings(),this.applySpellcheckSettings(),this.config.placeholder&&this.contentElement.setAttribute("data-placeholder",this.config.placeholder);try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(o){console.warn("defaultParagraphSeparator not supported:",o)}if(r){const o=document.createElement("div");o.innerHTML=r.trim(),!Array.from(o.childNodes).some(s=>{if(s.nodeType===Node.ELEMENT_NODE){const l=s.tagName;return["P","DIV","H1","H2","H3","H4","H5","H6","UL","OL","BLOCKQUOTE","PRE"].includes(l)}return!1})&&r.trim()?this.contentElement.innerHTML=`<p>${r.trim()}</p>`:this.contentElement.innerHTML=r}else this.config.placeholder?this.contentElement.innerHTML="":this.contentElement.innerHTML="<p><br></p>";this.appendChild(this.contentElement),this.isToolbarFloatingEnabled()&&(this.floatingToolbar=new ade({enabled:!0}),this.floatingToolbar.create(this)),i?this.appendChild(i):this.isStatusbarEnabled()&&(this.statusBarElement=document.createElement("div"),this.statusBarElement.className="editora-statusbar-container",this.appendChild(this.statusBarElement),this.statusBar=new sde({position:this.getStatusbarPosition()}),this.statusBar.create(this.statusBarElement)),this.config.autofocus&&setTimeout(()=>{var o;return(o=this.contentElement)==null?void 0:o.focus()},0)}recordInputHistory(e){const r=this.pendingHistorySnapshot;if(this.pendingHistorySnapshot=null,!r||!this.contentElement||r.beforeHTML===e)return;const n=window.execEditorCommand;typeof n=="function"&&n("recordDomTransaction",this.contentElement,r.beforeHTML,e,{inputType:r.inputType,data:r.data,selectionCollapsed:r.selectionCollapsed})}setupEventListeners(){if(!this.contentElement||!this.engine)return;const e=this.keyboardShortcutManager;this.contentElement.addEventListener("beforeinput",n=>{var i,o;this.lastBeforeInputType=n.inputType||null,n.inputType==="historyUndo"||n.inputType==="historyRedo"?this.pendingHistorySnapshot=null:this.contentElement&&(this.pendingHistorySnapshot={beforeHTML:this.contentElement.innerHTML,inputType:n.inputType||null,data:typeof n.data=="string"?n.data:null,selectionCollapsed:(o=(i=window.getSelection())==null?void 0:i.isCollapsed)!=null?o:!0})}),this.contentElement.addEventListener("input",n=>{var h;if(!this.contentElement)return;let i=this.contentElement.innerHTML;const o=(h=n==null?void 0:n.detail)==null?void 0:h.allowedTags,a=this.getPerformanceConfig(),s=this.getContentSanitizeConfig(),l=this.getSecurityConfig(),c=this.lastBeforeInputType;if(this.lastBeforeInputType=null,l.sanitizeOnInput!==!1&&s.sanitize!==!1&&!c){const f=o3(i,s,l,o);if(f!==i){const A=window.getSelection(),p=A&&A.rangeCount>0?A.getRangeAt(0):null;if(this.contentElement.innerHTML=f,p&&A)try{A.removeAllRanges(),A.addRange(p)}catch(g){}i=f}}this.recordInputHistory(i),this.contentChangeDebounceTimer&&clearTimeout(this.contentChangeDebounceTimer);const d=()=>{this.dispatchEvent(new CustomEvent("content-change",{detail:{html:a3(i)},bubbles:!0}))};a.debounceInputMs>0?this.contentChangeDebounceTimer=setTimeout(d,a.debounceInputMs):d(),this.updateStatusBar()}),this.contentElement.addEventListener("contextmenu",n=>{const i=this.config.contextMenu;(i===!1||typeof i=="object"&&i!==null&&i.enabled===!1)&&n.preventDefault()}),this.contentElement.addEventListener("paste",n=>{var u,d;if(n.__editoraSmartPasteHandled===!0||n.defaultPrevented)return;n.preventDefault();const i=this.config.paste||{};let o=((u=n.clipboardData)==null?void 0:u.getData("text/html"))||"";const a=((d=n.clipboardData)==null?void 0:d.getData("text/plain"))||"",s=this.getContentSanitizeConfig(),l=this.getSecurityConfig(),c=!!o&&/class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(o);if((i.clean||!i.keepFormatting)&&a){document.execCommand("insertText",!1,a);return}if(i.convertWord===!1&&c&&a){document.execCommand("insertText",!1,a);return}if(o){l.sanitizeOnPaste!==!1&&s.sanitize!==!1&&(o=Jde(o,s,l)),this.insertHTMLAtSelection(o);return}a&&document.execCommand("insertText",!1,a)}),this.contentElement.addEventListener("focus",()=>{tf=this,this.dispatchEvent(new Event("editor-focus",{bubbles:!0})),this.updateStatusBar()}),this.contentElement.addEventListener("blur",()=>{this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&this.dispatchEvent(new CustomEvent("content-change",{detail:{html:Mb(this.contentElement)},bubbles:!0})),this.dispatchEvent(new Event("editor-blur",{bubbles:!0})),this.updateFloatingToolbar(),this.updateStatusBar()}),this.contentElement.addEventListener("keydown",n=>{this.getAccessibilityConfig().keyboardNavigation&&e.handleKeyDown(n,(o,a)=>{this.executeCommand(o,a)})});const r=()=>{const n=this.getSelectionRangeInEditor(),i=document.activeElement,o=!!i&&!!this.contentElement&&(i===this.contentElement||this.contentElement.contains(i));this.getPerformanceConfig().viewportOnlyScan&&!this.isEditorInViewport()&&!o||!n&&!o||(this.updateFloatingToolbar(),this.updateStatusBar())};this.selectionChangeHandler=r,document.addEventListener("selectionchange",this.selectionChangeHandler)}getSelectionRangeInEditor(){if(!this.contentElement)return null;const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0),n=r.commonAncestorContainer;return this.contentElement.contains(n)?r:null}isSelectionBackward(e){if(!e.anchorNode||!e.focusNode)return!1;try{const r=document.createRange();return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed}catch(r){return!1}}getSelectionAnchorRect(e,r){const n=Array.from(r.getClientRects()).filter(o=>o.width>0||o.height>0);return n.length===0?r.getBoundingClientRect():this.isSelectionBackward(e)?n[0]:n[n.length-1]}updateFloatingToolbar(){if(!this.floatingToolbar||!this.contentElement)return;if(this.config.readonly||this.contentElement.contentEditable==="false"||this.contentElement.getAttribute("data-readonly")==="true"||this.isReadonlyAttribute(this.getAttribute("readonly"))||this.getAttribute("data-readonly")==="true"){this.floatingToolbar.hide();return}const r=this.getPerformanceConfig(),n=document.activeElement===this.contentElement||!!this.contentElement&&this.contentElement.contains(document.activeElement);if(r.viewportOnlyScan&&!this.isEditorInViewport()&&!n){this.floatingToolbar.hide();return}const i=this.getSelectionRangeInEditor();if(!i){this.floatingToolbar.hide();return}if(i.collapsed){this.floatingToolbar.hide();return}const o=window.getSelection();if(!o){this.floatingToolbar.hide();return}const a=this.getSelectionAnchorRect(o,i);if(!a){this.floatingToolbar.hide();return}this.floatingToolbar.show(a.left,a.top-40)}updateStatusBar(){if(!this.statusBar||!this.contentElement)return;const e=this.getPerformanceConfig(),r=document.activeElement===this.contentElement||this.contentElement.contains(document.activeElement);if(e.viewportOnlyScan&&!this.isEditorInViewport()&&!r)return;const n=this.contentElement.textContent||"",{words:i,chars:o}=dde(n),a=ude(this.contentElement);let s,l;const c=this.getSelectionRangeInEditor();c&&(s=lde(this.contentElement,c),c.collapsed||(l=hde(c,s),s=void 0)),this.statusBar.update({wordCount:i,charCount:o,lineCount:a,cursorPosition:s,selectionInfo:l})}isReadonlyAttribute(e){return e!==null&&e!=="false"}handleAttributeChange(e,r){switch(e){case"readonly":this.contentElement&&(this.contentElement.contentEditable=this.isReadonlyAttribute(r)?"false":"true",this.applyAccessibilitySettings()),this.engine&&this.engine.setReadonly(this.isReadonlyAttribute(r));break;case"theme":this.classList.forEach(n=>{n.startsWith("editora-theme-")&&this.classList.remove(n)}),r&&this.classList.add(`editora-theme-${r}`);break;case"placeholder":this.contentElement&&(this.contentElement.setAttribute("data-placeholder",r),this.applyAccessibilitySettings());break;case"aria-label":case"accessibility":case"accessibility-enable-aria":case"accessibility-keyboard-navigation":case"accessibility-checker":this.applyAccessibilitySettings();break;case"performance":case"performance-debounce-input-ms":case"performance-viewport-only-scan":break;case"language":case"language-locale":case"language-direction":this.applyLanguageSettings();break;case"spellcheck":case"spellcheck-enabled":case"spellcheck-provider":this.applySpellcheckSettings();break;case"autosave":case"autosave-enabled":case"autosave-interval-ms":case"autosave-storage-key":case"autosave-provider":case"autosave-api-url":this.startAutosave();break;case"security":case"security-sanitize-on-paste":case"security-sanitize-on-input":case"paste":case"paste-clean":case"paste-keep-formatting":case"paste-convert-word":case"context-menu":case"context-menu-enabled":break;case"toolbar":case"toolbar-items":case"toolbar-floating":case"toolbar-sticky":case"plugins":case"statusbar":this.isConnected&&(this.destroy(),this.waitForPluginLoader().then(()=>{this.initialize().catch(n=>{console.error("[RichTextEditor] Error during attribute change re-initialization:",n)})}));break}}resolveConfig(){const e={};for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r];e[n.name]=n.value}return b8.resolve({jsConfig:this.jsConfig,attributes:e})}getAPI(){return{getContent:()=>Mb(this.contentElement),setContent:e=>{this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))},execCommand:(e,r)=>this.executeCommand(e,r),focus:()=>{var e;(e=this.contentElement)==null||e.focus()},blur:()=>{var e;(e=this.contentElement)==null||e.blur()},destroy:()=>{this.destroy()},on:(e,r)=>(this.addEventListener(e,r),()=>this.removeEventListener(e,r)),getConfig:()=>({...this.config}),setReadonly:e=>{this.setAttribute("readonly",e.toString())}}}destroy(){var e,r,n,i;this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&(this.preservedContent=Mb(this.contentElement),this.persistAutosave(this.preservedContent)),this.stopAutosave(),this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),(e=this.engine)==null||e.destroy(),(r=this.toolbar)==null||r.destroy(),(n=this.floatingToolbar)==null||n.destroy(),(i=this.statusBar)==null||i.destroy(),this.innerHTML="",this.contentElement=void 0,this.toolbarElement=void 0,this.statusBarElement=void 0,this.loadedPlugins=[],this.isInitialized=!1,v8.delete(this),tf===this&&(tf=null),this.dispatchEvent(new Event("editor-destroy",{bubbles:!0}))}getContent(){return Mb(this.contentElement)}setContent(e){this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))}execCommand(e,...r){return this.executeCommand(e,...r)}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}}const Gw=new jA;gl.__globalPluginLoader=Gw;const dhe={bold:()=>Promise.resolve().then(()=>ghe).then(t=>t.BoldPlugin()),italic:()=>Promise.resolve().then(()=>vhe).then(t=>t.ItalicPlugin()),underline:()=>Promise.resolve().then(()=>yhe).then(t=>t.UnderlinePlugin()),strikethrough:()=>Promise.resolve().then(()=>Ehe).then(t=>t.StrikethroughPlugin()),clearFormatting:()=>Promise.resolve().then(()=>Rhe).then(t=>t.ClearFormattingPlugin()),heading:()=>Promise.resolve().then(()=>Yhe).then(t=>t.HeadingPlugin()),blockquote:()=>Promise.resolve().then(()=>cfe).then(t=>t.BlockquotePlugin()),code:()=>Promise.resolve().then(()=>EAe).then(t=>t.CodePlugin()),codeSample:()=>Promise.resolve().then(()=>NAe).then(t=>t.CodeSamplePlugin()),list:()=>Promise.resolve().then(()=>WAe).then(t=>t.ListPlugin()),checklist:()=>Promise.resolve().then(()=>spe).then(t=>t.ChecklistPlugin()),textAlignment:()=>Promise.resolve().then(()=>upe).then(t=>t.TextAlignmentPlugin()),indent:()=>Promise.resolve().then(()=>dpe).then(t=>t.IndentPlugin()),direction:()=>Promise.resolve().then(()=>ype).then(t=>t.DirectionPlugin()),textColor:()=>Promise.resolve().then(()=>Npe).then(t=>t.TextColorPlugin()),backgroundColor:()=>Promise.resolve().then(()=>jpe).then(t=>t.BackgroundColorPlugin()),fontSize:()=>Promise.resolve().then(()=>rme).then(t=>t.FontSizePlugin()),fontFamily:()=>Promise.resolve().then(()=>fme).then(t=>t.FontFamilyPlugin()),formatPainter:()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),"format-painter":()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),formatpainter:()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),lineHeight:()=>Promise.resolve().then(()=>vge).then(t=>t.LineHeightPlugin()),capitalization:()=>Promise.resolve().then(()=>Lge).then(t=>t.CapitalizationPlugin()),history:()=>Promise.resolve().then(()=>$ge).then(t=>t.HistoryPlugin()),link:()=>Promise.resolve().then(()=>Gge).then(t=>t.LinkPlugin()),table:()=>Promise.resolve().then(()=>y0e).then(t=>t.TablePlugin()),trackChanges:()=>Promise.resolve().then(()=>t1e).then(t=>t.TrackChangesPlugin()),versionDiff:()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),"version-diff":()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),versiondiff:()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),conditionalContent:()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),"conditional-content":()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),conditionalcontent:()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),dataBinding:()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),"data-binding":()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),databinding:()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),docSchema:()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),"doc-schema":()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),docschema:()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),translationWorkflow:()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),"translation-workflow":()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),translationworkflow:()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),contentRules:()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),"content-rules":()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),contentrules:()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),citations:()=>Promise.resolve().then(()=>bQ).then(t=>t.CitationsPlugin()),citation:()=>Promise.resolve().then(()=>bQ).then(t=>t.CitationsPlugin()),approvalWorkflow:()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),"approval-workflow":()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),approvalworkflow:()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),piiRedaction:()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),"pii-redaction":()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),piiredaction:()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),smartPaste:()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),"smart-paste":()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),smartpaste:()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),blocksLibrary:()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),"blocks-library":()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),blockslibrary:()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),mentions:()=>Promise.resolve().then(()=>Qq).then(t=>t.MentionPlugin()),mention:()=>Promise.resolve().then(()=>Qq).then(t=>t.MentionPlugin()),anchor:()=>Promise.resolve().then(()=>nxe).then(t=>t.AnchorPlugin()),embedIframe:()=>Promise.resolve().then(()=>kxe).then(t=>t.EmbedIframePlugin()),math:()=>Promise.resolve().then(()=>zxe).then(t=>t.MathPlugin()),image:()=>Promise.resolve().then(()=>GEe).then(t=>t.MediaManagerPlugin()),mergeTag:()=>Promise.resolve().then(()=>pCe).then(t=>t.MergeTagPlugin()),pageBreak:()=>Promise.resolve().then(()=>kCe).then(t=>t.PageBreakPlugin()),print:()=>Promise.resolve().then(()=>BCe).then(t=>t.PrintPlugin()),preview:()=>Promise.resolve().then(()=>UCe).then(t=>t.PreviewPlugin()),specialCharacters:()=>Promise.resolve().then(()=>qCe).then(t=>t.SpecialCharactersPlugin()),slashCommands:()=>Promise.resolve().then(()=>jW).then(t=>t.SlashCommandsPlugin()),"slash-commands":()=>Promise.resolve().then(()=>jW).then(t=>t.SlashCommandsPlugin()),spellCheck:()=>Promise.resolve().then(()=>W4e).then(t=>t.SpellCheckPlugin()),emojis:()=>Promise.resolve().then(()=>t6e).then(t=>t.EmojisPlugin()),a11yChecker:()=>Promise.resolve().then(()=>o6e).then(t=>t.A11yCheckerPlugin()),comments:()=>Promise.resolve().then(()=>Z6e).then(t=>t.CommentsPlugin()),collaboration:()=>Promise.resolve().then(()=>sBe).then(t=>t.CollaborationPlugin()),"document-manager":()=>Promise.resolve().then(()=>uBe).then(t=>t.DocumentManagerPlugin()),fullscreen:()=>Promise.resolve().then(()=>hBe).then(t=>t.FullscreenPlugin()),template:()=>Promise.resolve().then(()=>BBe).then(t=>t.TemplatePlugin()),footnote:()=>Promise.resolve().then(()=>$Be).then(t=>t.FootnotePlugin())};async function d3(){return Object.entries(dhe).forEach(([t,e])=>{Gw.register(t,e)}),Gw}typeof window!="undefined"&&d3().then(t=>{gl.__globalPluginLoader=t,customElements.get("editora-editor")||customElements.define("editora-editor",gl);const e=document.querySelectorAll("editora-editor:not([data-initial-content])"),r=[];e.forEach(o=>{const a=o.innerHTML.trim();r.push(a),a&&o.setAttribute("data-initial-content",a)});const n=document.querySelectorAll("editora-editor");Array.from(n).filter(o=>!o.hasAttribute("data-initial-content")).forEach(o=>{const a=Array.from(n).indexOf(o);r[a]&&o.setAttribute("data-initial-content",r[a])}),window.Editora={version:"1.0.0",plugins:Gw.getRegisteredPluginNames(),WebComponent:gl,init:async(o,a)=>{const s=document.querySelector(o);return s instanceof gl?(a&&await s.setConfig(a),s.getAPI()):null}}});const Xw="data-editora-selection-marker";function hhe(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function h3(t){return t?t.getAttribute("contenteditable")==="true"?t:t.querySelector('[contenteditable="true"]'):null}function fhe(t){var a;if((t==null?void 0:t.contentElement)instanceof HTMLElement)return t.contentElement;const e=h3((a=t==null?void 0:t.editorElement)!=null?a:null);if(e)return e;const r=typeof window!="undefined"?window.__editoraCommandEditorRoot:null,n=r instanceof HTMLElement?h3(r):null;if(n)return n;const i=window.getSelection();if(i&&i.rangeCount>0){const s=hhe(i.getRangeAt(0).startContainer),l=s==null?void 0:s.closest('.rte-content, .editora-content, [contenteditable="true"]');if(l instanceof HTMLElement)return l}const o=document.activeElement;if(o instanceof HTMLElement){const s=o.closest('.rte-content, .editora-content, [contenteditable="true"]');if(s instanceof HTMLElement)return s}return document.querySelector('.rte-content, .editora-content, [contenteditable="true"]')}function Ahe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const r=e.getRangeAt(0);return t.contains(r.startContainer)&&t.contains(r.endContainer)}function f3(t){const e=document.createElement("span");return e.setAttribute(Xw,t),e.style.display="inline-block",e.style.width="0",e.style.height="0",e.style.overflow="hidden",e.style.lineHeight="0",e.appendChild(document.createTextNode("\uFEFF")),e}function phe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);if(!t.contains(r.startContainer)||!t.contains(r.endContainer))return null;const n=r.collapsed,i=f3("start"),o=n?null:f3("end"),a=r.cloneRange();if(o){const l=a.cloneRange();l.collapse(!1),l.insertNode(o)}const s=a.cloneRange();return s.collapse(!0),s.insertNode(i),()=>{const l=window.getSelection(),c=document.createRange(),u=t.querySelector(`[${Xw}="start"]`),d=t.querySelector(`[${Xw}="end"]`);if(!l||!u){t.querySelectorAll(`[${Xw}]`).forEach(h=>h.remove());return}n||!d?(c.setStartBefore(u),c.collapse(!0)):(c.setStartAfter(u),c.setEndBefore(d)),l.removeAllRanges(),l.addRange(c),u.remove(),d==null||d.remove()}}function mhe(t,e,r){if(e!==r){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",t,e,r);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}catch(n){}}}function Yw(t){const e=fhe(t.context);if(!e)return!1;const r=e.innerHTML;Ahe(e)&&e.focus({preventScroll:!0});let n=!1;try{n=document.execCommand(t.command,!1)}catch(a){n=!1}const i=e.innerHTML;if(t.normalize&&i!==r){const a=phe(e);t.normalize(e),a==null||a()}const o=e.innerHTML;return r!==o&&(mhe(e,r,o),e.dispatchEvent(new Event("input",{bubbles:!0}))),n!==!1||r!==o}const ghe=Object.freeze(Object.defineProperty({__proto__:null,BoldPlugin:()=>({name:"bold",marks:{bold:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight",getAttrs:t=>{const e=typeof t=="string"?t:t.style.fontWeight;return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}],toDOM:()=>["strong",0]}},toolbar:[{label:"Bold",command:"toggleBold",icon:'<svg width="24" height="24" focusable="false"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-b"}],commands:{toggleBold:(t,e)=>Yw({command:"bold",context:e})},keymap:{"Mod-b":"toggleBold","Mod-B":"toggleBold"}})},Symbol.toStringTag,{value:"Module"})),x8=(t,e)=>Yw({command:"italic",context:e}),bhe=(t,e)=>{var r;typeof window!="undefined"&&((r=window.registerEditorCommand)==null||r.call(window,t,e))},A3=()=>{bhe("toggleItalic",x8)};typeof window!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A3):A3());const vhe=Object.freeze(Object.defineProperty({__proto__:null,ItalicPlugin:()=>({name:"italic",marks:{italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}},toolbar:[{label:"Italic",command:"toggleItalic",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-i"}],commands:{toggleItalic:x8},keymap:{"Mod-i":"toggleItalic","Mod-I":"toggleItalic"}}),toggleItalic:x8},Symbol.toStringTag,{value:"Module"})),yhe=Object.freeze(Object.defineProperty({__proto__:null,UnderlinePlugin:()=>({name:"underline",marks:{underline:{parseDOM:[{tag:"u"}],toDOM:()=>["u",{},0]}},toolbar:[{label:"Underline",command:"toggleUnderline",icon:'<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-u"}],commands:{toggleUnderline:(t,e)=>Yw({command:"underline",context:e})},keymap:{"Mod-u":"toggleUnderline","Mod-U":"toggleUnderline"}})},Symbol.toStringTag,{value:"Module"})),whe=()=>({name:"strikethrough",marks:{strikethrough:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>(typeof t=="string"?t:t.style.textDecoration)==="line-through"&&null}],toDOM:()=>["s",0]}},toolbar:[{label:"Strikethrough",command:"toggleStrikethrough",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"></path><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"></path></g></svg>',shortcut:"Mod-Shift-x"}],commands:{toggleStrikethrough:(t,e)=>Yw({command:"strikeThrough",context:e,normalize:xhe})},keymap:{"Mod-Shift-x":"toggleStrikethrough","Mod-Shift-X":"toggleStrikethrough"}});function xhe(t){t.querySelectorAll("strike, del").forEach(r=>{var i;const n=document.createElement("s");for(const o of Array.from(r.attributes))o.name!=="style"&&n.setAttribute(o.name,o.value);for(;r.firstChild;)n.appendChild(r.firstChild);(i=r.parentNode)==null||i.replaceChild(n,r)})}const Ehe=Object.freeze(Object.defineProperty({__proto__:null,StrikethroughPlugin:whe},Symbol.toStringTag,{value:"Module"}));function Fo(t,e,r=t==null?void 0:t.innerHTML){if(!t||typeof r!="string"||e===r)return!1;try{if(typeof window.execEditorCommand=="function")return window.execEditorCommand("recordDomTransaction",t,e,r)!==!1;if(typeof window.executeEditorCommand=="function")return window.executeEditorCommand("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})!==!1}catch(n){}return!1}const Che=()=>({name:"clearFormatting",toolbar:[{label:"Clear Formatting",command:"clearFormatting",icon:'<svg width="24" height="24" focusable="false"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-\\"}],commands:{clearFormatting:()=>{const t=Bhe();if(!t)return!1;const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const r=e.getRangeAt(0);if(!t.contains(r.commonAncestorContainer))return!1;const n=r.cloneRange(),i=t.innerHTML;return t.focus({preventScroll:!0}),Nhe(t,n),Uhe(t,n),Fo(t,i),t.dispatchEvent(new Event("input",{bubbles:!0})),!0}},keymap:{"Mod-\\":"clearFormatting"}}),The=new Set(["A","B","STRONG","I","EM","U","S","STRIKE","DEL","FONT","MARK","CODE","SUB","SUP"]),khe=new Set(["H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE"]),She=["color","background-color","font-size","font-family","font-weight","font-style","text-decoration","text-transform","line-height","letter-spacing","word-spacing","vertical-align","text-align","padding-left"];function Bhe(){const t=window.getSelection();if(t&&t.rangeCount>0){const r=t.getRangeAt(0).startContainer,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=n==null?void 0:n.closest('[contenteditable="true"], .rte-content, .editora-content');if(i)return i}const e=document.activeElement;return e?e.getAttribute("contenteditable")==="true"?e:e.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function p3(t,e){try{if(typeof t.intersectsNode=="function")return t.intersectsNode(e)}catch(n){}const r=document.createRange();return e.nodeType===Node.ELEMENT_NODE?r.selectNodeContents(e):r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)>0&&t.compareBoundaryPoints(Range.START_TO_END,r)<0}function Zw(t){let e=0,r=t;for(;r&&r.parentNode;)e+=1,r=r.parentNode;return e}function Dhe(t){She.forEach(e=>{t.style.removeProperty(e)}),(!t.getAttribute("style")||t.style.length===0)&&t.removeAttribute("style"),t.classList.contains("rte-text-color")&&t.classList.remove("rte-text-color"),t.classList.contains("rte-bg-color")&&t.classList.remove("rte-bg-color"),t.classList.contains("rte-format-painted")&&t.classList.remove("rte-format-painted"),t.classList.length===0&&t.removeAttribute("class")}function E8(t){const e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}function _he(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function m3(t){Array.from(t.children).forEach(e=>{_he(e)&&e.remove()})}function g3(t){m3(t),E8(t)}function b3(t){var r;const e=document.createElement("p");for(Array.from(t.attributes).forEach(n=>{e.setAttribute(n.name,n.value)});t.firstChild;)e.appendChild(t.firstChild);e.innerHTML.trim()||(e.innerHTML="<br>"),(r=t.parentNode)==null||r.replaceChild(e,t)}function Lhe(t){return!/^(A|B|STRONG|I|EM|U|S|STRIKE|DEL|FONT|MARK|CODE|SUB|SUP|SPAN)$/.test(t.tagName)||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, svg, math")}function Ihe(t){Array.from(t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span")).sort((r,n)=>Zw(n)-Zw(r)).forEach(r=>{r.isConnected&&Lhe(r)&&r.remove()})}function Fhe(t){if(m3(t),t.parentElement instanceof HTMLLIElement){g3(t);return}if(Array.from(t.childNodes).filter(i=>i.nodeType!==Node.TEXT_NODE||(i.textContent||"").trim()!=="").some(i=>i instanceof HTMLElement&&/^(P|DIV|H[1-6]|UL|OL|PRE|TABLE|BLOCKQUOTE)$/.test(i.tagName))){g3(t);return}b3(t)}function Uhe(t,e){Array.from(t.querySelectorAll("h1,h2,h3,h4,h5,h6,blockquote,pre")).forEach(n=>{if(p3(e,n)&&khe.has(n.tagName)){if(n.tagName==="BLOCKQUOTE"){Fhe(n);return}b3(n)}})}function Nhe(t,e){const r=Array.from(t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span,[style],[class]"));r.sort((n,i)=>Zw(i)-Zw(n)),r.forEach(n=>{if(n.isConnected&&p3(e,n)&&!(n.getAttribute("contenteditable")==="false"||n.closest('[contenteditable="false"]'))){if(Dhe(n),The.has(n.tagName)){E8(n);return}n.tagName==="SPAN"&&n.attributes.length===0&&E8(n)}}),Ihe(t)}const Rhe=Object.freeze(Object.defineProperty({__proto__:null,ClearFormattingPlugin:Che},Symbol.toStringTag,{value:"Module"})),Pb='.rte-content, .editora-content, [contenteditable="true"]',Mhe="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",v3=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","PRE"]),y3="p,div,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table",Ohe=new Set(["p","h1","h2","h3","h4","h5","h6"]);function w3(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Phe(t){const e=t==null?void 0:t.contentElement;if(e instanceof HTMLElement)return e;const r=t==null?void 0:t.editorElement;if(r instanceof HTMLElement){const a=r.querySelector(Pb);if(a instanceof HTMLElement)return a;if(r.getAttribute("contenteditable")==="true")return r}const n=window.getSelection();if(n&&n.rangeCount>0){const a=w3(n.getRangeAt(0).startContainer),s=a==null?void 0:a.closest(Pb);if(s instanceof HTMLElement)return s;const l=a==null?void 0:a.closest(Mhe),c=l==null?void 0:l.querySelector(Pb);if(c instanceof HTMLElement)return c}const i=document.activeElement,o=i==null?void 0:i.closest(Pb);return o instanceof HTMLElement?o:document.querySelector(Pb)}function Hhe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);return!t.contains(r.startContainer)||!t.contains(r.endContainer)?null:r}function x3(t,e){let r=w3(e);if(!r||r===t||!t.contains(r))return null;for(;r.parentElement&&r.parentElement!==t;)r=r.parentElement;if(r.parentElement!==t)return null;if(r.matches(y3))return r;const n=r.closest(y3);return n instanceof HTMLElement&&n.parentElement===t?n:r}function E3(t,e){if(typeof t.intersectsNode=="function")try{return t.intersectsNode(e)}catch(n){return!1}const r=document.createRange();return r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)<0&&t.compareBoundaryPoints(Range.START_TO_END,r)>0}function zhe(t,e){const r=x3(t,e.startContainer),n=x3(t,e.endContainer);if(!r)return[];if(!n||r===n)return[r];const o=Array.from(t.children).filter(a=>a instanceof HTMLElement).filter(a=>E3(e,a));return o.length>0?o:[r]}function $he(t,e){Array.from(t.attributes).forEach(r=>{e.setAttribute(r.name,r.value)})}function C8(t,e){for(;t.firstChild;)e.appendChild(t.firstChild)}function Qhe(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function Jw(t,e){const r=document.createElement(t);return e&&$he(e,r),r}function C3(t,e){const r=Jw(e,t);return C8(t,r),r.innerHTML.trim()||(r.innerHTML="<br>"),r}function qhe(t){const e=t.cloneNode(!1);return e instanceof HTMLElement?e:document.createElement(t.tagName.toLowerCase())}function T3(t,e,r){const n=t.parentNode;if(!n)return[];const i=document.createDocumentFragment(),o=[];let a=null;const s=()=>{a&&a.children.length>0&&i.appendChild(a),a=null};return Array.from(t.children).forEach(l=>{if(l instanceof HTMLLIElement){if(e.has(l)){s();const c=C3(l,r);i.appendChild(c),o.push(c);return}a||(a=qhe(t)),a.appendChild(l)}}),s(),n.insertBefore(i,t),n.removeChild(t),o}function jhe(t,e){var n;if(t.tagName.toLowerCase()===e)return[t];const r=Jw(e,t);return C8(t,r),r.innerHTML.trim()||(r.innerHTML="<br>"),(n=t.parentNode)==null||n.replaceChild(r,t),[r]}function Whe(t,e){const r=t.parentNode;if(!r)return[];const n=document.createDocumentFragment(),i=[];return Array.from(t.childNodes).forEach(o=>{if(o instanceof HTMLElement&&Qhe(o)){o.remove();return}if(o instanceof HTMLUListElement||o instanceof HTMLOListElement){Array.from(o.children).forEach(s=>{if(!(s instanceof HTMLLIElement))return;const l=C3(s,e);n.appendChild(l),i.push(l)}),o.remove();return}if(o instanceof HTMLElement&&v3.has(o.tagName)){const s=Jw(e,o);C8(o,s),n.appendChild(s),i.push(s);return}if(o.nodeType===Node.TEXT_NODE&&(o.textContent||"").trim()===""){o.remove();return}const a=Jw(e,t);a.appendChild(o),n.appendChild(a),i.push(a)}),r.insertBefore(n,t),r.removeChild(t),i}function Khe(t){const e=window.getSelection();if(!e)return;const r=document.createRange(),n=t instanceof HTMLElement&&t.querySelector("p,li,h1,h2,h3,h4,h5,h6")||t;r.selectNodeContents(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function Vhe(t){t.dispatchEvent(new Event("input",{bubbles:!0}))}function Ghe(t,e,r){const n=window.execEditorCommand;if(typeof n=="function"){n("recordDomTransaction",t,e,r);return}const i=window.executeEditorCommand;typeof i=="function"&&i("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}function Xhe(t,e){const r=new Map;return Array.from(t.querySelectorAll("li")).filter(i=>i instanceof HTMLLIElement&&E3(e,i)).forEach(i=>{var a;const o=i.parentElement;(o instanceof HTMLUListElement||o instanceof HTMLOListElement)&&o.parentElement===t&&(r.has(o)||r.set(o,new Set),(a=r.get(o))==null||a.add(i))}),r}function Hb(t,e){const r=t.toLowerCase();if(!Ohe.has(r))return!1;const n=Phe(e);if(!n)return!1;const i=Hhe(n);if(!i)return!1;const o=n.innerHTML,a=[],s=Xhe(n,i),l={startContainer:i.startContainer,startOffset:i.startOffset,endContainer:i.endContainer,endOffset:i.endOffset};s.size>0?s.forEach((u,d)=>{a.push(...T3(d,u,r))}):zhe(n,i).forEach(d=>{if(d instanceof HTMLUListElement||d instanceof HTMLOListElement){const h=new Set(Array.from(d.children).filter(f=>f instanceof HTMLLIElement));a.push(...T3(d,h,r));return}if(v3.has(d.tagName)){const h=d.querySelector(":scope > ul, :scope > ol, :scope > blockquote, :scope > table");a.push(...h?Whe(d,r):jhe(d,r))}});const c=n.innerHTML;if(o===c||a.length===0)return!1;if(Ghe(n,o,c),Vhe(n),n.contains(l.startContainer)&&n.contains(l.endContainer)){const u=document.createRange();u.setStart(l.startContainer,l.startOffset),u.setEnd(l.endContainer,l.endOffset);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(u)}else Khe(a[0]);return!0}const Yhe=Object.freeze(Object.defineProperty({__proto__:null,HeadingPlugin:()=>({name:"heading",toolbar:[{label:"P",command:"setBlockType",type:"dropdown",options:[{value:"p",label:"P"},{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],icon:'<svg width="24" height="24" focusable="false"><path d="M16.1 8.6 14.2 4l-1.4.5 2.8 7.4c.1.4.5.6.9.6h.1c.4-.1.6-.5.6-.9l1.8-4.8-1.4-.5-1.5 2.3ZM4 11.5h6V10H4v1.5ZM18.5 3v1L17 7l.9.9L20.7 3h-2.2ZM5.5 12h1v7h1v-7h1v-.5h-3V12Zm4 0h1v7h1v-7h1v-.5h-3V12Zm10 1.5a2 2 0 0 0-2-2h-1v7.5h1v-2.7h1a2 2 0 0 0 2-2v-.8Zm-2 1.3h-1v-2.3h1a.8.8 0 1 1 0 1.6v.7Z" fill-rule="evenodd"></path></svg>'}],commands:{setBlockType:(t,e)=>t?Hb(t,e):!1,setHeading1:(t,e)=>Hb("h1",e),setHeading2:(t,e)=>Hb("h2",e),setHeading3:(t,e)=>Hb("h3",e),setParagraph:(t,e)=>Hb("p",e)},keymap:{"Mod-Alt-1":"setHeading1","Mod-Alt-2":"setHeading2","Mod-Alt-3":"setHeading3","Mod-Alt-0":"setParagraph"}})},Symbol.toStringTag,{value:"Module"})),zb='.rte-content, .editora-content, [contenteditable="true"]',Zhe="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",k3=["p","div","h1","h2","h3","h4","h5","h6","ul","ol","blockquote","pre","table"].join(",");function T8(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Jhe(t){const e=t==null?void 0:t.contentElement;if(e instanceof HTMLElement)return e;const r=t==null?void 0:t.editorElement;if(r instanceof HTMLElement){const a=r.querySelector(zb);if(a instanceof HTMLElement)return a;if(r.getAttribute("contenteditable")==="true")return r}const n=window.getSelection();if(n&&n.rangeCount>0){const a=T8(n.getRangeAt(0).startContainer),s=a==null?void 0:a.closest(zb);if(s instanceof HTMLElement)return s;const l=a==null?void 0:a.closest(Zhe),c=l==null?void 0:l.querySelector(zb);if(c instanceof HTMLElement)return c}const i=document.activeElement,o=i==null?void 0:i.closest(zb);return o instanceof HTMLElement?o:document.querySelector(zb)}function efe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);return!t.contains(r.startContainer)||!t.contains(r.endContainer)?null:r}function S3(t,e){let r=T8(e);if(!r||r===t||!t.contains(r))return null;for(;r.parentElement&&r.parentElement!==t;)r=r.parentElement;if(r.parentElement!==t)return null;if(r.matches(k3))return r;const n=r.closest(k3);return n instanceof HTMLElement&&n.parentElement===t?n:r}function B3(t,e){if(typeof t.intersectsNode=="function")try{return t.intersectsNode(e)}catch(n){return!1}const r=document.createRange();return r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)<0&&t.compareBoundaryPoints(Range.START_TO_END,r)>0}function tfe(t,e){const r=S3(t,e.startContainer),n=S3(t,e.endContainer);if(!r)return[];if(!n||r===n)return[r];const o=Array.from(t.children).filter(a=>a instanceof HTMLElement).filter(a=>B3(e,a));return o.length>0?o:[r]}function D3(t,e){const r=T8(e),n=r==null?void 0:r.closest("blockquote");return n instanceof HTMLQuoteElement&&t.contains(n)?n:null}function rfe(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function nfe(t){Array.from(t.children).forEach(e=>{rfe(e)&&e.remove()})}function k8(t){nfe(t);const e=t.parentNode;if(!e)return;Array.from(t.childNodes).forEach(n=>{e.insertBefore(n,t)}),e.removeChild(t)}function _3(t){return t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim()===""}function L3(t){const e=Array.from(t.childNodes).filter(n=>!_3(n));if(e.length!==1)return null;const r=e[0];return r instanceof HTMLQuoteElement?r:null}function ife(t){const e=document.createElement("blockquote");return Array.from(t.childNodes).filter(n=>!_3(n)).forEach(n=>{e.appendChild(n)}),e.childNodes.length||(e.innerHTML="<br>"),t.appendChild(e),e}function ofe(t,e){const r=Array.from(t.querySelectorAll("li")).filter(i=>i instanceof HTMLLIElement&&B3(e,i)),n=new Set(r);return r.filter(i=>{var a,s;let o=(a=i.parentElement)==null?void 0:a.closest("li");for(;o;){if(n.has(o))return!1;o=(s=o.parentElement)==null?void 0:s.closest("li")}return!0})}function $b(t){const e=window.getSelection();if(!e)return;const r=document.createRange(),n=t instanceof HTMLElement&&t.querySelector("p,li,h1,h2,h3,h4,h5,h6")||t;r.selectNodeContents(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function afe(t){t.dispatchEvent(new Event("input",{bubbles:!0}))}function sfe(t,e,r){const n=window.execEditorCommand;if(typeof n=="function"){n("recordDomTransaction",t,e,r);return}const i=window.executeEditorCommand;typeof i=="function"&&i("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}function lfe(t){var u,d;const e=Jhe(t);if(!e)return!1;const r=efe(e);if(!r)return!1;const n=e.innerHTML,i=D3(e,r.startContainer),o=D3(e,r.endContainer),a=ofe(e,r),s=tfe(e,r),l=s.length>0&&s.every(h=>h.tagName==="BLOCKQUOTE");if(i&&i===o){const h=i.firstChild||i;k8(i),$b(h)}else if(a.length>0){const h=a.map(L3);if(h.every(Boolean)){const A=((u=h[0])==null?void 0:u.firstChild)||a[0];h.forEach(p=>{p&&k8(p)}),$b(A)}else{const A=a[0];a.forEach(p=>{L3(p)||ife(p)}),$b(A)}}else if(l){const h=s[0].firstChild||s[0];s.forEach(k8),$b(h)}else{const h=s.filter(p=>p.tagName!=="BLOCKQUOTE");if(h.length===0)return!1;const f=document.createElement("blockquote"),A=h[0];(d=A.parentNode)==null||d.insertBefore(f,A),h.forEach(p=>{f.appendChild(p)}),$b(f)}const c=e.innerHTML;return n===c?!1:(sfe(e,n,c),afe(e),!0)}const cfe=Object.freeze(Object.defineProperty({__proto__:null,BlockquotePlugin:()=>({name:"blockquote",nodes:{blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}},toolbar:[{label:"Quote",command:"toggleBlockquote",icon:'<svg fill="#000000" height="24px" width="24px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" xml:space="preserve"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <g> <path d="M13,11c0.6,0,1-0.4,1-1s-0.4-1-1-1c-5,0-9,4-9,9c0,2.8,2.2,5,5,5s5-2.2,5-5s-2.2-5-5-5c-0.3,0-0.7,0-1,0.1 C9.3,11.8,11,11,13,11z"></path> <path d="M23,13c-0.3,0-0.7,0-1,0.1c1.3-1.3,3-2.1,5-2.1c0.6,0,1-0.4,1-1s-0.4-1-1-1c-5,0-9,4-9,9c0,2.8,2.2,5,5,5s5-2.2,5-5 S25.8,13,23,13z"></path> </g> </g></svg>',shortcut:"Mod-Shift-9"}],commands:{toggleBlockquote:(t,e)=>lfe(e)},keymap:{"Mod-Shift-9":"toggleBlockquote"}})},Symbol.toStringTag,{value:"Module"}));function ufe(t){let e=!1;t.addEventListener("pointerdown",r=>{e=r.target!==t},!0),t.addEventListener("click",r=>{r.target===t&&e&&r.stopImmediatePropagation(),e=!1},!0)}const I3="rte-dialog-base-styles";function dfe(){if(typeof document=="undefined"||document.getElementById(I3))return;const t=document.createElement("style");t.id=I3,t.textContent=`
11
+ `+Xt),V&&(Xt=Pa(Xt)),S&&ot?P(Xt):Xt},e.setConfig=function(){let Ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ft(Ge),Ue=!0,Pe=L,Ye=Y},e.clearConfig=function(){Ir=null,Ue=!1,Pe=null,Ye=null,S=U,F=""},e.isValidAttribute=function(Ge,Z,Ee){Ir||Ft({});const je=$t(Ge),et=$t(Z);return ic(je,et,Ee)},e.addHook=function(Ge,Z){typeof Z=="function"&&hs($,Ge)&&Fb($[Ge],Z)},e.removeHook=function(Ge,Z){if(hs($,Ge)){if(Z!==void 0){const Ee=xde($[Ge],Z);return Ee===-1?void 0:Ede($[Ge],Ee,1)[0]}return QO($[Ge])}},e.removeHooks=function(Ge){hs($,Ge)&&($[Ge]=[])},e.removeAllHooks=function(){$=r3()},e}var Kw=n3();const Vde=["p","br","strong","em","u","s","strike","del","b","i","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","video","audio","table","thead","tbody","tr","th","td","blockquote","pre","code","span","div","section","figure","figcaption","sup","sub","hr"],Gde={"*":["class","style","id","data-*","role","aria-*","tabindex","contenteditable","spellcheck","dir","lang"],a:["href","target","rel","title"],img:["src","alt","width","height","loading"],video:["src","controls","width","height","autoplay","loop","muted"],audio:["src","controls","autoplay","loop","muted"],ol:["start","reversed"],table:["border","cellpadding","cellspacing"],td:["colspan","rowspan","align","valign"],th:["colspan","rowspan","align","valign"],iframe:["src","width","height","name","title","frameborder","scrolling","allowfullscreen","longdesc","allow"]},Xde="data-editora-embed";function Yde(t){if(!t||/\s/.test(t.trim()))return!1;try{const e=new URL(t.trim());return(e.protocol==="https:"||e.protocol==="http:")&&e.hostname.length>0}catch(e){return!1}}function i3(t,e,r,n){if((e==null?void 0:e.sanitize)===!1)return t;const i=e!=null&&e.allowedTags&&e.allowedTags.length>0?e.allowedTags:Vde,o=r!=null&&r.length?Array.from(new Set([...i,...r])):i,s=!!(e!=null&&e.allowedAttributes)&&Object.keys(e.allowedAttributes).length>0?e.allowedAttributes:Gde,l=new Set;for(const d of Object.values(s))for(const h of d)l.add(h);const c={ALLOWED_TAGS:o,ALLOWED_ATTR:Array.from(l)};if(!n)return Kw.sanitize(t,c);const u=o.includes("iframe");Kw.addHook("uponSanitizeElement",(d,h)=>{var A;if(h.tagName!=="iframe")return;const f=d;h.allowedTags.iframe=u||((A=f.getAttribute)==null?void 0:A.call(f,Xde))==="true"&&Yde(f.getAttribute("src"))});try{return Kw.sanitize(t,c)}finally{Kw.removeHook("uponSanitizeElement")}}function Zde(t,e,r,n){return i3(t,e,n,!1)}function Jde(t,e,r){return(r==null?void 0:r.sanitizeOnPaste)===!1?t:Zde(t,e)}function o3(t,e,r,n){return(r==null?void 0:r.sanitizeOnInput)===!1?t:i3(t,e,n,!0)}const ehe=".resize-handle, .table-resize-handle, [data-rte-media-pending]",the=/resize-handle|data-rte-media-pending|rte-media/;function a3(t){if(!t||!the.test(t))return t;const e=document.createElement("template");e.innerHTML=t;const r=new Set;return e.content.querySelectorAll(ehe).forEach(n=>{const i=n.parentElement;i&&(i.tagName==="TD"||i.tagName==="TH")&&r.add(i),n.remove()}),r.forEach(n=>{var i;n.style.position==="relative"&&(n.style.removeProperty("position"),(i=n.getAttribute("style"))!=null&&i.trim()||n.removeAttribute("style"))}),e.content.querySelectorAll("figure.rte-media").forEach(n=>{var o;n.removeAttribute("contenteditable");const i=n.querySelector(":scope > figcaption");i&&(i.removeAttribute("contenteditable"),!((o=i.textContent)!=null&&o.trim())&&!i.querySelector("img, video, a")&&i.remove())}),e.innerHTML}function Mb(t){return t?a3(t.innerHTML):""}const Rk=class Rk{static resolve(e){const r={};if(Object.assign(r,this.EDITOR_DEFAULTS),e.pluginDefaults&&Object.assign(r,e.pluginDefaults),e.attributes){const n=this.parseAttributes(e.attributes);Object.assign(r,n)}return e.jsConfig&&Object.assign(r,e.jsConfig),this.normalizeConfig(r)}static normalizeConfig(e){const r={...e};if(r.toolbarFloating!==void 0||r.toolbarSticky!==void 0){const a=typeof r.toolbar=="object"&&r.toolbar?{...r.toolbar}:typeof r.toolbar=="string"?{items:r.toolbar}:{};r.toolbarFloating!==void 0&&(a.floating=!!r.toolbarFloating),r.toolbarSticky!==void 0&&(a.sticky=!!r.toolbarSticky),r.toolbar=a}if(r.toolbarItems!==void 0&&typeof r.toolbar=="object"&&r.toolbar&&(r.toolbar.items=r.toolbarItems),r.autosaveEnabled!==void 0||r.autosaveIntervalMs!==void 0||r.autosaveStorageKey!==void 0||r.autosaveProvider!==void 0||r.autosaveApiUrl!==void 0){const a=typeof r.autosave=="object"&&r.autosave?{...r.autosave}:{};r.autosaveEnabled!==void 0&&(a.enabled=!!r.autosaveEnabled),r.autosaveIntervalMs!==void 0&&(a.intervalMs=Number(r.autosaveIntervalMs)),r.autosaveStorageKey!==void 0&&(a.storageKey=r.autosaveStorageKey),r.autosaveProvider!==void 0&&(a.provider=r.autosaveProvider),r.autosaveApiUrl!==void 0&&(a.apiUrl=r.autosaveApiUrl),r.autosave=a}const n={enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage",apiUrl:""};if(typeof r.autosave=="boolean")r.autosave={...n,enabled:r.autosave};else if(typeof r.autosave=="object"&&r.autosave){const a={...n,...r.autosave};a.intervalMs===void 0&&a.interval!==void 0&&(a.intervalMs=Number(a.interval)),a.enabled===void 0&&(a.enabled=!0),(!Number.isFinite(a.intervalMs)||a.intervalMs<=0)&&(a.intervalMs=n.intervalMs),r.autosave=a}else r.autosave=n;if(r.languageLocale!==void 0||r.languageDirection!==void 0){const a=typeof r.language=="object"&&r.language?{...r.language}:{};r.languageLocale!==void 0&&(a.locale=r.languageLocale),r.languageDirection!==void 0&&(a.direction=r.languageDirection),r.language=a}const i={locale:"en",direction:"ltr"};if(typeof r.language=="string"?r.language={locale:r.language,direction:i.direction}:typeof r.language=="object"&&r.language?r.language={...i,...r.language}:r.language=i,r.spellcheckEnabled!==void 0||r.spellcheckProvider!==void 0||r.spellcheckApiUrl!==void 0){const a=typeof r.spellcheck=="object"&&r.spellcheck?{...r.spellcheck}:{};r.spellcheckEnabled!==void 0&&(a.enabled=!!r.spellcheckEnabled),r.spellcheckProvider!==void 0&&(a.provider=r.spellcheckProvider),r.spellcheckApiUrl!==void 0&&(a.apiUrl=r.spellcheckApiUrl),r.spellcheck=a}const o={enabled:!1,provider:"browser",apiUrl:""};if(typeof r.spellcheck=="boolean")r.spellcheck={...o,enabled:r.spellcheck};else if(typeof r.spellcheck=="object"&&r.spellcheck){const a={...o,...r.spellcheck};!a.provider&&a.mode&&(a.provider=a.mode==="local"?"browser":"api"),a.enabled===void 0&&(a.enabled=!!(a.mode||a.provider||a.apiUrl)),r.spellcheck=a}else r.spellcheck=o;return r.contextMenuEnabled!==void 0&&(r.contextMenu={enabled:!!r.contextMenuEnabled}),typeof r.contextMenu=="boolean"?r.contextMenu={enabled:r.contextMenu}:typeof r.contextMenu=="object"&&r.contextMenu?r.contextMenu={enabled:r.contextMenu.enabled!==!1}:r.contextMenu={enabled:!0},(r.pasteClean!==void 0||r.pasteKeepFormatting!==void 0||r.pasteConvertWord!==void 0)&&(r.paste={...r.paste||{},...r.pasteClean!==void 0?{clean:!!r.pasteClean}:{},...r.pasteKeepFormatting!==void 0?{keepFormatting:!!r.pasteKeepFormatting}:{},...r.pasteConvertWord!==void 0?{convertWord:!!r.pasteConvertWord}:{}}),r.paste={clean:!0,keepFormatting:!1,convertWord:!0,...r.paste||{}},r.contentConfig={allowedTags:[],allowedAttributes:{},sanitize:!0,...r.contentConfig||{}},(r.securitySanitizeOnPaste!==void 0||r.securitySanitizeOnInput!==void 0)&&(r.security={...r.security||{},...r.securitySanitizeOnPaste!==void 0?{sanitizeOnPaste:!!r.securitySanitizeOnPaste}:{},...r.securitySanitizeOnInput!==void 0?{sanitizeOnInput:!!r.securitySanitizeOnInput}:{}}),r.security={sanitizeOnPaste:!0,sanitizeOnInput:!0,...r.security||{}},(r.accessibilityEnableAria!==void 0||r.accessibilityKeyboardNavigation!==void 0||r.accessibilityChecker!==void 0)&&(r.accessibility={...r.accessibility||{},...r.accessibilityEnableAria!==void 0?{enableARIA:!!r.accessibilityEnableAria}:{},...r.accessibilityKeyboardNavigation!==void 0?{keyboardNavigation:!!r.accessibilityKeyboardNavigation}:{},...r.accessibilityChecker!==void 0?{checker:!!r.accessibilityChecker}:{}}),typeof r.accessibility=="boolean"&&(r.accessibility={enableARIA:r.accessibility,keyboardNavigation:r.accessibility,checker:!1}),r.accessibility={enableARIA:!0,keyboardNavigation:!0,checker:!1,...r.accessibility||{}},(r.performanceDebounceInputMs!==void 0||r.performanceViewportOnlyScan!==void 0)&&(r.performance={...r.performance||{},...r.performanceDebounceInputMs!==void 0?{debounceInputMs:Number(r.performanceDebounceInputMs)}:{},...r.performanceViewportOnlyScan!==void 0?{viewportOnlyScan:!!r.performanceViewportOnlyScan}:{}}),typeof r.performance=="boolean"&&(r.performance={debounceInputMs:100,viewportOnlyScan:r.performance}),r.performance={debounceInputMs:100,viewportOnlyScan:!0,...r.performance||{}},(typeof r.performance.debounceInputMs!="number"||!Number.isFinite(r.performance.debounceInputMs)||r.performance.debounceInputMs<0)&&(r.performance.debounceInputMs=100),r}static parseAttributes(e){const r={};for(const[n,i]of Object.entries(e)){const o=this.kebabToCamel(n);r[o]=this.BOOLEAN_ATTRIBUTES.has(n)&&(i===""||i===n)?!0:this.parseAttributeValue(i)}return r}static parseAttributeValue(e){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(r){return e}return e}static kebabToCamel(e){return e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase())}static validate(e){const r=[];return e.height!==void 0&&typeof e.height=="number"&&e.height<0&&r.push("height must be a positive number"),e.width!==void 0&&typeof e.width=="number"&&e.width<0&&r.push("width must be a positive number"),e.plugins!==void 0&&!Array.isArray(e.plugins)&&typeof e.plugins!="string"&&r.push("plugins must be an array or string"),e.theme!==void 0&&typeof e.theme!="string"&&r.push("theme must be a string"),{valid:r.length===0,errors:r}}static getDefaults(){return{...this.EDITOR_DEFAULTS}}static merge(...e){const r={};for(const n of e)for(const[i,o]of Object.entries(n))o!=null&&(typeof o=="object"&&!Array.isArray(o)&&r[i]?r[i]=this.merge(r[i],o):r[i]=o);return r}};Rk.EDITOR_DEFAULTS={height:400,width:"100%",readonly:!1,disabled:!1,menubar:!0,toolbar:!0,plugins:[],theme:"light",content:"",placeholder:"Start typing...",autofocus:!1,autosave:!1,accessibility:{enableARIA:!0,keyboardNavigation:!0,checker:!1},performance:{debounceInputMs:100,viewportOnlyScan:!0},spellcheck:{enabled:!1,provider:"browser",apiUrl:""},language:{locale:"en",direction:"ltr"},contextMenu:{enabled:!0},contentConfig:{allowedTags:[],allowedAttributes:{},sanitize:!0},paste:{clean:!0,keepFormatting:!1,convertWord:!0},security:{sanitizeOnPaste:!0,sanitizeOnInput:!0},statusbar:!1},Rk.BOOLEAN_ATTRIBUTES=new Set(["readonly","disabled","autofocus","statusbar","toolbar-floating","toolbar-sticky","autosave-enabled","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance-viewport-only-scan","spellcheck-enabled","context-menu-enabled","paste-clean","paste-keep-formatting","paste-convert-word","security-sanitize-on-paste","security-sanitize-on-input"]);let b8=Rk;const rhe='.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}';let Vw;const nhe="__editoraCommandEditorRoot",ihe="__editoraLastCommandButton",s3="editora-editor, [data-editora-editor], .rte-editor, .editora-editor",l3=".rte-content, .editora-content",ohe="Rich text editor",v8=new Set;let tf=null,c3=!1,y8=null,w8=null;function u3(t){if(!(t instanceof HTMLElement))return!1;const e=t;return typeof e.execCommand=="function"&&(e.tagName.toLowerCase()==="editora-editor"||e.classList.contains("editora-editor")||e.hasAttribute("data-editora-editor"))}function ahe(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Ob(t){if(!t)return null;if(u3(t))return t;const e=t.matches(s3)?t:t.closest(s3);return!e||!u3(e)?null:e}function she(){var i;if(typeof window=="undefined")return null;const t=window[nhe];if(t instanceof HTMLElement){const o=Ob(t);if(o)return o;const a=t.matches(l3)?t:t.querySelector(l3);if(a){const s=Ob(a);if(s)return s}}const e=window[ihe];if(e instanceof HTMLElement){const o=Ob(e);if(o)return o}const r=document.activeElement;if(r){const o=Ob(r);if(o)return o}const n=(i=window.getSelection)==null?void 0:i.call(window);if(n&&n.rangeCount>0){const o=Ob(ahe(n.getRangeAt(0).startContainer));if(o)return o}if(tf&&tf.isConnected)return tf;for(const o of v8)if(o.isConnected)return o;return null}function lhe(){if(typeof window=="undefined"||c3)return;y8=typeof window.executeEditorCommand=="function"?window.executeEditorCommand.bind(window):null,w8=typeof window.execEditorCommand=="function"?window.execEditorCommand.bind(window):null;const t=(e,...r)=>{const n=she();return n?n.execCommand(e,...r):y8?y8(e,...r):w8?w8(e,...r):!1};window.executeEditorCommand=t,window.execEditorCommand=t,c3=!0}function che(){const t="editora-webcomponent-styles";if(!document.getElementById(t)){const e=document.createElement("style");e.id=t,e.textContent=rhe,document.head.appendChild(e)}}function uhe(){if(!Vw){const t=gl.__globalPluginLoader;t?Vw=t:Vw=new jA}return Vw}class gl extends HTMLElement{constructor(){if(super(),this.pluginLoader=uhe(),this.config={},this.isInitialized=!1,this.buildGeneration=0,this.keyboardShortcutManager=new fde,this.lastAutosavedContent="",this.preservedContent=null,this.loadedPlugins=[],this.lastBeforeInputType=null,this.pendingHistorySnapshot=null,che(),!this.hasAttribute("data-initial-content")){const e=this.innerHTML.trim();e&&this.setAttribute("data-initial-content",e)}}static get observedAttributes(){return["height","width","menubar","plugins","toolbar","toolbar-items","toolbar-floating","toolbar-sticky","readonly","disabled","theme","placeholder","aria-label","autofocus","autosave","autosave-enabled","autosave-interval-ms","autosave-storage-key","autosave-provider","autosave-api-url","accessibility","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance","performance-debounce-input-ms","performance-viewport-only-scan","language","language-locale","language-direction","spellcheck","spellcheck-enabled","spellcheck-provider","context-menu","context-menu-enabled","paste","paste-clean","paste-keep-formatting","paste-convert-word","security","security-sanitize-on-paste","security-sanitize-on-input","statusbar"]}connectedCallback(){this.config=this.resolveConfig(),this.waitForPluginLoader().then(()=>{setTimeout(async()=>{await this.initialize()},0)})}async waitForPluginLoader(){if(gl.__globalPluginLoader){this.pluginLoader=gl.__globalPluginLoader;return}return new Promise(e=>{const r=()=>{gl.__globalPluginLoader?(this.pluginLoader=gl.__globalPluginLoader,e()):setTimeout(r,0)};r()})}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,r,n){r!==n&&(this.config=this.resolveConfig(),this.handleAttributeChange(e,n))}async setConfig(e){this.jsConfig=e,this.config=this.resolveConfig(),this.isConnected&&(this.destroy(),await this.waitForPluginLoader(),await this.initialize())}async initialize(){var o;if(this.querySelector(".editora-toolbar")||this.isInitialized)return;const e=++this.buildGeneration;this.setAttribute("data-editora-editor","true"),v8.add(this),tf||(tf=this),lhe(),this.config.height&&(this.style.height=typeof this.config.height=="number"?`${this.config.height}px`:this.config.height),this.config.width&&(this.style.width=typeof this.config.width=="number"?`${this.config.width}px`:this.config.width),this.classList.add("editora-editor"),this.config.theme&&this.classList.add(`editora-theme-${this.config.theme}`);const r=await this.loadPlugins();if(e!==this.buildGeneration||!this.isConnected)return;if(this.loadedPlugins=r,r.forEach(a=>{if(a.init&&typeof a.init=="function")try{a.init({editorElement:this})}catch(s){console.error(`[RichTextEditor] Error initializing plugin ${a.name}:`,s)}}),!this.hasAttribute("data-initial-content")&&!this.contentElement){const a=this.innerHTML.trim();a&&this.setAttribute("data-initial-content",a)}const n=this.preservedContent;this.preservedContent=null;const i=this.sanitizeLoadedContent((o=n!=null?n:this.restoreAutosavedContent())!=null?o:this.getAttribute("data-initial-content")||"");this.engine=new ide({content:i,plugins:r,readonly:this.config.readonly}),this.createUI(r,i),this.setupEventListeners(),this.startAutosave(),this.isInitialized=!0,this.dispatchEvent(new CustomEvent("editor-ready",{detail:{api:this.getAPI()},bubbles:!0}))}getInitialContent(){if(this.config.content)return this.config.content;const e=this.querySelector("[slot]");return e?e.innerHTML:this.hasChildNodes()?Array.from(this.childNodes).map(n=>n.nodeType===Node.TEXT_NODE?n.textContent:n.nodeType===Node.ELEMENT_NODE?n.outerHTML:"").join("").trim():""}async loadPlugins(){this.pluginLoader||await this.waitForPluginLoader();const e=[],r=this.config.plugins&&(typeof this.config.plugins=="string"&&this.config.plugins.length>0||Array.isArray(this.config.plugins)&&this.config.plugins.length>0),i=this.getAccessibilityConfig().checker===!0;if(r){if(typeof this.config.plugins=="string"){const o=this.config.plugins.split(/\s+/).filter(Boolean);i&&!o.includes("a11yChecker")&&o.push("a11yChecker");for(const a of o){const s=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));s&&e.push(s)}}else if(Array.isArray(this.config.plugins)){for(const o of this.config.plugins)if(typeof o=="string"){const a=await this.pluginLoader.load(o,this.getPluginLoadConfig(o));a&&e.push(a)}else e.push(o);if(i&&!e.some(o=>(o==null?void 0:o.name)==="a11yChecker")){const o=await this.pluginLoader.load("a11yChecker",this.getPluginLoadConfig("a11yChecker"));o&&e.push(o)}}}else{const o=this.pluginLoader.getRegisteredPluginNames();for(const a of o){const s=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));s&&e.push(s)}}return e}resolveToolbarItems(){const e=this.config.toolbarItems;if(typeof e=="string")return e;if(Array.isArray(e))return e.join(" ");const r=this.config.toolbar;if(typeof r=="string")return r;if(!r||typeof r!="object")return;const n=r.items;if(typeof n=="string")return n;if(Array.isArray(n))return n.join(" ")}isToolbarStickyEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.sticky}isToolbarFloatingEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.floating}isStatusbarEnabled(){const e=this.config.statusbar;return typeof e=="boolean"?e:e&&typeof e=="object"?e.enabled!==!1:!1}getStatusbarPosition(){const e=this.config.statusbar;return e&&typeof e=="object"&&e.position==="top"?"top":"bottom"}getLanguageConfig(){const e=this.config.language;return typeof e=="string"?{locale:e,direction:"ltr"}:e&&typeof e=="object"?{locale:e.locale||"en",direction:e.direction==="rtl"?"rtl":"ltr"}:{locale:"en",direction:"ltr"}}getAccessibilityConfig(){const e=this.config.accessibility;return typeof e=="boolean"?{enableARIA:e,keyboardNavigation:e,checker:!1}:e&&typeof e=="object"?{enableARIA:e.enableARIA!==!1,keyboardNavigation:e.keyboardNavigation!==!1,checker:!!e.checker}:{enableARIA:!0,keyboardNavigation:!0,checker:!1}}getPerformanceConfig(){var r;const e=this.config.performance;if(typeof e=="boolean")return{debounceInputMs:100,viewportOnlyScan:e};if(e&&typeof e=="object"){const n=Number((r=e.debounceInputMs)!=null?r:100);return{debounceInputMs:Number.isFinite(n)&&n>=0?n:100,viewportOnlyScan:e.viewportOnlyScan!==!1}}return{debounceInputMs:100,viewportOnlyScan:!0}}isEditorInViewport(){if(!this.contentElement||typeof window=="undefined")return!0;const e=this.contentElement.getBoundingClientRect();return e.bottom>=0&&e.top<=window.innerHeight}applyAccessibilitySettings(){var r;if(!this.contentElement)return;const e=this.getAccessibilityConfig();if(e.enableARIA){this.contentElement.setAttribute("role","textbox"),this.contentElement.setAttribute("aria-multiline","true"),this.contentElement.setAttribute("aria-disabled",this.config.readonly?"true":"false");const n=(r=this.getAttribute("aria-label"))==null?void 0:r.trim(),i=typeof this.config.placeholder=="string"?this.config.placeholder.trim():"";this.contentElement.setAttribute("aria-label",n||i||ohe)}else this.contentElement.removeAttribute("role"),this.contentElement.removeAttribute("aria-multiline"),this.contentElement.removeAttribute("aria-disabled"),this.contentElement.removeAttribute("aria-label");this.contentElement.tabIndex=e.keyboardNavigation?0:-1}applyLanguageSettings(){if(!this.contentElement)return;const e=this.getLanguageConfig();this.contentElement.setAttribute("lang",e.locale),this.contentElement.setAttribute("dir",e.direction)}getSpellcheckConfig(){const e=this.config.spellcheck;if(typeof e=="boolean")return{enabled:e,provider:"browser"};if(e&&typeof e=="object"){const r=e.provider||"browser";return{enabled:!!e.enabled,provider:r,mode:e.mode}}return{enabled:!1,provider:"browser"}}applySpellcheckSettings(){if(!this.contentElement)return;const e=this.getSpellcheckConfig(),r=e.enabled&&e.provider==="browser";this.contentElement.spellcheck=r,this.contentElement.setAttribute("spellcheck",r?"true":"false")}executeCommand(e,...r){var o;typeof window!="undefined"&&(window.__editoraCommandEditorRoot=this);const n={editorElement:this,contentElement:this.contentElement,toolbarElement:this.toolbarElement},i=this.loadedPlugins.find(a=>a.commands&&a.commands[e]);if(i&&i.commands){const a=i.commands[e];if(typeof a=="function")try{return e==="toggleFullscreen"?a(this,n):a(...r,n),!0}catch(s){return console.error(`[RichTextEditor] Error executing native command ${e}:`,s),!1}}return((o=this.engine)==null?void 0:o.execCommand(e,...r))||!1}getPluginLoadConfig(e){const r=this.config.pluginConfig;if(r&&typeof r=="object"){const o=r[e];if(o&&typeof o=="object")return o}const n={spellCheck:["spellcheck","spellCheck"],trackChanges:["trackchanges","track-changes","trackChanges"],versionDiff:["versiondiff","version-diff","versionDiff"],"version-diff":["versiondiff","version-diff","versionDiff"],conditionalContent:["conditionalcontent","conditional-content","conditionalContent"],"conditional-content":["conditionalcontent","conditional-content","conditionalContent"],dataBinding:["databinding","data-binding","dataBinding"],"data-binding":["databinding","data-binding","dataBinding"],contentRules:["contentrules","content-rules","contentRules"],"content-rules":["contentrules","content-rules","contentRules"],mentions:["mention","mentions"],mention:["mention","mentions"],slashCommands:["slashcommands","slash-commands","slashCommands"],"slash-commands":["slashcommands","slash-commands","slashCommands"],formatPainter:["formatpainter","format-painter","formatPainter"],"format-painter":["formatpainter","format-painter","formatPainter"]},i=[e,e.toLowerCase(),...n[e]||[]];for(const o of i){const a=this.config[o];if(a&&typeof a=="object"&&!Array.isArray(a))return a}}getContentSanitizeConfig(){const e=this.config.contentConfig;return e&&typeof e=="object"?e:{sanitize:!0}}getSecurityConfig(){const e=this.config.security;return e&&typeof e=="object"?e:{sanitizeOnPaste:!0,sanitizeOnInput:!0}}sanitizeLoadedContent(e){return o3(e,this.getContentSanitizeConfig(),this.getSecurityConfig())}getAutosaveConfig(){var r,n;const e=this.config.autosave;if(typeof e=="boolean")return{enabled:e,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"};if(e&&typeof e=="object"){const i=Number((n=(r=e.intervalMs)!=null?r:e.interval)!=null?n:3e4);return{enabled:!!e.enabled,intervalMs:Number.isFinite(i)&&i>0?i:3e4,storageKey:String(e.storageKey||"rte-autosave"),provider:e.provider||"localStorage",apiUrl:e.apiUrl}}return{enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"}}persistAutosave(e){const r=this.getAutosaveConfig();if(r.enabled&&e!==this.lastAutosavedContent){if(this.lastAutosavedContent=e,r.provider==="localStorage"){try{localStorage.setItem(r.storageKey,e),localStorage.setItem(`${r.storageKey}-timestamp`,Date.now().toString())}catch(n){console.error("[RichTextEditor] Failed to save autosave content to localStorage:",n)}return}r.provider==="api"&&r.apiUrl&&fetch(r.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,timestamp:Date.now()})}).catch(n=>{console.error("[RichTextEditor] Failed to save autosave content to API:",n)})}}restoreAutosavedContent(){const e=this.getAutosaveConfig();if(!e.enabled||e.provider!=="localStorage")return null;try{const r=localStorage.getItem(e.storageKey);if(r)return this.lastAutosavedContent=r,r}catch(r){console.error("[RichTextEditor] Failed to restore autosaved content:",r)}return null}stopAutosave(){this.autosaveTimer&&(clearInterval(this.autosaveTimer),this.autosaveTimer=void 0)}startAutosave(){this.stopAutosave();const e=this.getAutosaveConfig();!e.enabled||!this.contentElement||(this.autosaveTimer=setInterval(()=>{this.persistAutosave(Mb(this.contentElement))},e.intervalMs))}insertHTMLAtSelection(e){if(!this.contentElement)return;const r=window.getSelection();if(r&&r.rangeCount>0){const n=r.getRangeAt(0);n.deleteContents();const i=document.createElement("div");i.innerHTML=e;const o=document.createDocumentFragment();for(;i.firstChild;)o.appendChild(i.firstChild);n.insertNode(o),n.collapse(!1),r.removeAllRanges(),r.addRange(n)}else this.contentElement.focus(),document.execCommand("insertHTML",!1,e)}createUI(e,r){const n=this.querySelector('[slot="toolbar"]'),i=this.querySelector('[slot="statusbar"]');this.innerHTML="",this.config.toolbar!==!1&&!n?(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.appendChild(this.toolbarElement),this.toolbar=new ode({items:this.resolveToolbarItems(),sticky:this.isToolbarStickyEnabled(),position:"top"},e,this.pluginLoader),this.toolbar.setCommandHandler((o,a)=>{var s;if(this.contentElement){this.contentElement.focus();const l=window.getSelection();if(!l||l.rangeCount===0||!this.contentElement.contains(l.anchorNode)){const c=document.createRange(),u=this.contentElement.lastChild||this.contentElement;u.nodeType===Node.TEXT_NODE?c.setStart(u,((s=u.textContent)==null?void 0:s.length)||0):u.nodeType===Node.ELEMENT_NODE?(c.selectNodeContents(u),c.collapse(!1)):c.setStart(this.contentElement,0),c.collapse(!0),l==null||l.removeAllRanges(),l==null||l.addRange(c)}}return this.executeCommand(o,a)}),this.toolbar.render(this.toolbarElement)):n&&this.appendChild(n),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content rte-content",this.contentElement.contentEditable=this.config.readonly?"false":"true",this.applyLanguageSettings(),this.applyAccessibilitySettings(),this.applySpellcheckSettings(),this.config.placeholder&&this.contentElement.setAttribute("data-placeholder",this.config.placeholder);try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(o){console.warn("defaultParagraphSeparator not supported:",o)}if(r){const o=document.createElement("div");o.innerHTML=r.trim(),!Array.from(o.childNodes).some(s=>{if(s.nodeType===Node.ELEMENT_NODE){const l=s.tagName;return["P","DIV","H1","H2","H3","H4","H5","H6","UL","OL","BLOCKQUOTE","PRE"].includes(l)}return!1})&&r.trim()?this.contentElement.innerHTML=`<p>${r.trim()}</p>`:this.contentElement.innerHTML=r}else this.config.placeholder?this.contentElement.innerHTML="":this.contentElement.innerHTML="<p><br></p>";this.appendChild(this.contentElement),this.isToolbarFloatingEnabled()&&(this.floatingToolbar=new ade({enabled:!0}),this.floatingToolbar.create(this)),i?this.appendChild(i):this.isStatusbarEnabled()&&(this.statusBarElement=document.createElement("div"),this.statusBarElement.className="editora-statusbar-container",this.appendChild(this.statusBarElement),this.statusBar=new sde({position:this.getStatusbarPosition()}),this.statusBar.create(this.statusBarElement)),this.config.autofocus&&setTimeout(()=>{var o;return(o=this.contentElement)==null?void 0:o.focus()},0)}recordInputHistory(e){const r=this.pendingHistorySnapshot;if(this.pendingHistorySnapshot=null,!r||!this.contentElement||r.beforeHTML===e)return;const n=window.execEditorCommand;typeof n=="function"&&n("recordDomTransaction",this.contentElement,r.beforeHTML,e,{inputType:r.inputType,data:r.data,selectionCollapsed:r.selectionCollapsed})}setupEventListeners(){if(!this.contentElement||!this.engine)return;const e=this.keyboardShortcutManager;this.contentElement.addEventListener("beforeinput",n=>{var i,o;this.lastBeforeInputType=n.inputType||null,n.inputType==="historyUndo"||n.inputType==="historyRedo"?this.pendingHistorySnapshot=null:this.contentElement&&(this.pendingHistorySnapshot={beforeHTML:this.contentElement.innerHTML,inputType:n.inputType||null,data:typeof n.data=="string"?n.data:null,selectionCollapsed:(o=(i=window.getSelection())==null?void 0:i.isCollapsed)!=null?o:!0})}),this.contentElement.addEventListener("input",n=>{var h;if(!this.contentElement)return;let i=this.contentElement.innerHTML;const o=(h=n==null?void 0:n.detail)==null?void 0:h.allowedTags,a=this.getPerformanceConfig(),s=this.getContentSanitizeConfig(),l=this.getSecurityConfig(),c=this.lastBeforeInputType;if(this.lastBeforeInputType=null,l.sanitizeOnInput!==!1&&s.sanitize!==!1&&!c){const f=o3(i,s,l,o);if(f!==i){const A=window.getSelection(),p=A&&A.rangeCount>0?A.getRangeAt(0):null;if(this.contentElement.innerHTML=f,p&&A)try{A.removeAllRanges(),A.addRange(p)}catch(g){}i=f}}this.recordInputHistory(i),this.contentChangeDebounceTimer&&clearTimeout(this.contentChangeDebounceTimer);const d=()=>{this.dispatchEvent(new CustomEvent("content-change",{detail:{html:a3(i)},bubbles:!0}))};a.debounceInputMs>0?this.contentChangeDebounceTimer=setTimeout(d,a.debounceInputMs):d(),this.updateStatusBar()}),this.contentElement.addEventListener("contextmenu",n=>{const i=this.config.contextMenu;(i===!1||typeof i=="object"&&i!==null&&i.enabled===!1)&&n.preventDefault()}),this.contentElement.addEventListener("paste",n=>{var u,d;if(n.__editoraSmartPasteHandled===!0||n.defaultPrevented)return;n.preventDefault();const i=this.config.paste||{};let o=((u=n.clipboardData)==null?void 0:u.getData("text/html"))||"";const a=((d=n.clipboardData)==null?void 0:d.getData("text/plain"))||"",s=this.getContentSanitizeConfig(),l=this.getSecurityConfig(),c=!!o&&/class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(o);if((i.clean||!i.keepFormatting)&&a){document.execCommand("insertText",!1,a);return}if(i.convertWord===!1&&c&&a){document.execCommand("insertText",!1,a);return}if(o){l.sanitizeOnPaste!==!1&&s.sanitize!==!1&&(o=Jde(o,s,l)),this.insertHTMLAtSelection(o);return}a&&document.execCommand("insertText",!1,a)}),this.contentElement.addEventListener("focus",()=>{tf=this,this.dispatchEvent(new Event("editor-focus",{bubbles:!0})),this.updateStatusBar()}),this.contentElement.addEventListener("blur",()=>{this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&this.dispatchEvent(new CustomEvent("content-change",{detail:{html:Mb(this.contentElement)},bubbles:!0})),this.dispatchEvent(new Event("editor-blur",{bubbles:!0})),this.updateFloatingToolbar(),this.updateStatusBar()}),this.contentElement.addEventListener("keydown",n=>{this.getAccessibilityConfig().keyboardNavigation&&e.handleKeyDown(n,(o,a)=>{this.executeCommand(o,a)})});const r=()=>{const n=this.getSelectionRangeInEditor(),i=document.activeElement,o=!!i&&!!this.contentElement&&(i===this.contentElement||this.contentElement.contains(i));this.getPerformanceConfig().viewportOnlyScan&&!this.isEditorInViewport()&&!o||!n&&!o||(this.updateFloatingToolbar(),this.updateStatusBar())};this.selectionChangeHandler=r,document.addEventListener("selectionchange",this.selectionChangeHandler)}getSelectionRangeInEditor(){if(!this.contentElement)return null;const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0),n=r.commonAncestorContainer;return this.contentElement.contains(n)?r:null}isSelectionBackward(e){if(!e.anchorNode||!e.focusNode)return!1;try{const r=document.createRange();return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed}catch(r){return!1}}getSelectionAnchorRect(e,r){const n=Array.from(r.getClientRects()).filter(o=>o.width>0||o.height>0);return n.length===0?r.getBoundingClientRect():this.isSelectionBackward(e)?n[0]:n[n.length-1]}updateFloatingToolbar(){if(!this.floatingToolbar||!this.contentElement)return;if(this.config.readonly||this.contentElement.contentEditable==="false"||this.contentElement.getAttribute("data-readonly")==="true"||this.isReadonlyAttribute(this.getAttribute("readonly"))||this.getAttribute("data-readonly")==="true"){this.floatingToolbar.hide();return}const r=this.getPerformanceConfig(),n=document.activeElement===this.contentElement||!!this.contentElement&&this.contentElement.contains(document.activeElement);if(r.viewportOnlyScan&&!this.isEditorInViewport()&&!n){this.floatingToolbar.hide();return}const i=this.getSelectionRangeInEditor();if(!i){this.floatingToolbar.hide();return}if(i.collapsed){this.floatingToolbar.hide();return}const o=window.getSelection();if(!o){this.floatingToolbar.hide();return}const a=this.getSelectionAnchorRect(o,i);if(!a){this.floatingToolbar.hide();return}this.floatingToolbar.show(a.left,a.top-40)}updateStatusBar(){if(!this.statusBar||!this.contentElement)return;const e=this.getPerformanceConfig(),r=document.activeElement===this.contentElement||this.contentElement.contains(document.activeElement);if(e.viewportOnlyScan&&!this.isEditorInViewport()&&!r)return;const n=this.contentElement.textContent||"",{words:i,chars:o}=dde(n),a=ude(this.contentElement);let s,l;const c=this.getSelectionRangeInEditor();c&&(s=lde(this.contentElement,c),c.collapsed||(l=hde(c,s),s=void 0)),this.statusBar.update({wordCount:i,charCount:o,lineCount:a,cursorPosition:s,selectionInfo:l})}isReadonlyAttribute(e){return e!==null&&e!=="false"}handleAttributeChange(e,r){switch(e){case"readonly":this.contentElement&&(this.contentElement.contentEditable=this.isReadonlyAttribute(r)?"false":"true",this.applyAccessibilitySettings()),this.engine&&this.engine.setReadonly(this.isReadonlyAttribute(r));break;case"theme":this.classList.forEach(n=>{n.startsWith("editora-theme-")&&this.classList.remove(n)}),r&&this.classList.add(`editora-theme-${r}`);break;case"placeholder":this.contentElement&&(this.contentElement.setAttribute("data-placeholder",r),this.applyAccessibilitySettings());break;case"aria-label":case"accessibility":case"accessibility-enable-aria":case"accessibility-keyboard-navigation":case"accessibility-checker":this.applyAccessibilitySettings();break;case"performance":case"performance-debounce-input-ms":case"performance-viewport-only-scan":break;case"language":case"language-locale":case"language-direction":this.applyLanguageSettings();break;case"spellcheck":case"spellcheck-enabled":case"spellcheck-provider":this.applySpellcheckSettings();break;case"autosave":case"autosave-enabled":case"autosave-interval-ms":case"autosave-storage-key":case"autosave-provider":case"autosave-api-url":this.startAutosave();break;case"security":case"security-sanitize-on-paste":case"security-sanitize-on-input":case"paste":case"paste-clean":case"paste-keep-formatting":case"paste-convert-word":case"context-menu":case"context-menu-enabled":break;case"toolbar":case"toolbar-items":case"toolbar-floating":case"toolbar-sticky":case"plugins":case"statusbar":this.isConnected&&(this.destroy(),this.waitForPluginLoader().then(()=>{this.initialize().catch(n=>{console.error("[RichTextEditor] Error during attribute change re-initialization:",n)})}));break}}resolveConfig(){const e={};for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r];e[n.name]=n.value}return b8.resolve({jsConfig:this.jsConfig,attributes:e})}getAPI(){return{getContent:()=>Mb(this.contentElement),setContent:e=>{this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))},execCommand:(e,r)=>this.executeCommand(e,r),focus:()=>{var e;(e=this.contentElement)==null||e.focus()},blur:()=>{var e;(e=this.contentElement)==null||e.blur()},destroy:()=>{this.destroy()},on:(e,r)=>(this.addEventListener(e,r),()=>this.removeEventListener(e,r)),getConfig:()=>({...this.config}),setReadonly:e=>{this.setAttribute("readonly",e.toString())}}}destroy(){var e,r,n,i;this.buildGeneration+=1,this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&(this.preservedContent=Mb(this.contentElement),this.persistAutosave(this.preservedContent)),this.stopAutosave(),this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),(e=this.engine)==null||e.destroy(),(r=this.toolbar)==null||r.destroy(),(n=this.floatingToolbar)==null||n.destroy(),(i=this.statusBar)==null||i.destroy(),this.innerHTML="",this.contentElement=void 0,this.toolbarElement=void 0,this.statusBarElement=void 0,this.loadedPlugins=[],this.isInitialized=!1,v8.delete(this),tf===this&&(tf=null),this.dispatchEvent(new Event("editor-destroy",{bubbles:!0}))}getContent(){return Mb(this.contentElement)}setContent(e){this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))}execCommand(e,...r){return this.executeCommand(e,...r)}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}}const Gw=new jA;gl.__globalPluginLoader=Gw;const dhe={bold:()=>Promise.resolve().then(()=>ghe).then(t=>t.BoldPlugin()),italic:()=>Promise.resolve().then(()=>vhe).then(t=>t.ItalicPlugin()),underline:()=>Promise.resolve().then(()=>yhe).then(t=>t.UnderlinePlugin()),strikethrough:()=>Promise.resolve().then(()=>Ehe).then(t=>t.StrikethroughPlugin()),clearFormatting:()=>Promise.resolve().then(()=>Rhe).then(t=>t.ClearFormattingPlugin()),heading:()=>Promise.resolve().then(()=>Yhe).then(t=>t.HeadingPlugin()),blockquote:()=>Promise.resolve().then(()=>cfe).then(t=>t.BlockquotePlugin()),code:()=>Promise.resolve().then(()=>EAe).then(t=>t.CodePlugin()),codeSample:()=>Promise.resolve().then(()=>NAe).then(t=>t.CodeSamplePlugin()),list:()=>Promise.resolve().then(()=>WAe).then(t=>t.ListPlugin()),checklist:()=>Promise.resolve().then(()=>spe).then(t=>t.ChecklistPlugin()),textAlignment:()=>Promise.resolve().then(()=>upe).then(t=>t.TextAlignmentPlugin()),indent:()=>Promise.resolve().then(()=>dpe).then(t=>t.IndentPlugin()),direction:()=>Promise.resolve().then(()=>ype).then(t=>t.DirectionPlugin()),textColor:()=>Promise.resolve().then(()=>Npe).then(t=>t.TextColorPlugin()),backgroundColor:()=>Promise.resolve().then(()=>jpe).then(t=>t.BackgroundColorPlugin()),fontSize:()=>Promise.resolve().then(()=>rme).then(t=>t.FontSizePlugin()),fontFamily:()=>Promise.resolve().then(()=>fme).then(t=>t.FontFamilyPlugin()),formatPainter:()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),"format-painter":()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),formatpainter:()=>Promise.resolve().then(()=>bS).then(t=>t.FormatPainterPlugin()),lineHeight:()=>Promise.resolve().then(()=>vge).then(t=>t.LineHeightPlugin()),capitalization:()=>Promise.resolve().then(()=>Lge).then(t=>t.CapitalizationPlugin()),history:()=>Promise.resolve().then(()=>$ge).then(t=>t.HistoryPlugin()),link:()=>Promise.resolve().then(()=>Gge).then(t=>t.LinkPlugin()),table:()=>Promise.resolve().then(()=>y0e).then(t=>t.TablePlugin()),trackChanges:()=>Promise.resolve().then(()=>t1e).then(t=>t.TrackChangesPlugin()),versionDiff:()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),"version-diff":()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),versiondiff:()=>Promise.resolve().then(()=>rB).then(t=>t.VersionDiffPlugin()),conditionalContent:()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),"conditional-content":()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),conditionalcontent:()=>Promise.resolve().then(()=>lB).then(t=>t.ConditionalContentPlugin()),dataBinding:()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),"data-binding":()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),databinding:()=>Promise.resolve().then(()=>mB).then(t=>t.DataBindingPlugin()),docSchema:()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),"doc-schema":()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),docschema:()=>Promise.resolve().then(()=>SB).then(t=>t.DocSchemaPlugin()),translationWorkflow:()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),"translation-workflow":()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),translationworkflow:()=>Promise.resolve().then(()=>HB).then(t=>t.TranslationWorkflowPlugin()),contentRules:()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),"content-rules":()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),contentrules:()=>Promise.resolve().then(()=>GB).then(t=>t.ContentRulesPlugin()),citations:()=>Promise.resolve().then(()=>bQ).then(t=>t.CitationsPlugin()),citation:()=>Promise.resolve().then(()=>bQ).then(t=>t.CitationsPlugin()),approvalWorkflow:()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),"approval-workflow":()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),approvalworkflow:()=>Promise.resolve().then(()=>h7).then(t=>t.ApprovalWorkflowPlugin()),piiRedaction:()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),"pii-redaction":()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),piiredaction:()=>Promise.resolve().then(()=>C7).then(t=>t.PIIRedactionPlugin()),smartPaste:()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),"smart-paste":()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),smartpaste:()=>Promise.resolve().then(()=>N7).then(t=>t.SmartPastePlugin()),blocksLibrary:()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),"blocks-library":()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),blockslibrary:()=>Promise.resolve().then(()=>Q7).then(t=>t.BlocksLibraryPlugin()),mentions:()=>Promise.resolve().then(()=>Qq).then(t=>t.MentionPlugin()),mention:()=>Promise.resolve().then(()=>Qq).then(t=>t.MentionPlugin()),anchor:()=>Promise.resolve().then(()=>nxe).then(t=>t.AnchorPlugin()),embedIframe:()=>Promise.resolve().then(()=>kxe).then(t=>t.EmbedIframePlugin()),math:()=>Promise.resolve().then(()=>zxe).then(t=>t.MathPlugin()),image:()=>Promise.resolve().then(()=>GEe).then(t=>t.MediaManagerPlugin()),mergeTag:()=>Promise.resolve().then(()=>pCe).then(t=>t.MergeTagPlugin()),pageBreak:()=>Promise.resolve().then(()=>kCe).then(t=>t.PageBreakPlugin()),print:()=>Promise.resolve().then(()=>BCe).then(t=>t.PrintPlugin()),preview:()=>Promise.resolve().then(()=>UCe).then(t=>t.PreviewPlugin()),specialCharacters:()=>Promise.resolve().then(()=>qCe).then(t=>t.SpecialCharactersPlugin()),slashCommands:()=>Promise.resolve().then(()=>jW).then(t=>t.SlashCommandsPlugin()),"slash-commands":()=>Promise.resolve().then(()=>jW).then(t=>t.SlashCommandsPlugin()),spellCheck:()=>Promise.resolve().then(()=>W4e).then(t=>t.SpellCheckPlugin()),emojis:()=>Promise.resolve().then(()=>t6e).then(t=>t.EmojisPlugin()),a11yChecker:()=>Promise.resolve().then(()=>o6e).then(t=>t.A11yCheckerPlugin()),comments:()=>Promise.resolve().then(()=>Z6e).then(t=>t.CommentsPlugin()),collaboration:()=>Promise.resolve().then(()=>sBe).then(t=>t.CollaborationPlugin()),"document-manager":()=>Promise.resolve().then(()=>uBe).then(t=>t.DocumentManagerPlugin()),fullscreen:()=>Promise.resolve().then(()=>hBe).then(t=>t.FullscreenPlugin()),template:()=>Promise.resolve().then(()=>BBe).then(t=>t.TemplatePlugin()),footnote:()=>Promise.resolve().then(()=>$Be).then(t=>t.FootnotePlugin())};async function d3(){return Object.entries(dhe).forEach(([t,e])=>{Gw.register(t,e)}),Gw}typeof window!="undefined"&&d3().then(t=>{gl.__globalPluginLoader=t,customElements.get("editora-editor")||customElements.define("editora-editor",gl);const e=document.querySelectorAll("editora-editor:not([data-initial-content])"),r=[];e.forEach(o=>{const a=o.innerHTML.trim();r.push(a),a&&o.setAttribute("data-initial-content",a)});const n=document.querySelectorAll("editora-editor");Array.from(n).filter(o=>!o.hasAttribute("data-initial-content")).forEach(o=>{const a=Array.from(n).indexOf(o);r[a]&&o.setAttribute("data-initial-content",r[a])}),window.Editora={version:"1.0.0",plugins:Gw.getRegisteredPluginNames(),WebComponent:gl,init:async(o,a)=>{const s=document.querySelector(o);return s instanceof gl?(a&&await s.setConfig(a),s.getAPI()):null}}});const Xw="data-editora-selection-marker";function hhe(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function h3(t){return t?t.getAttribute("contenteditable")==="true"?t:t.querySelector('[contenteditable="true"]'):null}function fhe(t){var a;if((t==null?void 0:t.contentElement)instanceof HTMLElement)return t.contentElement;const e=h3((a=t==null?void 0:t.editorElement)!=null?a:null);if(e)return e;const r=typeof window!="undefined"?window.__editoraCommandEditorRoot:null,n=r instanceof HTMLElement?h3(r):null;if(n)return n;const i=window.getSelection();if(i&&i.rangeCount>0){const s=hhe(i.getRangeAt(0).startContainer),l=s==null?void 0:s.closest('.rte-content, .editora-content, [contenteditable="true"]');if(l instanceof HTMLElement)return l}const o=document.activeElement;if(o instanceof HTMLElement){const s=o.closest('.rte-content, .editora-content, [contenteditable="true"]');if(s instanceof HTMLElement)return s}return document.querySelector('.rte-content, .editora-content, [contenteditable="true"]')}function Ahe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const r=e.getRangeAt(0);return t.contains(r.startContainer)&&t.contains(r.endContainer)}function f3(t){const e=document.createElement("span");return e.setAttribute(Xw,t),e.style.display="inline-block",e.style.width="0",e.style.height="0",e.style.overflow="hidden",e.style.lineHeight="0",e.appendChild(document.createTextNode("\uFEFF")),e}function phe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);if(!t.contains(r.startContainer)||!t.contains(r.endContainer))return null;const n=r.collapsed,i=f3("start"),o=n?null:f3("end"),a=r.cloneRange();if(o){const l=a.cloneRange();l.collapse(!1),l.insertNode(o)}const s=a.cloneRange();return s.collapse(!0),s.insertNode(i),()=>{const l=window.getSelection(),c=document.createRange(),u=t.querySelector(`[${Xw}="start"]`),d=t.querySelector(`[${Xw}="end"]`);if(!l||!u){t.querySelectorAll(`[${Xw}]`).forEach(h=>h.remove());return}n||!d?(c.setStartBefore(u),c.collapse(!0)):(c.setStartAfter(u),c.setEndBefore(d)),l.removeAllRanges(),l.addRange(c),u.remove(),d==null||d.remove()}}function mhe(t,e,r){if(e!==r){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",t,e,r);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}catch(n){}}}function Yw(t){const e=fhe(t.context);if(!e)return!1;const r=e.innerHTML;Ahe(e)&&e.focus({preventScroll:!0});let n=!1;try{n=document.execCommand(t.command,!1)}catch(a){n=!1}const i=e.innerHTML;if(t.normalize&&i!==r){const a=phe(e);t.normalize(e),a==null||a()}const o=e.innerHTML;return r!==o&&(mhe(e,r,o),e.dispatchEvent(new Event("input",{bubbles:!0}))),n!==!1||r!==o}const ghe=Object.freeze(Object.defineProperty({__proto__:null,BoldPlugin:()=>({name:"bold",marks:{bold:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight",getAttrs:t=>{const e=typeof t=="string"?t:t.style.fontWeight;return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}],toDOM:()=>["strong",0]}},toolbar:[{label:"Bold",command:"toggleBold",icon:'<svg width="24" height="24" focusable="false"><path d="M7.8 19c-.3 0-.5 0-.6-.2l-.2-.5V5.7c0-.2 0-.4.2-.5l.6-.2h5c1.5 0 2.7.3 3.5 1 .7.6 1.1 1.4 1.1 2.5a3 3 0 0 1-.6 1.9c-.4.6-1 1-1.6 1.2.4.1.9.3 1.3.6s.8.7 1 1.2c.4.4.5 1 .5 1.6 0 1.3-.4 2.3-1.3 3-.8.7-2.1 1-3.8 1H7.8Zm5-8.3c.6 0 1.2-.1 1.6-.5.4-.3.6-.7.6-1.3 0-1.1-.8-1.7-2.3-1.7H9.3v3.5h3.4Zm.5 6c.7 0 1.3-.1 1.7-.4.4-.4.6-.9.6-1.5s-.2-1-.7-1.4c-.4-.3-1-.4-2-.4H9.4v3.8h4Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-b"}],commands:{toggleBold:(t,e)=>Yw({command:"bold",context:e})},keymap:{"Mod-b":"toggleBold","Mod-B":"toggleBold"}})},Symbol.toStringTag,{value:"Module"})),x8=(t,e)=>Yw({command:"italic",context:e}),bhe=(t,e)=>{var r;typeof window!="undefined"&&((r=window.registerEditorCommand)==null||r.call(window,t,e))},A3=()=>{bhe("toggleItalic",x8)};typeof window!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",A3):A3());const vhe=Object.freeze(Object.defineProperty({__proto__:null,ItalicPlugin:()=>({name:"italic",marks:{italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}},toolbar:[{label:"Italic",command:"toggleItalic",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-i"}],commands:{toggleItalic:x8},keymap:{"Mod-i":"toggleItalic","Mod-I":"toggleItalic"}}),toggleItalic:x8},Symbol.toStringTag,{value:"Module"})),yhe=Object.freeze(Object.defineProperty({__proto__:null,UnderlinePlugin:()=>({name:"underline",marks:{underline:{parseDOM:[{tag:"u"}],toDOM:()=>["u",{},0]}},toolbar:[{label:"Underline",command:"toggleUnderline",icon:'<svg width="24" height="24" focusable="false"><path d="M16 5c.6 0 1 .4 1 1v7c0 2.8-2.2 5-5 5s-5-2.2-5-5V6c0-.6.4-1 1-1s1 .4 1 1v7c0 1.7 1.3 3 3 3s3-1.3 3-3V6c0-.6.4-1 1-1ZM4 17h16c.6 0 1 .4 1 1s-.4 1-1 1H4a1 1 0 1 1 0-2Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-u"}],commands:{toggleUnderline:(t,e)=>Yw({command:"underline",context:e})},keymap:{"Mod-u":"toggleUnderline","Mod-U":"toggleUnderline"}})},Symbol.toStringTag,{value:"Module"})),whe=()=>({name:"strikethrough",marks:{strikethrough:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>(typeof t=="string"?t:t.style.textDecoration)==="line-through"&&null}],toDOM:()=>["s",0]}},toolbar:[{label:"Strikethrough",command:"toggleStrikethrough",icon:'<svg width="24" height="24" focusable="false"><g fill-rule="evenodd"><path d="M15.6 8.5c-.5-.7-1-1.1-1.3-1.3-.6-.4-1.3-.6-2-.6-2.7 0-2.8 1.7-2.8 2.1 0 1.6 1.8 2 3.2 2.3 4.4.9 4.6 2.8 4.6 3.9 0 1.4-.7 4.1-5 4.1A6.2 6.2 0 0 1 7 16.4l1.5-1.1c.4.6 1.6 2 3.7 2 1.6 0 2.5-.4 3-1.2.4-.8.3-2-.8-2.6-.7-.4-1.6-.7-2.9-1-1-.2-3.9-.8-3.9-3.6C7.6 6 10.3 5 12.4 5c2.9 0 4.2 1.6 4.7 2.4l-1.5 1.1Z"></path><path d="M5 11h14a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z" fill-rule="nonzero"></path></g></svg>',shortcut:"Mod-Shift-x"}],commands:{toggleStrikethrough:(t,e)=>Yw({command:"strikeThrough",context:e,normalize:xhe})},keymap:{"Mod-Shift-x":"toggleStrikethrough","Mod-Shift-X":"toggleStrikethrough"}});function xhe(t){t.querySelectorAll("strike, del").forEach(r=>{var i;const n=document.createElement("s");for(const o of Array.from(r.attributes))o.name!=="style"&&n.setAttribute(o.name,o.value);for(;r.firstChild;)n.appendChild(r.firstChild);(i=r.parentNode)==null||i.replaceChild(n,r)})}const Ehe=Object.freeze(Object.defineProperty({__proto__:null,StrikethroughPlugin:whe},Symbol.toStringTag,{value:"Module"}));function Fo(t,e,r=t==null?void 0:t.innerHTML){if(!t||typeof r!="string"||e===r)return!1;try{if(typeof window.execEditorCommand=="function")return window.execEditorCommand("recordDomTransaction",t,e,r)!==!1;if(typeof window.executeEditorCommand=="function")return window.executeEditorCommand("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})!==!1}catch(n){}return!1}const Che=()=>({name:"clearFormatting",toolbar:[{label:"Clear Formatting",command:"clearFormatting",icon:'<svg width="24" height="24" focusable="false"><path d="M13.2 6a1 1 0 0 1 0 .2l-2.6 10a1 1 0 0 1-1 .8h-.2a.8.8 0 0 1-.8-1l2.6-10H8a1 1 0 1 1 0-2h9a1 1 0 0 1 0 2h-3.8ZM5 18h7a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Zm13 1.5L16.5 18 15 19.5a.7.7 0 0 1-1-1l1.5-1.5-1.5-1.5a.7.7 0 0 1 1-1l1.5 1.5 1.5-1.5a.7.7 0 0 1 1 1L17.5 17l1.5 1.5a.7.7 0 0 1-1 1Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-\\"}],commands:{clearFormatting:()=>{const t=Bhe();if(!t)return!1;const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const r=e.getRangeAt(0);if(!t.contains(r.commonAncestorContainer))return!1;const n=r.cloneRange(),i=t.innerHTML;return t.focus({preventScroll:!0}),Nhe(t,n),Uhe(t,n),Fo(t,i),t.dispatchEvent(new Event("input",{bubbles:!0})),!0}},keymap:{"Mod-\\":"clearFormatting"}}),The=new Set(["A","B","STRONG","I","EM","U","S","STRIKE","DEL","FONT","MARK","CODE","SUB","SUP"]),khe=new Set(["H1","H2","H3","H4","H5","H6","BLOCKQUOTE","PRE"]),She=["color","background-color","font-size","font-family","font-weight","font-style","text-decoration","text-transform","line-height","letter-spacing","word-spacing","vertical-align","text-align","padding-left"];function Bhe(){const t=window.getSelection();if(t&&t.rangeCount>0){const r=t.getRangeAt(0).startContainer,n=r.nodeType===Node.ELEMENT_NODE?r:r.parentElement,i=n==null?void 0:n.closest('[contenteditable="true"], .rte-content, .editora-content');if(i)return i}const e=document.activeElement;return e?e.getAttribute("contenteditable")==="true"?e:e.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function p3(t,e){try{if(typeof t.intersectsNode=="function")return t.intersectsNode(e)}catch(n){}const r=document.createRange();return e.nodeType===Node.ELEMENT_NODE?r.selectNodeContents(e):r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)>0&&t.compareBoundaryPoints(Range.START_TO_END,r)<0}function Zw(t){let e=0,r=t;for(;r&&r.parentNode;)e+=1,r=r.parentNode;return e}function Dhe(t){She.forEach(e=>{t.style.removeProperty(e)}),(!t.getAttribute("style")||t.style.length===0)&&t.removeAttribute("style"),t.classList.contains("rte-text-color")&&t.classList.remove("rte-text-color"),t.classList.contains("rte-bg-color")&&t.classList.remove("rte-bg-color"),t.classList.contains("rte-format-painted")&&t.classList.remove("rte-format-painted"),t.classList.length===0&&t.removeAttribute("class")}function E8(t){const e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}function _he(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function m3(t){Array.from(t.children).forEach(e=>{_he(e)&&e.remove()})}function g3(t){m3(t),E8(t)}function b3(t){var r;const e=document.createElement("p");for(Array.from(t.attributes).forEach(n=>{e.setAttribute(n.name,n.value)});t.firstChild;)e.appendChild(t.firstChild);e.innerHTML.trim()||(e.innerHTML="<br>"),(r=t.parentNode)==null||r.replaceChild(e,t)}function Lhe(t){return!/^(A|B|STRONG|I|EM|U|S|STRIKE|DEL|FONT|MARK|CODE|SUB|SUP|SPAN)$/.test(t.tagName)||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, svg, math")}function Ihe(t){Array.from(t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span")).sort((r,n)=>Zw(n)-Zw(r)).forEach(r=>{r.isConnected&&Lhe(r)&&r.remove()})}function Fhe(t){if(m3(t),t.parentElement instanceof HTMLLIElement){g3(t);return}if(Array.from(t.childNodes).filter(i=>i.nodeType!==Node.TEXT_NODE||(i.textContent||"").trim()!=="").some(i=>i instanceof HTMLElement&&/^(P|DIV|H[1-6]|UL|OL|PRE|TABLE|BLOCKQUOTE)$/.test(i.tagName))){g3(t);return}b3(t)}function Uhe(t,e){Array.from(t.querySelectorAll("h1,h2,h3,h4,h5,h6,blockquote,pre")).forEach(n=>{if(p3(e,n)&&khe.has(n.tagName)){if(n.tagName==="BLOCKQUOTE"){Fhe(n);return}b3(n)}})}function Nhe(t,e){const r=Array.from(t.querySelectorAll("a,b,strong,i,em,u,s,strike,del,font,mark,code,sub,sup,span,[style],[class]"));r.sort((n,i)=>Zw(i)-Zw(n)),r.forEach(n=>{if(n.isConnected&&p3(e,n)&&!(n.getAttribute("contenteditable")==="false"||n.closest('[contenteditable="false"]'))){if(Dhe(n),The.has(n.tagName)){E8(n);return}n.tagName==="SPAN"&&n.attributes.length===0&&E8(n)}}),Ihe(t)}const Rhe=Object.freeze(Object.defineProperty({__proto__:null,ClearFormattingPlugin:Che},Symbol.toStringTag,{value:"Module"})),Pb='.rte-content, .editora-content, [contenteditable="true"]',Mhe="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",v3=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","PRE"]),y3="p,div,h1,h2,h3,h4,h5,h6,ul,ol,blockquote,pre,table",Ohe=new Set(["p","h1","h2","h3","h4","h5","h6"]);function w3(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Phe(t){const e=t==null?void 0:t.contentElement;if(e instanceof HTMLElement)return e;const r=t==null?void 0:t.editorElement;if(r instanceof HTMLElement){const a=r.querySelector(Pb);if(a instanceof HTMLElement)return a;if(r.getAttribute("contenteditable")==="true")return r}const n=window.getSelection();if(n&&n.rangeCount>0){const a=w3(n.getRangeAt(0).startContainer),s=a==null?void 0:a.closest(Pb);if(s instanceof HTMLElement)return s;const l=a==null?void 0:a.closest(Mhe),c=l==null?void 0:l.querySelector(Pb);if(c instanceof HTMLElement)return c}const i=document.activeElement,o=i==null?void 0:i.closest(Pb);return o instanceof HTMLElement?o:document.querySelector(Pb)}function Hhe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);return!t.contains(r.startContainer)||!t.contains(r.endContainer)?null:r}function x3(t,e){let r=w3(e);if(!r||r===t||!t.contains(r))return null;for(;r.parentElement&&r.parentElement!==t;)r=r.parentElement;if(r.parentElement!==t)return null;if(r.matches(y3))return r;const n=r.closest(y3);return n instanceof HTMLElement&&n.parentElement===t?n:r}function E3(t,e){if(typeof t.intersectsNode=="function")try{return t.intersectsNode(e)}catch(n){return!1}const r=document.createRange();return r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)<0&&t.compareBoundaryPoints(Range.START_TO_END,r)>0}function zhe(t,e){const r=x3(t,e.startContainer),n=x3(t,e.endContainer);if(!r)return[];if(!n||r===n)return[r];const o=Array.from(t.children).filter(a=>a instanceof HTMLElement).filter(a=>E3(e,a));return o.length>0?o:[r]}function $he(t,e){Array.from(t.attributes).forEach(r=>{e.setAttribute(r.name,r.value)})}function C8(t,e){for(;t.firstChild;)e.appendChild(t.firstChild)}function Qhe(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function Jw(t,e){const r=document.createElement(t);return e&&$he(e,r),r}function C3(t,e){const r=Jw(e,t);return C8(t,r),r.innerHTML.trim()||(r.innerHTML="<br>"),r}function qhe(t){const e=t.cloneNode(!1);return e instanceof HTMLElement?e:document.createElement(t.tagName.toLowerCase())}function T3(t,e,r){const n=t.parentNode;if(!n)return[];const i=document.createDocumentFragment(),o=[];let a=null;const s=()=>{a&&a.children.length>0&&i.appendChild(a),a=null};return Array.from(t.children).forEach(l=>{if(l instanceof HTMLLIElement){if(e.has(l)){s();const c=C3(l,r);i.appendChild(c),o.push(c);return}a||(a=qhe(t)),a.appendChild(l)}}),s(),n.insertBefore(i,t),n.removeChild(t),o}function jhe(t,e){var n;if(t.tagName.toLowerCase()===e)return[t];const r=Jw(e,t);return C8(t,r),r.innerHTML.trim()||(r.innerHTML="<br>"),(n=t.parentNode)==null||n.replaceChild(r,t),[r]}function Whe(t,e){const r=t.parentNode;if(!r)return[];const n=document.createDocumentFragment(),i=[];return Array.from(t.childNodes).forEach(o=>{if(o instanceof HTMLElement&&Qhe(o)){o.remove();return}if(o instanceof HTMLUListElement||o instanceof HTMLOListElement){Array.from(o.children).forEach(s=>{if(!(s instanceof HTMLLIElement))return;const l=C3(s,e);n.appendChild(l),i.push(l)}),o.remove();return}if(o instanceof HTMLElement&&v3.has(o.tagName)){const s=Jw(e,o);C8(o,s),n.appendChild(s),i.push(s);return}if(o.nodeType===Node.TEXT_NODE&&(o.textContent||"").trim()===""){o.remove();return}const a=Jw(e,t);a.appendChild(o),n.appendChild(a),i.push(a)}),r.insertBefore(n,t),r.removeChild(t),i}function Khe(t){const e=window.getSelection();if(!e)return;const r=document.createRange(),n=t instanceof HTMLElement&&t.querySelector("p,li,h1,h2,h3,h4,h5,h6")||t;r.selectNodeContents(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function Vhe(t){t.dispatchEvent(new Event("input",{bubbles:!0}))}function Ghe(t,e,r){const n=window.execEditorCommand;if(typeof n=="function"){n("recordDomTransaction",t,e,r);return}const i=window.executeEditorCommand;typeof i=="function"&&i("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}function Xhe(t,e){const r=new Map;return Array.from(t.querySelectorAll("li")).filter(i=>i instanceof HTMLLIElement&&E3(e,i)).forEach(i=>{var a;const o=i.parentElement;(o instanceof HTMLUListElement||o instanceof HTMLOListElement)&&o.parentElement===t&&(r.has(o)||r.set(o,new Set),(a=r.get(o))==null||a.add(i))}),r}function Hb(t,e){const r=t.toLowerCase();if(!Ohe.has(r))return!1;const n=Phe(e);if(!n)return!1;const i=Hhe(n);if(!i)return!1;const o=n.innerHTML,a=[],s=Xhe(n,i),l={startContainer:i.startContainer,startOffset:i.startOffset,endContainer:i.endContainer,endOffset:i.endOffset};s.size>0?s.forEach((u,d)=>{a.push(...T3(d,u,r))}):zhe(n,i).forEach(d=>{if(d instanceof HTMLUListElement||d instanceof HTMLOListElement){const h=new Set(Array.from(d.children).filter(f=>f instanceof HTMLLIElement));a.push(...T3(d,h,r));return}if(v3.has(d.tagName)){const h=d.querySelector(":scope > ul, :scope > ol, :scope > blockquote, :scope > table");a.push(...h?Whe(d,r):jhe(d,r))}});const c=n.innerHTML;if(o===c||a.length===0)return!1;if(Ghe(n,o,c),Vhe(n),n.contains(l.startContainer)&&n.contains(l.endContainer)){const u=document.createRange();u.setStart(l.startContainer,l.startOffset),u.setEnd(l.endContainer,l.endOffset);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(u)}else Khe(a[0]);return!0}const Yhe=Object.freeze(Object.defineProperty({__proto__:null,HeadingPlugin:()=>({name:"heading",toolbar:[{label:"P",command:"setBlockType",type:"dropdown",options:[{value:"p",label:"P"},{value:"h1",label:"H1"},{value:"h2",label:"H2"},{value:"h3",label:"H3"},{value:"h4",label:"H4"},{value:"h5",label:"H5"},{value:"h6",label:"H6"}],icon:'<svg width="24" height="24" focusable="false"><path d="M16.1 8.6 14.2 4l-1.4.5 2.8 7.4c.1.4.5.6.9.6h.1c.4-.1.6-.5.6-.9l1.8-4.8-1.4-.5-1.5 2.3ZM4 11.5h6V10H4v1.5ZM18.5 3v1L17 7l.9.9L20.7 3h-2.2ZM5.5 12h1v7h1v-7h1v-.5h-3V12Zm4 0h1v7h1v-7h1v-.5h-3V12Zm10 1.5a2 2 0 0 0-2-2h-1v7.5h1v-2.7h1a2 2 0 0 0 2-2v-.8Zm-2 1.3h-1v-2.3h1a.8.8 0 1 1 0 1.6v.7Z" fill-rule="evenodd"></path></svg>'}],commands:{setBlockType:(t,e)=>t?Hb(t,e):!1,setHeading1:(t,e)=>Hb("h1",e),setHeading2:(t,e)=>Hb("h2",e),setHeading3:(t,e)=>Hb("h3",e),setParagraph:(t,e)=>Hb("p",e)},keymap:{"Mod-Alt-1":"setHeading1","Mod-Alt-2":"setHeading2","Mod-Alt-3":"setHeading3","Mod-Alt-0":"setParagraph"}})},Symbol.toStringTag,{value:"Module"})),zb='.rte-content, .editora-content, [contenteditable="true"]',Zhe="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",k3=["p","div","h1","h2","h3","h4","h5","h6","ul","ol","blockquote","pre","table"].join(",");function T8(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function Jhe(t){const e=t==null?void 0:t.contentElement;if(e instanceof HTMLElement)return e;const r=t==null?void 0:t.editorElement;if(r instanceof HTMLElement){const a=r.querySelector(zb);if(a instanceof HTMLElement)return a;if(r.getAttribute("contenteditable")==="true")return r}const n=window.getSelection();if(n&&n.rangeCount>0){const a=T8(n.getRangeAt(0).startContainer),s=a==null?void 0:a.closest(zb);if(s instanceof HTMLElement)return s;const l=a==null?void 0:a.closest(Zhe),c=l==null?void 0:l.querySelector(zb);if(c instanceof HTMLElement)return c}const i=document.activeElement,o=i==null?void 0:i.closest(zb);return o instanceof HTMLElement?o:document.querySelector(zb)}function efe(t){const e=window.getSelection();if(!e||e.rangeCount===0)return null;const r=e.getRangeAt(0);return!t.contains(r.startContainer)||!t.contains(r.endContainer)?null:r}function S3(t,e){let r=T8(e);if(!r||r===t||!t.contains(r))return null;for(;r.parentElement&&r.parentElement!==t;)r=r.parentElement;if(r.parentElement!==t)return null;if(r.matches(k3))return r;const n=r.closest(k3);return n instanceof HTMLElement&&n.parentElement===t?n:r}function B3(t,e){if(typeof t.intersectsNode=="function")try{return t.intersectsNode(e)}catch(n){return!1}const r=document.createRange();return r.selectNode(e),t.compareBoundaryPoints(Range.END_TO_START,r)<0&&t.compareBoundaryPoints(Range.START_TO_END,r)>0}function tfe(t,e){const r=S3(t,e.startContainer),n=S3(t,e.endContainer);if(!r)return[];if(!n||r===n)return[r];const o=Array.from(t.children).filter(a=>a instanceof HTMLElement).filter(a=>B3(e,a));return o.length>0?o:[r]}function D3(t,e){const r=T8(e),n=r==null?void 0:r.closest("blockquote");return n instanceof HTMLQuoteElement&&t.contains(n)?n:null}function rfe(t){return t.tagName!=="P"||t.attributes.length>0||(t.textContent||"").trim()!==""?!1:!t.querySelector("img, video, table, iframe, hr, pre, ul, ol")}function nfe(t){Array.from(t.children).forEach(e=>{rfe(e)&&e.remove()})}function k8(t){nfe(t);const e=t.parentNode;if(!e)return;Array.from(t.childNodes).forEach(n=>{e.insertBefore(n,t)}),e.removeChild(t)}function _3(t){return t.nodeType===Node.TEXT_NODE&&(t.textContent||"").trim()===""}function L3(t){const e=Array.from(t.childNodes).filter(n=>!_3(n));if(e.length!==1)return null;const r=e[0];return r instanceof HTMLQuoteElement?r:null}function ife(t){const e=document.createElement("blockquote");return Array.from(t.childNodes).filter(n=>!_3(n)).forEach(n=>{e.appendChild(n)}),e.childNodes.length||(e.innerHTML="<br>"),t.appendChild(e),e}function ofe(t,e){const r=Array.from(t.querySelectorAll("li")).filter(i=>i instanceof HTMLLIElement&&B3(e,i)),n=new Set(r);return r.filter(i=>{var a,s;let o=(a=i.parentElement)==null?void 0:a.closest("li");for(;o;){if(n.has(o))return!1;o=(s=o.parentElement)==null?void 0:s.closest("li")}return!0})}function $b(t){const e=window.getSelection();if(!e)return;const r=document.createRange(),n=t instanceof HTMLElement&&t.querySelector("p,li,h1,h2,h3,h4,h5,h6")||t;r.selectNodeContents(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}function afe(t){t.dispatchEvent(new Event("input",{bubbles:!0}))}function sfe(t,e,r){const n=window.execEditorCommand;if(typeof n=="function"){n("recordDomTransaction",t,e,r);return}const i=window.executeEditorCommand;typeof i=="function"&&i("recordDomTransaction",{editor:t,beforeHTML:e,afterHTML:r})}function lfe(t){var u,d;const e=Jhe(t);if(!e)return!1;const r=efe(e);if(!r)return!1;const n=e.innerHTML,i=D3(e,r.startContainer),o=D3(e,r.endContainer),a=ofe(e,r),s=tfe(e,r),l=s.length>0&&s.every(h=>h.tagName==="BLOCKQUOTE");if(i&&i===o){const h=i.firstChild||i;k8(i),$b(h)}else if(a.length>0){const h=a.map(L3);if(h.every(Boolean)){const A=((u=h[0])==null?void 0:u.firstChild)||a[0];h.forEach(p=>{p&&k8(p)}),$b(A)}else{const A=a[0];a.forEach(p=>{L3(p)||ife(p)}),$b(A)}}else if(l){const h=s[0].firstChild||s[0];s.forEach(k8),$b(h)}else{const h=s.filter(p=>p.tagName!=="BLOCKQUOTE");if(h.length===0)return!1;const f=document.createElement("blockquote"),A=h[0];(d=A.parentNode)==null||d.insertBefore(f,A),h.forEach(p=>{f.appendChild(p)}),$b(f)}const c=e.innerHTML;return n===c?!1:(sfe(e,n,c),afe(e),!0)}const cfe=Object.freeze(Object.defineProperty({__proto__:null,BlockquotePlugin:()=>({name:"blockquote",nodes:{blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]}},toolbar:[{label:"Quote",command:"toggleBlockquote",icon:'<svg fill="#000000" height="24px" width="24px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" xml:space="preserve"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <g> <path d="M13,11c0.6,0,1-0.4,1-1s-0.4-1-1-1c-5,0-9,4-9,9c0,2.8,2.2,5,5,5s5-2.2,5-5s-2.2-5-5-5c-0.3,0-0.7,0-1,0.1 C9.3,11.8,11,11,13,11z"></path> <path d="M23,13c-0.3,0-0.7,0-1,0.1c1.3-1.3,3-2.1,5-2.1c0.6,0,1-0.4,1-1s-0.4-1-1-1c-5,0-9,4-9,9c0,2.8,2.2,5,5,5s5-2.2,5-5 S25.8,13,23,13z"></path> </g> </g></svg>',shortcut:"Mod-Shift-9"}],commands:{toggleBlockquote:(t,e)=>lfe(e)},keymap:{"Mod-Shift-9":"toggleBlockquote"}})},Symbol.toStringTag,{value:"Module"}));function ufe(t){let e=!1;t.addEventListener("pointerdown",r=>{e=r.target!==t},!0),t.addEventListener("click",r=>{r.target===t&&e&&r.stopImmediatePropagation(),e=!1},!0)}const I3="rte-dialog-base-styles";function dfe(){if(typeof document=="undefined"||document.getElementById(I3))return;const t=document.createElement("style");t.id=I3,t.textContent=`
12
12
  [data-rte-dialog] {
13
13
  font-family: var(--rte-font-family-base, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editora/core",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Framework-agnostic rich text editor (WYSIWYG) with a plugin system, an accessible toolbar and TypeScript types. Works in plain JavaScript, React and any other framework.",
5
5
  "author": "Ajay Kumar <ajaykr089@gmail.com>",
6
6
  "license": "MIT",