@paroicms/quill-editor-plugin 1.23.1 → 1.24.0
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.
- package/backend/dist/plugin.js +2 -2
- package/backend/dist/quill-delta.js +8 -4
- package/bo-front/dist/{quill-editor-plugin.css → bo-plugin.css} +2 -2
- package/bo-front/dist/bo-plugin.mjs +1 -1
- package/package.json +1 -1
- /package/public-front/dist/{quill-editor-plugin.css → public-front-plugin.css} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{delegateEvents as As,effect as ir,insert as fe,template as ye,createComponent as ln,className as Js}from"https://esm.sh/solid-js@1.9.4/web";import{createMemo as ei,createSignal as St,createEffect as ti,For as Gi,onMount as Dl,createRoot as Bl,onCleanup as ql}from"https://esm.sh/solid-js@1.9.4";var ro=typeof global=="object"&&global&&global.Object===Object&&global,$l=typeof self=="object"&&self&&self.Object===Object&&self,Bt=ro||$l||Function("return this")(),fn=Bt.Symbol,so=Object.prototype,Pl=so.hasOwnProperty,Ul=so.toString,Cr=fn?fn.toStringTag:void 0;function Fl(n){var e=Pl.call(n,Cr),t=n[Cr];try{n[Cr]=void 0;var r=!0}catch{}var s=Ul.call(n);return r&&(e?n[Cr]=t:delete n[Cr]),s}var Hl=Object.prototype,zl=Hl.toString;function Kl(n){return zl.call(n)}var Gl="[object Null]",jl="[object Undefined]",ji=fn?fn.toStringTag:void 0;function dr(n){return n==null?n===void 0?jl:Gl:ji&&ji in Object(n)?Fl(n):Kl(n)}function jt(n){return n!=null&&typeof n=="object"}var In=Array.isArray;function gn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function io(n){return n}var Vl="[object AsyncFunction]",Zl="[object Function]",Wl="[object GeneratorFunction]",Yl="[object Proxy]";function yi(n){if(!gn(n))return!1;var e=dr(n);return e==Zl||e==Wl||e==Vl||e==Yl}var qs=Bt["__core-js_shared__"],Vi=function(){var n=/[^.]+$/.exec(qs&&qs.keys&&qs.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Ql(n){return!!Vi&&Vi in n}var Xl=Function.prototype,Jl=Xl.toString;function Dn(n){if(n!=null){try{return Jl.call(n)}catch{}try{return n+""}catch{}}return""}var ec=/[\\^$.*+?()[\]{}|]/g,tc=/^\[object .+?Constructor\]$/,nc=Function.prototype,rc=Object.prototype,sc=nc.toString,ic=rc.hasOwnProperty,ac=RegExp("^"+sc.call(ic).replace(ec,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oc(n){if(!gn(n)||Ql(n))return!1;var e=yi(n)?ac:tc;return e.test(Dn(n))}function lc(n,e){return n?.[e]}function Bn(n,e){var t=lc(n,e);return oc(t)?t:void 0}var ni=Bn(Bt,"WeakMap"),Zi=Object.create,cc=function(){function n(){}return function(e){if(!gn(e))return{};if(Zi)return Zi(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function uc(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function ao(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var dc=800,hc=16,fc=Date.now;function gc(n){var e=0,t=0;return function(){var r=fc(),s=hc-(r-t);if(t=r,s>0){if(++e>=dc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function pc(n){return function(){return n}}var ms=function(){try{var n=Bn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),mc=ms?function(n,e){return ms(n,"toString",{configurable:!0,enumerable:!1,value:pc(e),writable:!0})}:io,bc=gc(mc);function Ec(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var yc=9007199254740991,_c=/^(?:0|[1-9]\d*)$/;function oo(n,e){var t=typeof n;return e=e??yc,!!e&&(t=="number"||t!="symbol"&&_c.test(n))&&n>-1&&n%1==0&&n<e}function _i(n,e,t){e=="__proto__"&&ms?ms(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Kr(n,e){return n===e||n!==n&&e!==e}var vc=Object.prototype,Nc=vc.hasOwnProperty;function lo(n,e,t){var r=n[e];(!(Nc.call(n,e)&&Kr(r,t))||t===void 0&&!(e in n))&&_i(n,e,t)}function Gr(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?_i(t,l,c):lo(t,l,c)}return t}var Wi=Math.max;function Tc(n,e,t){return e=Wi(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Wi(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),uc(n,this,l)}}function Ac(n,e){return bc(Tc(n,e,io),n+"")}var wc=9007199254740991;function co(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=wc}function ws(n){return n!=null&&co(n.length)&&!yi(n)}function Sc(n,e,t){if(!gn(t))return!1;var r=typeof e;return(r=="number"?ws(t)&&oo(e,t.length):r=="string"&&e in t)?Kr(t[e],n):!1}function xc(n){return Ac((function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&Sc(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e}))}var Oc=Object.prototype;function vi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Oc;return n===t}function Lc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Cc="[object Arguments]";function Yi(n){return jt(n)&&dr(n)==Cc}var uo=Object.prototype,Ic=uo.hasOwnProperty,Rc=uo.propertyIsEnumerable,ri=Yi(function(){return arguments}())?Yi:function(n){return jt(n)&&Ic.call(n,"callee")&&!Rc.call(n,"callee")};function kc(){return!1}var ho=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Qi=ho&&typeof module=="object"&&module&&!module.nodeType&&module,Mc=Qi&&Qi.exports===ho,Xi=Mc?Bt.Buffer:void 0,Dc=Xi?Xi.isBuffer:void 0,qr=Dc||kc,Bc="[object Arguments]",qc="[object Array]",$c="[object Boolean]",Pc="[object Date]",Uc="[object Error]",Fc="[object Function]",Hc="[object Map]",zc="[object Number]",Kc="[object Object]",Gc="[object RegExp]",jc="[object Set]",Vc="[object String]",Zc="[object WeakMap]",Wc="[object ArrayBuffer]",Yc="[object DataView]",Qc="[object Float32Array]",Xc="[object Float64Array]",Jc="[object Int8Array]",eu="[object Int16Array]",tu="[object Int32Array]",nu="[object Uint8Array]",ru="[object Uint8ClampedArray]",su="[object Uint16Array]",iu="[object Uint32Array]",ke={};ke[Qc]=ke[Xc]=ke[Jc]=ke[eu]=ke[tu]=ke[nu]=ke[ru]=ke[su]=ke[iu]=!0;ke[Bc]=ke[qc]=ke[Wc]=ke[$c]=ke[Yc]=ke[Pc]=ke[Uc]=ke[Fc]=ke[Hc]=ke[zc]=ke[Kc]=ke[Gc]=ke[jc]=ke[Vc]=ke[Zc]=!1;function au(n){return jt(n)&&co(n.length)&&!!ke[dr(n)]}function Ni(n){return function(e){return n(e)}}var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dr=fo&&typeof module=="object"&&module&&!module.nodeType&&module,ou=Dr&&Dr.exports===fo,$s=ou&&ro.process,cr=function(){try{var n=Dr&&Dr.require&&Dr.require("util").types;return n||$s&&$s.binding&&$s.binding("util")}catch{}}(),Ji=cr&&cr.isTypedArray,Ti=Ji?Ni(Ji):au,lu=Object.prototype,cu=lu.hasOwnProperty;function go(n,e){var t=In(n),r=!t&&ri(n),s=!t&&!r&&qr(n),i=!t&&!r&&!s&&Ti(n),a=t||r||s||i,l=a?Lc(n.length,String):[],c=l.length;for(var u in n)(e||cu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||oo(u,c)))&&l.push(u);return l}function po(n,e){return function(t){return n(e(t))}}var uu=po(Object.keys,Object),du=Object.prototype,hu=du.hasOwnProperty;function fu(n){if(!vi(n))return uu(n);var e=[];for(var t in Object(n))hu.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ai(n){return ws(n)?go(n):fu(n)}function gu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var pu=Object.prototype,mu=pu.hasOwnProperty;function bu(n){if(!gn(n))return gu(n);var e=vi(n),t=[];for(var r in n)r=="constructor"&&(e||!mu.call(n,r))||t.push(r);return t}function jr(n){return ws(n)?go(n,!0):bu(n)}var $r=Bn(Object,"create");function Eu(){this.__data__=$r?$r(null):{},this.size=0}function yu(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var _u="__lodash_hash_undefined__",vu=Object.prototype,Nu=vu.hasOwnProperty;function Tu(n){var e=this.__data__;if($r){var t=e[n];return t===_u?void 0:t}return Nu.call(e,n)?e[n]:void 0}var Au=Object.prototype,wu=Au.hasOwnProperty;function Su(n){var e=this.__data__;return $r?e[n]!==void 0:wu.call(e,n)}var xu="__lodash_hash_undefined__";function Ou(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?xu:e,this}function Rn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Rn.prototype.clear=Eu;Rn.prototype.delete=yu;Rn.prototype.get=Tu;Rn.prototype.has=Su;Rn.prototype.set=Ou;function Lu(){this.__data__=[],this.size=0}function Ss(n,e){for(var t=n.length;t--;)if(Kr(n[t][0],e))return t;return-1}var Cu=Array.prototype,Iu=Cu.splice;function Ru(n){var e=this.__data__,t=Ss(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Iu.call(e,t,1),--this.size,!0}function ku(n){var e=this.__data__,t=Ss(e,n);return t<0?void 0:e[t][1]}function Mu(n){return Ss(this.__data__,n)>-1}function Du(n,e){var t=this.__data__,r=Ss(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Zt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Zt.prototype.clear=Lu;Zt.prototype.delete=Ru;Zt.prototype.get=ku;Zt.prototype.has=Mu;Zt.prototype.set=Du;var Pr=Bn(Bt,"Map");function Bu(){this.size=0,this.__data__={hash:new Rn,map:new(Pr||Zt),string:new Rn}}function qu(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function xs(n,e){var t=n.__data__;return qu(e)?t[typeof e=="string"?"string":"hash"]:t.map}function $u(n){var e=xs(this,n).delete(n);return this.size-=e?1:0,e}function Pu(n){return xs(this,n).get(n)}function Uu(n){return xs(this,n).has(n)}function Fu(n,e){var t=xs(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function qn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}qn.prototype.clear=Bu;qn.prototype.delete=$u;qn.prototype.get=Pu;qn.prototype.has=Uu;qn.prototype.set=Fu;function mo(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var wi=po(Object.getPrototypeOf,Object),Hu="[object Object]",zu=Function.prototype,Ku=Object.prototype,bo=zu.toString,Gu=Ku.hasOwnProperty,ju=bo.call(Object);function Vu(n){if(!jt(n)||dr(n)!=Hu)return!1;var e=wi(n);if(e===null)return!0;var t=Gu.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&bo.call(t)==ju}function Zu(){this.__data__=new Zt,this.size=0}function Wu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Yu(n){return this.__data__.get(n)}function Qu(n){return this.__data__.has(n)}var Xu=200;function Ju(n,e){var t=this.__data__;if(t instanceof Zt){var r=t.__data__;if(!Pr||r.length<Xu-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new qn(r)}return t.set(n,e),this.size=t.size,this}function Mt(n){var e=this.__data__=new Zt(n);this.size=e.size}Mt.prototype.clear=Zu;Mt.prototype.delete=Wu;Mt.prototype.get=Yu;Mt.prototype.has=Qu;Mt.prototype.set=Ju;function ed(n,e){return n&&Gr(e,Ai(e),n)}function td(n,e){return n&&Gr(e,jr(e),n)}var Eo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ea=Eo&&typeof module=="object"&&module&&!module.nodeType&&module,nd=ea&&ea.exports===Eo,ta=nd?Bt.Buffer:void 0,na=ta?ta.allocUnsafe:void 0;function yo(n,e){if(e)return n.slice();var t=n.length,r=na?na(t):new n.constructor(t);return n.copy(r),r}function rd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function _o(){return[]}var sd=Object.prototype,id=sd.propertyIsEnumerable,ra=Object.getOwnPropertySymbols,Si=ra?function(n){return n==null?[]:(n=Object(n),rd(ra(n),(function(e){return id.call(n,e)})))}:_o;function ad(n,e){return Gr(n,Si(n),e)}var od=Object.getOwnPropertySymbols,vo=od?function(n){for(var e=[];n;)mo(e,Si(n)),n=wi(n);return e}:_o;function ld(n,e){return Gr(n,vo(n),e)}function No(n,e,t){var r=e(n);return In(n)?r:mo(r,t(n))}function si(n){return No(n,Ai,Si)}function cd(n){return No(n,jr,vo)}var ii=Bn(Bt,"DataView"),ai=Bn(Bt,"Promise"),oi=Bn(Bt,"Set"),sa="[object Map]",ud="[object Object]",ia="[object Promise]",aa="[object Set]",oa="[object WeakMap]",la="[object DataView]",dd=Dn(ii),hd=Dn(Pr),fd=Dn(ai),gd=Dn(oi),pd=Dn(ni),Tt=dr;(ii&&Tt(new ii(new ArrayBuffer(1)))!=la||Pr&&Tt(new Pr)!=sa||ai&&Tt(ai.resolve())!=ia||oi&&Tt(new oi)!=aa||ni&&Tt(new ni)!=oa)&&(Tt=function(n){var e=dr(n),t=e==ud?n.constructor:void 0,r=t?Dn(t):"";if(r)switch(r){case dd:return la;case hd:return sa;case fd:return ia;case gd:return aa;case pd:return oa}return e});var md=Object.prototype,bd=md.hasOwnProperty;function Ed(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&bd.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var bs=Bt.Uint8Array;function xi(n){var e=new n.constructor(n.byteLength);return new bs(e).set(new bs(n)),e}function yd(n,e){var t=e?xi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var _d=/\w*$/;function vd(n){var e=new n.constructor(n.source,_d.exec(n));return e.lastIndex=n.lastIndex,e}var ca=fn?fn.prototype:void 0,ua=ca?ca.valueOf:void 0;function Nd(n){return ua?Object(ua.call(n)):{}}function To(n,e){var t=e?xi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Td="[object Boolean]",Ad="[object Date]",wd="[object Map]",Sd="[object Number]",xd="[object RegExp]",Od="[object Set]",Ld="[object String]",Cd="[object Symbol]",Id="[object ArrayBuffer]",Rd="[object DataView]",kd="[object Float32Array]",Md="[object Float64Array]",Dd="[object Int8Array]",Bd="[object Int16Array]",qd="[object Int32Array]",$d="[object Uint8Array]",Pd="[object Uint8ClampedArray]",Ud="[object Uint16Array]",Fd="[object Uint32Array]";function Hd(n,e,t){var r=n.constructor;switch(e){case Id:return xi(n);case Td:case Ad:return new r(+n);case Rd:return yd(n,t);case kd:case Md:case Dd:case Bd:case qd:case $d:case Pd:case Ud:case Fd:return To(n,t);case wd:return new r;case Sd:case Ld:return new r(n);case xd:return vd(n);case Od:return new r;case Cd:return Nd(n)}}function Ao(n){return typeof n.constructor=="function"&&!vi(n)?cc(wi(n)):{}}var zd="[object Map]";function Kd(n){return jt(n)&&Tt(n)==zd}var da=cr&&cr.isMap,Gd=da?Ni(da):Kd,jd="[object Set]";function Vd(n){return jt(n)&&Tt(n)==jd}var ha=cr&&cr.isSet,Zd=ha?Ni(ha):Vd,Wd=1,Yd=2,Qd=4,wo="[object Arguments]",Xd="[object Array]",Jd="[object Boolean]",eh="[object Date]",th="[object Error]",So="[object Function]",nh="[object GeneratorFunction]",rh="[object Map]",sh="[object Number]",xo="[object Object]",ih="[object RegExp]",ah="[object Set]",oh="[object String]",lh="[object Symbol]",ch="[object WeakMap]",uh="[object ArrayBuffer]",dh="[object DataView]",hh="[object Float32Array]",fh="[object Float64Array]",gh="[object Int8Array]",ph="[object Int16Array]",mh="[object Int32Array]",bh="[object Uint8Array]",Eh="[object Uint8ClampedArray]",yh="[object Uint16Array]",_h="[object Uint32Array]",Le={};Le[wo]=Le[Xd]=Le[uh]=Le[dh]=Le[Jd]=Le[eh]=Le[hh]=Le[fh]=Le[gh]=Le[ph]=Le[mh]=Le[rh]=Le[sh]=Le[xo]=Le[ih]=Le[ah]=Le[oh]=Le[lh]=Le[bh]=Le[Eh]=Le[yh]=Le[_h]=!0;Le[th]=Le[So]=Le[ch]=!1;function ps(n,e,t,r,s,i){var a,l=e&Wd,c=e&Yd,u=e&Qd;if(a!==void 0)return a;if(!gn(n))return n;var f=In(n);if(f){if(a=Ed(n),!l)return ao(n,a)}else{var p=Tt(n),h=p==So||p==nh;if(qr(n))return yo(n,l);if(p==xo||p==wo||h&&!s){if(a=c||h?{}:Ao(n),!l)return c?ld(n,td(a,n)):ad(n,ed(a,n))}else{if(!Le[p])return s?n:{};a=Hd(n,p,l)}}i||(i=new Mt);var g=i.get(n);if(g)return g;i.set(n,a),Zd(n)?n.forEach((function(N){a.add(ps(N,e,t,N,n,i))})):Gd(n)&&n.forEach((function(N,T){a.set(T,ps(N,e,t,T,n,i))}));var y=u?c?cd:si:c?jr:Ai,_=f?void 0:y(n);return Ec(_||n,(function(N,T){_&&(T=N,N=n[T]),lo(a,T,ps(N,e,t,T,n,i))})),a}var vh=1,Nh=4;function ar(n){return ps(n,vh|Nh)}var Th="__lodash_hash_undefined__";function Ah(n){return this.__data__.set(n,Th),this}function wh(n){return this.__data__.has(n)}function Es(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new qn;++e<t;)this.add(n[e])}Es.prototype.add=Es.prototype.push=Ah;Es.prototype.has=wh;function Sh(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function xh(n,e){return n.has(e)}var Oh=1,Lh=2;function Oo(n,e,t,r,s,i){var a=t&Oh,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),f=i.get(e);if(u&&f)return u==e&&f==n;var p=-1,h=!0,g=t&Lh?new Es:void 0;for(i.set(n,e),i.set(e,n);++p<l;){var y=n[p],_=e[p];if(r)var N=a?r(_,y,p,e,n,i):r(y,_,p,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(g){if(!Sh(e,(function(T,L){if(!xh(g,L)&&(y===T||s(y,T,t,r,i)))return g.push(L)}))){h=!1;break}}else if(!(y===_||s(y,_,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function Ch(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function Ih(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var Rh=1,kh=2,Mh="[object Boolean]",Dh="[object Date]",Bh="[object Error]",qh="[object Map]",$h="[object Number]",Ph="[object RegExp]",Uh="[object Set]",Fh="[object String]",Hh="[object Symbol]",zh="[object ArrayBuffer]",Kh="[object DataView]",fa=fn?fn.prototype:void 0,Ps=fa?fa.valueOf:void 0;function Gh(n,e,t,r,s,i,a){switch(t){case Kh:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case zh:return!(n.byteLength!=e.byteLength||!i(new bs(n),new bs(e)));case Mh:case Dh:case $h:return Kr(+n,+e);case Bh:return n.name==e.name&&n.message==e.message;case Ph:case Fh:return n==e+"";case qh:var l=Ch;case Uh:var c=r&Rh;if(l||(l=Ih),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=kh,a.set(n,e);var f=Oo(l(n),l(e),r,s,i,a);return a.delete(n),f;case Hh:if(Ps)return Ps.call(n)==Ps.call(e)}return!1}var jh=1,Vh=Object.prototype,Zh=Vh.hasOwnProperty;function Wh(n,e,t,r,s,i){var a=t&jh,l=si(n),c=l.length,u=si(e),f=u.length;if(c!=f&&!a)return!1;for(var p=c;p--;){var h=l[p];if(!(a?h in e:Zh.call(e,h)))return!1}var g=i.get(n),y=i.get(e);if(g&&y)return g==e&&y==n;var _=!0;i.set(n,e),i.set(e,n);for(var N=a;++p<c;){h=l[p];var T=n[h],L=e[h];if(r)var w=a?r(L,T,h,e,n,i):r(T,L,h,n,e,i);if(!(w===void 0?T===L||s(T,L,t,r,i):w)){_=!1;break}N||(N=h=="constructor")}if(_&&!N){var k=n.constructor,M=e.constructor;k!=M&&"constructor"in n&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof M=="function"&&M instanceof M)&&(_=!1)}return i.delete(n),i.delete(e),_}var Yh=1,ga="[object Arguments]",pa="[object Array]",ns="[object Object]",Qh=Object.prototype,ma=Qh.hasOwnProperty;function Xh(n,e,t,r,s,i){var a=In(n),l=In(e),c=a?pa:Tt(n),u=l?pa:Tt(e);c=c==ga?ns:c,u=u==ga?ns:u;var f=c==ns,p=u==ns,h=c==u;if(h&&qr(n)){if(!qr(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Mt),a||Ti(n)?Oo(n,e,t,r,s,i):Gh(n,e,c,t,r,s,i);if(!(t&Yh)){var g=f&&ma.call(n,"__wrapped__"),y=p&&ma.call(e,"__wrapped__");if(g||y){var _=g?n.value():n,N=y?e.value():e;return i||(i=new Mt),s(_,N,t,r,i)}}return h?(i||(i=new Mt),Wh(n,e,t,r,s,i)):!1}function Lo(n,e,t,r,s){return n===e?!0:n==null||e==null||!jt(n)&&!jt(e)?n!==n&&e!==e:Xh(n,e,t,r,Lo,s)}function Jh(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var ef=Jh();function li(n,e,t){(t!==void 0&&!Kr(n[e],t)||t===void 0&&!(e in n))&&_i(n,e,t)}function tf(n){return jt(n)&&ws(n)}function ci(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function nf(n){return Gr(n,jr(n))}function rf(n,e,t,r,s,i,a){var l=ci(n,t),c=ci(e,t),u=a.get(c);if(u){li(n,t,u);return}var f=i?i(l,c,t+"",n,e,a):void 0,p=f===void 0;if(p){var h=In(c),g=!h&&qr(c),y=!h&&!g&&Ti(c);f=c,h||g||y?In(l)?f=l:tf(l)?f=ao(l):g?(p=!1,f=yo(c,!0)):y?(p=!1,f=To(c,!0)):f=[]:Vu(c)||ri(c)?(f=l,ri(l)?f=nf(l):(!gn(l)||yi(l))&&(f=Ao(c))):p=!1}p&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),li(n,t,f)}function Co(n,e,t,r,s){n!==e&&ef(e,(function(i,a){if(s||(s=new Mt),gn(i))rf(n,e,a,t,Co,r,s);else{var l=r?r(ci(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),li(n,a,l)}}),jr)}function Oi(n,e){return Lo(n,e)}var dn=xc((function(n,e,t){Co(n,e,t)})),Z=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(Z||{});class Dt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Z.TYPE&Z.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Z.LEVEL|s:Z.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map((t=>t.name))}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class or extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Io=class ui{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new or(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return ui.blots.set(l.domNode,l),l}find(e,t=!1){return ui.find(e,t)}query(e,t=Z.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Z.LEVEL&Z.BLOCK?r=this.types.block:e&Z.LEVEL&Z.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((s=>(r=this.classes[s],!!r))),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&Z.LEVEL&r.scope&&t&Z.TYPE&r.scope?r:null}register(...e){return e.map((t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new or("Invalid definition");if(r&&t.blotName==="abstract")throw new or("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map((a=>a.toUpperCase())):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)})))),t}))}};Io.blots=new WeakMap;let ur=Io;function ba(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class sf extends Dt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){ba(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(ba(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Lt=sf;function Us(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class af extends Dt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[Us(this.keyName)]=t,!0):!1}remove(e){e.style[Us(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Us(this.keyName)];return this.canAdd(e,t)?t:""}}const pn=af;class of{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ur.find(this.domNode);if(e==null)return;const t=Dt.keys(this.domNode),r=Lt.keys(this.domNode),s=pn.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,Z.ATTRIBUTE);a instanceof Dt&&(this.attributes[a.attrName]=a)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}}const Os=of,Ro=class{constructor(e,t){this.scroll=e,this.domNode=t,ur.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new or("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),ur.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,Z.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,Z.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new or(`Cannot wrap ${e}`);return r.appendChild(this),r}};Ro.blotName="abstract";let ko=Ro;const Mo=class extends ko{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Mo.scope=Z.INLINE_BLOT;let lf=Mo;const et=lf;class cf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const l=this.iterator(s);let c=l();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=l()}}map(e){return this.reduce(((t,r)=>(t.push(e(r)),t)),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function Ea(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Z.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Do=class on extends ko{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,on.uiClass&&this.uiNode.classList.add(on.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new cf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=Ea(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof or)return;throw t}}))}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,((r,s,i)=>{r.deleteAt(s,i)}))}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof on?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,((a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof on&&(s=s.concat(a.descendants(e,l,i))),i-=c})),s}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((t=>{e||this.statics.allowedChildren.some((r=>t instanceof r))||(t.statics.scope===Z.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof on?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,l)=>{i.formatAt(a,l,r,s)}))}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((r=>{e.insertBefore(r,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof on?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof on&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),((s,i,a)=>{const l=s.split(i,t);l!=null&&r.appendChild(l)})),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],s=[];e.forEach((i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))})),s.forEach((i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()})),r.filter((i=>i.parentNode===this.domNode&&i!==this.uiNode)).sort(((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const l=Ea(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))})),this.enforceAllowedChildren()}};Do.uiClass="";let uf=Do;const xt=uf;function df(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const Jn=class er extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(er.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Os(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof er||(r=r.wrap(er.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,Z.INLINE);if(r==null)return;r instanceof Dt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,Z.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof er&&r.prev===this&&df(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof er&&this.attributes.move(r),r}};Jn.allowedChildren=[Jn,et],Jn.blotName="inline",Jn.scope=Z.INLINE_BLOT,Jn.tagName="SPAN";let hf=Jn;const Li=hf,tr=class di extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(di.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Os(this.domNode)}format(e,t){const r=this.scroll.query(e,Z.BLOCK);r!=null&&(r instanceof Dt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(di.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,Z.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Z.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}};tr.blotName="block",tr.scope=Z.BLOCK_BLOT,tr.tagName="P",tr.allowedChildren=[Li,tr,et];let ff=tr;const Ur=ff,hi=class extends xt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};hi.blotName="container",hi.scope=Z.BLOCK_BLOT;let gf=hi;const Ls=gf;class pf extends et{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const lt=pf,mf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},bf=100,nr=class extends xt{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((r=>{this.update(r)})),this.observer.observe(this.domNode,mf),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Z.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach((r=>{r.remove()})):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof xt&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=bf)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((p=>{const h=this.find(p,!1);i(h,!1),h instanceof xt&&h.children.forEach((g=>{i(g,!1)}))}))):u.type==="attributes"&&i(f.prev)),i(f))})),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map((s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)})).forEach((s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)})),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};nr.blotName="scroll",nr.defaultChild=Ur,nr.allowedChildren=[Ur,Ls],nr.scope=Z.BLOCK_BLOT,nr.tagName="DIV";let Ef=nr;const Ci=Ef,fi=class Bo extends et{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Bo&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some((r=>r.type==="characterData"&&r.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};fi.blotName="text",fi.scope=Z.INLINE_BLOT;let yf=fi;const ys=yf,_f=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Dt,AttributorStore:Os,BlockBlot:Ur,ClassAttributor:Lt,ContainerBlot:Ls,EmbedBlot:lt,InlineBlot:Li,LeafBlot:et,ParentBlot:xt,Registry:ur,Scope:Z,ScrollBlot:Ci,StyleAttributor:pn,TextBlot:ys},Symbol.toStringTag,{value:"Module"}));var cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rs={exports:{}},Fs,ya;function vf(){if(ya)return Fs;ya=1;var n=-1,e=1,t=0;function r(E,C,v,I,D){if(E===C)return E?[[t,E]]:[];if(v!=null){var O=Ce(E,C,v);if(O)return O}var $=l(E,C),B=E.substring(0,$);E=E.substring($),C=C.substring($),$=u(E,C);var F=E.substring(E.length-$);E=E.substring(0,E.length-$),C=C.substring(0,C.length-$);var P=s(E,C);return B&&P.unshift([t,B]),F&&P.push([t,F]),L(P,D),I&&p(P),P}function s(E,C){var v;if(!E)return[[e,C]];if(!C)return[[n,E]];var I=E.length>C.length?E:C,D=E.length>C.length?C:E,O=I.indexOf(D);if(O!==-1)return v=[[e,I.substring(0,O)],[t,D],[e,I.substring(O+D.length)]],E.length>C.length&&(v[0][0]=v[2][0]=n),v;if(D.length===1)return[[n,E],[e,C]];var $=f(E,C);if($){var B=$[0],F=$[1],P=$[2],J=$[3],X=$[4],se=r(B,P),ce=r(F,J);return se.concat([[t,X]],ce)}return i(E,C)}function i(E,C){for(var v=E.length,I=C.length,D=Math.ceil((v+I)/2),O=D,$=2*D,B=new Array($),F=new Array($),P=0;P<$;P++)B[P]=-1,F[P]=-1;B[O+1]=0,F[O+1]=0;for(var J=v-I,X=J%2!==0,se=0,ce=0,Q=0,Se=0,xe=0;xe<D;xe++){for(var oe=-xe+se;oe<=xe-ce;oe+=2){var be=O+oe,ue;oe===-xe||oe!==xe&&B[be-1]<B[be+1]?ue=B[be+1]:ue=B[be-1]+1;for(var pe=ue-oe;ue<v&&pe<I&&E.charAt(ue)===C.charAt(pe);)ue++,pe++;if(B[be]=ue,ue>v)ce+=2;else if(pe>I)se+=2;else if(X){var Ee=O+J-oe;if(Ee>=0&&Ee<$&&F[Ee]!==-1){var _e=v-F[Ee];if(ue>=_e)return a(E,C,ue,pe)}}}for(var De=-xe+Q;De<=xe-Se;De+=2){var Ee=O+De,_e;De===-xe||De!==xe&&F[Ee-1]<F[Ee+1]?_e=F[Ee+1]:_e=F[Ee-1]+1;for(var ze=_e-De;_e<v&&ze<I&&E.charAt(v-_e-1)===C.charAt(I-ze-1);)_e++,ze++;if(F[Ee]=_e,_e>v)Se+=2;else if(ze>I)Q+=2;else if(!X){var be=O+J-De;if(be>=0&&be<$&&B[be]!==-1){var ue=B[be],pe=O+ue-be;if(_e=v-_e,ue>=_e)return a(E,C,ue,pe)}}}}return[[n,E],[e,C]]}function a(E,C,v,I){var D=E.substring(0,v),O=C.substring(0,I),$=E.substring(v),B=C.substring(I),F=r(D,O),P=r($,B);return F.concat(P)}function l(E,C){if(!E||!C||E.charAt(0)!==C.charAt(0))return 0;for(var v=0,I=Math.min(E.length,C.length),D=I,O=0;v<D;)E.substring(O,D)==C.substring(O,D)?(v=D,O=v):I=D,D=Math.floor((I-v)/2+v);return w(E.charCodeAt(D-1))&&D--,D}function c(E,C){var v=E.length,I=C.length;if(v==0||I==0)return 0;v>I?E=E.substring(v-I):v<I&&(C=C.substring(0,v));var D=Math.min(v,I);if(E==C)return D;for(var O=0,$=1;;){var B=E.substring(D-$),F=C.indexOf(B);if(F==-1)return O;$+=F,(F==0||E.substring(D-$)==C.substring(0,$))&&(O=$,$++)}}function u(E,C){if(!E||!C||E.slice(-1)!==C.slice(-1))return 0;for(var v=0,I=Math.min(E.length,C.length),D=I,O=0;v<D;)E.substring(E.length-D,E.length-O)==C.substring(C.length-D,C.length-O)?(v=D,O=v):I=D,D=Math.floor((I-v)/2+v);return k(E.charCodeAt(E.length-D))&&D--,D}function f(E,C){var v=E.length>C.length?E:C,I=E.length>C.length?C:E;if(v.length<4||I.length*2<v.length)return null;function D(ce,Q,Se){for(var xe=ce.substring(Se,Se+Math.floor(ce.length/4)),oe=-1,be="",ue,pe,Ee,_e;(oe=Q.indexOf(xe,oe+1))!==-1;){var De=l(ce.substring(Se),Q.substring(oe)),ze=u(ce.substring(0,Se),Q.substring(0,oe));be.length<ze+De&&(be=Q.substring(oe-ze,oe)+Q.substring(oe,oe+De),ue=ce.substring(0,Se-ze),pe=ce.substring(Se+De),Ee=Q.substring(0,oe-ze),_e=Q.substring(oe+De))}return be.length*2>=ce.length?[ue,pe,Ee,_e,be]:null}var O=D(v,I,Math.ceil(v.length/4)),$=D(v,I,Math.ceil(v.length/2)),B;if(!O&&!$)return null;$?O?B=O[4].length>$[4].length?O:$:B=$:B=O;var F,P,J,X;E.length>C.length?(F=B[0],P=B[1],J=B[2],X=B[3]):(J=B[0],X=B[1],F=B[2],P=B[3]);var se=B[4];return[F,P,J,X,se]}function p(E){for(var C=!1,v=[],I=0,D=null,O=0,$=0,B=0,F=0,P=0;O<E.length;)E[O][0]==t?(v[I++]=O,$=F,B=P,F=0,P=0,D=E[O][1]):(E[O][0]==e?F+=E[O][1].length:P+=E[O][1].length,D&&D.length<=Math.max($,B)&&D.length<=Math.max(F,P)&&(E.splice(v[I-1],0,[n,D]),E[v[I-1]+1][0]=e,I--,I--,O=I>0?v[I-1]:-1,$=0,B=0,F=0,P=0,D=null,C=!0)),O++;for(C&&L(E),T(E),O=1;O<E.length;){if(E[O-1][0]==n&&E[O][0]==e){var J=E[O-1][1],X=E[O][1],se=c(J,X),ce=c(X,J);se>=ce?(se>=J.length/2||se>=X.length/2)&&(E.splice(O,0,[t,X.substring(0,se)]),E[O-1][1]=J.substring(0,J.length-se),E[O+1][1]=X.substring(se),O++):(ce>=J.length/2||ce>=X.length/2)&&(E.splice(O,0,[t,J.substring(0,ce)]),E[O-1][0]=e,E[O-1][1]=X.substring(0,X.length-ce),E[O+1][0]=n,E[O+1][1]=J.substring(ce),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,g=/\s/,y=/[\r\n]/,_=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(E){function C(ce,Q){if(!ce||!Q)return 6;var Se=ce.charAt(ce.length-1),xe=Q.charAt(0),oe=Se.match(h),be=xe.match(h),ue=oe&&Se.match(g),pe=be&&xe.match(g),Ee=ue&&Se.match(y),_e=pe&&xe.match(y),De=Ee&&ce.match(_),ze=_e&&Q.match(N);return De||ze?5:Ee||_e?4:oe&&!ue&&pe?3:ue||pe?2:oe||be?1:0}for(var v=1;v<E.length-1;){if(E[v-1][0]==t&&E[v+1][0]==t){var I=E[v-1][1],D=E[v][1],O=E[v+1][1],$=u(I,D);if($){var B=D.substring(D.length-$);I=I.substring(0,I.length-$),D=B+D.substring(0,D.length-$),O=B+O}for(var F=I,P=D,J=O,X=C(I,D)+C(D,O);D.charAt(0)===O.charAt(0);){I+=D.charAt(0),D=D.substring(1)+O.charAt(0),O=O.substring(1);var se=C(I,D)+C(D,O);se>=X&&(X=se,F=I,P=D,J=O)}E[v-1][1]!=F&&(F?E[v-1][1]=F:(E.splice(v-1,1),v--),E[v][1]=P,J?E[v+1][1]=J:(E.splice(v+1,1),v--))}v++}}function L(E,C){E.push([t,""]);for(var v=0,I=0,D=0,O="",$="",B;v<E.length;){if(v<E.length-1&&!E[v][1]){E.splice(v,1);continue}switch(E[v][0]){case e:D++,$+=E[v][1],v++;break;case n:I++,O+=E[v][1],v++;break;case t:var F=v-D-I-1;if(C){if(F>=0&&V(E[F][1])){var P=E[F][1].slice(-1);if(E[F][1]=E[F][1].slice(0,-1),O=P+O,$=P+$,!E[F][1]){E.splice(F,1),v--;var J=F-1;E[J]&&E[J][0]===e&&(D++,$=E[J][1]+$,J--),E[J]&&E[J][0]===n&&(I++,O=E[J][1]+O,J--),F=J}}if(M(E[v][1])){var P=E[v][1].charAt(0);E[v][1]=E[v][1].slice(1),O+=P,$+=P}}if(v<E.length-1&&!E[v][1]){E.splice(v,1);break}if(O.length>0||$.length>0){O.length>0&&$.length>0&&(B=l($,O),B!==0&&(F>=0?E[F][1]+=$.substring(0,B):(E.splice(0,0,[t,$.substring(0,B)]),v++),$=$.substring(B),O=O.substring(B)),B=u($,O),B!==0&&(E[v][1]=$.substring($.length-B)+E[v][1],$=$.substring(0,$.length-B),O=O.substring(0,O.length-B)));var X=D+I;O.length===0&&$.length===0?(E.splice(v-X,X),v=v-X):O.length===0?(E.splice(v-X,X,[e,$]),v=v-X+1):$.length===0?(E.splice(v-X,X,[n,O]),v=v-X+1):(E.splice(v-X,X,[n,O],[e,$]),v=v-X+2)}v!==0&&E[v-1][0]===t?(E[v-1][1]+=E[v][1],E.splice(v,1)):v++,D=0,I=0,O="",$="";break}}E[E.length-1][1]===""&&E.pop();var se=!1;for(v=1;v<E.length-1;)E[v-1][0]===t&&E[v+1][0]===t&&(E[v][1].substring(E[v][1].length-E[v-1][1].length)===E[v-1][1]?(E[v][1]=E[v-1][1]+E[v][1].substring(0,E[v][1].length-E[v-1][1].length),E[v+1][1]=E[v-1][1]+E[v+1][1],E.splice(v-1,1),se=!0):E[v][1].substring(0,E[v+1][1].length)==E[v+1][1]&&(E[v-1][1]+=E[v+1][1],E[v][1]=E[v][1].substring(E[v+1][1].length)+E[v+1][1],E.splice(v+1,1),se=!0)),v++;se&&L(E,C)}function w(E){return E>=55296&&E<=56319}function k(E){return E>=56320&&E<=57343}function M(E){return k(E.charCodeAt(0))}function V(E){return w(E.charCodeAt(E.length-1))}function re(E){for(var C=[],v=0;v<E.length;v++)E[v][1].length>0&&C.push(E[v]);return C}function he(E,C,v,I){return V(E)||M(I)?null:re([[t,E],[n,C],[e,v],[t,I]])}function Ce(E,C,v){var I=typeof v=="number"?{index:v,length:0}:v.oldRange,D=typeof v=="number"?null:v.newRange,O=E.length,$=C.length;if(I.length===0&&(D===null||D.length===0)){var B=I.index,F=E.slice(0,B),P=E.slice(B),J=D?D.index:null;e:{var X=B+$-O;if(J!==null&&J!==X||X<0||X>$)break e;var se=C.slice(0,X),ce=C.slice(X);if(ce!==P)break e;var Q=Math.min(B,X),Se=F.slice(0,Q),xe=se.slice(0,Q);if(Se!==xe)break e;var oe=F.slice(Q),be=se.slice(Q);return he(Se,oe,be,P)}e:{if(J!==null&&J!==B)break e;var ue=B,se=C.slice(0,ue),ce=C.slice(ue);if(se!==F)break e;var pe=Math.min(O-ue,$-ue),Ee=P.slice(P.length-pe),_e=ce.slice(ce.length-pe);if(Ee!==_e)break e;var oe=P.slice(0,P.length-pe),be=ce.slice(0,ce.length-pe);return he(F,oe,be,Ee)}}if(I.length>0&&D&&D.length===0)e:{var Se=E.slice(0,I.index),Ee=E.slice(I.index+I.length),Q=Se.length,pe=Ee.length;if($<Q+pe)break e;var xe=C.slice(0,Q),_e=C.slice($-pe);if(Se!==xe||Ee!==_e)break e;var oe=E.slice(Q,O-pe),be=C.slice(Q,$-pe);return he(Se,oe,be,Ee)}return null}function Ie(E,C,v,I){return r(E,C,v,I,!0)}return Ie.INSERT=e,Ie.DELETE=n,Ie.EQUAL=t,Fs=Ie,Fs}var Rr={exports:{}};Rr.exports;var _a;function qo(){return _a||(_a=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Function]",p="[object GeneratorFunction]",h="[object Map]",g="[object Number]",y="[object Object]",_="[object Promise]",N="[object RegExp]",T="[object Set]",L="[object String]",w="[object Symbol]",k="[object WeakMap]",M="[object ArrayBuffer]",V="[object DataView]",re="[object Float32Array]",he="[object Float64Array]",Ce="[object Int8Array]",Ie="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",v="[object Uint8ClampedArray]",I="[object Uint16Array]",D="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,$=/\w*$/,B=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,P={};P[i]=P[a]=P[M]=P[V]=P[l]=P[c]=P[re]=P[he]=P[Ce]=P[Ie]=P[E]=P[h]=P[g]=P[y]=P[N]=P[T]=P[L]=P[w]=P[C]=P[v]=P[I]=P[D]=!0,P[u]=P[f]=P[k]=!1;var J=typeof cn=="object"&&cn&&cn.Object===Object&&cn,X=typeof self=="object"&&self&&self.Object===Object&&self,se=J||X||Function("return this")(),ce=e&&!e.nodeType&&e,Q=ce&&!0&&n&&!n.nodeType&&n,Se=Q&&Q.exports===ce;function xe(o,d){return o.set(d[0],d[1]),o}function oe(o,d){return o.add(d),o}function be(o,d){for(var b=-1,S=o?o.length:0;++b<S&&d(o[b],b,o)!==!1;);return o}function ue(o,d){for(var b=-1,S=d.length,ae=o.length;++b<S;)o[ae+b]=d[b];return o}function pe(o,d,b,S){for(var ae=-1,Y=o?o.length:0;++ae<Y;)b=d(b,o[ae],ae,o);return b}function Ee(o,d){for(var b=-1,S=Array(o);++b<o;)S[b]=d(b);return S}function _e(o,d){return o?.[d]}function De(o){var d=!1;if(o!=null&&typeof o.toString!="function")try{d=!!(o+"")}catch{}return d}function ze(o){var d=-1,b=Array(o.size);return o.forEach((function(S,ae){b[++d]=[ae,S]})),b}function En(o,d){return function(b){return o(d(b))}}function Fn(o){var d=-1,b=Array(o.size);return o.forEach((function(S){b[++d]=S})),b}var fr=Array.prototype,gr=Function.prototype,$t=Object.prototype,yn=se["__core-js_shared__"],Hn=function(){var o=/[^.]+$/.exec(yn&&yn.keys&&yn.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),_n=gr.toString,Ke=$t.hasOwnProperty,Pt=$t.toString,It=RegExp("^"+_n.call(Ke).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=Se?se.Buffer:void 0,Ut=se.Symbol,vn=se.Uint8Array,rt=En(Object.getPrototypeOf,Object),zn=Object.create,Kn=$t.propertyIsEnumerable,pr=fr.splice,Yt=Object.getOwnPropertySymbols,Qt=ct?ct.isBuffer:void 0,Gn=En(Object.keys,Object),Xt=at(se,"DataView"),Et=at(se,"Map"),st=at(se,"Promise"),Ft=at(se,"Set"),Nn=at(se,"WeakMap"),Rt=at(Object,"create"),ut=q(Xt),m=q(Et),x=q(st),U=q(Ft),te=q(Nn),ve=Ut?Ut.prototype:void 0,Oe=ve?ve.valueOf:void 0;function H(o){var d=-1,b=o?o.length:0;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function z(){this.__data__=Rt?Rt(null):{}}function ne(o){return this.has(o)&&delete this.__data__[o]}function Be(o){var d=this.__data__;if(Rt){var b=d[o];return b===r?void 0:b}return Ke.call(d,o)?d[o]:void 0}function Re(o){var d=this.__data__;return Rt?d[o]!==void 0:Ke.call(d,o)}function yt(o,d){var b=this.__data__;return b[o]=Rt&&d===void 0?r:d,this}H.prototype.clear=z,H.prototype.delete=ne,H.prototype.get=Be,H.prototype.has=Re,H.prototype.set=yt;function $e(o){var d=-1,b=o?o.length:0;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function Tn(){this.__data__=[]}function mr(o){var d=this.__data__,b=tn(d,o);if(b<0)return!1;var S=d.length-1;return b==S?d.pop():pr.call(d,b,1),!0}function An(o){var d=this.__data__,b=tn(d,o);return b<0?void 0:d[b][1]}function br(o){return tn(this.__data__,o)>-1}function Er(o,d){var b=this.__data__,S=tn(b,o);return S<0?b.push([o,d]):b[S][1]=d,this}$e.prototype.clear=Tn,$e.prototype.delete=mr,$e.prototype.get=An,$e.prototype.has=br,$e.prototype.set=Er;function Ge(o){var d=-1,b=o?o.length:0;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function jn(){this.__data__={hash:new H,map:new(Et||$e),string:new H}}function Jt(o){return Ve(this,o).delete(o)}function yr(o){return Ve(this,o).get(o)}function _r(o){return Ve(this,o).has(o)}function vr(o,d){return Ve(this,o).set(o,d),this}Ge.prototype.clear=jn,Ge.prototype.delete=Jt,Ge.prototype.get=yr,Ge.prototype.has=_r,Ge.prototype.set=vr;function Ye(o){this.__data__=new $e(o)}function dt(){this.__data__=new $e}function Vn(o){return this.__data__.delete(o)}function Zn(o){return this.__data__.get(o)}function Nr(o){return this.__data__.has(o)}function Tr(o,d){var b=this.__data__;if(b instanceof $e){var S=b.__data__;if(!Et||S.length<t-1)return S.push([o,d]),this;b=this.__data__=new Ge(S)}return b.set(o,d),this}Ye.prototype.clear=dt,Ye.prototype.delete=Vn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function en(o,d){var b=qe(o)||de(o)?Ee(o.length,String):[],S=b.length,ae=!!S;for(var Y in o)Ke.call(o,Y)&&!(ae&&(Y=="length"||rn(Y,S)))&&b.push(Y);return b}function Ht(o,d,b){var S=o[d];(!(Ke.call(o,d)&&ie(S,b))||b===void 0&&!(d in o))&&(o[d]=b)}function tn(o,d){for(var b=o.length;b--;)if(ie(o[b][0],d))return b;return-1}function R(o,d){return o&&xn(d,Lr(d),o)}function W(o,d,b,S,ae,Y,me){var ge;if(S&&(ge=Y?S(o,ae,Y,me):S(o)),ge!==void 0)return ge;if(!kt(o))return o;var Pe=qe(o);if(Pe){if(ge=Qn(o),!d)return Sr(o,ge)}else{var Te=ee(o),Xe=Te==f||Te==p;if(Xn(o))return _t(o,d);if(Te==y||Te==i||Xe&&!Y){if(De(o))return Y?o:{};if(ge=we(Xe?{}:o),!d)return nn(o,R(ge,o))}else{if(!P[Te])return Y?o:{};ge=Ae(o,Te,W,d)}}me||(me=new Ye);var it=me.get(o);if(it)return it;if(me.set(o,ge),!Pe)var Fe=b?Yn(o):Lr(o);return be(Fe||o,(function(Je,Ze){Fe&&(Ze=Je,Je=o[Ze]),Ht(ge,Ze,W(Je,d,b,S,Ze,o,me))})),ge}function le(o){return kt(o)?zn(o):{}}function Ne(o,d,b){var S=d(o);return qe(o)?S:ue(S,b(o))}function Me(o){return Pt.call(o)}function tt(o){if(!kt(o)||On(o))return!1;var d=Or(o)||De(o)?It:B;return d.test(q(o))}function ht(o){if(!sn(o))return Gn(o);var d=[];for(var b in Object(o))Ke.call(o,b)&&b!="constructor"&&d.push(b);return d}function _t(o,d){if(d)return o.slice();var b=new o.constructor(o.length);return o.copy(b),b}function Ue(o){var d=new o.constructor(o.byteLength);return new vn(d).set(new vn(o)),d}function je(o,d){var b=d?Ue(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.byteLength)}function wn(o,d,b){var S=d?b(ze(o),!0):ze(o);return pe(S,xe,new o.constructor)}function Sn(o){var d=new o.constructor(o.source,$.exec(o));return d.lastIndex=o.lastIndex,d}function Wn(o,d,b){var S=d?b(Fn(o),!0):Fn(o);return pe(S,oe,new o.constructor)}function Ar(o){return Oe?Object(Oe.call(o)):{}}function wr(o,d){var b=d?Ue(o.buffer):o.buffer;return new o.constructor(b,o.byteOffset,o.length)}function Sr(o,d){var b=-1,S=o.length;for(d||(d=Array(S));++b<S;)d[b]=o[b];return d}function xn(o,d,b,S){b||(b={});for(var ae=-1,Y=d.length;++ae<Y;){var me=d[ae],ge=void 0;Ht(b,me,ge===void 0?o[me]:ge)}return b}function nn(o,d){return xn(o,ot(o),d)}function Yn(o){return Ne(o,Lr,ot)}function Ve(o,d){var b=o.__data__;return vt(d)?b[typeof d=="string"?"string":"hash"]:b.map}function at(o,d){var b=_e(o,d);return tt(b)?b:void 0}var ot=Yt?En(Yt,Object):Ds,ee=Me;(Xt&&ee(new Xt(new ArrayBuffer(1)))!=V||Et&&ee(new Et)!=h||st&&ee(st.resolve())!=_||Ft&&ee(new Ft)!=T||Nn&&ee(new Nn)!=k)&&(ee=function(o){var d=Pt.call(o),b=d==y?o.constructor:void 0,S=b?q(b):void 0;if(S)switch(S){case ut:return V;case m:return h;case x:return _;case U:return T;case te:return k}return d});function Qn(o){var d=o.length,b=o.constructor(d);return d&&typeof o[0]=="string"&&Ke.call(o,"index")&&(b.index=o.index,b.input=o.input),b}function we(o){return typeof o.constructor=="function"&&!sn(o)?le(rt(o)):{}}function Ae(o,d,b,S){var ae=o.constructor;switch(d){case M:return Ue(o);case l:case c:return new ae(+o);case V:return je(o,S);case re:case he:case Ce:case Ie:case E:case C:case v:case I:case D:return wr(o,S);case h:return wn(o,S,b);case g:case L:return new ae(o);case N:return Sn(o);case T:return Wn(o,S,b);case w:return Ar(o)}}function rn(o,d){return d=d??s,!!d&&(typeof o=="number"||F.test(o))&&o>-1&&o%1==0&&o<d}function vt(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function On(o){return!!Hn&&Hn in o}function sn(o){var d=o&&o.constructor,b=typeof d=="function"&&d.prototype||$t;return o===b}function q(o){if(o!=null){try{return _n.call(o)}catch{}try{return o+""}catch{}}return""}function j(o){return W(o,!0,!0)}function ie(o,d){return o===d||o!==o&&d!==d}function de(o){return xr(o)&&Ke.call(o,"callee")&&(!Kn.call(o,"callee")||Pt.call(o)==i)}var qe=Array.isArray;function Qe(o){return o!=null&&Xr(o.length)&&!Or(o)}function xr(o){return Jr(o)&&Qe(o)}var Xn=Qt||Bs;function Or(o){var d=kt(o)?Pt.call(o):"";return d==f||d==p}function Xr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function kt(o){var d=typeof o;return!!o&&(d=="object"||d=="function")}function Jr(o){return!!o&&typeof o=="object"}function Lr(o){return Qe(o)?en(o):ht(o)}function Ds(){return[]}function Bs(){return!1}n.exports=j}(Rr,Rr.exports)),Rr.exports}var kr={exports:{}};kr.exports;var va;function $o(){return va||(va=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",p="[object Date]",h="[object Error]",g="[object Function]",y="[object GeneratorFunction]",_="[object Map]",N="[object Number]",T="[object Null]",L="[object Object]",w="[object Promise]",k="[object Proxy]",M="[object RegExp]",V="[object Set]",re="[object String]",he="[object Symbol]",Ce="[object Undefined]",Ie="[object WeakMap]",E="[object ArrayBuffer]",C="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",D="[object Int8Array]",O="[object Int16Array]",$="[object Int32Array]",B="[object Uint8Array]",F="[object Uint8ClampedArray]",P="[object Uint16Array]",J="[object Uint32Array]",X=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,ce=/^(?:0|[1-9]\d*)$/,Q={};Q[v]=Q[I]=Q[D]=Q[O]=Q[$]=Q[B]=Q[F]=Q[P]=Q[J]=!0,Q[l]=Q[c]=Q[E]=Q[f]=Q[C]=Q[p]=Q[h]=Q[g]=Q[_]=Q[N]=Q[L]=Q[M]=Q[V]=Q[re]=Q[Ie]=!1;var Se=typeof cn=="object"&&cn&&cn.Object===Object&&cn,xe=typeof self=="object"&&self&&self.Object===Object&&self,oe=Se||xe||Function("return this")(),be=e&&!e.nodeType&&e,ue=be&&!0&&n&&!n.nodeType&&n,pe=ue&&ue.exports===be,Ee=pe&&Se.process,_e=function(){try{return Ee&&Ee.binding&&Ee.binding("util")}catch{}}(),De=_e&&_e.isTypedArray;function ze(o,d){for(var b=-1,S=o==null?0:o.length,ae=0,Y=[];++b<S;){var me=o[b];d(me,b,o)&&(Y[ae++]=me)}return Y}function En(o,d){for(var b=-1,S=d.length,ae=o.length;++b<S;)o[ae+b]=d[b];return o}function Fn(o,d){for(var b=-1,S=o==null?0:o.length;++b<S;)if(d(o[b],b,o))return!0;return!1}function fr(o,d){for(var b=-1,S=Array(o);++b<o;)S[b]=d(b);return S}function gr(o){return function(d){return o(d)}}function $t(o,d){return o.has(d)}function yn(o,d){return o?.[d]}function Hn(o){var d=-1,b=Array(o.size);return o.forEach((function(S,ae){b[++d]=[ae,S]})),b}function _n(o,d){return function(b){return o(d(b))}}function Ke(o){var d=-1,b=Array(o.size);return o.forEach((function(S){b[++d]=S})),b}var Pt=Array.prototype,It=Function.prototype,ct=Object.prototype,Ut=oe["__core-js_shared__"],vn=It.toString,rt=ct.hasOwnProperty,zn=function(){var o=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Kn=ct.toString,pr=RegExp("^"+vn.call(rt).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yt=pe?oe.Buffer:void 0,Qt=oe.Symbol,Gn=oe.Uint8Array,Xt=ct.propertyIsEnumerable,Et=Pt.splice,st=Qt?Qt.toStringTag:void 0,Ft=Object.getOwnPropertySymbols,Nn=Yt?Yt.isBuffer:void 0,Rt=_n(Object.keys,Object),ut=ot(oe,"DataView"),m=ot(oe,"Map"),x=ot(oe,"Promise"),U=ot(oe,"Set"),te=ot(oe,"WeakMap"),ve=ot(Object,"create"),Oe=q(ut),H=q(m),z=q(x),ne=q(U),Be=q(te),Re=Qt?Qt.prototype:void 0,yt=Re?Re.valueOf:void 0;function $e(o){var d=-1,b=o==null?0:o.length;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function Tn(){this.__data__=ve?ve(null):{},this.size=0}function mr(o){var d=this.has(o)&&delete this.__data__[o];return this.size-=d?1:0,d}function An(o){var d=this.__data__;if(ve){var b=d[o];return b===r?void 0:b}return rt.call(d,o)?d[o]:void 0}function br(o){var d=this.__data__;return ve?d[o]!==void 0:rt.call(d,o)}function Er(o,d){var b=this.__data__;return this.size+=this.has(o)?0:1,b[o]=ve&&d===void 0?r:d,this}$e.prototype.clear=Tn,$e.prototype.delete=mr,$e.prototype.get=An,$e.prototype.has=br,$e.prototype.set=Er;function Ge(o){var d=-1,b=o==null?0:o.length;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function jn(){this.__data__=[],this.size=0}function Jt(o){var d=this.__data__,b=_t(d,o);if(b<0)return!1;var S=d.length-1;return b==S?d.pop():Et.call(d,b,1),--this.size,!0}function yr(o){var d=this.__data__,b=_t(d,o);return b<0?void 0:d[b][1]}function _r(o){return _t(this.__data__,o)>-1}function vr(o,d){var b=this.__data__,S=_t(b,o);return S<0?(++this.size,b.push([o,d])):b[S][1]=d,this}Ge.prototype.clear=jn,Ge.prototype.delete=Jt,Ge.prototype.get=yr,Ge.prototype.has=_r,Ge.prototype.set=vr;function Ye(o){var d=-1,b=o==null?0:o.length;for(this.clear();++d<b;){var S=o[d];this.set(S[0],S[1])}}function dt(){this.size=0,this.__data__={hash:new $e,map:new(m||Ge),string:new $e}}function Vn(o){var d=at(this,o).delete(o);return this.size-=d?1:0,d}function Zn(o){return at(this,o).get(o)}function Nr(o){return at(this,o).has(o)}function Tr(o,d){var b=at(this,o),S=b.size;return b.set(o,d),this.size+=b.size==S?0:1,this}Ye.prototype.clear=dt,Ye.prototype.delete=Vn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function en(o){var d=-1,b=o==null?0:o.length;for(this.__data__=new Ye;++d<b;)this.add(o[d])}function Ht(o){return this.__data__.set(o,r),this}function tn(o){return this.__data__.has(o)}en.prototype.add=en.prototype.push=Ht,en.prototype.has=tn;function R(o){var d=this.__data__=new Ge(o);this.size=d.size}function W(){this.__data__=new Ge,this.size=0}function le(o){var d=this.__data__,b=d.delete(o);return this.size=d.size,b}function Ne(o){return this.__data__.get(o)}function Me(o){return this.__data__.has(o)}function tt(o,d){var b=this.__data__;if(b instanceof Ge){var S=b.__data__;if(!m||S.length<t-1)return S.push([o,d]),this.size=++b.size,this;b=this.__data__=new Ye(S)}return b.set(o,d),this.size=b.size,this}R.prototype.clear=W,R.prototype.delete=le,R.prototype.get=Ne,R.prototype.has=Me,R.prototype.set=tt;function ht(o,d){var b=de(o),S=!b&&ie(o),ae=!b&&!S&&Qe(o),Y=!b&&!S&&!ae&&Jr(o),me=b||S||ae||Y,ge=me?fr(o.length,String):[],Pe=ge.length;for(var Te in o)rt.call(o,Te)&&!(me&&(Te=="length"||ae&&(Te=="offset"||Te=="parent")||Y&&(Te=="buffer"||Te=="byteLength"||Te=="byteOffset")||Ae(Te,Pe)))&&ge.push(Te);return ge}function _t(o,d){for(var b=o.length;b--;)if(j(o[b][0],d))return b;return-1}function Ue(o,d,b){var S=d(o);return de(o)?S:En(S,b(o))}function je(o){return o==null?o===void 0?Ce:T:st&&st in Object(o)?ee(o):sn(o)}function wn(o){return kt(o)&&je(o)==l}function Sn(o,d,b,S,ae){return o===d?!0:o==null||d==null||!kt(o)&&!kt(d)?o!==o&&d!==d:Wn(o,d,b,S,Sn,ae)}function Wn(o,d,b,S,ae,Y){var me=de(o),ge=de(d),Pe=me?c:we(o),Te=ge?c:we(d);Pe=Pe==l?L:Pe,Te=Te==l?L:Te;var Xe=Pe==L,it=Te==L,Fe=Pe==Te;if(Fe&&Qe(o)){if(!Qe(d))return!1;me=!0,Xe=!1}if(Fe&&!Xe)return Y||(Y=new R),me||Jr(o)?xn(o,d,b,S,ae,Y):nn(o,d,Pe,b,S,ae,Y);if(!(b&s)){var Je=Xe&&rt.call(o,"__wrapped__"),Ze=it&&rt.call(d,"__wrapped__");if(Je||Ze){var an=Je?o.value():o,zt=Ze?d.value():d;return Y||(Y=new R),ae(an,zt,b,S,Y)}}return Fe?(Y||(Y=new R),Yn(o,d,b,S,ae,Y)):!1}function Ar(o){if(!Xr(o)||vt(o))return!1;var d=Xn(o)?pr:se;return d.test(q(o))}function wr(o){return kt(o)&&Or(o.length)&&!!Q[je(o)]}function Sr(o){if(!On(o))return Rt(o);var d=[];for(var b in Object(o))rt.call(o,b)&&b!="constructor"&&d.push(b);return d}function xn(o,d,b,S,ae,Y){var me=b&s,ge=o.length,Pe=d.length;if(ge!=Pe&&!(me&&Pe>ge))return!1;var Te=Y.get(o);if(Te&&Y.get(d))return Te==d;var Xe=-1,it=!0,Fe=b&i?new en:void 0;for(Y.set(o,d),Y.set(d,o);++Xe<ge;){var Je=o[Xe],Ze=d[Xe];if(S)var an=me?S(Ze,Je,Xe,d,o,Y):S(Je,Ze,Xe,o,d,Y);if(an!==void 0){if(an)continue;it=!1;break}if(Fe){if(!Fn(d,(function(zt,Ln){if(!$t(Fe,Ln)&&(Je===zt||ae(Je,zt,b,S,Y)))return Fe.push(Ln)}))){it=!1;break}}else if(!(Je===Ze||ae(Je,Ze,b,S,Y))){it=!1;break}}return Y.delete(o),Y.delete(d),it}function nn(o,d,b,S,ae,Y,me){switch(b){case C:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case E:return!(o.byteLength!=d.byteLength||!Y(new Gn(o),new Gn(d)));case f:case p:case N:return j(+o,+d);case h:return o.name==d.name&&o.message==d.message;case M:case re:return o==d+"";case _:var ge=Hn;case V:var Pe=S&s;if(ge||(ge=Ke),o.size!=d.size&&!Pe)return!1;var Te=me.get(o);if(Te)return Te==d;S|=i,me.set(o,d);var Xe=xn(ge(o),ge(d),S,ae,Y,me);return me.delete(o),Xe;case he:if(yt)return yt.call(o)==yt.call(d)}return!1}function Yn(o,d,b,S,ae,Y){var me=b&s,ge=Ve(o),Pe=ge.length,Te=Ve(d),Xe=Te.length;if(Pe!=Xe&&!me)return!1;for(var it=Pe;it--;){var Fe=ge[it];if(!(me?Fe in d:rt.call(d,Fe)))return!1}var Je=Y.get(o);if(Je&&Y.get(d))return Je==d;var Ze=!0;Y.set(o,d),Y.set(d,o);for(var an=me;++it<Pe;){Fe=ge[it];var zt=o[Fe],Ln=d[Fe];if(S)var Ki=me?S(Ln,zt,Fe,d,o,Y):S(zt,Ln,Fe,o,d,Y);if(!(Ki===void 0?zt===Ln||ae(zt,Ln,b,S,Y):Ki)){Ze=!1;break}an||(an=Fe=="constructor")}if(Ze&&!an){var es=o.constructor,ts=d.constructor;es!=ts&&"constructor"in o&&"constructor"in d&&!(typeof es=="function"&&es instanceof es&&typeof ts=="function"&&ts instanceof ts)&&(Ze=!1)}return Y.delete(o),Y.delete(d),Ze}function Ve(o){return Ue(o,Lr,Qn)}function at(o,d){var b=o.__data__;return rn(d)?b[typeof d=="string"?"string":"hash"]:b.map}function ot(o,d){var b=yn(o,d);return Ar(b)?b:void 0}function ee(o){var d=rt.call(o,st),b=o[st];try{o[st]=void 0;var S=!0}catch{}var ae=Kn.call(o);return S&&(d?o[st]=b:delete o[st]),ae}var Qn=Ft?function(o){return o==null?[]:(o=Object(o),ze(Ft(o),(function(d){return Xt.call(o,d)})))}:Ds,we=je;(ut&&we(new ut(new ArrayBuffer(1)))!=C||m&&we(new m)!=_||x&&we(x.resolve())!=w||U&&we(new U)!=V||te&&we(new te)!=Ie)&&(we=function(o){var d=je(o),b=d==L?o.constructor:void 0,S=b?q(b):"";if(S)switch(S){case Oe:return C;case H:return _;case z:return w;case ne:return V;case Be:return Ie}return d});function Ae(o,d){return d=d??a,!!d&&(typeof o=="number"||ce.test(o))&&o>-1&&o%1==0&&o<d}function rn(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function vt(o){return!!zn&&zn in o}function On(o){var d=o&&o.constructor,b=typeof d=="function"&&d.prototype||ct;return o===b}function sn(o){return Kn.call(o)}function q(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function j(o,d){return o===d||o!==o&&d!==d}var ie=wn(function(){return arguments}())?wn:function(o){return kt(o)&&rt.call(o,"callee")&&!Xt.call(o,"callee")},de=Array.isArray;function qe(o){return o!=null&&Or(o.length)&&!Xn(o)}var Qe=Nn||Bs;function xr(o,d){return Sn(o,d)}function Xn(o){if(!Xr(o))return!1;var d=je(o);return d==g||d==y||d==u||d==k}function Or(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function Xr(o){var d=typeof o;return o!=null&&(d=="object"||d=="function")}function kt(o){return o!=null&&typeof o=="object"}var Jr=De?gr(De):wr;function Lr(o){return qe(o)?ht(o):Sr(o)}function Ds(){return[]}function Bs(){return!1}n.exports=xr}(kr,kr.exports)),kr.exports}var ss={},Na;function Nf(){if(Na)return ss;Na=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=qo(),e=$o();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let p=n(u);f||(p=Object.keys(p).reduce(((h,g)=>(p[g]!=null&&(h[g]=p[g]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(p[h]=c[h]);return Object.keys(p).length>0?p:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const f=Object.keys(c).concat(Object.keys(u)).reduce(((p,h)=>(e(c[h],u[h])||(p[h]=u[h]===void 0?null:u[h]),p)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((p,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(p[h]=u[h]),p)),{});return Object.keys(c).reduce(((p,h)=>(c[h]!==u[h]&&u[h]===void 0&&(p[h]=null),p)),f)}r.invert=a;function l(c,u,f=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!f)return u;const p=Object.keys(u).reduce(((h,g)=>(c[g]===void 0&&(h[g]=u[g]),h)),{});return Object.keys(p).length>0?p:void 0}r.transform=l}(t||(t={})),ss.default=t,ss}var is={},Ta;function Po(){if(Ta)return is;Ta=1,Object.defineProperty(is,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),is.default=n,is}var as={},Aa;function Tf(){if(Aa)return as;Aa=1,Object.defineProperty(as,"__esModule",{value:!0});const n=Po();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return as.default=e,as}var wa;function Af(){return wa||(wa=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=vf(),r=qo(),s=$o(),i=Nf();e.AttributeMap=i.default;const a=Po();e.Op=a.default;const l=Tf();e.OpIterator=l.default;const c="\0",u=(p,h)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(p)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,p[g],h[g]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y)}push(h){let g=this.ops.length,y=this.ops[g-1];if(h=r(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[g-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(g-=1,y=this.ops[g-1],typeof y!="object"))return this.ops.unshift(h),this;if(s(h.attributes,y.attributes)){if(typeof h.insert=="string"&&typeof y.insert=="string")return this.ops[g-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[g-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],y=[];return this.forEach((_=>{(h(_)?g:y).push(_)})),[g,y]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce(((h,g)=>g.insert?h+a.default.length(g):g.delete?h-g.delete:h),0)}length(){return this.reduce(((h,g)=>h+a.default.length(g)),0)}slice(h=0,g=1/0){const y=[],_=new l.default(this.ops);let N=0;for(;N<g&&_.hasNext();){let T;N<h?T=_.next(h-N):(T=_.next(g-N),y.push(T)),N+=a.default.length(T)}return new f(y)}compose(h){const g=new l.default(this.ops),y=new l.default(h.ops),_=[],N=y.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let L=N.retain;for(;g.peekType()==="insert"&&g.peekLength()<=L;)L-=g.peekLength(),_.push(g.next());N.retain-L>0&&y.next(N.retain-L)}const T=new f(_);for(;g.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(g.peekType()==="delete")T.push(g.next());else{const L=Math.min(g.peekLength(),y.peekLength()),w=g.next(L),k=y.next(L);if(k.retain){const M={};if(typeof w.retain=="number")M.retain=typeof k.retain=="number"?L:k.retain;else if(typeof k.retain=="number")w.retain==null?M.insert=w.insert:M.retain=w.retain;else{const re=w.retain==null?"insert":"retain",[he,Ce,Ie]=u(w[re],k.retain),E=f.getHandler(he);M[re]={[he]:E.compose(Ce,Ie,re==="retain")}}const V=i.default.compose(w.attributes,k.attributes,typeof w.retain=="number");if(V&&(M.attributes=V),T.push(M),!y.hasNext()&&s(T.ops[T.ops.length-1],M)){const re=new f(g.rest());return T.concat(re).chop()}}else typeof k.delete=="number"&&(typeof w.retain=="number"||typeof w.retain=="object"&&w.retain!==null)&&T.push(k)}return T.chop()}concat(h){const g=new f(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new f;const y=[this,h].map((w=>w.map((k=>{if(k.insert!=null)return typeof k.insert=="string"?k.insert:c;const M=w===h?"on":"with";throw new Error("diff() called "+M+" non-document")})).join(""))),_=new f,N=t(y[0],y[1],g,!0),T=new l.default(this.ops),L=new l.default(h.ops);return N.forEach((w=>{let k=w[1].length;for(;k>0;){let M=0;switch(w[0]){case t.INSERT:M=Math.min(L.peekLength(),k),_.push(L.next(M));break;case t.DELETE:M=Math.min(k,T.peekLength()),T.next(M),_.delete(M);break;case t.EQUAL:M=Math.min(T.peekLength(),L.peekLength(),k);const V=T.next(M),re=L.next(M);s(V.insert,re.insert)?_.retain(M,i.default.diff(V.attributes,re.attributes)):_.push(re).delete(M);break}k-=M}})),_.chop()}eachLine(h,g=`\n`){const y=new l.default(this.ops);let _=new f,N=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const T=y.peek(),L=a.default.length(T)-y.peekLength(),w=typeof T.insert=="string"?T.insert.indexOf(g,L)-L:-1;if(w<0)_.push(y.next());else if(w>0)_.push(y.next(w));else{if(h(_,y.next(1).attributes||{},N)===!1)return;N+=1,_=new f}}_.length()>0&&h(_,{},N)}invert(h){const g=new f;return this.reduce(((y,_)=>{if(_.insert)g.delete(a.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return g.retain(_.retain),y+_.retain;if(_.delete||typeof _.retain=="number"){const N=_.delete||_.retain;return h.slice(y,y+N).forEach((L=>{_.delete?g.push(L):_.retain&&_.attributes&&g.retain(a.default.length(L),i.default.invert(_.attributes,L.attributes))})),y+N}else if(typeof _.retain=="object"&&_.retain!==null){const N=h.slice(y,y+1),T=new l.default(N.ops).next(),[L,w,k]=u(_.retain,T.insert),M=f.getHandler(L);return g.retain({[L]:M.invert(w,k)},i.default.invert(_.attributes,T.attributes)),y+1}}return y}),0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const y=h,_=new l.default(this.ops),N=new l.default(y.ops),T=new f;for(;_.hasNext()||N.hasNext();)if(_.peekType()==="insert"&&(g||N.peekType()!=="insert"))T.retain(a.default.length(_.next()));else if(N.peekType()==="insert")T.push(N.next());else{const L=Math.min(_.peekLength(),N.peekLength()),w=_.next(L),k=N.next(L);if(w.delete)continue;if(k.delete)T.push(k);else{const M=w.retain,V=k.retain;let re=typeof V=="object"&&V!==null?V:L;if(typeof M=="object"&&M!==null&&typeof V=="object"&&V!==null){const he=Object.keys(M)[0];if(he===Object.keys(V)[0]){const Ce=f.getHandler(he);Ce&&(re={[he]:Ce.transform(M[he],V[he],g)})}}T.retain(re,i.default.transform(w.attributes,k.attributes,g))}}return T.chop()}transformPosition(h,g=!1){g=!!g;const y=new l.default(this.ops);let _=0;for(;y.hasNext()&&_<=h;){const N=y.peekLength(),T=y.peekType();if(y.next(),T==="delete"){h-=Math.min(N,h-_);continue}else T==="insert"&&(_<h||!g)&&(h+=N);_+=N}return h}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(rs,rs.exports)),rs.exports}var bt=Af();const K=Ii(bt);class Ct extends lt{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ct.blotName="break";Ct.tagName="BR";let Ot=class extends ys{};const wf={"&":"&","<":"<",">":">",'"':""","'":"'"};function Cs(n){return n.replace(/[&<>"']/g,(e=>wf[e]))}let mn=class Cn extends Li{static allowedChildren=[Cn,Ct,lt,Ot];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=Cn.order.indexOf(e),s=Cn.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(Cn.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Z.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Cn&&Cn.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};const Sa=1;class We extends Ur{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Uo(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Z.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`\n`),i=s.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;s.reduce(((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ct&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Sa),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-Sa)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}We.blotName="block";We.tagName="P";We.defaultChild=Ct;We.allowedChildren=[Ct,mn,lt,Ot];let mt=class extends lt{attach(){super.attach(),this.attributes=new Os(this.domNode)}delta(){return(new K).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Z.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`\n`),i=s.pop(),a=s.map((c=>{const u=this.scroll.create(We.blotName);return u.insertAt(0,c),u})),l=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,l)})),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}};mt.scope=Z.BLOCK_BLOT;function Uo(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(et).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),gt(r,{},e))),new K).insert(`\n`,gt(n))}function gt(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:gt(n.parent,e,t)}class At extends lt{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(At.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Z.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=At.CONTENTS.length,r.optimize(),r.formatAt(s,At.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ot?this.prev:null,r=t?t.length():0,s=this.next instanceof Ot?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(At.CONTENTS).join("");a.data=At.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(h,g)=>t&&h===t.domNode?g:h===a?r+g-1:s&&h===s.domNode?r+l.length+g:null,f=u(e.start.node,e.start.offset),p=u(e.end.node,e.end.offset);if(f!==null&&p!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:p}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=At.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var Hs={exports:{}},xa;function Sf(){return xa||(xa=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function s(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,p,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var g=new s(f,p||c,h),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],g]:c._events[y].push(g):(c._events[y]=g,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)e.call(f,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,g=p.length,y=new Array(g);h<g;h++)y[h]=p[h].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,p=this._events[f];return p?p.fn?1:p.length:0},l.prototype.emit=function(u,f,p,h,g,y){var _=t?t+u:u;if(!this._events[_])return!1;var N=this._events[_],T=arguments.length,L,w;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,p),!0;case 4:return N.fn.call(N.context,f,p,h),!0;case 5:return N.fn.call(N.context,f,p,h,g),!0;case 6:return N.fn.call(N.context,f,p,h,g,y),!0}for(w=1,L=new Array(T-1);w<T;w++)L[w-1]=arguments[w];N.fn.apply(N.context,L)}else{var k=N.length,M;for(w=0;w<k;w++)switch(N[w].once&&this.removeListener(u,N[w].fn,void 0,!0),T){case 1:N[w].fn.call(N[w].context);break;case 2:N[w].fn.call(N[w].context,f);break;case 3:N[w].fn.call(N[w].context,f,p);break;case 4:N[w].fn.call(N[w].context,f,p,h);break;default:if(!L)for(M=1,L=new Array(T-1);M<T;M++)L[M-1]=arguments[M];N[w].fn.apply(N[w].context,L)}}return!0},l.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},l.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},l.prototype.removeListener=function(u,f,p,h){var g=t?t+u:u;if(!this._events[g])return this;if(!f)return a(this,g),this;var y=this._events[g];if(y.fn)y.fn===f&&(!h||y.once)&&(!p||y.context===p)&&a(this,g);else{for(var _=0,N=[],T=y.length;_<T;_++)(y[_].fn!==f||h&&!y[_].once||p&&y[_].context!==p)&&N.push(y[_]);N.length?this._events[g]=N.length===1?N[0]:N:a(this,g)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(Hs)),Hs.exports}var xf=Sf();const Of=Ii(xf),gi=new WeakMap,pi=["error","warn","log","info"];let mi="warn";function Fo(n){if(mi&&pi.indexOf(n)<=pi.indexOf(mi)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Wt(n){return pi.reduce(((e,t)=>(e[t]=Fo.bind(console,t,n),e)),{})}Wt.level=n=>{mi=n};Fo.level=Wt.level;const zs=Wt("quill:events"),Lf=["selectionchange","mousedown","mouseup","click"];Lf.forEach((n=>{document.addEventListener(n,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach((s=>{const i=gi.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class G extends Of{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",zs.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return zs.log.call(zs,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach((i=>{let{node:a,handler:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Ks=Wt("quill:selection");class kn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class Cf{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new kn(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,G.sources.USER),1)})),this.emitter.on(G.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(G.events.SCROLL_UPDATE,((s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some((l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root));this.update(a?G.sources.SILENT:s)}catch{}}))})),this.emitter.on(G.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(G.sources.SILENT)}})),this.update(G.sources.SILENT)}handleComposition(){this.emitter.on(G.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(G.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(G.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Z.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof et){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[f]=this.scroll.leaf(e+1);if(f){const[p]=this.scroll.line(e),[h]=this.scroll.line(e+1);p===h&&(i=f,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Ks.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Gs(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map((a=>{const[l,c]=a,u=this.scroll.find(l,!0),f=u.offset(this.scroll);return c===0?f:u instanceof et?f+u.index(l,c):f+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new kn(i,s-i)}normalizeNative(e){if(!Gs(this.root,e.startContainer)||!e.collapsed&&!Gs(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i})),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,l]=this.scroll.leaf(s);return a?a.position(l,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Ks.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;if(typeof t=="string"&&(r=t,t=!1),Ks.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Oi(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[G.events.SELECTION_CHANGE,ar(this.lastRange),ar(t),e];this.emitter.emit(G.events.EDITOR_CHANGE,...i),e!==G.sources.SILENT&&this.emitter.emit(...i)}}}function Gs(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const If=/^[ -~]*$/;class Rf{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=Oa(e),s=new K;return Mf(r.ops.slice()).reduce(((a,l)=>{const c=bt.Op.length(l);let u=l.attributes||{},f=!1,p=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;p=!y.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(mt,a)[0]),this.scroll.insertAt(a,y);const[_,N]=this.scroll.line(a);let T=dn({},gt(_));if(_ instanceof We){const[L]=_.descendant(et,N);L&&(T=dn(T,gt(L)))}u=bt.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const y=Object.keys(l.insert)[0];if(y==null)return a;const _=this.scroll.query(y,Z.INLINE)!=null;if(_)(t<=a||this.scroll.descendant(mt,a)[0])&&(p=!0);else if(a>0){const[N,T]=this.scroll.descendant(et,a-1);N instanceof Ot?N.value()[T]!==`\n`&&(f=!0):N instanceof lt&&N.statics.scope===Z.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,y,l.insert[y]),_){const[N]=this.scroll.descendant(et,a);if(N){const T=dn({},gt(N));u=bt.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const y=Object.keys(l.retain)[0];if(y==null)return a;this.scroll.updateEmbedAt(a,y,l.retain[y])}Object.keys(u).forEach((y=>{this.scroll.formatAt(a,c,y,u[y])}));const h=f?1:0,g=p?1:0;return t+=h+g,s.retain(h),s.delete(g),a+c+h+g}),0),s.reduce(((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+bt.Op.length(l)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new K).retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach((i=>{this.scroll.lines(e,Math.max(t,1)).forEach((a=>{a.format(i,r[i])}))})),this.scroll.optimize();const s=(new K).retain(e).retain(t,ar(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach((i=>{this.scroll.formatAt(e,t,i,r[i])}));const s=(new K).retain(e).retain(t,ar(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new K)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach((l=>{const[c]=l;c instanceof We?r.push(c):c instanceof et&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(et,e,t));const[i,a]=[r,s].map((l=>{const c=l.shift();if(c==null)return{};let u=gt(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=kf(gt(f),u)}return u}));return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?Fr(r,s,t,!0):Fr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((r=>typeof r.insert=="string")).map((r=>r.insert)).join("")}insertContents(e,t){const r=Oa(t),s=(new K).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update((new K).retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`),this.scroll.insertAt(e,t),Object.keys(r).forEach((s=>{this.scroll.formatAt(e,t.length,s,r[s])})),this.update((new K).retain(e).insert(t,ar(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==We.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ct}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new K;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new K).insert(r).concat(l)),f=(new K).retain(e).concat(u);return this.applyDelta(f)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(If)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=gt(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(At.CONTENTS,""),u=(new K).insert(c),f=(new K).insert(i.value()),p=r&&{oldRange:La(r.oldRange,-l),newRange:La(r.newRange,-l)};e=(new K).retain(l).concat(u.diff(f,p)).reduce(((g,y)=>y.insert?g.insert(y.insert,a):g.push(y)),new K),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Oi(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function rr(n,e,t){if(n.length===0){const[g]=js(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${rr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=js(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Fr(r,s,i)}${rr(c,a,t)}`:`<${u}><li>${rr(n,e+1,t)}`;const p=t[t.length-1];if(a===e&&l===p)return`</li><li${f}>${Fr(r,s,i)}${rr(c,a,t)}`;const[h]=js(t.pop());return`</li></${h}>${rr(n,e-1,t)}`}function Fr(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ot)return Cs(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof xt){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((f,p,h)=>{const g="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:p,length:h,indent:g.indent||0,type:g.list})})),rr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,p)=>{s.push(Fr(u,f,p))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function kf(n,e){return Object.keys(e).reduce(((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t}),{})}function js(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function Oa(n){return n.reduce(((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`);return e.insert(r,t.attributes)}return e.push(t)}),new K)}function La(n,e){let{index:t,length:r}=n;return new kn(t+e,r)}function Mf(n){const e=[];return n.forEach((t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach(((s,i)=>{i&&e.push({insert:`\n`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})})):e.push(t)})),e}class qt{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const os="\ufeff";class Ri extends lt{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((r=>{this.contentNode.appendChild(r)})),this.leftGuard=document.createTextNode(os),this.rightGuard=document.createTextNode(os),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const s=e.data.split(os).join("");if(e===this.leftGuard)if(this.prev instanceof Ot){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ot?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=os,t}update(e,t){e.forEach((r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}}))}}class Df{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Ri)&&(this.emitter.emit(G.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(G.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(G.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(G.events.COMPOSITION_END,e),this.isComposing=!1}}class hr{static DEFAULTS={modules:{}};static themes={default:hr};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{this.modules[e]==null&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const Bf=n=>n.parentElement||n.getRootNode().host||null,qf=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},ls=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Ca=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,$f=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:qf(s),l=getComputedStyle(s),c=Ca(r.left,r.right,a.left,a.right,ls(l.scrollPaddingLeft),ls(l.scrollPaddingRight)),u=Ca(r.top,r.bottom,a.top,a.bottom,ls(l.scrollPaddingTop),ls(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:p}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,g=s.scrollTop-p;r={left:r.left-h,top:r.top-g,right:r.right-h,bottom:r.bottom-g}}s=i||l.position==="fixed"?null:Bf(s)}},Pf=100,Uf=["block","break","cursor","inline","scroll","text"],Ff=(n,e,t)=>{const r=new ur;return Uf.forEach((s=>{const i=e.query(s);i&&r.register(i)})),n.forEach((s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>Pf){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},lr=Wt("quill"),cs=new ur;xt.uiClass="ql-ui";class A{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:cs,theme:"default"};static events=G.events;static sources=G.sources;static version="2.0.3";static imports={delta:K,parchment:_f,"core/module":qt,"core/theme":hr};static debug(e){e===!0&&(e="log"),Wt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return gi.get(e)||cs.find(e,t)}static import(e){return this.imports[e]==null&&lr.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach((s=>{this.register(s,e[s],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&lr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&cs.register(t),typeof t.register=="function"&&t.register(cs)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=Hf(e,t),this.container=this.options.container,this.container==null){lr.error("Invalid Quill container",e);return}this.options.debug&&A.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",gi.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new G;const s=Ci.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new Rf(this.scroll),this.selection=new Cf(this.scroll,this.emitter),this.composition=new Df(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(G.events.EDITOR_CHANGE,(a=>{a===G.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(G.events.SCROLL_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Nt.call(this,(()=>this.editor.update(null,l,f)),a)})),this.emitter.on(G.events.SCROLL_EMBED_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Nt.call(this,(()=>{const p=(new K).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(p,[],f)}),A.sources.USER)})),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`\n`});this.setContents(a)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=Kt(e,t,r),Nt.call(this,(()=>this.editor.deleteText(e,t)),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:G.sources.API;return Nt.call(this,(()=>{const s=this.getSelection(!0);let i=new K;if(s==null)return i;if(this.scroll.query(e,Z.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,G.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=Kt(e,t,r,s,i),Nt.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=Kt(e,t,r,s,i),Nt.call(this,(()=>this.editor.formatText(e,t,a)),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=Kt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Kt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Kt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A.sources.API;return Nt.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=Kt(e,0,r,s,i),Nt.call(this,(()=>this.editor.insertText(e,t,a)),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,r){return[e,t,,r]=Kt(e,t,r),Nt.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){$f(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;return Nt.call(this,(()=>{e=new K(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)}),t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||A.sources.API):([e,t,,r]=Kt(e,t,r),this.selection.setRange(new kn(Math.max(0,e),t),r),r!==G.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;const r=(new K).insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:G.sources.API;return Nt.call(this,(()=>(e=new K(e),this.editor.applyDelta(e))),t,!0)}}function Ia(n){return typeof n=="string"?document.querySelector(n):n}function Vs(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function Ra(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function Hf(n,e){const t=Ia(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===A.DEFAULTS.theme?hr:A.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=A.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=Vs(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=dn({},Vs(i),Vs(l),u),p={...a,...Ra(c),...Ra(e)};let h=e.registry;return h?e.formats&&lr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Ff(e.formats,p.registry,lr):p.registry,{...p,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((g,y)=>{let[_,N]=y;if(!N)return g;const T=A.import(`modules/${_}`);return T==null?(lr.error(`Cannot load ${_} module. Are you sure you registered it?`),g):{...g,[_]:dn({},T.DEFAULTS||{},N)}}),{}),bounds:Ia(p.bounds)}}function Nt(n,e,t,r){if(!this.isEnabled()&&e===G.sources.USER&&!this.allowReadOnlyEdits)return new K;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=ka(s,a,e):r!==0&&(s=ka(s,t,r,e)),this.setSelection(s,G.sources.SILENT)),a.length()>0){const l=[G.events.TEXT_CHANGE,a,i,e];this.emitter.emit(G.events.EDITOR_CHANGE,...l),e!==G.sources.SILENT&&this.emitter.emit(...l)}return a}function Kt(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||G.sources.API,[n,e,i,s]}function ka(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map((l=>e.transformPosition(l,r!==G.sources.USER))):[i,a]=[n.index,n.index+n.length].map((l=>l<e||l===e&&r===G.sources.USER?l:s>=0?l+s:Math.max(e,l+s))),new kn(i,a-i)}class $n extends Ls{}function Ma(n){return n instanceof We||n instanceof mt}function Da(n){return typeof n.updateContent=="function"}class zf extends Ci{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=We;static allowedChildren=[We,mt,$n];constructor(e,t,r){let{emitter:s}=r;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(i=>this.handleDragStart(i)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(G.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(G.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(G.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof mt||i instanceof mt){this.optimize();return}const a=i.children.head instanceof Ct?null:i.children.head;r.moveChildren(i,a),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Z.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`\n`)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===Z.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat((new K).insert(`\n`))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(mt,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new K).insert({[i.key]:i.value});Zs(this,e,u);const f=i.type==="block"?1:0,p=e+u.length()+f;c&&this.insertAt(p-1,`\n`);const h=gt(this.line(e)[0]),g=bt.AttributeMap.diff(h,i.attributes)||{};Object.keys(g).forEach((y=>{this.formatAt(p-1,1,y,g[y])})),e=p}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);Zs(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((f=>{u.format(f,c.attributes[f])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Zs(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,s]=t;return r instanceof et?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Ma,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,a)=>{let l=[],c=a;return s.children.forEachAt(i,a,((u,f,p)=>{Ma(u)?l.push(u):u instanceof Ls&&(l=l.concat(r(u,f,c))),c-=p})),l};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(G.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=G.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter((r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!Da(i)})),e.length>0&&this.emitter.emit(G.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(G.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof mt),e);s&&s.statics.blotName===t&&Da(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new K;return e.forEach((s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`\n`);a.slice(0,-1).forEach((c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new K}));const l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,Z.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new K,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}})),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach((l=>{let[c,u]=l;this.query(c,Z.BLOCK&Z.BLOT)!=null?r=c:s[c]=u}));const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach((l=>{let[c,u]=l;i.formatAt(0,a,c,u)})),i}}function Zs(n,e,t){t.reduce(((r,s)=>{const i=bt.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(et,r),u=gt(c);a=bt.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,Z.INLINE)!=null){const[u]=n.descendant(et,r),f=gt(u);a=bt.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach((l=>{n.formatAt(r,i,l,a[l])})),r+i}),e)}const ki={scope:Z.BLOCK,whitelist:["right","center","justify"]},Kf=new Dt("align","align",ki),Ho=new Lt("align","ql-align",ki),zo=new pn("align","text-align",ki);class Ko extends pn{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map((s=>`00${parseInt(s,10).toString(16)}`.slice(-2))).join("")}`):t}}const Gf=new Lt("color","ql-color",{scope:Z.INLINE}),Mi=new Ko("color","color",{scope:Z.INLINE}),jf=new Lt("background","ql-bg",{scope:Z.INLINE}),Di=new Ko("background","background-color",{scope:Z.INLINE});class Pn extends $n{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((r=>r.length()<=1?"":r.domNode.innerText)).join(`\n`).slice(e,e+t)}html(e,t){return`<pre>\n${Cs(this.code(e,t))}\n</pre>`}}class nt extends We{static TAB=" ";static register(){A.register(Pn)}}class Bi extends mn{}Bi.blotName="code";Bi.tagName="CODE";nt.blotName="code-block";nt.className="ql-code-block";nt.tagName="DIV";Pn.blotName="code-block-container";Pn.className="ql-code-block-container";Pn.tagName="DIV";Pn.allowedChildren=[nt];nt.allowedChildren=[Ot,Ct,At];nt.requiredContainer=Pn;const qi={scope:Z.BLOCK,whitelist:["rtl"]},Go=new Dt("direction","dir",qi),jo=new Lt("direction","ql-direction",qi),Vo=new pn("direction","direction",qi),Zo={scope:Z.INLINE,whitelist:["serif","monospace"]},Wo=new Lt("font","ql-font",Zo);class Vf extends pn{value(e){return super.value(e).replace(/["']/g,"")}}const Yo=new Vf("font","font-family",Zo),Qo=new Lt("size","ql-size",{scope:Z.INLINE,whitelist:["small","large","huge"]}),Xo=new pn("size","font-size",{scope:Z.INLINE,whitelist:["10px","18px","32px"]}),Zf=Wt("quill:keyboard"),Wf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Is extends qt{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some((r=>!!t[r]!==e[r]&&t[r]!==null))?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Qf(e);if(s==null){Zf.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach((a=>{const l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((T=>Is.match(e,T)));if(s.length===0)return;const i=A.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[l,c]=this.quill.getLine(a.index),[u,f]=this.quill.getLeaf(a.index),[p,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),g=u instanceof ys?u.value().slice(0,f):"",y=p instanceof ys?p.value().slice(h):"",_={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:g,suffix:y,event:e};s.some((T=>{if(T.collapsed!=null&&T.collapsed!==_.collapsed||T.empty!=null&&T.empty!==_.empty||T.offset!=null&&T.offset!==_.offset)return!1;if(Array.isArray(T.format)){if(T.format.every((L=>_.format[L]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((L=>T.format[L]===!0?_.format[L]!=null:T.format[L]===!1?_.format[L]==null:Oi(T.format[L],_.format[L]))))return!1;return T.prefix!=null&&!T.prefix.test(_.prefix)||T.suffix!=null&&!T.suffix.test(_.suffix)?!1:T.handler.call(this,a,_,T)!==!0}))&&e.preventDefault()}))}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new K).retain(e.index-r).delete(r);if(t.offset===0){const[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),f=this.quill.getFormat(e.index-1,1);if(s=bt.AttributeMap.diff(u,f)||{},Object.keys(s).length>0){const p=(new K).retain(e.index+i.length()-2).retain(1,s);a=a.compose(p)}}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new K).retain(e.index).delete(r);if(t.offset>=i.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=bt.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){$i({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce(((i,a)=>(this.quill.scroll.query(a,Z.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i)),{}),s=(new K).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const Yf={bindings:{bold:Ws("bold"),italic:Ws("italic"),underline:Ws("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",A.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",A.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",A.sources.USER):e.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":Ba(!0),"outdent code-block":Ba(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,A.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=(new K).retain(n.index).delete(n.length).insert("\t");return this.quill.updateContents(t,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,A.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=(new K).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=(new K).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,s,i]=e.getTable(n),a=Xf(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(n.index+1,n.length,A.sources.SILENT)}else if(a>0){l+=t.length();const c=(new K).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(l,A.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,A.sources.USER):this.quill.setSelection(s+r.length(),A.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,s]=this.quill.getLine(n.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",A.sources.USER),this.quill.history.cutoff();const a=(new K).retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,A.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=(new K).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":us("ArrowLeft",!1),"embed left shift":us("ArrowLeft",!0),"embed right":us("ArrowRight",!1),"embed right shift":us("ArrowRight",!0),"table down":qa(!1),"table up":qa(!0)}};Is.DEFAULTS=Yf;function Ba(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,A.sources.USER),this.quill.setSelection(e.index+i.length,A.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach(((u,f)=>{n?(u.insertAt(0,i),f===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),f===0?l-=i.length:c-=i.length)})),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function us(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof lt?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,A.sources.USER):this.quill.setSelection(r.index-1,A.sources.USER):e?this.quill.setSelection(r.index,r.length+1,A.sources.USER):this.quill.setSelection(r.index+r.length+1,A.sources.USER),!1):!0}}}function Ws(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],A.sources.USER)}}}function qa(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,A.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Qf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=ar(n);else return null;return n.shortKey&&(n[Wf]=n.shortKey,delete n.shortKey),n}function $i(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=bt.AttributeMap.diff(a,i)||{}}e.deleteText(t,A.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Xf(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const Jf=/font-weight:\s*normal/,eg=["P","OL","UL"],$a=n=>n&&eg.includes(n.tagName),tg=n=>{Array.from(n.querySelectorAll("br")).filter((e=>$a(e.previousElementSibling)&&$a(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},ng=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(Jf))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function rg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(ng(n),tg(n))}const sg=/\bmso-list:[^;]*ignore/i,ig=/\bmso-list:[^;]*\bl(\d+)/i,ag=/\bmso-list:[^;]*\blevel(\d+)/i,og=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(ig);if(!r)return null;const s=Number(r[1]),i=t?.match(ag),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},lg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(sg)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>og(a,s))).filter((a=>a));for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach((p=>{const h=document.createElement("li");h.setAttribute("data-list",p.type),p.indent>1&&h.setAttribute("class",`ql-indent-${p.indent-1}`),h.innerHTML=p.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((p=>{let{element:h}=p;f?.removeChild(h)}))}};function cg(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&lg(n)}const ug=[cg,rg],dg=n=>{n.documentElement&&ug.forEach((e=>{e(n)}))},hg=Wt("quill:clipboard"),fg=[[Node.TEXT_NODE,Sg],[Node.TEXT_NODE,Ua],["br",yg],[Node.ELEMENT_NODE,Ua],[Node.ELEMENT_NODE,Eg],[Node.ELEMENT_NODE,bg],[Node.ELEMENT_NODE,Ag],["li",Ng],["ol, ul",Tg],["pre",_g],["tr",wg],["b",Ys("bold")],["i",Ys("italic")],["strike",Ys("strike")],["style",vg]],gg=[Kf,Go].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Pa=[zo,Di,Mi,Vo,Yo,Xo].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class pg extends qt{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(r=>this.onCaptureCopy(r,!1))),this.quill.root.addEventListener("cut",(r=>this.onCaptureCopy(r,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],fg.concat(this.options.matchers??[]).forEach((r=>{let[s,i]=r;this.addMatcher(s,i)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[nt.blotName])return(new K).insert(r||"",{[nt.blotName]:s[nt.blotName]});if(!t)return(new K).insert(r||"",s);const i=this.convertHTML(t);return Vr(i,`\n`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose((new K).retain(i.length()-1).delete(1)):i}normalizeHTML(e){dg(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return Pi(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,A.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents((new K).retain(e).concat(s),r),this.quill.setSelection(e+s.length(),A.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&$i({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((t=>t[0]!=="#")).join(`\n`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=(new DOMParser).parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);hg.log("onPaste",a,{text:r,html:s});const l=(new K).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,A.sources.USER),this.quill.setSelection(l.length()-e.length,A.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])}));break}})),[r,s]}}function Un(n,e,t,r){return r.query(e)?n.reduce(((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})}),new K):n}function Vr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function un(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof lt?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function mg(n,e){return n.previousElementSibling&&n.nextElementSibling&&!un(n.previousElementSibling,e)&&!un(n.nextElementSibling,e)}const ds=new WeakMap;function Jo(n){return n==null?!1:(ds.has(n)||(n.tagName==="PRE"?ds.set(n,!0):ds.set(n,Jo(n.parentNode))),ds.get(n))}function Pi(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce(((i,a)=>a(e,i,n)),new K):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((i,a)=>{let l=Pi(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce(((c,u)=>u(a,c,n)),l),l=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),l)),i.concat(l)}),new K):new K}function Ys(n){return(e,t,r)=>Un(t,n,!0,r)}function bg(n,e,t){const r=Dt.keys(n),s=Lt.keys(n),i=pn.keys(n),a={};return r.concat(s).concat(i).forEach((l=>{let c=t.query(l,Z.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=gg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Pa[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Pa[l],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((l,c)=>{let[u,f]=c;return Un(l,u,f,t)}),e)}function Eg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof lt){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,(new K).insert(s,r.formats(n,t))}else if(r.prototype instanceof Ur&&!Vr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Un(e,r.blotName,r.formats(n,t),t);return e}function yg(n,e){return Vr(e,`\n`)||e.insert(`\n`),e}function _g(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Un(e,"code-block",s,t)}function vg(){return new K}function Ng(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Vr(e,`\n`))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce(((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a),new K)}function Tg(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Un(e,"list",s,t)}function Ua(n,e,t){if(!Vr(e,`\n`)){if(un(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`\n`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(un(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof mt)return e.insert(`\n`);r=r.firstChild}}}return e}function Ag(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce(((i,a)=>{let[l,c]=a;return Un(i,l,c,t)}),e),parseFloat(s.textIndent||0)>0?(new K).insert("\t").concat(e):e}function wg(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Un(e,"table",i,t)}return e}function Sg(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!Jo(n)){if(r.trim().length===0&&r.includes(`\n`)&&!mg(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&un(n.parentElement,t)||n.previousSibling instanceof Element&&un(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&un(n.parentElement,t)||n.nextSibling instanceof Element&&un(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class xg extends qt{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(A.events.EDITOR_CHANGE,((r,s,i,a)=>{r===A.events.SELECTION_CHANGE?s&&a!==A.sources.SILENT&&(this.currentRange=s):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=bi(this.currentRange,s))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())}))}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:bi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,A.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Fa(this.stack.undo,e),Fa(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,A.sources.USER);else{const t=Lg(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function Fa(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&bi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Og(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some((r=>n.query(r,Z.BLOCK)!=null)):!1}function Lg(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return Og(n,e)&&(r-=1),r}function bi(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class el extends qt{constructor(e,t){super(e,t),e.root.addEventListener("drop",(r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}}))}upload(e,t){const r=[];Array.from(t).forEach((s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)})),r.length>0&&this.options.handler.call(this,e,r)}}el.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map((r=>new Promise((s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}))));Promise.all(t).then((r=>{const s=r.reduce(((i,a)=>i.insert({image:a})),(new K).retain(n.index).delete(n.length));this.quill.updateContents(s,G.sources.USER),this.quill.setSelection(n.index+r.length,G.sources.SILENT)}))}};const Cg=["insertText","insertReplacementText"];class Ig extends qt{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(A.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){$i({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new K).retain(e.index).insert(t,r),A.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,A.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Cg.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=Rg(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function Rg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const kg=/Mac/i.test(navigator.platform),Mg=100,Dg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||kg&&n.key==="a"&&n.ctrlKey===!0);class Bg extends qt{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof xt)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Dg(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Mg,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof xt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}A.register({"blots/block":We,"blots/block/embed":mt,"blots/break":Ct,"blots/container":$n,"blots/cursor":At,"blots/embed":Ri,"blots/inline":mn,"blots/scroll":zf,"blots/text":Ot,"modules/clipboard":pg,"modules/history":xg,"modules/keyboard":Is,"modules/uploader":el,"modules/input":Ig,"modules/uiNode":Bg});class qg extends Lt{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const $g=new qg("indent","ql-indent",{scope:Z.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Pg extends We{static blotName="blockquote";static tagName="blockquote"}class Ug extends We{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Zr extends $n{}Zr.blotName="list-container";Zr.tagName="OL";class Wr extends We{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){A.register(Zr)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Wr.blotName="list";Wr.tagName="LI";Zr.allowedChildren=[Wr];Wr.requiredContainer=Zr;class Ui extends mn{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Fg extends Ui{static blotName="italic";static tagName=["EM","I"]}class _s extends mn{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return tl(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}function tl(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class Hg extends mn{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}class zg extends Ui{static blotName="strike";static tagName=["S","STRIKE"]}class Kg extends mn{static blotName="underline";static tagName="U"}class Gg extends Ri{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const Ha=["alt","height","width"];let jg=class extends lt{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ha.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return tl(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){Ha.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const za=["height","width"];class Vg extends mt{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return za.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return _s.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){za.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Mr=new Lt("code-token","hljs",{scope:Z.INLINE});class Vt extends mn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(nt.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Mr.add(this.domNode,r)}format(e,t){e!==Vt.blotName?super.format(e,t):t?Mr.add(this.domNode,t):(Mr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Mr.value(this.domNode)||this.unwrap()}}Vt.blotName="code-token";Vt.className="ql-token";class pt extends nt{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Vt.blotName,!1),super.replaceWith(e,t)}}class Br extends Pn{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===pt.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===pt.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter((a=>a!==this.uiNode)).map((a=>a.textContent)).join(`\n`)}\n`,i=pt.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce(((c,u)=>c.concat(Uo(u,!1))),new K),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:p}=u;return f?(p&&Object.keys(p).forEach((h=>{[pt.blotName,Vt.blotName].includes(h)&&this.formatAt(c,f,h,p[h])})),c+f):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?pt.formats(r.domNode):"plain"}">\n${Cs(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=pt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Br.allowedChildren=[pt];pt.requiredContainer=Br;pt.allowedChildren=[Vt,At,Ot,Ct];const Zg=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class nl extends qt{static register(){A.register(Vt,!0),A.register(pt,!0),A.register(Br,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((r,s)=>{let{key:i}=s;return r[i]=!0,r}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(A.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Br))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(pt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=pt.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(A.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(A.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Br):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(A.sources.SILENT),r!=null&&this.quill.setSelection(r,A.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return Cs(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[nt.blotName]:t}),s.insert(i))),new K);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Zg(this.options.hljs,t,e),Pi(this.quill.scroll,r,[(s,i)=>{const a=Mr.value(s);return a?i.compose((new K).retain(i.length(),{[Vt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l))),i)],new WeakMap)}}nl.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class wt extends We{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Fi()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===wt.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Mn extends $n{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach((t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class hn extends $n{static blotName="table-body";static tagName="TBODY"}class vs extends $n{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Mn),t=e.reduce(((r,s)=>Math.max(s.children.length,r)),0);e.forEach((r=>{new Array(t-r.children.length).fill(0).forEach((()=>{let s;r.children.head!=null&&(s=wt.formats(r.children.head.domNode));const i=this.scroll.create(wt.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(hn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=wt.formats(r.children.head.domNode),a=this.scroll.create(wt.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(hn);if(t==null||t.children.head==null)return;const r=Fi(),s=this.scroll.create(Mn.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(wt.blotName,r);s.appendChild(a)}));const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map((t=>t))}}vs.allowedChildren=[hn];hn.requiredContainer=vs;hn.allowedChildren=[Mn];Mn.requiredContainer=hn;Mn.allowedChildren=[wt];wt.requiredContainer=Mn;function Fi(){return`row-${Math.random().toString(36).slice(2,6)}`}class Wg extends qt{static register(){A.register(wt),A.register(Mn),A.register(hn),A.register(vs)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(vs).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(t,A.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==wt.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(A.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,A.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(A.sources.USER),e>0?this.quill.setSelection(t,A.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,A.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce((i=>{const a=new Array(t).fill(`\n`).join("");return i.insert(a,{table:Fi()})}),(new K).retain(r.index));this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(r.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,((r,s,i)=>{i===A.sources.USER&&this.balanceTables()})),!0):!1))}))}}const Ka=Wt("quill:toolbar");class Hi extends qt{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Yg(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ka.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)})),Array.from(this.container.querySelectorAll("button, select")).forEach((r=>{this.attach(r)})),this.quill.on(A.events.EDITOR_CHANGE,(()=>{const[r]=this.quill.selection.getRange();this.update(r)}))}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((s=>s.indexOf("ql-")===0));if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Ka.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,(s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof lt){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new K).retain(a.index).delete(a.length).insert({[t]:i}),A.sources.USER)}else this.quill.format(t,i,A.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach((r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}Hi.DEFAULTS={};function Ga(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function Yg(n,e){Array.isArray(e[0])||(e=[e]),e.forEach((t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach((s=>{if(typeof s=="string")Ga(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Qg(r,i,a):Ga(r,i,a)}})),n.appendChild(r)}))}function Qg(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach((s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)})),n.appendChild(r)}Hi.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach((t=>{this.quill.scroll.query(t,Z.INLINE)!=null&&this.quill.format(t,!1,A.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,A.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",A.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",n,A.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Xg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',Jg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',ep='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',tp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',np='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',rp='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',sp='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',ip='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',ja='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',ap='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',op='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',lp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',cp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',up='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',dp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',hp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',fp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',gp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',pp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',mp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',bp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',Ep='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',yp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',_p='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',vp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Np='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Tp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',Ap='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',wp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',Sp='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',xp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Op='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Lp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Hr={align:{"":Xg,center:Jg,right:ep,justify:tp},background:np,blockquote:rp,bold:sp,clean:ip,code:ja,"code-block":ja,color:ap,direction:{"":op,rtl:lp},formula:cp,header:{1:up,2:dp,3:hp,4:fp,5:gp,6:pp},italic:mp,image:bp,indent:{"+1":Ep,"-1":yp},link:_p,list:{bullet:vp,check:Np,ordered:Tp},script:{sub:Ap,super:wp},strike:Sp,table:xp,underline:Op,video:Lp},Cp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Va=0;function Za(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class Rs{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Za(this.label,"aria-expanded"),Za(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Cp,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Va}`,Va+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class rl extends Rs{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((r=>{r.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class sl extends Rs{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((r=>{r.innerHTML=t[r.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Ip=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let il=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Ip(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const l=i.bottom-i.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const Rp=[!1,"center","right","justify"],kp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Mp=[!1,"serif","monospace"],Dp=["1","2","3",!1],Bp=["small",!1,"large","huge"];class Yr extends hr{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach((i=>{i.container.contains(s.target)||i.close()}))};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((r=>{(r.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Ir(s,Rp),typeof t.align=="object"))return new sl(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Ir(s,kp,i==="background"?"#ffffff":"#000000"),new rl(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Ir(s,Mp):s.classList.contains("ql-header")?Ir(s,Dp):s.classList.contains("ql-size")&&Ir(s,Bp)),new Rs(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(G.events.EDITOR_CHANGE,r)}}Yr.DEFAULTS=dn({},hr.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""})),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class al extends il{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,G.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,G.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=qp(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,G.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",G.sources.USER),this.quill.setSelection(r+2,G.sources.USER)}break}}this.textbox.value="",this.hide()}}function qp(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Ir(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach((r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)}))}const $p=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Pp extends al{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(G.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===G.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===G.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-u),p=this.quill.getBounds(new kn(u,f));p!=null&&this.position(p)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(G.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class ol extends Yr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=$p),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Pp(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr))}}ol.DEFAULTS=dn({},Yr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const Up=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Fp extends al{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,G.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(G.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===G.sources.USER){const[s,i]=this.quill.scroll.descendant(_s,e.index);if(s!=null){this.linkRange=new kn(e.index-i,s.length());const a=_s.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class ll extends Yr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Up),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr),this.tooltip=new Fp(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,r)=>{e.handlers.link.call(e,!r.format.link)})))}}ll.DEFAULTS=dn({},Yr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":Go,"attributors/class/align":Ho,"attributors/class/background":jf,"attributors/class/color":Gf,"attributors/class/direction":jo,"attributors/class/font":Wo,"attributors/class/size":Qo,"attributors/style/align":zo,"attributors/style/background":Di,"attributors/style/color":Mi,"attributors/style/direction":Vo,"attributors/style/font":Yo,"attributors/style/size":Xo},!0);A.register({"formats/align":Ho,"formats/direction":jo,"formats/indent":$g,"formats/background":Di,"formats/color":Mi,"formats/font":Wo,"formats/size":Qo,"formats/blockquote":Pg,"formats/code-block":nt,"formats/header":Ug,"formats/list":Wr,"formats/bold":Ui,"formats/code":Bi,"formats/italic":Fg,"formats/link":_s,"formats/script":Hg,"formats/strike":zg,"formats/underline":Kg,"formats/formula":Gg,"formats/image":jg,"formats/video":Vg,"modules/syntax":nl,"modules/table":Wg,"modules/toolbar":Hi,"themes/bubble":ol,"themes/snow":ll,"ui/icons":Hr,"ui/picker":Rs,"ui/icon-picker":sl,"ui/color-picker":rl,"ui/tooltip":il},!0);var ft={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(n,e=3e3){return this.validURL(n)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(n)?Promise.resolve(!0):new Promise(((t,r)=>{let s;const i=new Image;i.onerror=i.onabort=()=>{clearTimeout(s),r(!1)},i.onload=()=>{clearTimeout(s),t(!0)},s=setTimeout((()=>{i.src="//!/an/invalid.jpg",r(!1)}),e),i.src=n})):Promise.reject(!1)},urlIsImageDataUrl(n){return/^data:image\/\w+;base64,/.test(n)},validURL(n){try{return!!new URL(n)}catch{return!1}},isRichText(n){let e=!1,t=!1;return Array.prototype.forEach.call(n,(r=>{r.kind==="string"&&r.type.match(/^text\/html$/i)&&(e=!0),r.kind==="file"&&r.type.match(/^image\/\w+$/i)&&(t=!0)})),e&&!t},resolveDataUrl(n,e){let t="";return typeof n=="string"?t=n:n instanceof ArrayBuffer&&(t=this.arrayBufferToBase64Url(n,e)),t},binaryStringToArrayBuffer(n){const e=n.length,t=new ArrayBuffer(e),r=new Uint8Array(t);let s=-1;for(;++s<e;)r[s]=n.charCodeAt(s);return t},arrayBufferToBase64Url(n,e){return`data:${e};base64,`+btoa(new Uint8Array(n).reduce(((t,r)=>t+String.fromCharCode(r)),""))},copyText(n,e=document.body){const t=document.createElement("textarea"),r=document.activeElement;t.value=n,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection();let i=!1;s&&s.rangeCount>0&&(i=s.getRangeAt(0)),e.append(t),t.select(),t.selectionStart=0,t.selectionEnd=n.length;let a=!1;try{a=document.execCommand("copy")}catch{}return t.remove(),s&&i&&(s.removeAllRanges(),s.addRange(i)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class Hp{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class zr extends Hp{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${ft.generateFilename()}.${this.getSuffix()}`}minify(e){return new Promise(((t,r)=>{const s=e.maxWidth||800,i=e.maxHeight||800,a=e.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});const l=new Image;l.onload=()=>{const c=l.width,u=l.height;c>u?c>s&&(l.height=u*s/c,l.width=s):u>i&&(l.width=c*i/u,l.height=i);const f=document.createElement("canvas");f.width=l.width,f.height=l.height;const p=f.getContext("2d");if(p){p.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",g=f.toDataURL(h,a);t(new zr(g,h,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},l.src=ft.resolveDataUrl(this.dataUrl,this.type)}))}toFile(e){return e=e||this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){const e=ft.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=ft.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||(t={}),typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(r){if(r.name!=="TypeError")throw r;const s="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,i=new s;for(let a=0;a<e.length;a++)i.append(e[a]);return i.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class zp{constructor(e,t){this.quill=e,this.option=t}}class ks extends zp{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&&ft.isObject(e.uploader)&&ft.isObject((r=e.uploader)===null||r===void 0?void 0:r.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){const t=document.getSelection(),r=document.caretRangeFromPoint(e.clientX,e.clientY);t&&r&&t.setBaseAndExtent(r.startContainer,r.startOffset,r.startContainer,r.startOffset)}this.readFiles(e.dataTransfer.files,((t,r="image/png",s)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new zr(t,r,s)):this.insert.call(this,ft.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(ft.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,((t,r="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new zr(t,r)):this.insert(ft.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{ft.isType(s,"DataTransferItem")?this.handleDataTransfer(s,t,r):s instanceof File&&this.handleDroppedFile(s,t,r)}))}handleDataTransfer(e,t,r){const s=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=c=>{c.target&&c.target.result&&t(c.target.result,i)};const l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(ft.urlIsImageDataUrl(a)){const l=a.match(/^data:(image\/\w+);base64,/),c=l?l[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&&ft.urlIsImage(a).then((()=>{setTimeout((()=>{const l=this.getIndex();this.quill.deleteText(l-a.length,a.length,"user"),s.insert(a,"image",l-a.length)}))})).catch((()=>{}))}))}handleDroppedFile(e,t,r){const{type:s,name:i=""}=e;if(s.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=l=>{l.target&&l.target.result&&t(l.target.result,s,i)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let s;t.startsWith("image")?(s=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(s=r+e.length,this.quill.insertText(r,e,"user")),setTimeout((()=>{this.quill.setSelection(s)}))}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}ks.ImageData=zr;window.QuillImageDropAndPaste=ks;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",ks);function Ns(n){return n.varName?` for '${n.varName}'`:""}function Kp(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function Gp(n,e={}){if(n==null||n===""&&!e.allowEmpty)throw new Error(`Missing string value${Ns(e)}`);return typeof n=="string"?n:n.toString()}function jp(n,e={}){return n==null||n===""&&!e.allowEmpty?void 0:Gp(n,e)}function Vp(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Ns(e)}`);if(typeof n=="string"&&Kp(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Ns(e)}`)}function Wa(n,e={}){return n==null?void 0:Vp(n,e)}function Zp(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Wp(n,e={}){if(Zp(n))return n;const t=n===null?"null":Array.isArray(n)?"array":typeof n;throw new Error(`invalid object value '${t}'${Ns(e)}`)}var cl=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function ul(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,cl(s)&&ul(n,s,i)}}function Yp(n){const e={...n};for(const[t,r]of Object.entries(n))cl(r)&&ul(e,r,t);return e}var Qp=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Xp=n=>n;function Jp(n,e=Xp){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const s=n()?.[t];switch(typeof s){case"function":return s(...r);case"string":return e(s,r[0]);default:return s}}}const em={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},tm="image",nm="Validate",rm="Cancel",sm="Remove",im="Done",am="Image not inserted, place cursor in editor first",om="HTML Snippet",lm="Confirm Deletion",cm={content:"Are you sure you want to delete this HTML Snippet?"},um={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom"},dm={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},hm={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},fm={insertLink:"Insert an internal link"},gm={CustomToolbar:em,image:tm,validate:nm,delete:"Delete",cancel:rm,remove:sm,done:im,editorFocusLost:am,htmlSnippetLabel:om,confirmDeletion:lm,comfirmSnippetDeletionDialog:cm,makeImagePropertiesDialog:um,openObfuscatorDialog:dm,videoPlugin:hm,internalLinkPlugin:fm},pm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},mm="image",bm="Valider",Em="Annuler",ym="Terminé",_m="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",vm="Code HTML",Nm="Confirmer la suppression",Tm="Retirer",Am={content:"Voulez-vous vraiment supprimer ce code HTML ?"},wm={variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom"},Sm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},xm={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},Om={insertLink:"Insérer un lien interne"},Lm={CustomToolbar:pm,image:mm,validate:bm,delete:"Supprimer",cancel:Em,done:ym,editorFocusLost:_m,htmlSnippetLabel:vm,confirmDeletion:Nm,remove:Tm,comfirmSnippetDeletionDialog:Am,makeImagePropertiesDialog:wm,openObfuscatorDialog:Sm,videoPlugin:xm,internalLinkPlugin:Om},Ya={en:gm,fr:Lm};function bn(n){const e=ei((()=>{const r=n()in Ya?n():"en";return Yp(Ya[r])}));return{t:Jp(e,Qp)}}var Cm=ye('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),dl=ye('<button class="QpBtn secondary"type=button>'),Im=ye("<button class=QpBtn type=button>"),Rm=ye('<button class="QpBtn danger outlined"type=button>'),km=ye("<p>"),Mm=ye('<button class="QpBtn danger"type=button>');async function hl({service:n,language:e,mode:t,html:r}){const{t:s}=bn(e),[i,a]=St(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=Cm();return u.addEventListener("change",(f=>a(f.target.value))),ir((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=Rm();return u.$$click=()=>{Dm({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},fe(u,(()=>s("delete"))),u})(),(()=>{var u=dl();return u.$$click=()=>c.close(),fe(u,(()=>s("cancel"))),u})(),(()=>{var u=Im();return u.$$click=()=>c.close({action:t,values:{html:i()}}),fe(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Dm({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=bn(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=km();return fe(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=dl();return a.$$click=()=>{i.hide()},fe(a,(()=>s("cancel"))),a})(),(()=>{var a=Mm();return a.$$click=()=>{i.hide(),e()},fe(a,(()=>s("validate"))),a})()]});i.show()}As(["click"]);var Bm=ye("<div class=QpSpinner>");function qm(){return Bm()}var $m=ye('<button class="QpBtn outlined danger"type=button>'),Pm=ye("<button class=QpBtn type=button>"),Qs=ye("<h2 class=FieldLabel>"),Qa=ye("<div class=QpOption>"),Um=ye("<div><label><input type=checkbox name=enableZoom>"),Fm=ye("<button type=button> <small class=ml-1>(<!>)"),Hm=ye("<button type=button>");async function zm({language:n,imageUid:e,themeConf:t,service:r,...s}){const{t:i}=bn(n),[a,l]=St(!1),[c,u]=St(),[f,p]=St(),[h,g]=St(s.zoom),y=ei((()=>t.fTextImages.map(((w,k)=>({size:w,label:i("makeImagePropertiesDialog.variantLabel",{n:k+1})})))),[t,n()]),_=ei((()=>[{align:"left",label:i("makeImagePropertiesDialog.left")},{align:"center",label:i("makeImagePropertiesDialog.center")},{align:"right",label:i("makeImagePropertiesDialog.right")}]),[n()]),N=async()=>{const w=c();if(!e||!w)throw new Error("missing a find variant name");l(!0);const{url:k,displayWidth:M,displayHeight:V}=await r.useImage(e,w.displaySize);l(!1),L.close({action:"update",values:{uid:e,src:k,align:f(),variant:w.displaySize,width:M,height:V,zoom:h()?void 0:"none"}})};ti((()=>{s.align&&p(s.align)})),ti((()=>{if(s.imageSize){const w=y().find((k=>k.size.displaySize===s.imageSize));w&&u(w.size)}}));let T=ln(qm,{});a()||(T=[(()=>{var w=$m();return w.$$click=()=>{L.close({action:"remove"})},fe(w,(()=>i("remove"))),w})(),(()=>{var w=Pm();return w.$$click=N,w.disabled=!e||f===void 0||c===void 0,fe(w,(()=>i("validate"))),w})()]);const L=r.createModalDialog({header:i("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var w=Qs();return fe(w,(()=>i("makeImagePropertiesDialog.sizes"))),w})(),(()=>{var w=Qa();return fe(w,ln(Gi,{get each(){return y()},children:k=>(()=>{var M=Fm(),V=M.firstChild,re=V.nextSibling,he=re.firstChild,Ce=he.nextSibling;return Ce.nextSibling,M.$$click=()=>u(k.size),M.disabled=!e,fe(M,(()=>k.label),V),fe(re,(()=>k.size.displaySize),Ce),ir((()=>Js(M,`QpBtn secondary ${k.size.displaySize!==c()?.displaySize?"outlined":""}`))),M})()})),w})(),(()=>{var w=Qs();return fe(w,(()=>i("makeImagePropertiesDialog.alignment"))),w})(),(()=>{var w=Qa();return fe(w,ln(Gi,{get each(){return _()},children:k=>(()=>{var M=Hm();return M.$$click=()=>p(k.align),M.disabled=!e,fe(M,(()=>k.label)),ir((()=>Js(M,`QpBtn secondary ${k.align!==f()?"outlined":""}`))),M})()})),w})(),(()=>{var w=Qs();return fe(w,(()=>i("makeImagePropertiesDialog.options"))),w})(),(()=>{var w=Um(),k=w.firstChild,M=k.firstChild;return M.addEventListener("change",(()=>{g(!h())})),fe(k,(()=>i("makeImagePropertiesDialog.enableZoom")),null),ir((()=>M.checked=h())),w})()],footer:T});return await L.open()}As(["click"]);async function fl({language:n,value:e,internalLinkPluginHook:t}){if(!t)return;const r=await t.openDialog(e??"",{getLanguage:n});if(e&&r)return r.documentId?{action:"update",value:r.documentId}:{action:"remove"};if(!e&&r?.documentId)return{action:"insert",value:r.documentId}}function gl(n){return Km(n)||zi(n)}function zi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Km(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function Gm(n){return gl(n)?zi(n)?"mailto":"tel":"raw"}function pl(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var jm=ye("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),Vm=ye('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Zm=ye('<button class="QpBtn danger outlined"type=button>'),Wm=ye("<button class=QpBtn type=button>");async function Ym({service:n,language:e,value:t}){const{t:r}=bn(e),[s,i]=St(t.asALink),[a,l]=St(t.content),c=f=>{l(f),gl(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=jm(),p=f.firstChild;return fe(f,(()=>r("openObfuscatorDialog.content")),p),p.$$input=h=>c(h.currentTarget.value),ir((()=>p.value=a())),f})(),(()=>{var f=Vm(),p=f.firstChild;return p.addEventListener("change",(()=>i(!s()))),fe(f,(()=>r("openObfuscatorDialog.asALink")),null),ir((()=>p.checked=s())),f})()],footer:[(()=>{var f=Zm();return f.$$click=()=>u.close({action:"remove"}),fe(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=Wm();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?zi(a())?"mailto":"tel":"raw"}),fe(f,(()=>r("done"))),f})()]});return await u.open()}As(["input","click"]);var Qm=ye('<button class="QpBtn outlined danger"type=button>'),Xm=ye('<button class="QpBtn secondary"type=button>'),Jm=ye("<button class=QpBtn type=button>");async function ml({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=bn(e),[a,l]=St(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(p){l(p)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var p=Qm();return p.$$click=()=>{f.close({action:"remove"}),c()},fe(p,(()=>i("remove"))),p})(),(()=>{var p=Xm();return p.$$click=()=>{f.close(),c()},fe(p,(()=>i("cancel"))),p})(),(()=>{var p=Jm();return p.$$click=()=>{f.close({action:t,value:a()??""}),c()},fe(p,(()=>i("validate"))),p})()],header:i("videoPlugin.dialog.title")});return await f.open()}As(["click"]);function eb(n,{label:e,url:t}){let r=e??t;const s=n.getSelection();s&&s.length!==0&&(r=n.getText(s.index,s.length),n.deleteText(s.index,s.length)),n.insertText(Ms(n)??0,r,"link",t)}function bl({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=bn(s),a=r??Ms(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function Ei(n){const e=Ms(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function El({values:n,editor:e,index:t}){if(n.html===void 0)throw new Error("html is undefined");e.insertEmbed(t,"html-snippet",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function yl({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function _l({values:n,editor:e,index:t}){e.insertEmbed(t,"video-plugin",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function Ms(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function tb(n){const{uid:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),s=r.split("/"),a=s[s.length-1].match(/^([0-9a-f-]{36})\-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,l]=a;return l}function nb(n){const e=vl(n);return{imageSize:n.dataset.variant,align:e}}function vl(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function rb(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function sb({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await hl({service:t,html:s,mode:"update",language:r});i&&Qr({editor:n,element:e,data:i,insertElementHandler:El,service:t,language:r})}async function ib({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await fl({language:t,value:i,internalLinkPluginHook:s});if(!a)return;const l=A.find(e);if(!l||l instanceof A)throw new Error("missing link blot");if(a.action==="update"){if(!a.value)return;const c=n.getIndex(l);l.deleteAt(0,l.length()),yl({values:a.value,editor:n,index:c})}else a.action==="remove"&&l.deleteAt(0,l.length())}async function ab({editor:n,videoElement:e,language:t,service:r,videoPluginHook:s}){const i=e.dataset.videoId,a=await ml({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Qr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:_l,service:r,language:t})}async function Nl({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?pl(n.dataset.asALink):void 0,a=await Ym({service:e,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const l=A.find(n);if(!l||l instanceof A)throw new Error("missing embed blot");const c=r.getIndex(l);a.action==="remove"&&(l.remove(),r.insertText(c,s)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function ob({element:n,editor:e,themeConf:t,service:r,language:s}){const i=tb(n),{align:a,imageSize:l}=nb(n),c=await zm({imageSize:l,align:a,imageUid:i,themeConf:t,width:Wa(n.getAttribute("width")),height:Wa(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",service:r,language:s});c&&Qr({editor:e,element:n,data:c,insertElementHandler:bl,service:r,language:s})}function lb({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i,useImage:a}=e;return{insertHtmlSnippetHandler:async h=>{if(!n)return;const g=Ei(n);await ub({editorContent:g,quillEditor:n,service:e,language:t})},insertMedia:async h=>{if(!n)return;if(!hb(h)){eb(n,{label:h.originalName,url:h.url});return}const g=i.fTextImages[0],{displaySize:y}=g,_="center",{url:N,displayWidth:T,displayHeight:L}=await a(h.uid,y);bl({editor:n,values:{uid:h.uid,src:N,width:T,height:L,variant:y,align:_},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const h=n.getSelection();!h||h.length===0||cb({userSelection:h,quillEditor:n,service:e,language:t})},insertVideoHandler:async()=>{if(!n)return;const h=Ei(n);await Tl({editorContent:h,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const h=Ms(n);h!==void 0&&await db({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:h})}}}async function cb({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=Gm(s);e.formatText(n,"obfuscate",i);const a=e.root.querySelectorAll("span.ObfuscateBlot");if(a.length===0)throw new Error("missing element 'span' with class 'ObfuscateBlot'");for(const l of a)if(l.innerText===s){await Nl({obfuscatorSpan:l,service:r,language:t,editor:e});break}}async function ub({editorContent:n,quillEditor:e,service:t,language:r}){const s=await hl({service:t,language:r,mode:"insert"});s&&Qr({editor:e,element:n,data:s,insertElementHandler:El,service:t,language:r})}async function Tl({editorContent:n,quillEditor:e,service:t,language:r,videoPluginHook:s,value:i}){const a=await ml({service:t,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Qr({editor:e,element:n,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:_l,service:t,language:r})}async function db({quillEditor:n,service:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await fl({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||yl({editor:n,values:a.value,index:i})}function Qr({editor:n,element:e,data:{values:t,action:r,updateOptions:s},insertElementHandler:i,service:a,language:l}){const c=A.find(e);if(!c||c instanceof A)throw new Error("missing embed blot");const u=n.getIndex(c),f=new K;if(!(u===void 0||u===-1)){if(r==="insert"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l})}else if(r==="update"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else r==="remove"&&(f.retain(u),f.delete(1));n.updateContents(f)}}function hb(n){return"width"in n&&"height"in n}var Xs,Xa;function fb(){if(Xa)return Xs;Xa=1;function n(m){return m instanceof Map?m.clear=m.delete=m.set=function(){throw new Error("map is read-only")}:m instanceof Set&&(m.add=m.clear=m.delete=function(){throw new Error("set is read-only")}),Object.freeze(m),Object.getOwnPropertyNames(m).forEach((x=>{const U=m[x],te=typeof U;(te==="object"||te==="function")&&!Object.isFrozen(U)&&n(U)})),m}class e{constructor(x){x.data===void 0&&(x.data={}),this.data=x.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(m){return m.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(m,...x){const U=Object.create(null);for(const te in m)U[te]=m[te];return x.forEach((function(te){for(const ve in te)U[ve]=te[ve]})),U}const s="</span>",i=m=>!!m.scope,a=(m,{prefix:x})=>{if(m.startsWith("language:"))return m.replace("language:","language-");if(m.includes(".")){const U=m.split(".");return[`${x}${U.shift()}`,...U.map(((te,ve)=>`${te}${"_".repeat(ve+1)}`))].join(" ")}return`${x}${m}`};class l{constructor(x,U){this.buffer="",this.classPrefix=U.classPrefix,x.walk(this)}addText(x){this.buffer+=t(x)}openNode(x){if(!i(x))return;const U=a(x.scope,{prefix:this.classPrefix});this.span(U)}closeNode(x){i(x)&&(this.buffer+=s)}value(){return this.buffer}span(x){this.buffer+=`<span class="${x}">`}}const c=(m={})=>{const x={children:[]};return Object.assign(x,m),x};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(x){this.top.children.push(x)}openNode(x){const U=c({scope:x});this.add(U),this.stack.push(U)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(x){return this.constructor._walk(x,this.rootNode)}static _walk(x,U){return typeof U=="string"?x.addText(U):U.children&&(x.openNode(U),U.children.forEach((te=>this._walk(x,te))),x.closeNode(U)),x}static _collapse(x){typeof x!="string"&&x.children&&(x.children.every((U=>typeof U=="string"))?x.children=[x.children.join("")]:x.children.forEach((U=>{u._collapse(U)})))}}class f extends u{constructor(x){super(),this.options=x}addText(x){x!==""&&this.add(x)}startScope(x){this.openNode(x)}endScope(){this.closeNode()}__addSublanguage(x,U){const te=x.root;U&&(te.scope=`language:${U}`),this.add(te)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(m){return m?typeof m=="string"?m:m.source:null}function h(m){return _("(?=",m,")")}function g(m){return _("(?:",m,")*")}function y(m){return _("(?:",m,")?")}function _(...m){return m.map((U=>p(U))).join("")}function N(m){const x=m[m.length-1];return typeof x=="object"&&x.constructor===Object?(m.splice(m.length-1,1),x):{}}function T(...m){return"("+(N(m).capture?"":"?:")+m.map((te=>p(te))).join("|")+")"}function L(m){return new RegExp(m.toString()+"|").exec("").length-1}function w(m,x){const U=m&&m.exec(x);return U&&U.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(m,{joinWith:x}){let U=0;return m.map((te=>{U+=1;const ve=U;let Oe=p(te),H="";for(;Oe.length>0;){const z=k.exec(Oe);if(!z){H+=Oe;break}H+=Oe.substring(0,z.index),Oe=Oe.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1]?H+="\\"+String(Number(z[1])+ve):(H+=z[0],z[0]==="("&&U++)}return H})).map((te=>`(${te})`)).join(x)}const V=/\b\B/,re="[a-zA-Z]\\w*",he="[a-zA-Z_]\\w*",Ce="\\b\\d+(\\.\\d+)?",Ie="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",E="\\b(0b[01]+)",C="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",v=(m={})=>{const x=/^#![ ]*\//;return m.binary&&(m.begin=_(x,/.*\b/,m.binary,/\b.*/)),r({scope:"meta",begin:x,end:/$/,relevance:0,"on:begin":(U,te)=>{U.index!==0&&te.ignoreMatch()}},m)},I={begin:"\\\\[\\s\\S]",relevance:0},D={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[I]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[I]},$={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},B=function(m,x,U={}){const te=r({scope:"comment",begin:m,end:x,contains:[]},U);te.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ve=T("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return te.contains.push({begin:_(/[ ]+/,"(",ve,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),te},F=B("//","$"),P=B("/\\*","\\*/"),J=B("#","$"),X={scope:"number",begin:Ce,relevance:0},se={scope:"number",begin:Ie,relevance:0},ce={scope:"number",begin:E,relevance:0},Q={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[I,{begin:/\[/,end:/\]/,relevance:0,contains:[I]}]},Se={scope:"title",begin:re,relevance:0},xe={scope:"title",begin:he,relevance:0},oe={begin:"\\.\\s*"+he,relevance:0};var ue=Object.freeze({__proto__:null,APOS_STRING_MODE:D,BACKSLASH_ESCAPE:I,BINARY_NUMBER_MODE:ce,BINARY_NUMBER_RE:E,COMMENT:B,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:F,C_NUMBER_MODE:se,C_NUMBER_RE:Ie,END_SAME_AS_BEGIN:function(m){return Object.assign(m,{"on:begin":(x,U)=>{U.data._beginMatch=x[1]},"on:end":(x,U)=>{U.data._beginMatch!==x[1]&&U.ignoreMatch()}})},HASH_COMMENT_MODE:J,IDENT_RE:re,MATCH_NOTHING_RE:V,METHOD_GUARD:oe,NUMBER_MODE:X,NUMBER_RE:Ce,PHRASAL_WORDS_MODE:$,QUOTE_STRING_MODE:O,REGEXP_MODE:Q,RE_STARTERS_RE:C,SHEBANG:v,TITLE_MODE:Se,UNDERSCORE_IDENT_RE:he,UNDERSCORE_TITLE_MODE:xe});function pe(m,x){m.input[m.index-1]==="."&&x.ignoreMatch()}function Ee(m,x){m.className!==void 0&&(m.scope=m.className,delete m.className)}function _e(m,x){x&&m.beginKeywords&&(m.begin="\\b("+m.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",m.__beforeBegin=pe,m.keywords=m.keywords||m.beginKeywords,delete m.beginKeywords,m.relevance===void 0&&(m.relevance=0))}function De(m,x){Array.isArray(m.illegal)&&(m.illegal=T(...m.illegal))}function ze(m,x){if(m.match){if(m.begin||m.end)throw new Error("begin & end are not supported with match");m.begin=m.match,delete m.match}}function En(m,x){m.relevance===void 0&&(m.relevance=1)}const Fn=(m,x)=>{if(!m.beforeMatch)return;if(m.starts)throw new Error("beforeMatch cannot be used with starts");const U=Object.assign({},m);Object.keys(m).forEach((te=>{delete m[te]})),m.keywords=U.keywords,m.begin=_(U.beforeMatch,h(U.begin)),m.starts={relevance:0,contains:[Object.assign(U,{endsParent:!0})]},m.relevance=0,delete U.beforeMatch},fr=["of","and","for","in","not","or","if","then","parent","list","value"],gr="keyword";function $t(m,x,U=gr){const te=Object.create(null);return typeof m=="string"?ve(U,m.split(" ")):Array.isArray(m)?ve(U,m):Object.keys(m).forEach((function(Oe){Object.assign(te,$t(m[Oe],x,Oe))})),te;function ve(Oe,H){x&&(H=H.map((z=>z.toLowerCase()))),H.forEach((function(z){const ne=z.split("|");te[ne[0]]=[Oe,yn(ne[0],ne[1])]}))}}function yn(m,x){return x?Number(x):Hn(m)?0:1}function Hn(m){return fr.includes(m.toLowerCase())}const _n={},Ke=m=>{console.error(m)},Pt=(m,...x)=>{console.log(`WARN: ${m}`,...x)},It=(m,x)=>{_n[`${m}/${x}`]||(console.log(`Deprecated as of ${m}. ${x}`),_n[`${m}/${x}`]=!0)},ct=new Error;function Ut(m,x,{key:U}){let te=0;const ve=m[U],Oe={},H={};for(let z=1;z<=x.length;z++)H[z+te]=ve[z],Oe[z+te]=!0,te+=L(x[z-1]);m[U]=H,m[U]._emit=Oe,m[U]._multi=!0}function vn(m){if(Array.isArray(m.begin)){if(m.skip||m.excludeBegin||m.returnBegin)throw Ke("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ct;if(typeof m.beginScope!="object"||m.beginScope===null)throw Ke("beginScope must be object"),ct;Ut(m,m.begin,{key:"beginScope"}),m.begin=M(m.begin,{joinWith:""})}}function rt(m){if(Array.isArray(m.end)){if(m.skip||m.excludeEnd||m.returnEnd)throw Ke("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ct;if(typeof m.endScope!="object"||m.endScope===null)throw Ke("endScope must be object"),ct;Ut(m,m.end,{key:"endScope"}),m.end=M(m.end,{joinWith:""})}}function zn(m){m.scope&&typeof m.scope=="object"&&m.scope!==null&&(m.beginScope=m.scope,delete m.scope)}function Kn(m){zn(m),typeof m.beginScope=="string"&&(m.beginScope={_wrap:m.beginScope}),typeof m.endScope=="string"&&(m.endScope={_wrap:m.endScope}),vn(m),rt(m)}function pr(m){function x(H,z){return new RegExp(p(H),"m"+(m.case_insensitive?"i":"")+(m.unicodeRegex?"u":"")+(z?"g":""))}class U{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(z,ne){ne.position=this.position++,this.matchIndexes[this.matchAt]=ne,this.regexes.push([ne,z]),this.matchAt+=L(z)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const z=this.regexes.map((ne=>ne[1]));this.matcherRe=x(M(z,{joinWith:"|"}),!0),this.lastIndex=0}exec(z){this.matcherRe.lastIndex=this.lastIndex;const ne=this.matcherRe.exec(z);if(!ne)return null;const Be=ne.findIndex(((yt,$e)=>$e>0&&yt!==void 0)),Re=this.matchIndexes[Be];return ne.splice(0,Be),Object.assign(ne,Re)}}class te{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(z){if(this.multiRegexes[z])return this.multiRegexes[z];const ne=new U;return this.rules.slice(z).forEach((([Be,Re])=>ne.addRule(Be,Re))),ne.compile(),this.multiRegexes[z]=ne,ne}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(z,ne){this.rules.push([z,ne]),ne.type==="begin"&&this.count++}exec(z){const ne=this.getMatcher(this.regexIndex);ne.lastIndex=this.lastIndex;let Be=ne.exec(z);if(this.resumingScanAtSamePosition()&&!(Be&&Be.index===this.lastIndex)){const Re=this.getMatcher(0);Re.lastIndex=this.lastIndex+1,Be=Re.exec(z)}return Be&&(this.regexIndex+=Be.position+1,this.regexIndex===this.count&&this.considerAll()),Be}}function ve(H){const z=new te;return H.contains.forEach((ne=>z.addRule(ne.begin,{rule:ne,type:"begin"}))),H.terminatorEnd&&z.addRule(H.terminatorEnd,{type:"end"}),H.illegal&&z.addRule(H.illegal,{type:"illegal"}),z}function Oe(H,z){const ne=H;if(H.isCompiled)return ne;[Ee,ze,Kn,Fn].forEach((Re=>Re(H,z))),m.compilerExtensions.forEach((Re=>Re(H,z))),H.__beforeBegin=null,[_e,De,En].forEach((Re=>Re(H,z))),H.isCompiled=!0;let Be=null;return typeof H.keywords=="object"&&H.keywords.$pattern&&(H.keywords=Object.assign({},H.keywords),Be=H.keywords.$pattern,delete H.keywords.$pattern),Be=Be||/\w+/,H.keywords&&(H.keywords=$t(H.keywords,m.case_insensitive)),ne.keywordPatternRe=x(Be,!0),z&&(H.begin||(H.begin=/\B|\b/),ne.beginRe=x(ne.begin),!H.end&&!H.endsWithParent&&(H.end=/\B|\b/),H.end&&(ne.endRe=x(ne.end)),ne.terminatorEnd=p(ne.end)||"",H.endsWithParent&&z.terminatorEnd&&(ne.terminatorEnd+=(H.end?"|":"")+z.terminatorEnd)),H.illegal&&(ne.illegalRe=x(H.illegal)),H.contains||(H.contains=[]),H.contains=[].concat(...H.contains.map((function(Re){return Qt(Re==="self"?H:Re)}))),H.contains.forEach((function(Re){Oe(Re,ne)})),H.starts&&Oe(H.starts,z),ne.matcher=ve(ne),ne}if(m.compilerExtensions||(m.compilerExtensions=[]),m.contains&&m.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return m.classNameAliases=r(m.classNameAliases||{}),Oe(m)}function Yt(m){return m?m.endsWithParent||Yt(m.starts):!1}function Qt(m){return m.variants&&!m.cachedVariants&&(m.cachedVariants=m.variants.map((function(x){return r(m,{variants:null},x)}))),m.cachedVariants?m.cachedVariants:Yt(m)?r(m,{starts:m.starts?r(m.starts):null}):Object.isFrozen(m)?r(m):m}var Gn="11.10.0";class Xt extends Error{constructor(x,U){super(x),this.name="HTMLInjectionError",this.html=U}}const Et=t,st=r,Ft=Symbol("nomatch"),Nn=7,Rt=function(m){const x=Object.create(null),U=Object.create(null),te=[];let ve=!0;const Oe="Could not find the language '{}', did you forget to load/include a language module?",H={disableAutodetect:!0,name:"Plain text",contains:[]};let z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function ne(R){return z.noHighlightRe.test(R)}function Be(R){let W=R.className+" ";W+=R.parentNode?R.parentNode.className:"";const le=z.languageDetectRe.exec(W);if(le){const Ne=dt(le[1]);return Ne||(Pt(Oe.replace("{}",le[1])),Pt("Falling back to no-highlight mode for this block.",R)),Ne?le[1]:"no-highlight"}return W.split(/\s+/).find((Ne=>ne(Ne)||dt(Ne)))}function Re(R,W,le){let Ne="",Me="";typeof W=="object"?(Ne=R,le=W.ignoreIllegals,Me=W.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=R,Ne=W),le===void 0&&(le=!0);const tt={code:Ne,language:Me};Ht("before:highlight",tt);const ht=tt.result?tt.result:yt(tt.language,tt.code,le);return ht.code=tt.code,Ht("after:highlight",ht),ht}function yt(R,W,le,Ne){const Me=Object.create(null);function tt(q,j){return q.keywords[j]}function ht(){if(!ee.keywords){we.addText(Ae);return}let q=0;ee.keywordPatternRe.lastIndex=0;let j=ee.keywordPatternRe.exec(Ae),ie="";for(;j;){ie+=Ae.substring(q,j.index);const de=Ve.case_insensitive?j[0].toLowerCase():j[0],qe=tt(ee,de);if(qe){const[Qe,xr]=qe;if(we.addText(ie),ie="",Me[de]=(Me[de]||0)+1,Me[de]<=Nn&&(rn+=xr),Qe.startsWith("_"))ie+=j[0];else{const Xn=Ve.classNameAliases[Qe]||Qe;je(j[0],Xn)}}else ie+=j[0];q=ee.keywordPatternRe.lastIndex,j=ee.keywordPatternRe.exec(Ae)}ie+=Ae.substring(q),we.addText(ie)}function _t(){if(Ae==="")return;let q=null;if(typeof ee.subLanguage=="string"){if(!x[ee.subLanguage]){we.addText(Ae);return}q=yt(ee.subLanguage,Ae,!0,Qn[ee.subLanguage]),Qn[ee.subLanguage]=q._top}else q=Tn(Ae,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(rn+=q.relevance),we.__addSublanguage(q._emitter,q.language)}function Ue(){ee.subLanguage!=null?_t():ht(),Ae=""}function je(q,j){q!==""&&(we.startScope(j),we.addText(q),we.endScope())}function wn(q,j){let ie=1;const de=j.length-1;for(;ie<=de;){if(!q._emit[ie]){ie++;continue}const qe=Ve.classNameAliases[q[ie]]||q[ie],Qe=j[ie];qe?je(Qe,qe):(Ae=Qe,ht(),Ae=""),ie++}}function Sn(q,j){return q.scope&&typeof q.scope=="string"&&we.openNode(Ve.classNameAliases[q.scope]||q.scope),q.beginScope&&(q.beginScope._wrap?(je(Ae,Ve.classNameAliases[q.beginScope._wrap]||q.beginScope._wrap),Ae=""):q.beginScope._multi&&(wn(q.beginScope,j),Ae="")),ee=Object.create(q,{parent:{value:ee}}),ee}function Wn(q,j,ie){let de=w(q.endRe,ie);if(de){if(q["on:end"]){const qe=new e(q);q["on:end"](j,qe),qe.isMatchIgnored&&(de=!1)}if(de){for(;q.endsParent&&q.parent;)q=q.parent;return q}}if(q.endsWithParent)return Wn(q.parent,j,ie)}function Ar(q){return ee.matcher.regexIndex===0?(Ae+=q[0],1):(sn=!0,0)}function wr(q){const j=q[0],ie=q.rule,de=new e(ie),qe=[ie.__beforeBegin,ie["on:begin"]];for(const Qe of qe)if(Qe&&(Qe(q,de),de.isMatchIgnored))return Ar(j);return ie.skip?Ae+=j:(ie.excludeBegin&&(Ae+=j),Ue(),!ie.returnBegin&&!ie.excludeBegin&&(Ae=j)),Sn(ie,q),ie.returnBegin?0:j.length}function Sr(q){const j=q[0],ie=W.substring(q.index),de=Wn(ee,q,ie);if(!de)return Ft;const qe=ee;ee.endScope&&ee.endScope._wrap?(Ue(),je(j,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(Ue(),wn(ee.endScope,q)):qe.skip?Ae+=j:(qe.returnEnd||qe.excludeEnd||(Ae+=j),Ue(),qe.excludeEnd&&(Ae=j));do{ee.scope&&we.closeNode(),!ee.skip&&!ee.subLanguage&&(rn+=ee.relevance),ee=ee.parent}while(ee!==de.parent);return de.starts&&Sn(de.starts,q),qe.returnEnd?0:j.length}function xn(){const q=[];for(let j=ee;j!==Ve;j=j.parent)j.scope&&q.unshift(j.scope);q.forEach((j=>we.openNode(j)))}let nn={};function Yn(q,j){const ie=j&&j[0];if(Ae+=q,ie==null)return Ue(),0;if(nn.type==="begin"&&j.type==="end"&&nn.index===j.index&&ie===""){if(Ae+=W.slice(j.index,j.index+1),!ve){const de=new Error(`0 width match regex (${R})`);throw de.languageName=R,de.badRule=nn.rule,de}return 1}if(nn=j,j.type==="begin")return wr(j);if(j.type==="illegal"&&!le){const de=new Error('Illegal lexeme "'+ie+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw de.mode=ee,de}else if(j.type==="end"){const de=Sr(j);if(de!==Ft)return de}if(j.type==="illegal"&&ie==="")return 1;if(On>1e5&&On>j.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ae+=ie,ie.length}const Ve=dt(R);if(!Ve)throw Ke(Oe.replace("{}",R)),new Error('Unknown language: "'+R+'"');const at=pr(Ve);let ot="",ee=Ne||at;const Qn={},we=new z.__emitter(z);xn();let Ae="",rn=0,vt=0,On=0,sn=!1;try{if(Ve.__emitTokens)Ve.__emitTokens(W,we);else{for(ee.matcher.considerAll();;){On++,sn?sn=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=vt;const q=ee.matcher.exec(W);if(!q)break;const j=W.substring(vt,q.index),ie=Yn(j,q);vt=q.index+ie}Yn(W.substring(vt))}return we.finalize(),ot=we.toHTML(),{language:R,value:ot,relevance:rn,illegal:!1,_emitter:we,_top:ee}}catch(q){if(q.message&&q.message.includes("Illegal"))return{language:R,value:Et(W),illegal:!0,relevance:0,_illegalBy:{message:q.message,index:vt,context:W.slice(vt-100,vt+100),mode:q.mode,resultSoFar:ot},_emitter:we};if(ve)return{language:R,value:Et(W),illegal:!1,relevance:0,errorRaised:q,_emitter:we,_top:ee};throw q}}function $e(R){const W={value:Et(R),illegal:!1,relevance:0,_top:H,_emitter:new z.__emitter(z)};return W._emitter.addText(R),W}function Tn(R,W){W=W||z.languages||Object.keys(x);const le=$e(R),Ne=W.filter(dt).filter(Zn).map((Ue=>yt(Ue,R,!1)));Ne.unshift(le);const Me=Ne.sort(((Ue,je)=>{if(Ue.relevance!==je.relevance)return je.relevance-Ue.relevance;if(Ue.language&&je.language){if(dt(Ue.language).supersetOf===je.language)return 1;if(dt(je.language).supersetOf===Ue.language)return-1}return 0})),[tt,ht]=Me,_t=tt;return _t.secondBest=ht,_t}function mr(R,W,le){const Ne=W&&U[W]||le;R.classList.add("hljs"),R.classList.add(`language-${Ne}`)}function An(R){let W=null;const le=Be(R);if(ne(le))return;if(Ht("before:highlightElement",{el:R,language:le}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(z.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R)),z.throwUnescapedHTML))throw new Xt("One of your code blocks includes unescaped HTML.",R.innerHTML);W=R;const Ne=W.textContent,Me=le?Re(Ne,{language:le,ignoreIllegals:!0}):Tn(Ne);R.innerHTML=Me.value,R.dataset.highlighted="yes",mr(R,le,Me.language),R.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(R.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),Ht("after:highlightElement",{el:R,result:Me,text:Ne})}function br(R){z=st(z,R)}const Er=()=>{Jt(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ge(){Jt(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let jn=!1;function Jt(){if(document.readyState==="loading"){jn=!0;return}document.querySelectorAll(z.cssSelector).forEach(An)}function yr(){jn&&Jt()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",yr,!1);function _r(R,W){let le=null;try{le=W(m)}catch(Ne){if(Ke("Language definition for '{}' could not be registered.".replace("{}",R)),ve)Ke(Ne);else throw Ne;le=H}le.name||(le.name=R),x[R]=le,le.rawDefinition=W.bind(null,m),le.aliases&&Vn(le.aliases,{languageName:R})}function vr(R){delete x[R];for(const W of Object.keys(U))U[W]===R&&delete U[W]}function Ye(){return Object.keys(x)}function dt(R){return R=(R||"").toLowerCase(),x[R]||x[U[R]]}function Vn(R,{languageName:W}){typeof R=="string"&&(R=[R]),R.forEach((le=>{U[le.toLowerCase()]=W}))}function Zn(R){const W=dt(R);return W&&!W.disableAutodetect}function Nr(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=W=>{R["before:highlightBlock"](Object.assign({block:W.el},W))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=W=>{R["after:highlightBlock"](Object.assign({block:W.el},W))})}function Tr(R){Nr(R),te.push(R)}function en(R){const W=te.indexOf(R);W!==-1&&te.splice(W,1)}function Ht(R,W){const le=R;te.forEach((function(Ne){Ne[le]&&Ne[le](W)}))}function tn(R){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),An(R)}Object.assign(m,{highlight:Re,highlightAuto:Tn,highlightAll:Jt,highlightElement:An,highlightBlock:tn,configure:br,initHighlighting:Er,initHighlightingOnLoad:Ge,registerLanguage:_r,unregisterLanguage:vr,listLanguages:Ye,getLanguage:dt,registerAliases:Vn,autoDetection:Zn,inherit:st,addPlugin:Tr,removePlugin:en}),m.debugMode=function(){ve=!1},m.safeMode=function(){ve=!0},m.versionString=Gn,m.regex={concat:_,lookahead:h,either:T,optional:y,anyNumberOfTimes:g};for(const R in ue)typeof ue[R]=="object"&&n(ue[R]);return Object.assign(m,ue),m},ut=Rt({});return ut.newInstance=()=>Rt({}),Xs=ut,ut.HighlightJS=ut,ut.default=ut,Xs}var gb=fb();const He=Ii(gb);function pb(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:N,built_in:[...L,...w,"set","shopt",...k,...M]},contains:[g,n.SHEBANG(),y,p,i,a,T,l,c,u,f,t]}}function mb(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",N={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},w={begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(L,w,T,[p,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:N}}}function bb(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:_,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},M={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},V=[M,p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],re={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:V.concat([{begin:/\(/,end:/\)/,keywords:k,contains:V.concat(["self"]),relevance:0}]),relevance:0},he={className:"function",begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,relevance:0},{begin:g,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(re,he,M,V,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:k,contains:["self",l]},{begin:n.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Eb(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:e,literal:r},l=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},g=n.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});h.contains=[_,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],g.contains=[N,y,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[u,_,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},L={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},w=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",k={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},T,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,L,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,L,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+w+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,L],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[T,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},k]}}const yb=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),_b=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],vb=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Nb=[..._b,...vb],Tb=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ab=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),wb=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Sb=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();function xb(n){const e=n.regex,t=yb(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ab.join("|")+")"},{begin:":(:)?("+wb.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Sb.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Tb.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Nb.join("|")+")\\b"}]}}var sr="[0-9](_*[0-9])*",hs=`\\.(${sr})`,fs="[0-9a-fA-F](_*[0-9a-fA-F])*",Ja={className:"number",variants:[{begin:`(\\b(${sr})((${hs})|\\.)?|(${hs}))[eE][+-]?(${sr})[fFdD]?\\b`},{begin:`\\b(${sr})((${hs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${hs})[fFdD]?\\b`},{begin:`\\b(${sr})[fFdD]\\b`},{begin:`\\b0[xX]((${fs})\\.?|(${fs})?\\.(${fs}))[pP][+-]?(${sr})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Al(n,e,t){return t===-1?"":n.replace(e,(r=>Al(n,e,t-1)))}function Ob(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+Al("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[f,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,Ja,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},Ja,u]}}const eo="[A-Za-z$_][0-9A-Za-z$_]*",Lb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Cb=["true","false","null","undefined","NaN","Infinity"],wl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Sl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],xl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ib=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Rb=[].concat(xl,wl,Sl);function kb(n){const e=n.regex,t=(B,{after:F})=>{const P="</"+B[0].slice(1);return B.input.indexOf(P,F)!==-1},r=eo,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,F)=>{const P=B[0].length+B.index,J=B.input[P];if(J==="<"||J===","){F.ignoreMatch();return}J===">"&&(t(B,{after:P})||F.ignoreMatch());let X;const se=B.input.substring(P);if(X=se.match(/^\s*=/)){F.ignoreMatch();return}if((X=se.match(/^\s+extends\s+/))&&X.index===0){F.ignoreMatch();return}}},l={$pattern:eo,keyword:Lb,literal:Cb,built_in:Rb,"variable.language":Ib},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},w=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,{match:/\$\d+/},p];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(L,h.contains),M=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M},re={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},he={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...wl,...Sl]}},Ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(B){return e.concat("(?!",B.join("|"),")")}const v={match:e.concat(/\b/,C([...xl,"super","import"].map((B=>`${B}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:he},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),Ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,L,{match:/\$\d+/},p,he,{className:"attr",begin:r+e.lookahead(":"),relevance:0},$,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},Ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,E,re,D,{match:/\$[(.]/}]}}function Mb(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Db(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(p);let g=[t,c];return[u,f,p,h].forEach((T=>{T.contains=T.contains.concat(g)})),g=g.concat(u,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,i,u,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Bb(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),s=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(v,I)=>{I.data._beginMatch=v[1]||v[2]},"on:end":(v,I)=>{I.data._beginMatch!==v[1]&&I.ignoreMatch()}},p=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[ \t\n]`,g={scope:"string",variants:[u,c,f,p]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],N=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],T=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],w={keyword:N,literal:(v=>{const I=[];return v.forEach((D=>{I.push(D),D.toLowerCase()===D?I.push(D.toUpperCase()):I.push(D.toLowerCase())})),I})(_),built_in:T},k=v=>v.map((I=>I.replace(/\|\d+$/,""))),M={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",k(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},V=e.concat(r,"\\b(?!\\()"),re={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),V],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),V],scope:{1:"title.class",3:"variable.constant"}},{match:[s,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},he={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},Ce={relevance:0,begin:/\(/,end:/\)/,keywords:w,contains:[he,i,re,n.C_BLOCK_COMMENT_MODE,g,y,M]},Ie={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",k(N).join("\\b|"),"|",k(T).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[Ce]};Ce.contains.push(Ie);const E=[he,re,n.C_BLOCK_COMMENT_MODE,g,y,M],C={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...E]},...E,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:w,contains:[C,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},i,Ie,re,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},M,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:w,contains:["self",i,re,n.C_BLOCK_COMMENT_MODE,g,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},g,y]}}function qb(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function $b(n){const e=n.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},p={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,f,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",g=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,y=`\\b|${r.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${g}))[eE][+-]?(${h})[jJ]?(?=${y})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${h})[jJ](?=${y})`}]},N={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,_,p,n.HASH_COMMENT_MODE]}]};return u.contains=[p,_,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,N,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,T,p]}]}}function Pb(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[l]}),n.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[n.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,f]})]}]},h="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},V=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);f.contains=V,_.contains=V;const Ie=[{begin:/^\s*=>/,starts:{end:"$",contains:V}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:V}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(Ie).concat(u).concat(V)}}function Ub(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),s=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:f,keyword:l,literal:c,built_in:u},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:f}},{className:"punctuation",begin:"->"},i]}}function Fb(n){const e=n.regex,t=n.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},s={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,y=[...u,...c].filter((w=>!f.includes(w))),_={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},N={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function L(w,{exceptions:k,when:M}={}){const V=M;return k=k||[],w.map((re=>re.match(/\|\d+$/)||k.includes(re)?re:V(re)?`${re}|0`:re))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(y,{when:w=>w.length<3}),literal:i,type:l,built_in:p},contains:[{begin:e.either(...h),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(h),literal:i,type:l}},{className:"type",begin:e.either(...a)},T,_,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const Ts="[A-Za-z$_][0-9A-Za-z$_]*",Ol=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ll=["true","false","null","undefined","NaN","Infinity"],Cl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Il=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Rl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],kl=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ml=[].concat(Rl,Cl,Il);function Hb(n){const e=n.regex,t=(B,{after:F})=>{const P="</"+B[0].slice(1);return B.input.indexOf(P,F)!==-1},r=Ts,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,F)=>{const P=B[0].length+B.index,J=B.input[P];if(J==="<"||J===","){F.ignoreMatch();return}J===">"&&(t(B,{after:P})||F.ignoreMatch());let X;const se=B.input.substring(P);if(X=se.match(/^\s*=/)){F.ignoreMatch();return}if((X=se.match(/^\s+extends\s+/))&&X.index===0){F.ignoreMatch();return}}},l={$pattern:Ts,keyword:Ol,literal:Ll,built_in:Ml,"variable.language":kl},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},w=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,{match:/\$\d+/},p];h.contains=w.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(w)});const k=[].concat(L,h.contains),M=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(k)}]),V={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M},re={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},he={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Cl,...Il]}},Ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Ie={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[V],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function C(B){return e.concat("(?!",B.join("|"),")")}const v={match:e.concat(/\b/,C([...Rl,"super","import"].map((B=>`${B}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},D={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},V]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",$={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[V]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:he},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),Ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,L,{match:/\$\d+/},p,he,{className:"attr",begin:r+e.lookahead(":"),relevance:0},$,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},Ie,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[V,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[V]},v,E,re,D,{match:/\$[(.]/}]}}function zb(n){const e=Hb(n),t=Ts,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Ts,keyword:Ol.concat(l),literal:Ll,built_in:Ml.concat(r),"variable.language":kl},u={className:"meta",begin:"@"+t},f=(g,y,_)=>{const N=g.contains.findIndex((T=>T.label===y));if(N===-1)throw new Error("can not find mode to replace");g.contains.splice(N,1,_)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(u);const p=e.contains.find((g=>g.className==="attr"));e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,p]),e.contains=e.contains.concat([u,s,i]),f(e,"shebang",n.SHEBANG()),f(e,"use_strict",a);const h=e.contains.find((g=>g.label==="func.def"));return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Kb(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(i,{begin:/\(/,end:/\)/}),l=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Gb(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/\w[\w :()\./-]*:(?=[ \t]|$)/},{begin:/"\w[\w :()\./-]*":(?=[ \t]|$)/},{begin:/'\w[\w :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,s]},a=n.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},_=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},g,y,i],N=[..._];return N.pop(),N.push(a),h.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}He.registerLanguage("bash",pb);He.registerLanguage("c",mb);He.registerLanguage("cpp",bb);He.registerLanguage("cs",Eb);He.registerLanguage("css",xb);He.registerLanguage("java",Ob);He.registerLanguage("javascript",kb);He.registerLanguage("json",Mb);He.registerLanguage("markdown",Db);He.registerLanguage("plain",qb);He.registerLanguage("php",Bb);He.registerLanguage("python",$b);He.registerLanguage("sql",Fb);He.registerLanguage("typescript",zb);He.registerLanguage("ruby",Pb);He.registerLanguage("rust",Ub);He.registerLanguage("xml",Kb);He.registerLanguage("yaml",Gb);const jb=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}];var Vb=ye("<button type=button><span class=QpTooltip-text>");function gs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=Vb(),i=s.firstChild;return Js(s,`QpTooltip ${e}`),fe(s,n,i),fe(s,r,i),fe(i,t),s})()}var Zb=ye("<button type=button class=ql-code>"),Wb=ye("<button type=button class=ql-code-block>"),Yb=ye('<span class="pi pi-hashtag">'),Qb=ye('<span class="pi pi-pencil">'),Xb=ye('<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value=""selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value=""selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value=""selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>'),Jb=ye('<span class="pi pi-youtube">'),e1=ye('<span class="pi pi-link">');function t1({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=bn(n),i=[Zb(),(()=>{var a=Wb();return a.style.setProperty("border","1px dotted #999"),a})()];return(()=>{var a=Xb(),l=a.firstChild,c=l.nextSibling,u=c.nextSibling,f=u.nextSibling,p=f.nextSibling,h=p.nextSibling,g=h.nextSibling,y=g.nextSibling,_=y.nextSibling,N=_.nextSibling,T=N.nextSibling;return fe(a,(()=>e?.code&&i),_),fe(a,ln(gs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return Yb()}}),T),fe(a,ln(gs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return Qb()}}),T),fe(a,t&&ln(gs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return Jb()}}),T),fe(a,r&&ln(gs,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return e1()}}),T),a})()}var n1=ye("<div>"),r1=ye("<div class=QuillEditor>");function s1({onSetQuillInst:n,language:e,setValue:t,value:r,service:s,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:l}){const{t:c}=bn(e),u=s.configuration,p=s.fieldType.backOffice?.editorRows??26,h=t1({language:e,configuration:u,videoPluginHook:a,internalLinkPluginHook:l}),g=(()=>{var _=n1();return`calc(${p}rem + 24px)`!=null?_.style.setProperty("height",`calc(${p}rem + 24px)`):_.style.removeProperty("height"),_})();async function y(_,N){if(!s.uploadMedia)return;const T=N.toBlob(),L=new File([T],`${c("image")}-${(new Date).getTime()}.${_.split("/")[1]}`,{type:_}),w=await s.uploadMedia(L);w&&i(w)}return Dl((()=>{A.register("modules/imageDropAndPaste",ks,!0);const _=new A(g,{modules:{toolbar:h,syntax:u.code?{hljs:He,languages:jb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,L,w)=>{y(L,w).catch(s.logger.error)}}},theme:"snow"});_.on("text-change",((T,L,w)=>{w==="user"&&T.ops.forEach((async k=>{if(k.insert&&typeof k.insert=="string"){const M=k.insert;if(!a?.recognizeUrl(M))return;const re=Ei(_);await Tl({editorContent:re,quillEditor:_,service:s,language:e,videoPluginHook:a,value:M})}}))})),n(_),_.on("text-change",((T,L)=>{const w={delta:_.getContents(),html:_.getSemanticHTML()};t(w)}));const N=r();N&&_.setContents(N.delta??new K)})),(()=>{var _=r1();return fe(_,h,null),fe(_,g,null),_})()}function to(n){if(n===void 0)return{};const e=Wp(n);return{handle:jp(e.handle),delta:e.delta}}function i1(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}const a1=A.import("blots/block/embed");function o1(){return class extends a1{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){const t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){const{html:t}=e.dataset;return{html:t}}}}const l1=A.import("blots/block/embed"),no=["alt","height","width"];function c1({publicSiteUrl:n}){return class extends l1{static blotName="img";static tagName="img";static create(s){const i=super.create(s);if(s.src&&i.setAttribute("src",e(s.src)),s.width&&i.setAttribute("width",String(s.width)),s.height&&i.setAttribute("height",String(s.height)),i.classList.add("Img"),s.align){const a=rb(s.align);a&&i.classList.add(a)}return s.zoom==="none"&&i.setAttribute("data-zoom","none"),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i}static formats(s){return no.reduce(((i,a)=>(s.hasAttribute(a)&&(i[a]=s.getAttribute(a)),i)),{})}static match(s){return/\.(jpe?g|gif|png|webp)$/.test(s)||/^data:image\/.+;base64/.test(s)}static value(s){const{uid:i,variant:a}=s.dataset,l=s.getAttribute("src")||void 0,c=s.getAttribute("width")||void 0,u=c===void 0?void 0:Number(c),f=s.getAttribute("height")||void 0,p=f===void 0?void 0:Number(f),h=vl(s),g=s.dataset.zoom==="none"?"none":void 0;return i?{uid:i,src:l?t(l):void 0,width:u,height:p,align:h,variant:a,zoom:g}:{src:l,width:u,height:p,align:h,zoom:g}}format(s,i){no.indexOf(s)>-1?i?this.domNode.setAttribute(s,i):this.domNode.removeAttribute(s):super.format(s,i)}};function e(r){return r.startsWith("/")?`${n}${r}`:u1(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function u1(n){return d1(n,["http","https","data"])?n:"//:0"}function d1(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}const h1=A.import("blots/inline");function f1(n){return class extends h1{static blotName="internal-link-plugin";static tagName="SPAN";static className="InternalLinkPlugin";static create(t){const r=super.create(t);return n?.getDocumentTitle(t).then((s=>{r.innerHTML=`${s}`})),t&&r.setAttribute("data-document-id",t),r.setAttribute("contenteditable","false"),r}static formats(t){const{documentId:r}=t.dataset;return r}}}const g1=A.import("blots/inline");function p1(){return class extends g1{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){const t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){const{asALink:t}=e.dataset;if(!t)throw new Error("No data attribute data-as-a-link");return pl(t)}}}const m1=A.import("blots/block/embed");function b1(n){return class extends m1{static blotName="video-plugin";static tagName="DIV";static className="VideoPlugin";static create(t){const r=super.create(t),s=n?.getThumbnailUrl(t);return r.style.backgroundImage=`url(${s})`,r.classList.add("VideoPlugin"),r.innerHTML='<span class="pi pi-youtube VideoPlugin-playButton"></span>',t&&r.setAttribute("data-video-id",t),r.querySelector("span")?.addEventListener("click",(()=>{r.dispatchEvent(new CustomEvent("click",{bubbles:!0}))})),r}static value(t){const{videoId:r}=t.dataset;return r}}}function E1({publicSiteUrl:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/img",c1({publicSiteUrl:n}),!0),A.register("formats/html-snippet",o1(),!0),A.register("formats/obfuscate",p1(),!0),A.register("formats/video-plugin",b1(e),!0),A.register("formats/internal-link-plugin",f1(t),!0)}const q1={create:_1,init:y1},Gt=i1();function y1(n){const e=`${n.pluginBaseUrl}/style.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",(()=>Gt.service))}function _1(n){if(n.fieldType.dataType!=="quillDelta")throw new Error(`data type '${n.fieldType.dataType}' is incompatible, should be 'quillDelta'`);return Bl((e=>{const[t,r]=St(to(n.initialValue)),[s,i]=St(n.language),[a,l]=St();E1({publicSiteUrl:n.publicSiteUrl,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});let c;ti((()=>{if(!a())return;const f=lb({quillEditor:a(),service:n,language:s,videoPluginHook:Gt.videoPlugin,internalLinkPluginHook:Gt.internalLinkPlugin});c=f.insertMedia;const p=a();if(!p)return;const h=p.getModule("toolbar");h.addHandler("html-snippet",f.insertHtmlSnippetHandler),h.addHandler("obfuscate",f.insertObfuscateBlotHandler),h.addHandler("video-plugin",f.insertVideoHandler),h.addHandler("internal-link-plugin",f.insertInternalLinkHandler);const g=p.root,y=_=>u(_,p,n.themeConf);g.addEventListener("click",y),ql((()=>g.removeEventListener("click",y)))}));const u=async(f,p,h)=>{const g=f.target;g.tagName==="IMG"&&await ob({editor:p,themeConf:h,service:n,element:g,language:s}),g.tagName==="BUTTON"&&g.classList.contains("HtmlSnippet")&&await sb({language:s,editor:p,service:n,htmlSnippetBtn:g}),g.tagName==="SPAN"&&g.classList.contains("ObfuscateBlot")&&await Nl({language:s,editor:p,service:n,obfuscatorSpan:g}),g.tagName==="DIV"&&g.classList.contains("VideoPlugin")&&await ab({editor:p,videoElement:g,language:s,service:n,videoPluginHook:Gt.videoPlugin}),g.tagName==="SPAN"&&g.classList.contains("InternalLinkPlugin")&&await ib({editor:p,internalLinkElement:g,language:s,service:n,internalLinkPluginHook:Gt.internalLinkPlugin})};return{element:ln(s1,{language:s,onSetQuillInst:f=>{l(f)},value:t,setValue:f=>{const p=t()?.delta;r(f),v1(f.delta,p)||n.setModifiedValue(f)},service:n,get videoPluginHook(){return Gt.videoPlugin},get internalLinkPluginHook(){return Gt.internalLinkPlugin},insertMedia:f=>c?.(f)}),setValue:f=>r(to(f)),setLanguage:i,getValue:t,dispose:e,insertMedia:f=>c?.(f)}}))}function v1(n,e){return!n||!e?n===e:JSON.stringify(n)===JSON.stringify(e)}export{q1 as default};
|
|
1
|
+
import{delegateEvents as ws,effect as cn,insert as he,template as be,createComponent as Mt,className as ei}from"https://esm.sh/solid-js@1.9.4/web";import{createMemo as ti,createSignal as lt,createEffect as ps,For as Gi,Show as ji,onMount as Bl,createRoot as ql,onCleanup as $l}from"https://esm.sh/solid-js@1.9.4";var so=typeof global=="object"&&global&&global.Object===Object&&global,Pl=typeof self=="object"&&self&&self.Object===Object&&self,qt=so||Pl||Function("return this")(),gn=qt.Symbol,io=Object.prototype,Ul=io.hasOwnProperty,Fl=io.toString,Cr=gn?gn.toStringTag:void 0;function Hl(n){var e=Ul.call(n,Cr),t=n[Cr];try{n[Cr]=void 0;var r=!0}catch{}var s=Fl.call(n);return r&&(e?n[Cr]=t:delete n[Cr]),s}var zl=Object.prototype,Kl=zl.toString;function Gl(n){return Kl.call(n)}var jl="[object Null]",Vl="[object Undefined]",Vi=gn?gn.toStringTag:void 0;function dr(n){return n==null?n===void 0?Vl:jl:Vi&&Vi in Object(n)?Hl(n):Gl(n)}function Vt(n){return n!=null&&typeof n=="object"}var Rn=Array.isArray;function pn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}function ao(n){return n}var Wl="[object AsyncFunction]",Zl="[object Function]",Yl="[object GeneratorFunction]",Ql="[object Proxy]";function yi(n){if(!pn(n))return!1;var e=dr(n);return e==Zl||e==Yl||e==Wl||e==Ql}var $s=qt["__core-js_shared__"],Wi=function(){var n=/[^.]+$/.exec($s&&$s.keys&&$s.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function Xl(n){return!!Wi&&Wi in n}var Jl=Function.prototype,ec=Jl.toString;function Bn(n){if(n!=null){try{return ec.call(n)}catch{}try{return n+""}catch{}}return""}var tc=/[\\^$.*+?()[\]{}|]/g,nc=/^\[object .+?Constructor\]$/,rc=Function.prototype,sc=Object.prototype,ic=rc.toString,ac=sc.hasOwnProperty,oc=RegExp("^"+ic.call(ac).replace(tc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lc(n){if(!pn(n)||Xl(n))return!1;var e=yi(n)?oc:nc;return e.test(Bn(n))}function cc(n,e){return n?.[e]}function qn(n,e){var t=cc(n,e);return lc(t)?t:void 0}var ni=qn(qt,"WeakMap"),Zi=Object.create,uc=function(){function n(){}return function(e){if(!pn(e))return{};if(Zi)return Zi(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}}();function dc(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function oo(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var hc=800,fc=16,gc=Date.now;function pc(n){var e=0,t=0;return function(){var r=gc(),s=fc-(r-t);if(t=r,s>0){if(++e>=hc)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function mc(n){return function(){return n}}var bs=function(){try{var n=qn(Object,"defineProperty");return n({},"",{}),n}catch{}}(),bc=bs?function(n,e){return bs(n,"toString",{configurable:!0,enumerable:!1,value:mc(e),writable:!0})}:ao,Ec=pc(bc);function yc(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}var _c=9007199254740991,vc=/^(?:0|[1-9]\d*)$/;function lo(n,e){var t=typeof n;return e=e??_c,!!e&&(t=="number"||t!="symbol"&&vc.test(n))&&n>-1&&n%1==0&&n<e}function _i(n,e,t){e=="__proto__"&&bs?bs(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function Kr(n,e){return n===e||n!==n&&e!==e}var Nc=Object.prototype,Tc=Nc.hasOwnProperty;function co(n,e,t){var r=n[e];(!(Tc.call(n,e)&&Kr(r,t))||t===void 0&&!(e in n))&&_i(n,e,t)}function Gr(n,e,t,r){var s=!t;t||(t={});for(var i=-1,a=e.length;++i<a;){var l=e[i],c=void 0;c===void 0&&(c=n[l]),s?_i(t,l,c):co(t,l,c)}return t}var Yi=Math.max;function Ac(n,e,t){return e=Yi(e===void 0?n.length-1:e,0),function(){for(var r=arguments,s=-1,i=Yi(r.length-e,0),a=Array(i);++s<i;)a[s]=r[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=r[s];return l[e]=t(a),dc(n,this,l)}}function wc(n,e){return Ec(Ac(n,e,ao),n+"")}var Sc=9007199254740991;function uo(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Sc}function Ss(n){return n!=null&&uo(n.length)&&!yi(n)}function xc(n,e,t){if(!pn(t))return!1;var r=typeof e;return(r=="number"?Ss(t)&&lo(e,t.length):r=="string"&&e in t)?Kr(t[e],n):!1}function Oc(n){return wc((function(e,t){var r=-1,s=t.length,i=s>1?t[s-1]:void 0,a=s>2?t[2]:void 0;for(i=n.length>3&&typeof i=="function"?(s--,i):void 0,a&&xc(t[0],t[1],a)&&(i=s<3?void 0:i,s=1),e=Object(e);++r<s;){var l=t[r];l&&n(e,l,r,i)}return e}))}var Lc=Object.prototype;function vi(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Lc;return n===t}function Cc(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Ic="[object Arguments]";function Qi(n){return Vt(n)&&dr(n)==Ic}var ho=Object.prototype,Rc=ho.hasOwnProperty,kc=ho.propertyIsEnumerable,ri=Qi(function(){return arguments}())?Qi:function(n){return Vt(n)&&Rc.call(n,"callee")&&!kc.call(n,"callee")};function Mc(){return!1}var fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xi=fo&&typeof module=="object"&&module&&!module.nodeType&&module,Dc=Xi&&Xi.exports===fo,Ji=Dc?qt.Buffer:void 0,Bc=Ji?Ji.isBuffer:void 0,qr=Bc||Mc,qc="[object Arguments]",$c="[object Array]",Pc="[object Boolean]",Uc="[object Date]",Fc="[object Error]",Hc="[object Function]",zc="[object Map]",Kc="[object Number]",Gc="[object Object]",jc="[object RegExp]",Vc="[object Set]",Wc="[object String]",Zc="[object WeakMap]",Yc="[object ArrayBuffer]",Qc="[object DataView]",Xc="[object Float32Array]",Jc="[object Float64Array]",eu="[object Int8Array]",tu="[object Int16Array]",nu="[object Int32Array]",ru="[object Uint8Array]",su="[object Uint8ClampedArray]",iu="[object Uint16Array]",au="[object Uint32Array]",ke={};ke[Xc]=ke[Jc]=ke[eu]=ke[tu]=ke[nu]=ke[ru]=ke[su]=ke[iu]=ke[au]=!0;ke[qc]=ke[$c]=ke[Yc]=ke[Pc]=ke[Qc]=ke[Uc]=ke[Fc]=ke[Hc]=ke[zc]=ke[Kc]=ke[Gc]=ke[jc]=ke[Vc]=ke[Wc]=ke[Zc]=!1;function ou(n){return Vt(n)&&uo(n.length)&&!!ke[dr(n)]}function Ni(n){return function(e){return n(e)}}var go=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Dr=go&&typeof module=="object"&&module&&!module.nodeType&&module,lu=Dr&&Dr.exports===go,Ps=lu&&so.process,cr=function(){try{var n=Dr&&Dr.require&&Dr.require("util").types;return n||Ps&&Ps.binding&&Ps.binding("util")}catch{}}(),ea=cr&&cr.isTypedArray,Ti=ea?Ni(ea):ou,cu=Object.prototype,uu=cu.hasOwnProperty;function po(n,e){var t=Rn(n),r=!t&&ri(n),s=!t&&!r&&qr(n),i=!t&&!r&&!s&&Ti(n),a=t||r||s||i,l=a?Cc(n.length,String):[],c=l.length;for(var u in n)(e||uu.call(n,u))&&!(a&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||lo(u,c)))&&l.push(u);return l}function mo(n,e){return function(t){return n(e(t))}}var du=mo(Object.keys,Object),hu=Object.prototype,fu=hu.hasOwnProperty;function gu(n){if(!vi(n))return du(n);var e=[];for(var t in Object(n))fu.call(n,t)&&t!="constructor"&&e.push(t);return e}function Ai(n){return Ss(n)?po(n):gu(n)}function pu(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var mu=Object.prototype,bu=mu.hasOwnProperty;function Eu(n){if(!pn(n))return pu(n);var e=vi(n),t=[];for(var r in n)r=="constructor"&&(e||!bu.call(n,r))||t.push(r);return t}function jr(n){return Ss(n)?po(n,!0):Eu(n)}var $r=qn(Object,"create");function yu(){this.__data__=$r?$r(null):{},this.size=0}function _u(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var vu="__lodash_hash_undefined__",Nu=Object.prototype,Tu=Nu.hasOwnProperty;function Au(n){var e=this.__data__;if($r){var t=e[n];return t===vu?void 0:t}return Tu.call(e,n)?e[n]:void 0}var wu=Object.prototype,Su=wu.hasOwnProperty;function xu(n){var e=this.__data__;return $r?e[n]!==void 0:Su.call(e,n)}var Ou="__lodash_hash_undefined__";function Lu(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=$r&&e===void 0?Ou:e,this}function kn(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}kn.prototype.clear=yu;kn.prototype.delete=_u;kn.prototype.get=Au;kn.prototype.has=xu;kn.prototype.set=Lu;function Cu(){this.__data__=[],this.size=0}function xs(n,e){for(var t=n.length;t--;)if(Kr(n[t][0],e))return t;return-1}var Iu=Array.prototype,Ru=Iu.splice;function ku(n){var e=this.__data__,t=xs(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():Ru.call(e,t,1),--this.size,!0}function Mu(n){var e=this.__data__,t=xs(e,n);return t<0?void 0:e[t][1]}function Du(n){return xs(this.__data__,n)>-1}function Bu(n,e){var t=this.__data__,r=xs(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Zt(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Zt.prototype.clear=Cu;Zt.prototype.delete=ku;Zt.prototype.get=Mu;Zt.prototype.has=Du;Zt.prototype.set=Bu;var Pr=qn(qt,"Map");function qu(){this.size=0,this.__data__={hash:new kn,map:new(Pr||Zt),string:new kn}}function $u(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function Os(n,e){var t=n.__data__;return $u(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Pu(n){var e=Os(this,n).delete(n);return this.size-=e?1:0,e}function Uu(n){return Os(this,n).get(n)}function Fu(n){return Os(this,n).has(n)}function Hu(n,e){var t=Os(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function $n(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}$n.prototype.clear=qu;$n.prototype.delete=Pu;$n.prototype.get=Uu;$n.prototype.has=Fu;$n.prototype.set=Hu;function bo(n,e){for(var t=-1,r=e.length,s=n.length;++t<r;)n[s+t]=e[t];return n}var wi=mo(Object.getPrototypeOf,Object),zu="[object Object]",Ku=Function.prototype,Gu=Object.prototype,Eo=Ku.toString,ju=Gu.hasOwnProperty,Vu=Eo.call(Object);function Wu(n){if(!Vt(n)||dr(n)!=zu)return!1;var e=wi(n);if(e===null)return!0;var t=ju.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Eo.call(t)==Vu}function Zu(){this.__data__=new Zt,this.size=0}function Yu(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function Qu(n){return this.__data__.get(n)}function Xu(n){return this.__data__.has(n)}var Ju=200;function ed(n,e){var t=this.__data__;if(t instanceof Zt){var r=t.__data__;if(!Pr||r.length<Ju-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new $n(r)}return t.set(n,e),this.size=t.size,this}function Dt(n){var e=this.__data__=new Zt(n);this.size=e.size}Dt.prototype.clear=Zu;Dt.prototype.delete=Yu;Dt.prototype.get=Qu;Dt.prototype.has=Xu;Dt.prototype.set=ed;function td(n,e){return n&&Gr(e,Ai(e),n)}function nd(n,e){return n&&Gr(e,jr(e),n)}var yo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ta=yo&&typeof module=="object"&&module&&!module.nodeType&&module,rd=ta&&ta.exports===yo,na=rd?qt.Buffer:void 0,ra=na?na.allocUnsafe:void 0;function _o(n,e){if(e)return n.slice();var t=n.length,r=ra?ra(t):new n.constructor(t);return n.copy(r),r}function sd(n,e){for(var t=-1,r=n==null?0:n.length,s=0,i=[];++t<r;){var a=n[t];e(a,t,n)&&(i[s++]=a)}return i}function vo(){return[]}var id=Object.prototype,ad=id.propertyIsEnumerable,sa=Object.getOwnPropertySymbols,Si=sa?function(n){return n==null?[]:(n=Object(n),sd(sa(n),(function(e){return ad.call(n,e)})))}:vo;function od(n,e){return Gr(n,Si(n),e)}var ld=Object.getOwnPropertySymbols,No=ld?function(n){for(var e=[];n;)bo(e,Si(n)),n=wi(n);return e}:vo;function cd(n,e){return Gr(n,No(n),e)}function To(n,e,t){var r=e(n);return Rn(n)?r:bo(r,t(n))}function si(n){return To(n,Ai,Si)}function ud(n){return To(n,jr,No)}var ii=qn(qt,"DataView"),ai=qn(qt,"Promise"),oi=qn(qt,"Set"),ia="[object Map]",dd="[object Object]",aa="[object Promise]",oa="[object Set]",la="[object WeakMap]",ca="[object DataView]",hd=Bn(ii),fd=Bn(Pr),gd=Bn(ai),pd=Bn(oi),md=Bn(ni),At=dr;(ii&&At(new ii(new ArrayBuffer(1)))!=ca||Pr&&At(new Pr)!=ia||ai&&At(ai.resolve())!=aa||oi&&At(new oi)!=oa||ni&&At(new ni)!=la)&&(At=function(n){var e=dr(n),t=e==dd?n.constructor:void 0,r=t?Bn(t):"";if(r)switch(r){case hd:return ca;case fd:return ia;case gd:return aa;case pd:return oa;case md:return la}return e});var bd=Object.prototype,Ed=bd.hasOwnProperty;function yd(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&Ed.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var Es=qt.Uint8Array;function xi(n){var e=new n.constructor(n.byteLength);return new Es(e).set(new Es(n)),e}function _d(n,e){var t=e?xi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var vd=/\w*$/;function Nd(n){var e=new n.constructor(n.source,vd.exec(n));return e.lastIndex=n.lastIndex,e}var ua=gn?gn.prototype:void 0,da=ua?ua.valueOf:void 0;function Td(n){return da?Object(da.call(n)):{}}function Ao(n,e){var t=e?xi(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var Ad="[object Boolean]",wd="[object Date]",Sd="[object Map]",xd="[object Number]",Od="[object RegExp]",Ld="[object Set]",Cd="[object String]",Id="[object Symbol]",Rd="[object ArrayBuffer]",kd="[object DataView]",Md="[object Float32Array]",Dd="[object Float64Array]",Bd="[object Int8Array]",qd="[object Int16Array]",$d="[object Int32Array]",Pd="[object Uint8Array]",Ud="[object Uint8ClampedArray]",Fd="[object Uint16Array]",Hd="[object Uint32Array]";function zd(n,e,t){var r=n.constructor;switch(e){case Rd:return xi(n);case Ad:case wd:return new r(+n);case kd:return _d(n,t);case Md:case Dd:case Bd:case qd:case $d:case Pd:case Ud:case Fd:case Hd:return Ao(n,t);case Sd:return new r;case xd:case Cd:return new r(n);case Od:return Nd(n);case Ld:return new r;case Id:return Td(n)}}function wo(n){return typeof n.constructor=="function"&&!vi(n)?uc(wi(n)):{}}var Kd="[object Map]";function Gd(n){return Vt(n)&&At(n)==Kd}var ha=cr&&cr.isMap,jd=ha?Ni(ha):Gd,Vd="[object Set]";function Wd(n){return Vt(n)&&At(n)==Vd}var fa=cr&&cr.isSet,Zd=fa?Ni(fa):Wd,Yd=1,Qd=2,Xd=4,So="[object Arguments]",Jd="[object Array]",eh="[object Boolean]",th="[object Date]",nh="[object Error]",xo="[object Function]",rh="[object GeneratorFunction]",sh="[object Map]",ih="[object Number]",Oo="[object Object]",ah="[object RegExp]",oh="[object Set]",lh="[object String]",ch="[object Symbol]",uh="[object WeakMap]",dh="[object ArrayBuffer]",hh="[object DataView]",fh="[object Float32Array]",gh="[object Float64Array]",ph="[object Int8Array]",mh="[object Int16Array]",bh="[object Int32Array]",Eh="[object Uint8Array]",yh="[object Uint8ClampedArray]",_h="[object Uint16Array]",vh="[object Uint32Array]",Ie={};Ie[So]=Ie[Jd]=Ie[dh]=Ie[hh]=Ie[eh]=Ie[th]=Ie[fh]=Ie[gh]=Ie[ph]=Ie[mh]=Ie[bh]=Ie[sh]=Ie[ih]=Ie[Oo]=Ie[ah]=Ie[oh]=Ie[lh]=Ie[ch]=Ie[Eh]=Ie[yh]=Ie[_h]=Ie[vh]=!0;Ie[nh]=Ie[xo]=Ie[uh]=!1;function ms(n,e,t,r,s,i){var a,l=e&Yd,c=e&Qd,u=e&Xd;if(a!==void 0)return a;if(!pn(n))return n;var f=Rn(n);if(f){if(a=yd(n),!l)return oo(n,a)}else{var p=At(n),h=p==xo||p==rh;if(qr(n))return _o(n,l);if(p==Oo||p==So||h&&!s){if(a=c||h?{}:wo(n),!l)return c?cd(n,nd(a,n)):od(n,td(a,n))}else{if(!Ie[p])return s?n:{};a=zd(n,p,l)}}i||(i=new Dt);var g=i.get(n);if(g)return g;i.set(n,a),Zd(n)?n.forEach((function(N){a.add(ms(N,e,t,N,n,i))})):jd(n)&&n.forEach((function(N,T){a.set(T,ms(N,e,t,T,n,i))}));var y=u?c?ud:si:c?jr:Ai,_=f?void 0:y(n);return yc(_||n,(function(N,T){_&&(T=N,N=n[T]),co(a,T,ms(N,e,t,T,n,i))})),a}var Nh=1,Th=4;function ar(n){return ms(n,Nh|Th)}var Ah="__lodash_hash_undefined__";function wh(n){return this.__data__.set(n,Ah),this}function Sh(n){return this.__data__.has(n)}function ys(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new $n;++e<t;)this.add(n[e])}ys.prototype.add=ys.prototype.push=wh;ys.prototype.has=Sh;function xh(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Oh(n,e){return n.has(e)}var Lh=1,Ch=2;function Lo(n,e,t,r,s,i){var a=t&Lh,l=n.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var u=i.get(n),f=i.get(e);if(u&&f)return u==e&&f==n;var p=-1,h=!0,g=t&Ch?new ys:void 0;for(i.set(n,e),i.set(e,n);++p<l;){var y=n[p],_=e[p];if(r)var N=a?r(_,y,p,e,n,i):r(y,_,p,n,e,i);if(N!==void 0){if(N)continue;h=!1;break}if(g){if(!xh(e,(function(T,L){if(!Oh(g,L)&&(y===T||s(y,T,t,r,i)))return g.push(L)}))){h=!1;break}}else if(!(y===_||s(y,_,t,r,i))){h=!1;break}}return i.delete(n),i.delete(e),h}function Ih(n){var e=-1,t=Array(n.size);return n.forEach((function(r,s){t[++e]=[s,r]})),t}function Rh(n){var e=-1,t=Array(n.size);return n.forEach((function(r){t[++e]=r})),t}var kh=1,Mh=2,Dh="[object Boolean]",Bh="[object Date]",qh="[object Error]",$h="[object Map]",Ph="[object Number]",Uh="[object RegExp]",Fh="[object Set]",Hh="[object String]",zh="[object Symbol]",Kh="[object ArrayBuffer]",Gh="[object DataView]",ga=gn?gn.prototype:void 0,Us=ga?ga.valueOf:void 0;function jh(n,e,t,r,s,i,a){switch(t){case Gh:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case Kh:return!(n.byteLength!=e.byteLength||!i(new Es(n),new Es(e)));case Dh:case Bh:case Ph:return Kr(+n,+e);case qh:return n.name==e.name&&n.message==e.message;case Uh:case Hh:return n==e+"";case $h:var l=Ih;case Fh:var c=r&kh;if(l||(l=Rh),n.size!=e.size&&!c)return!1;var u=a.get(n);if(u)return u==e;r|=Mh,a.set(n,e);var f=Lo(l(n),l(e),r,s,i,a);return a.delete(n),f;case zh:if(Us)return Us.call(n)==Us.call(e)}return!1}var Vh=1,Wh=Object.prototype,Zh=Wh.hasOwnProperty;function Yh(n,e,t,r,s,i){var a=t&Vh,l=si(n),c=l.length,u=si(e),f=u.length;if(c!=f&&!a)return!1;for(var p=c;p--;){var h=l[p];if(!(a?h in e:Zh.call(e,h)))return!1}var g=i.get(n),y=i.get(e);if(g&&y)return g==e&&y==n;var _=!0;i.set(n,e),i.set(e,n);for(var N=a;++p<c;){h=l[p];var T=n[h],L=e[h];if(r)var C=a?r(L,T,h,e,n,i):r(T,L,h,n,e,i);if(!(C===void 0?T===L||s(T,L,t,r,i):C)){_=!1;break}N||(N=h=="constructor")}if(_&&!N){var U=n.constructor,F=e.constructor;U!=F&&"constructor"in n&&"constructor"in e&&!(typeof U=="function"&&U instanceof U&&typeof F=="function"&&F instanceof F)&&(_=!1)}return i.delete(n),i.delete(e),_}var Qh=1,pa="[object Arguments]",ma="[object Array]",ns="[object Object]",Xh=Object.prototype,ba=Xh.hasOwnProperty;function Jh(n,e,t,r,s,i){var a=Rn(n),l=Rn(e),c=a?ma:At(n),u=l?ma:At(e);c=c==pa?ns:c,u=u==pa?ns:u;var f=c==ns,p=u==ns,h=c==u;if(h&&qr(n)){if(!qr(e))return!1;a=!0,f=!1}if(h&&!f)return i||(i=new Dt),a||Ti(n)?Lo(n,e,t,r,s,i):jh(n,e,c,t,r,s,i);if(!(t&Qh)){var g=f&&ba.call(n,"__wrapped__"),y=p&&ba.call(e,"__wrapped__");if(g||y){var _=g?n.value():n,N=y?e.value():e;return i||(i=new Dt),s(_,N,t,r,i)}}return h?(i||(i=new Dt),Yh(n,e,t,r,s,i)):!1}function Co(n,e,t,r,s){return n===e?!0:n==null||e==null||!Vt(n)&&!Vt(e)?n!==n&&e!==e:Jh(n,e,t,r,Co,s)}function ef(n){return function(e,t,r){for(var s=-1,i=Object(e),a=r(e),l=a.length;l--;){var c=a[++s];if(t(i[c],c,i)===!1)break}return e}}var tf=ef();function li(n,e,t){(t!==void 0&&!Kr(n[e],t)||t===void 0&&!(e in n))&&_i(n,e,t)}function nf(n){return Vt(n)&&Ss(n)}function ci(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function rf(n){return Gr(n,jr(n))}function sf(n,e,t,r,s,i,a){var l=ci(n,t),c=ci(e,t),u=a.get(c);if(u){li(n,t,u);return}var f=i?i(l,c,t+"",n,e,a):void 0,p=f===void 0;if(p){var h=Rn(c),g=!h&&qr(c),y=!h&&!g&&Ti(c);f=c,h||g||y?Rn(l)?f=l:nf(l)?f=oo(l):g?(p=!1,f=_o(c,!0)):y?(p=!1,f=Ao(c,!0)):f=[]:Wu(c)||ri(c)?(f=l,ri(l)?f=rf(l):(!pn(l)||yi(l))&&(f=wo(c))):p=!1}p&&(a.set(c,f),s(f,c,r,i,a),a.delete(c)),li(n,t,f)}function Io(n,e,t,r,s){n!==e&&tf(e,(function(i,a){if(s||(s=new Dt),pn(i))sf(n,e,a,t,Io,r,s);else{var l=r?r(ci(n,a),i,a+"",n,e,s):void 0;l===void 0&&(l=i),li(n,a,l)}}),jr)}function Oi(n,e){return Co(n,e)}var hn=Oc((function(n,e,t){Io(n,e,t)})),Z=(n=>(n[n.TYPE=3]="TYPE",n[n.LEVEL=12]="LEVEL",n[n.ATTRIBUTE=13]="ATTRIBUTE",n[n.BLOT=14]="BLOT",n[n.INLINE=7]="INLINE",n[n.BLOCK=11]="BLOCK",n[n.BLOCK_BLOT=10]="BLOCK_BLOT",n[n.INLINE_BLOT=6]="INLINE_BLOT",n[n.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",n[n.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",n[n.ANY=15]="ANY",n))(Z||{});class Bt{constructor(e,t,r={}){this.attrName=e,this.keyName=t;const s=Z.TYPE&Z.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Z.LEVEL|s:Z.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map((t=>t.name))}add(e,t){return this.canAdd(e,t)?(e.setAttribute(this.keyName,t),!0):!1}canAdd(e,t){return this.whitelist==null?!0:typeof t=="string"?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class or extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Ro=class ui{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,t)}return null}create(e,t,r){const s=this.query(t);if(s==null)throw new or(`Unable to create ${t} blot`);const i=s,a=t instanceof Node||t.nodeType===Node.TEXT_NODE?t:i.create(r),l=new i(e,a,r);return ui.blots.set(l.domNode,l),l}find(e,t=!1){return ui.find(e,t)}query(e,t=Z.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Z.LEVEL&Z.BLOCK?r=this.types.block:e&Z.LEVEL&Z.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some((s=>(r=this.classes[s],!!r))),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&t&Z.LEVEL&r.scope&&t&Z.TYPE&r.scope?r:null}register(...e){return e.map((t=>{const r="blotName"in t,s="attrName"in t;if(!r&&!s)throw new or("Invalid definition");if(r&&t.blotName==="abstract")throw new or("Cannot register abstract class");const i=r?t.blotName:s?t.attrName:void 0;return this.types[i]=t,s?typeof t.keyName=="string"&&(this.attributes[t.keyName]=t):r&&(t.className&&(this.classes[t.className]=t),t.tagName&&(Array.isArray(t.tagName)?t.tagName=t.tagName.map((a=>a.toUpperCase())):t.tagName=t.tagName.toUpperCase(),(Array.isArray(t.tagName)?t.tagName:[t.tagName]).forEach((a=>{(this.tags[a]==null||t.className==null)&&(this.tags[a]=t)})))),t}))}};Ro.blots=new WeakMap;let ur=Ro;function Ea(n,e){return(n.getAttribute("class")||"").split(/\s+/).filter((t=>t.indexOf(`${e}-`)===0))}class af extends Bt{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map((t=>t.split("-").slice(0,-1).join("-")))}add(e,t){return this.canAdd(e,t)?(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0):!1}remove(e){Ea(e,this.keyName).forEach((t=>{e.classList.remove(t)})),e.classList.length===0&&e.removeAttribute("class")}value(e){const t=(Ea(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}}const Lt=af;function Fs(n){const e=n.split("-"),t=e.slice(1).map((r=>r[0].toUpperCase()+r.slice(1))).join("");return e[0]+t}class of extends Bt{static keys(e){return(e.getAttribute("style")||"").split(";").map((t=>t.split(":")[0].trim()))}add(e,t){return this.canAdd(e,t)?(e.style[Fs(this.keyName)]=t,!0):!1}remove(e){e.style[Fs(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[Fs(this.keyName)];return this.canAdd(e,t)?t:""}}const mn=of;class lf{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=ur.find(this.domNode);if(e==null)return;const t=Bt.keys(this.domNode),r=Lt.keys(this.domNode),s=mn.keys(this.domNode);t.concat(r).concat(s).forEach((i=>{const a=e.scroll.query(i,Z.ATTRIBUTE);a instanceof Bt&&(this.attributes[a.attrName]=a)}))}copy(e){Object.keys(this.attributes).forEach((t=>{const r=this.attributes[t].value(this.domNode);e.format(t,r)}))}move(e){this.copy(e),Object.keys(this.attributes).forEach((t=>{this.attributes[t].remove(this.domNode)})),this.attributes={}}values(){return Object.keys(this.attributes).reduce(((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e)),{})}}const Ls=lf,ko=class{constructor(e,t){this.scroll=e,this.domNode=t,ur.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new or("Blot definition missing tagName");let t,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?t=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?t=document.createElement(r):t=document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),ur.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,r,s){const i=this.isolate(e,t);if(this.scroll.query(r,Z.BLOT)!=null&&s)i.wrap(r,s);else if(this.scroll.query(r,Z.ATTRIBUTE)!=null){const a=this.scroll.create(this.statics.scope);i.wrap(a),a.format(r,s)}}insertAt(e,t,r){const s=r==null?this.scroll.create("text",t):this.scroll.create(t,r),i=this.split(e);this.parent.insertBefore(s,i||void 0)}isolate(e,t){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(t),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,t){return e===0?this:this.next}update(e,t){}wrap(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new or(`Cannot wrap ${e}`);return r.appendChild(this),r}};ko.blotName="abstract";let Mo=ko;const Do=class extends Mo{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Do.scope=Z.INLINE_BLOT;let cf=Do;const et=cf;class uf{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let r=t();for(;r&&e>0;)e-=1,r=t();return r}contains(e){const t=this.iterator();let r=t();for(;r;){if(r===e)return!0;r=t()}return!1}indexOf(e){const t=this.iterator();let r=t(),s=0;for(;r;){if(r===e)return s;s+=1,r=t()}return-1}insertBefore(e,t){e!=null&&(this.remove(e),e.next=t,t!=null?(e.prev=t.prev,t.prev!=null&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,r=this.head;for(;r!=null;){if(r===e)return t;t+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return e!=null&&(e=e.next),t}}find(e,t=!1){const r=this.iterator();let s=r();for(;s;){const i=s.length();if(e<i||t&&e===i&&(s.next==null||s.next.length()!==0))return[s,e];e-=i,s=r()}return[null,0]}forEach(e){const t=this.iterator();let r=t();for(;r;)e(r),r=t()}forEachAt(e,t,r){if(t<=0)return;const[s,i]=this.find(e);let a=e-i;const l=this.iterator(s);let c=l();for(;c&&a<e+t;){const u=c.length();e>a?r(c,e-a,Math.min(t,a+u-e)):r(c,0,Math.min(u,e+t-a)),a+=u,c=l()}}map(e){return this.reduce(((t,r)=>(t.push(e(r)),t)),[])}reduce(e,t){const r=this.iterator();let s=r();for(;s;)t=e(t,s),s=r();return t}}function ya(n,e){const t=e.find(n);if(t)return t;try{return e.create(n)}catch{const r=e.create(Z.INLINE);return Array.from(n.childNodes).forEach((s=>{r.domNode.appendChild(s)})),n.parentNode&&n.parentNode.replaceChild(r.domNode,n),r.attach(),r}}const Bo=class ln extends Mo{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach((e=>{e.attach()}))}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,ln.uiClass&&this.uiNode.classList.add(ln.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new uf,Array.from(this.domNode.childNodes).filter((e=>e!==this.uiNode)).reverse().forEach((e=>{try{const t=ya(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(t){if(t instanceof or)return;throw t}}))}deleteAt(e,t){if(e===0&&t===this.length())return this.remove();this.children.forEachAt(e,t,((r,s,i)=>{r.deleteAt(s,i)}))}descendant(e,t=0){const[r,s]=this.children.find(t);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof ln?r.descendant(e,s):[null,-1]}descendants(e,t=0,r=Number.MAX_VALUE){let s=[],i=r;return this.children.forEachAt(t,r,((a,l,c)=>{(e.blotName==null&&e(a)||e.blotName!=null&&a instanceof e)&&s.push(a),a instanceof ln&&(s=s.concat(a.descendants(e,l,i))),i-=c})),s}detach(){this.children.forEach((e=>{e.detach()})),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach((t=>{e||this.statics.allowedChildren.some((r=>t instanceof r))||(t.statics.scope===Z.BLOCK_BLOT?(t.next!=null&&this.splitAfter(t),t.prev!=null&&this.splitAfter(t.prev),t.parent.unwrap(),e=!0):t instanceof ln?t.unwrap():t.remove())}))}formatAt(e,t,r,s){this.children.forEachAt(e,t,((i,a,l)=>{i.formatAt(a,l,r,s)}))}insertAt(e,t,r){const[s,i]=this.children.find(e);if(s)s.insertAt(i,t,r);else{const a=r==null?this.scroll.create("text",t):this.scroll.create(t,r);this.appendChild(a)}}insertBefore(e,t){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,t||null),e.parent=this,t!=null&&(r=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce(((e,t)=>e+t.length()),0)}moveChildren(e,t){this.children.forEach((r=>{e.insertBefore(r,t)}))}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(e,t=!1){const[r,s]=this.children.find(e,t),i=[[this,e]];return r instanceof ln?i.concat(r.path(s,t)):(r!=null&&i.push([r,s]),i)}removeChild(e){this.children.remove(e)}replaceWith(e,t){const r=typeof e=="string"?this.scroll.create(e,t):e;return r instanceof ln&&this.moveChildren(r),super.replaceWith(r)}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),((s,i,a)=>{const l=s.split(i,t);l!=null&&r.appendChild(l)})),r}splitAfter(e){const t=this.clone();for(;e.next!=null;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const r=[],s=[];e.forEach((i=>{i.target===this.domNode&&i.type==="childList"&&(r.push(...i.addedNodes),s.push(...i.removedNodes))})),s.forEach((i=>{if(i.parentNode!=null&&i.tagName!=="IFRAME"&&document.body.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const a=this.scroll.find(i);a!=null&&(a.domNode.parentNode==null||a.domNode.parentNode===this.domNode)&&a.detach()})),r.filter((i=>i.parentNode===this.domNode&&i!==this.uiNode)).sort(((i,a)=>i===a?0:i.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1)).forEach((i=>{let a=null;i.nextSibling!=null&&(a=this.scroll.find(i.nextSibling));const l=ya(i,this.scroll);(l.next!==a||l.next==null)&&(l.parent!=null&&l.parent.removeChild(this),this.insertBefore(l,a||void 0))})),this.enforceAllowedChildren()}};Bo.uiClass="";let df=Bo;const xt=df;function hf(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}const er=class tr extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(tr.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ls(this.domNode)}format(e,t){if(e===this.statics.blotName&&!t)this.children.forEach((r=>{r instanceof tr||(r=r.wrap(tr.blotName,!0)),this.attributes.copy(r)})),this.unwrap();else{const r=this.scroll.query(e,Z.INLINE);if(r==null)return;r instanceof Bt?this.attributes.attribute(r,t):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t)}}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.formats()[r]!=null||this.scroll.query(r,Z.ATTRIBUTE)?this.isolate(e,t).format(r,s):super.formatAt(e,t,r,s)}optimize(e){super.optimize(e);const t=this.formats();if(Object.keys(t).length===0)return this.unwrap();const r=this.next;r instanceof tr&&r.prev===this&&hf(t,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}wrap(e,t){const r=super.wrap(e,t);return r instanceof tr&&this.attributes.move(r),r}};er.allowedChildren=[er,et],er.blotName="inline",er.scope=Z.INLINE_BLOT,er.tagName="SPAN";let ff=er;const Li=ff,nr=class di extends xt{static create(e){return super.create(e)}static formats(e,t){const r=t.query(di.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new Ls(this.domNode)}format(e,t){const r=this.scroll.query(e,Z.BLOCK);r!=null&&(r instanceof Bt?this.attributes.attribute(r,t):e===this.statics.blotName&&!t?this.replaceWith(di.blotName):t&&(e!==this.statics.blotName||this.formats()[e]!==t)&&this.replaceWith(e,t))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return t!=null&&(e[this.statics.blotName]=t),e}formatAt(e,t,r,s){this.scroll.query(r,Z.BLOCK)!=null?this.format(r,s):super.formatAt(e,t,r,s)}insertAt(e,t,r){if(r==null||this.scroll.query(t,Z.INLINE)!=null)super.insertAt(e,t,r);else{const s=this.split(e);if(s!=null){const i=this.scroll.create(t,r);s.parent.insertBefore(i,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,t){const r=super.replaceWith(e,t);return this.attributes.copy(r),r}update(e,t){super.update(e,t),e.some((r=>r.target===this.domNode&&r.type==="attributes"))&&this.attributes.build()}};nr.blotName="block",nr.scope=Z.BLOCK_BLOT,nr.tagName="P",nr.allowedChildren=[Li,nr,et];let gf=nr;const Ur=gf,hi=class extends xt{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.enforceAllowedChildren()}insertAt(e,t,r){super.insertAt(e,t,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};hi.blotName="container",hi.scope=Z.BLOCK_BLOT;let pf=hi;const Cs=pf;class mf extends et{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,r,s){e===0&&t===this.length()?this.format(r,s):super.formatAt(e,t,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const ct=mf,bf={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},Ef=100,rr=class extends xt{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver((r=>{this.update(r)})),this.observer.observe(this.domNode,bf),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const r=this.registry.find(e,t);return r?r.scroll===this?r:t?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,t=Z.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),e===0&&t===this.length()?this.children.forEach((r=>{r.remove()})):super.deleteAt(e,t)}formatAt(e,t,r,s){this.update(),super.formatAt(e,t,r,s)}insertAt(e,t,r){this.update(),super.insertAt(e,t,r)}optimize(e=[],t={}){super.optimize(t);const r=t.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const i=(c,u=!0)=>{c==null||c===this||c.domNode.parentNode!=null&&(r.has(c.domNode)||r.set(c.domNode,[]),u&&i(c.parent))},a=c=>{r.has(c.domNode)&&(c instanceof xt&&c.children.forEach(a),r.delete(c.domNode),c.optimize(t))};let l=e;for(let c=0;l.length>0;c+=1){if(c>=Ef)throw new Error("[Parchment] Maximum optimize iterations reached");for(l.forEach((u=>{const f=this.find(u.target,!0);f!=null&&(f.domNode===u.target&&(u.type==="childList"?(i(this.find(u.previousSibling,!1)),Array.from(u.addedNodes).forEach((p=>{const h=this.find(p,!1);i(h,!1),h instanceof xt&&h.children.forEach((g=>{i(g,!1)}))}))):u.type==="attributes"&&i(f.prev)),i(f))})),this.children.forEach(a),l=Array.from(this.observer.takeRecords()),s=l.slice();s.length>0;)e.push(s.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map((s=>{const i=this.find(s.target,!0);return i==null?null:r.has(i.domNode)?(r.get(i.domNode).push(s),null):(r.set(i.domNode,[s]),i)})).forEach((s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],t)})),t.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),t),this.optimize(e,t)}};rr.blotName="scroll",rr.defaultChild=Ur,rr.allowedChildren=[Ur,Cs],rr.scope=Z.BLOCK_BLOT,rr.tagName="DIV";let yf=rr;const Ci=yf,fi=class qo extends et{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,r){r==null?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof qo&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,t){e.some((r=>r.type==="characterData"&&r.target===this.domNode))&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};fi.blotName="text",fi.scope=Z.INLINE_BLOT;let _f=fi;const _s=_f,vf=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Bt,AttributorStore:Ls,BlockBlot:Ur,ClassAttributor:Lt,ContainerBlot:Cs,EmbedBlot:ct,InlineBlot:Li,LeafBlot:et,ParentBlot:xt,Registry:ur,Scope:Z,ScrollBlot:Ci,StyleAttributor:mn,TextBlot:_s},Symbol.toStringTag,{value:"Module"}));var un=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ii(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var rs={exports:{}},Hs,_a;function Nf(){if(_a)return Hs;_a=1;var n=-1,e=1,t=0;function r(b,x,v,I,k){if(b===x)return b?[[t,b]]:[];if(v!=null){var O=ce(b,x,v);if(O)return O}var B=l(b,x),M=b.substring(0,B);b=b.substring(B),x=x.substring(B),B=u(b,x);var H=b.substring(b.length-B);b=b.substring(0,b.length-B),x=x.substring(0,x.length-B);var q=s(b,x);return M&&q.unshift([t,M]),H&&q.push([t,H]),L(q,k),I&&p(q),q}function s(b,x){var v;if(!b)return[[e,x]];if(!x)return[[n,b]];var I=b.length>x.length?b:x,k=b.length>x.length?x:b,O=I.indexOf(k);if(O!==-1)return v=[[e,I.substring(0,O)],[t,k],[e,I.substring(O+k.length)]],b.length>x.length&&(v[0][0]=v[2][0]=n),v;if(k.length===1)return[[n,b],[e,x]];var B=f(b,x);if(B){var M=B[0],H=B[1],q=B[2],ee=B[3],J=B[4],ie=r(M,q),de=r(H,ee);return ie.concat([[t,J]],de)}return i(b,x)}function i(b,x){for(var v=b.length,I=x.length,k=Math.ceil((v+I)/2),O=k,B=2*k,M=new Array(B),H=new Array(B),q=0;q<B;q++)M[q]=-1,H[q]=-1;M[O+1]=0,H[O+1]=0;for(var ee=v-I,J=ee%2!==0,ie=0,de=0,X=0,Oe=0,Le=0;Le<k;Le++){for(var le=-Le+ie;le<=Le-de;le+=2){var _e=O+le,fe;le===-Le||le!==Le&&M[_e-1]<M[_e+1]?fe=M[_e+1]:fe=M[_e-1]+1;for(var Ee=fe-le;fe<v&&Ee<I&&b.charAt(fe)===x.charAt(Ee);)fe++,Ee++;if(M[_e]=fe,fe>v)de+=2;else if(Ee>I)ie+=2;else if(J){var ve=O+ee-le;if(ve>=0&&ve<B&&H[ve]!==-1){var Ne=v-H[ve];if(fe>=Ne)return a(b,x,fe,Ee)}}}for(var De=-Le+X;De<=Le-Oe;De+=2){var ve=O+De,Ne;De===-Le||De!==Le&&H[ve-1]<H[ve+1]?Ne=H[ve+1]:Ne=H[ve-1]+1;for(var ze=Ne-De;Ne<v&&ze<I&&b.charAt(v-Ne-1)===x.charAt(I-ze-1);)Ne++,ze++;if(H[ve]=Ne,Ne>v)Oe+=2;else if(ze>I)X+=2;else if(!J){var _e=O+ee-De;if(_e>=0&&_e<B&&M[_e]!==-1){var fe=M[_e],Ee=O+fe-_e;if(Ne=v-Ne,fe>=Ne)return a(b,x,fe,Ee)}}}}return[[n,b],[e,x]]}function a(b,x,v,I){var k=b.substring(0,v),O=x.substring(0,I),B=b.substring(v),M=x.substring(I),H=r(k,O),q=r(B,M);return H.concat(q)}function l(b,x){if(!b||!x||b.charAt(0)!==x.charAt(0))return 0;for(var v=0,I=Math.min(b.length,x.length),k=I,O=0;v<k;)b.substring(O,k)==x.substring(O,k)?(v=k,O=v):I=k,k=Math.floor((I-v)/2+v);return C(b.charCodeAt(k-1))&&k--,k}function c(b,x){var v=b.length,I=x.length;if(v==0||I==0)return 0;v>I?b=b.substring(v-I):v<I&&(x=x.substring(0,v));var k=Math.min(v,I);if(b==x)return k;for(var O=0,B=1;;){var M=b.substring(k-B),H=x.indexOf(M);if(H==-1)return O;B+=H,(H==0||b.substring(k-B)==x.substring(0,B))&&(O=B,B++)}}function u(b,x){if(!b||!x||b.slice(-1)!==x.slice(-1))return 0;for(var v=0,I=Math.min(b.length,x.length),k=I,O=0;v<k;)b.substring(b.length-k,b.length-O)==x.substring(x.length-k,x.length-O)?(v=k,O=v):I=k,k=Math.floor((I-v)/2+v);return U(b.charCodeAt(b.length-k))&&k--,k}function f(b,x){var v=b.length>x.length?b:x,I=b.length>x.length?x:b;if(v.length<4||I.length*2<v.length)return null;function k(de,X,Oe){for(var Le=de.substring(Oe,Oe+Math.floor(de.length/4)),le=-1,_e="",fe,Ee,ve,Ne;(le=X.indexOf(Le,le+1))!==-1;){var De=l(de.substring(Oe),X.substring(le)),ze=u(de.substring(0,Oe),X.substring(0,le));_e.length<ze+De&&(_e=X.substring(le-ze,le)+X.substring(le,le+De),fe=de.substring(0,Oe-ze),Ee=de.substring(Oe+De),ve=X.substring(0,le-ze),Ne=X.substring(le+De))}return _e.length*2>=de.length?[fe,Ee,ve,Ne,_e]:null}var O=k(v,I,Math.ceil(v.length/4)),B=k(v,I,Math.ceil(v.length/2)),M;if(!O&&!B)return null;B?O?M=O[4].length>B[4].length?O:B:M=B:M=O;var H,q,ee,J;b.length>x.length?(H=M[0],q=M[1],ee=M[2],J=M[3]):(ee=M[0],J=M[1],H=M[2],q=M[3]);var ie=M[4];return[H,q,ee,J,ie]}function p(b){for(var x=!1,v=[],I=0,k=null,O=0,B=0,M=0,H=0,q=0;O<b.length;)b[O][0]==t?(v[I++]=O,B=H,M=q,H=0,q=0,k=b[O][1]):(b[O][0]==e?H+=b[O][1].length:q+=b[O][1].length,k&&k.length<=Math.max(B,M)&&k.length<=Math.max(H,q)&&(b.splice(v[I-1],0,[n,k]),b[v[I-1]+1][0]=e,I--,I--,O=I>0?v[I-1]:-1,B=0,M=0,H=0,q=0,k=null,x=!0)),O++;for(x&&L(b),T(b),O=1;O<b.length;){if(b[O-1][0]==n&&b[O][0]==e){var ee=b[O-1][1],J=b[O][1],ie=c(ee,J),de=c(J,ee);ie>=de?(ie>=ee.length/2||ie>=J.length/2)&&(b.splice(O,0,[t,J.substring(0,ie)]),b[O-1][1]=ee.substring(0,ee.length-ie),b[O+1][1]=J.substring(ie),O++):(de>=ee.length/2||de>=J.length/2)&&(b.splice(O,0,[t,ee.substring(0,de)]),b[O-1][0]=e,b[O-1][1]=J.substring(0,J.length-de),b[O+1][0]=n,b[O+1][1]=ee.substring(de),O++),O++}O++}}var h=/[^a-zA-Z0-9]/,g=/\s/,y=/[\r\n]/,_=/\n\r?\n$/,N=/^\r?\n\r?\n/;function T(b){function x(de,X){if(!de||!X)return 6;var Oe=de.charAt(de.length-1),Le=X.charAt(0),le=Oe.match(h),_e=Le.match(h),fe=le&&Oe.match(g),Ee=_e&&Le.match(g),ve=fe&&Oe.match(y),Ne=Ee&&Le.match(y),De=ve&&de.match(_),ze=Ne&&X.match(N);return De||ze?5:ve||Ne?4:le&&!fe&&Ee?3:fe||Ee?2:le||_e?1:0}for(var v=1;v<b.length-1;){if(b[v-1][0]==t&&b[v+1][0]==t){var I=b[v-1][1],k=b[v][1],O=b[v+1][1],B=u(I,k);if(B){var M=k.substring(k.length-B);I=I.substring(0,I.length-B),k=M+k.substring(0,k.length-B),O=M+O}for(var H=I,q=k,ee=O,J=x(I,k)+x(k,O);k.charAt(0)===O.charAt(0);){I+=k.charAt(0),k=k.substring(1)+O.charAt(0),O=O.substring(1);var ie=x(I,k)+x(k,O);ie>=J&&(J=ie,H=I,q=k,ee=O)}b[v-1][1]!=H&&(H?b[v-1][1]=H:(b.splice(v-1,1),v--),b[v][1]=q,ee?b[v+1][1]=ee:(b.splice(v+1,1),v--))}v++}}function L(b,x){b.push([t,""]);for(var v=0,I=0,k=0,O="",B="",M;v<b.length;){if(v<b.length-1&&!b[v][1]){b.splice(v,1);continue}switch(b[v][0]){case e:k++,B+=b[v][1],v++;break;case n:I++,O+=b[v][1],v++;break;case t:var H=v-k-I-1;if(x){if(H>=0&&W(b[H][1])){var q=b[H][1].slice(-1);if(b[H][1]=b[H][1].slice(0,-1),O=q+O,B=q+B,!b[H][1]){b.splice(H,1),v--;var ee=H-1;b[ee]&&b[ee][0]===e&&(k++,B=b[ee][1]+B,ee--),b[ee]&&b[ee][0]===n&&(I++,O=b[ee][1]+O,ee--),H=ee}}if(F(b[v][1])){var q=b[v][1].charAt(0);b[v][1]=b[v][1].slice(1),O+=q,B+=q}}if(v<b.length-1&&!b[v][1]){b.splice(v,1);break}if(O.length>0||B.length>0){O.length>0&&B.length>0&&(M=l(B,O),M!==0&&(H>=0?b[H][1]+=B.substring(0,M):(b.splice(0,0,[t,B.substring(0,M)]),v++),B=B.substring(M),O=O.substring(M)),M=u(B,O),M!==0&&(b[v][1]=B.substring(B.length-M)+b[v][1],B=B.substring(0,B.length-M),O=O.substring(0,O.length-M)));var J=k+I;O.length===0&&B.length===0?(b.splice(v-J,J),v=v-J):O.length===0?(b.splice(v-J,J,[e,B]),v=v-J+1):B.length===0?(b.splice(v-J,J,[n,O]),v=v-J+1):(b.splice(v-J,J,[n,O],[e,B]),v=v-J+2)}v!==0&&b[v-1][0]===t?(b[v-1][1]+=b[v][1],b.splice(v,1)):v++,k=0,I=0,O="",B="";break}}b[b.length-1][1]===""&&b.pop();var ie=!1;for(v=1;v<b.length-1;)b[v-1][0]===t&&b[v+1][0]===t&&(b[v][1].substring(b[v][1].length-b[v-1][1].length)===b[v-1][1]?(b[v][1]=b[v-1][1]+b[v][1].substring(0,b[v][1].length-b[v-1][1].length),b[v+1][1]=b[v-1][1]+b[v+1][1],b.splice(v-1,1),ie=!0):b[v][1].substring(0,b[v+1][1].length)==b[v+1][1]&&(b[v-1][1]+=b[v+1][1],b[v][1]=b[v][1].substring(b[v+1][1].length)+b[v+1][1],b.splice(v+1,1),ie=!0)),v++;ie&&L(b,x)}function C(b){return b>=55296&&b<=56319}function U(b){return b>=56320&&b<=57343}function F(b){return U(b.charCodeAt(0))}function W(b){return C(b.charCodeAt(b.length-1))}function P(b){for(var x=[],v=0;v<b.length;v++)b[v][1].length>0&&x.push(b[v]);return x}function ne(b,x,v,I){return W(b)||F(I)?null:P([[t,b],[n,x],[e,v],[t,I]])}function ce(b,x,v){var I=typeof v=="number"?{index:v,length:0}:v.oldRange,k=typeof v=="number"?null:v.newRange,O=b.length,B=x.length;if(I.length===0&&(k===null||k.length===0)){var M=I.index,H=b.slice(0,M),q=b.slice(M),ee=k?k.index:null;e:{var J=M+B-O;if(ee!==null&&ee!==J||J<0||J>B)break e;var ie=x.slice(0,J),de=x.slice(J);if(de!==q)break e;var X=Math.min(M,J),Oe=H.slice(0,X),Le=ie.slice(0,X);if(Oe!==Le)break e;var le=H.slice(X),_e=ie.slice(X);return ne(Oe,le,_e,q)}e:{if(ee!==null&&ee!==M)break e;var fe=M,ie=x.slice(0,fe),de=x.slice(fe);if(ie!==H)break e;var Ee=Math.min(O-fe,B-fe),ve=q.slice(q.length-Ee),Ne=de.slice(de.length-Ee);if(ve!==Ne)break e;var le=q.slice(0,q.length-Ee),_e=de.slice(0,de.length-Ee);return ne(H,le,_e,ve)}}if(I.length>0&&k&&k.length===0)e:{var Oe=b.slice(0,I.index),ve=b.slice(I.index+I.length),X=Oe.length,Ee=ve.length;if(B<X+Ee)break e;var Le=x.slice(0,X),Ne=x.slice(B-Ee);if(Oe!==Le||ve!==Ne)break e;var le=b.slice(X,O-Ee),_e=x.slice(X,B-Ee);return ne(Oe,le,_e,ve)}return null}function pe(b,x,v,I){return r(b,x,v,I,!0)}return pe.INSERT=e,pe.DELETE=n,pe.EQUAL=t,Hs=pe,Hs}var Rr={exports:{}};Rr.exports;var va;function $o(){return va||(va=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=9007199254740991,i="[object Arguments]",a="[object Array]",l="[object Boolean]",c="[object Date]",u="[object Error]",f="[object Function]",p="[object GeneratorFunction]",h="[object Map]",g="[object Number]",y="[object Object]",_="[object Promise]",N="[object RegExp]",T="[object Set]",L="[object String]",C="[object Symbol]",U="[object WeakMap]",F="[object ArrayBuffer]",W="[object DataView]",P="[object Float32Array]",ne="[object Float64Array]",ce="[object Int8Array]",pe="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",v="[object Uint8ClampedArray]",I="[object Uint16Array]",k="[object Uint32Array]",O=/[\\^$.*+?()[\]{}|]/g,B=/\w*$/,M=/^\[object .+?Constructor\]$/,H=/^(?:0|[1-9]\d*)$/,q={};q[i]=q[a]=q[F]=q[W]=q[l]=q[c]=q[P]=q[ne]=q[ce]=q[pe]=q[b]=q[h]=q[g]=q[y]=q[N]=q[T]=q[L]=q[C]=q[x]=q[v]=q[I]=q[k]=!0,q[u]=q[f]=q[U]=!1;var ee=typeof un=="object"&&un&&un.Object===Object&&un,J=typeof self=="object"&&self&&self.Object===Object&&self,ie=ee||J||Function("return this")(),de=e&&!e.nodeType&&e,X=de&&!0&&n&&!n.nodeType&&n,Oe=X&&X.exports===de;function Le(o,d){return o.set(d[0],d[1]),o}function le(o,d){return o.add(d),o}function _e(o,d){for(var E=-1,w=o?o.length:0;++E<w&&d(o[E],E,o)!==!1;);return o}function fe(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Ee(o,d,E,w){for(var oe=-1,Q=o?o.length:0;++oe<Q;)E=d(E,o[oe],oe,o);return E}function ve(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function Ne(o,d){return o?.[d]}function De(o){var d=!1;if(o!=null&&typeof o.toString!="function")try{d=!!(o+"")}catch{}return d}function ze(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function yn(o,d){return function(E){return o(d(E))}}function Hn(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var fr=Array.prototype,gr=Function.prototype,Pt=Object.prototype,_n=ie["__core-js_shared__"],zn=function(){var o=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),vn=gr.toString,Ke=Pt.hasOwnProperty,Ut=Pt.toString,It=RegExp("^"+vn.call(Ke).replace(O,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=Oe?ie.Buffer:void 0,Ft=ie.Symbol,Nn=ie.Uint8Array,rt=yn(Object.getPrototypeOf,Object),Kn=Object.create,Gn=Pt.propertyIsEnumerable,pr=fr.splice,Qt=Object.getOwnPropertySymbols,Xt=ut?ut.isBuffer:void 0,jn=yn(Object.keys,Object),Jt=at(ie,"DataView"),yt=at(ie,"Map"),st=at(ie,"Promise"),Ht=at(ie,"Set"),Tn=at(ie,"WeakMap"),Rt=at(Object,"create"),dt=D(Jt),m=D(yt),S=D(st),$=D(Ht),re=D(Tn),Te=Ft?Ft.prototype:void 0,Ce=Te?Te.valueOf:void 0;function z(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function K(){this.__data__=Rt?Rt(null):{}}function se(o){return this.has(o)&&delete this.__data__[o]}function Be(o){var d=this.__data__;if(Rt){var E=d[o];return E===r?void 0:E}return Ke.call(d,o)?d[o]:void 0}function Re(o){var d=this.__data__;return Rt?d[o]!==void 0:Ke.call(d,o)}function _t(o,d){var E=this.__data__;return E[o]=Rt&&d===void 0?r:d,this}z.prototype.clear=K,z.prototype.delete=se,z.prototype.get=Be,z.prototype.has=Re,z.prototype.set=_t;function $e(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=[]}function mr(o){var d=this.__data__,E=nn(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():pr.call(d,E,1),!0}function wn(o){var d=this.__data__,E=nn(d,o);return E<0?void 0:d[E][1]}function br(o){return nn(this.__data__,o)>-1}function Er(o,d){var E=this.__data__,w=nn(E,o);return w<0?E.push([o,d]):E[w][1]=d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ge(o){var d=-1,E=o?o.length:0;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__={hash:new z,map:new(yt||$e),string:new z}}function en(o){return Ve(this,o).delete(o)}function yr(o){return Ve(this,o).get(o)}function _r(o){return Ve(this,o).has(o)}function vr(o,d){return Ve(this,o).set(o,d),this}Ge.prototype.clear=Vn,Ge.prototype.delete=en,Ge.prototype.get=yr,Ge.prototype.has=_r,Ge.prototype.set=vr;function Ye(o){this.__data__=new $e(o)}function ht(){this.__data__=new $e}function Wn(o){return this.__data__.delete(o)}function Zn(o){return this.__data__.get(o)}function Nr(o){return this.__data__.has(o)}function Tr(o,d){var E=this.__data__;if(E instanceof $e){var w=E.__data__;if(!yt||w.length<t-1)return w.push([o,d]),this;E=this.__data__=new Ge(w)}return E.set(o,d),this}Ye.prototype.clear=ht,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o,d){var E=qe(o)||ge(o)?ve(o.length,String):[],w=E.length,oe=!!w;for(var Q in o)Ke.call(o,Q)&&!(oe&&(Q=="length"||sn(Q,w)))&&E.push(Q);return E}function zt(o,d,E){var w=o[d];(!(Ke.call(o,d)&&ae(w,E))||E===void 0&&!(d in o))&&(o[d]=E)}function nn(o,d){for(var E=o.length;E--;)if(ae(o[E][0],d))return E;return-1}function R(o,d){return o&&On(d,Lr(d),o)}function Y(o,d,E,w,oe,Q,ye){var me;if(w&&(me=Q?w(o,oe,Q,ye):w(o)),me!==void 0)return me;if(!kt(o))return o;var Pe=qe(o);if(Pe){if(me=Xn(o),!d)return Sr(o,me)}else{var we=te(o),Xe=we==f||we==p;if(Jn(o))return vt(o,d);if(we==y||we==i||Xe&&!Q){if(De(o))return Q?o:{};if(me=xe(Xe?{}:o),!d)return rn(o,R(me,o))}else{if(!q[we])return Q?o:{};me=Se(o,we,Y,d)}}ye||(ye=new Ye);var it=ye.get(o);if(it)return it;if(ye.set(o,me),!Pe)var Fe=E?Qn(o):Lr(o);return _e(Fe||o,(function(Je,We){Fe&&(We=Je,Je=o[We]),zt(me,We,Y(Je,d,E,w,We,o,ye))})),me}function ue(o){return kt(o)?Kn(o):{}}function Ae(o,d,E){var w=d(o);return qe(o)?w:fe(w,E(o))}function Me(o){return Ut.call(o)}function tt(o){if(!kt(o)||Ln(o))return!1;var d=Or(o)||De(o)?It:M;return d.test(D(o))}function ft(o){if(!an(o))return jn(o);var d=[];for(var E in Object(o))Ke.call(o,E)&&E!="constructor"&&d.push(E);return d}function vt(o,d){if(d)return o.slice();var E=new o.constructor(o.length);return o.copy(E),E}function Ue(o){var d=new o.constructor(o.byteLength);return new Nn(d).set(new Nn(o)),d}function je(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.byteLength)}function Sn(o,d,E){var w=d?E(ze(o),!0):ze(o);return Ee(w,Le,new o.constructor)}function xn(o){var d=new o.constructor(o.source,B.exec(o));return d.lastIndex=o.lastIndex,d}function Yn(o,d,E){var w=d?E(Hn(o),!0):Hn(o);return Ee(w,le,new o.constructor)}function Ar(o){return Ce?Object(Ce.call(o)):{}}function wr(o,d){var E=d?Ue(o.buffer):o.buffer;return new o.constructor(E,o.byteOffset,o.length)}function Sr(o,d){var E=-1,w=o.length;for(d||(d=Array(w));++E<w;)d[E]=o[E];return d}function On(o,d,E,w){E||(E={});for(var oe=-1,Q=d.length;++oe<Q;){var ye=d[oe],me=void 0;zt(E,ye,me===void 0?o[ye]:me)}return E}function rn(o,d){return On(o,ot(o),d)}function Qn(o){return Ae(o,Lr,ot)}function Ve(o,d){var E=o.__data__;return Nt(d)?E[typeof d=="string"?"string":"hash"]:E.map}function at(o,d){var E=Ne(o,d);return tt(E)?E:void 0}var ot=Qt?yn(Qt,Object):Bs,te=Me;(Jt&&te(new Jt(new ArrayBuffer(1)))!=W||yt&&te(new yt)!=h||st&&te(st.resolve())!=_||Ht&&te(new Ht)!=T||Tn&&te(new Tn)!=U)&&(te=function(o){var d=Ut.call(o),E=d==y?o.constructor:void 0,w=E?D(E):void 0;if(w)switch(w){case dt:return W;case m:return h;case S:return _;case $:return T;case re:return U}return d});function Xn(o){var d=o.length,E=o.constructor(d);return d&&typeof o[0]=="string"&&Ke.call(o,"index")&&(E.index=o.index,E.input=o.input),E}function xe(o){return typeof o.constructor=="function"&&!an(o)?ue(rt(o)):{}}function Se(o,d,E,w){var oe=o.constructor;switch(d){case F:return Ue(o);case l:case c:return new oe(+o);case W:return je(o,w);case P:case ne:case ce:case pe:case b:case x:case v:case I:case k:return wr(o,w);case h:return Sn(o,w,E);case g:case L:return new oe(o);case N:return xn(o);case T:return Yn(o,w,E);case C:return Ar(o)}}function sn(o,d){return d=d??s,!!d&&(typeof o=="number"||H.test(o))&&o>-1&&o%1==0&&o<d}function Nt(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Ln(o){return!!zn&&zn in o}function an(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||Pt;return o===E}function D(o){if(o!=null){try{return vn.call(o)}catch{}try{return o+""}catch{}}return""}function V(o){return Y(o,!0,!0)}function ae(o,d){return o===d||o!==o&&d!==d}function ge(o){return xr(o)&&Ke.call(o,"callee")&&(!Gn.call(o,"callee")||Ut.call(o)==i)}var qe=Array.isArray;function Qe(o){return o!=null&&Xr(o.length)&&!Or(o)}function xr(o){return Jr(o)&&Qe(o)}var Jn=Xt||qs;function Or(o){var d=kt(o)?Ut.call(o):"";return d==f||d==p}function Xr(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=s}function kt(o){var d=typeof o;return!!o&&(d=="object"||d=="function")}function Jr(o){return!!o&&typeof o=="object"}function Lr(o){return Qe(o)?tn(o):ft(o)}function Bs(){return[]}function qs(){return!1}n.exports=V}(Rr,Rr.exports)),Rr.exports}var kr={exports:{}};kr.exports;var Na;function Po(){return Na||(Na=1,function(n,e){var t=200,r="__lodash_hash_undefined__",s=1,i=2,a=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",f="[object Boolean]",p="[object Date]",h="[object Error]",g="[object Function]",y="[object GeneratorFunction]",_="[object Map]",N="[object Number]",T="[object Null]",L="[object Object]",C="[object Promise]",U="[object Proxy]",F="[object RegExp]",W="[object Set]",P="[object String]",ne="[object Symbol]",ce="[object Undefined]",pe="[object WeakMap]",b="[object ArrayBuffer]",x="[object DataView]",v="[object Float32Array]",I="[object Float64Array]",k="[object Int8Array]",O="[object Int16Array]",B="[object Int32Array]",M="[object Uint8Array]",H="[object Uint8ClampedArray]",q="[object Uint16Array]",ee="[object Uint32Array]",J=/[\\^$.*+?()[\]{}|]/g,ie=/^\[object .+?Constructor\]$/,de=/^(?:0|[1-9]\d*)$/,X={};X[v]=X[I]=X[k]=X[O]=X[B]=X[M]=X[H]=X[q]=X[ee]=!0,X[l]=X[c]=X[b]=X[f]=X[x]=X[p]=X[h]=X[g]=X[_]=X[N]=X[L]=X[F]=X[W]=X[P]=X[pe]=!1;var Oe=typeof un=="object"&&un&&un.Object===Object&&un,Le=typeof self=="object"&&self&&self.Object===Object&&self,le=Oe||Le||Function("return this")(),_e=e&&!e.nodeType&&e,fe=_e&&!0&&n&&!n.nodeType&&n,Ee=fe&&fe.exports===_e,ve=Ee&&Oe.process,Ne=function(){try{return ve&&ve.binding&&ve.binding("util")}catch{}}(),De=Ne&&Ne.isTypedArray;function ze(o,d){for(var E=-1,w=o==null?0:o.length,oe=0,Q=[];++E<w;){var ye=o[E];d(ye,E,o)&&(Q[oe++]=ye)}return Q}function yn(o,d){for(var E=-1,w=d.length,oe=o.length;++E<w;)o[oe+E]=d[E];return o}function Hn(o,d){for(var E=-1,w=o==null?0:o.length;++E<w;)if(d(o[E],E,o))return!0;return!1}function fr(o,d){for(var E=-1,w=Array(o);++E<o;)w[E]=d(E);return w}function gr(o){return function(d){return o(d)}}function Pt(o,d){return o.has(d)}function _n(o,d){return o?.[d]}function zn(o){var d=-1,E=Array(o.size);return o.forEach((function(w,oe){E[++d]=[oe,w]})),E}function vn(o,d){return function(E){return o(d(E))}}function Ke(o){var d=-1,E=Array(o.size);return o.forEach((function(w){E[++d]=w})),E}var Ut=Array.prototype,It=Function.prototype,ut=Object.prototype,Ft=le["__core-js_shared__"],Nn=It.toString,rt=ut.hasOwnProperty,Kn=function(){var o=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Gn=ut.toString,pr=RegExp("^"+Nn.call(rt).replace(J,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qt=Ee?le.Buffer:void 0,Xt=le.Symbol,jn=le.Uint8Array,Jt=ut.propertyIsEnumerable,yt=Ut.splice,st=Xt?Xt.toStringTag:void 0,Ht=Object.getOwnPropertySymbols,Tn=Qt?Qt.isBuffer:void 0,Rt=vn(Object.keys,Object),dt=ot(le,"DataView"),m=ot(le,"Map"),S=ot(le,"Promise"),$=ot(le,"Set"),re=ot(le,"WeakMap"),Te=ot(Object,"create"),Ce=D(dt),z=D(m),K=D(S),se=D($),Be=D(re),Re=Xt?Xt.prototype:void 0,_t=Re?Re.valueOf:void 0;function $e(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function An(){this.__data__=Te?Te(null):{},this.size=0}function mr(o){var d=this.has(o)&&delete this.__data__[o];return this.size-=d?1:0,d}function wn(o){var d=this.__data__;if(Te){var E=d[o];return E===r?void 0:E}return rt.call(d,o)?d[o]:void 0}function br(o){var d=this.__data__;return Te?d[o]!==void 0:rt.call(d,o)}function Er(o,d){var E=this.__data__;return this.size+=this.has(o)?0:1,E[o]=Te&&d===void 0?r:d,this}$e.prototype.clear=An,$e.prototype.delete=mr,$e.prototype.get=wn,$e.prototype.has=br,$e.prototype.set=Er;function Ge(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function Vn(){this.__data__=[],this.size=0}function en(o){var d=this.__data__,E=vt(d,o);if(E<0)return!1;var w=d.length-1;return E==w?d.pop():yt.call(d,E,1),--this.size,!0}function yr(o){var d=this.__data__,E=vt(d,o);return E<0?void 0:d[E][1]}function _r(o){return vt(this.__data__,o)>-1}function vr(o,d){var E=this.__data__,w=vt(E,o);return w<0?(++this.size,E.push([o,d])):E[w][1]=d,this}Ge.prototype.clear=Vn,Ge.prototype.delete=en,Ge.prototype.get=yr,Ge.prototype.has=_r,Ge.prototype.set=vr;function Ye(o){var d=-1,E=o==null?0:o.length;for(this.clear();++d<E;){var w=o[d];this.set(w[0],w[1])}}function ht(){this.size=0,this.__data__={hash:new $e,map:new(m||Ge),string:new $e}}function Wn(o){var d=at(this,o).delete(o);return this.size-=d?1:0,d}function Zn(o){return at(this,o).get(o)}function Nr(o){return at(this,o).has(o)}function Tr(o,d){var E=at(this,o),w=E.size;return E.set(o,d),this.size+=E.size==w?0:1,this}Ye.prototype.clear=ht,Ye.prototype.delete=Wn,Ye.prototype.get=Zn,Ye.prototype.has=Nr,Ye.prototype.set=Tr;function tn(o){var d=-1,E=o==null?0:o.length;for(this.__data__=new Ye;++d<E;)this.add(o[d])}function zt(o){return this.__data__.set(o,r),this}function nn(o){return this.__data__.has(o)}tn.prototype.add=tn.prototype.push=zt,tn.prototype.has=nn;function R(o){var d=this.__data__=new Ge(o);this.size=d.size}function Y(){this.__data__=new Ge,this.size=0}function ue(o){var d=this.__data__,E=d.delete(o);return this.size=d.size,E}function Ae(o){return this.__data__.get(o)}function Me(o){return this.__data__.has(o)}function tt(o,d){var E=this.__data__;if(E instanceof Ge){var w=E.__data__;if(!m||w.length<t-1)return w.push([o,d]),this.size=++E.size,this;E=this.__data__=new Ye(w)}return E.set(o,d),this.size=E.size,this}R.prototype.clear=Y,R.prototype.delete=ue,R.prototype.get=Ae,R.prototype.has=Me,R.prototype.set=tt;function ft(o,d){var E=ge(o),w=!E&&ae(o),oe=!E&&!w&&Qe(o),Q=!E&&!w&&!oe&&Jr(o),ye=E||w||oe||Q,me=ye?fr(o.length,String):[],Pe=me.length;for(var we in o)rt.call(o,we)&&!(ye&&(we=="length"||oe&&(we=="offset"||we=="parent")||Q&&(we=="buffer"||we=="byteLength"||we=="byteOffset")||Se(we,Pe)))&&me.push(we);return me}function vt(o,d){for(var E=o.length;E--;)if(V(o[E][0],d))return E;return-1}function Ue(o,d,E){var w=d(o);return ge(o)?w:yn(w,E(o))}function je(o){return o==null?o===void 0?ce:T:st&&st in Object(o)?te(o):an(o)}function Sn(o){return kt(o)&&je(o)==l}function xn(o,d,E,w,oe){return o===d?!0:o==null||d==null||!kt(o)&&!kt(d)?o!==o&&d!==d:Yn(o,d,E,w,xn,oe)}function Yn(o,d,E,w,oe,Q){var ye=ge(o),me=ge(d),Pe=ye?c:xe(o),we=me?c:xe(d);Pe=Pe==l?L:Pe,we=we==l?L:we;var Xe=Pe==L,it=we==L,Fe=Pe==we;if(Fe&&Qe(o)){if(!Qe(d))return!1;ye=!0,Xe=!1}if(Fe&&!Xe)return Q||(Q=new R),ye||Jr(o)?On(o,d,E,w,oe,Q):rn(o,d,Pe,E,w,oe,Q);if(!(E&s)){var Je=Xe&&rt.call(o,"__wrapped__"),We=it&&rt.call(d,"__wrapped__");if(Je||We){var on=Je?o.value():o,Kt=We?d.value():d;return Q||(Q=new R),oe(on,Kt,E,w,Q)}}return Fe?(Q||(Q=new R),Qn(o,d,E,w,oe,Q)):!1}function Ar(o){if(!Xr(o)||Nt(o))return!1;var d=Jn(o)?pr:ie;return d.test(D(o))}function wr(o){return kt(o)&&Or(o.length)&&!!X[je(o)]}function Sr(o){if(!Ln(o))return Rt(o);var d=[];for(var E in Object(o))rt.call(o,E)&&E!="constructor"&&d.push(E);return d}function On(o,d,E,w,oe,Q){var ye=E&s,me=o.length,Pe=d.length;if(me!=Pe&&!(ye&&Pe>me))return!1;var we=Q.get(o);if(we&&Q.get(d))return we==d;var Xe=-1,it=!0,Fe=E&i?new tn:void 0;for(Q.set(o,d),Q.set(d,o);++Xe<me;){var Je=o[Xe],We=d[Xe];if(w)var on=ye?w(We,Je,Xe,d,o,Q):w(Je,We,Xe,o,d,Q);if(on!==void 0){if(on)continue;it=!1;break}if(Fe){if(!Hn(d,(function(Kt,Cn){if(!Pt(Fe,Cn)&&(Je===Kt||oe(Je,Kt,E,w,Q)))return Fe.push(Cn)}))){it=!1;break}}else if(!(Je===We||oe(Je,We,E,w,Q))){it=!1;break}}return Q.delete(o),Q.delete(d),it}function rn(o,d,E,w,oe,Q,ye){switch(E){case x:if(o.byteLength!=d.byteLength||o.byteOffset!=d.byteOffset)return!1;o=o.buffer,d=d.buffer;case b:return!(o.byteLength!=d.byteLength||!Q(new jn(o),new jn(d)));case f:case p:case N:return V(+o,+d);case h:return o.name==d.name&&o.message==d.message;case F:case P:return o==d+"";case _:var me=zn;case W:var Pe=w&s;if(me||(me=Ke),o.size!=d.size&&!Pe)return!1;var we=ye.get(o);if(we)return we==d;w|=i,ye.set(o,d);var Xe=On(me(o),me(d),w,oe,Q,ye);return ye.delete(o),Xe;case ne:if(_t)return _t.call(o)==_t.call(d)}return!1}function Qn(o,d,E,w,oe,Q){var ye=E&s,me=Ve(o),Pe=me.length,we=Ve(d),Xe=we.length;if(Pe!=Xe&&!ye)return!1;for(var it=Pe;it--;){var Fe=me[it];if(!(ye?Fe in d:rt.call(d,Fe)))return!1}var Je=Q.get(o);if(Je&&Q.get(d))return Je==d;var We=!0;Q.set(o,d),Q.set(d,o);for(var on=ye;++it<Pe;){Fe=me[it];var Kt=o[Fe],Cn=d[Fe];if(w)var Ki=ye?w(Cn,Kt,Fe,d,o,Q):w(Kt,Cn,Fe,o,d,Q);if(!(Ki===void 0?Kt===Cn||oe(Kt,Cn,E,w,Q):Ki)){We=!1;break}on||(on=Fe=="constructor")}if(We&&!on){var es=o.constructor,ts=d.constructor;es!=ts&&"constructor"in o&&"constructor"in d&&!(typeof es=="function"&&es instanceof es&&typeof ts=="function"&&ts instanceof ts)&&(We=!1)}return Q.delete(o),Q.delete(d),We}function Ve(o){return Ue(o,Lr,Xn)}function at(o,d){var E=o.__data__;return sn(d)?E[typeof d=="string"?"string":"hash"]:E.map}function ot(o,d){var E=_n(o,d);return Ar(E)?E:void 0}function te(o){var d=rt.call(o,st),E=o[st];try{o[st]=void 0;var w=!0}catch{}var oe=Gn.call(o);return w&&(d?o[st]=E:delete o[st]),oe}var Xn=Ht?function(o){return o==null?[]:(o=Object(o),ze(Ht(o),(function(d){return Jt.call(o,d)})))}:Bs,xe=je;(dt&&xe(new dt(new ArrayBuffer(1)))!=x||m&&xe(new m)!=_||S&&xe(S.resolve())!=C||$&&xe(new $)!=W||re&&xe(new re)!=pe)&&(xe=function(o){var d=je(o),E=d==L?o.constructor:void 0,w=E?D(E):"";if(w)switch(w){case Ce:return x;case z:return _;case K:return C;case se:return W;case Be:return pe}return d});function Se(o,d){return d=d??a,!!d&&(typeof o=="number"||de.test(o))&&o>-1&&o%1==0&&o<d}function sn(o){var d=typeof o;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?o!=="__proto__":o===null}function Nt(o){return!!Kn&&Kn in o}function Ln(o){var d=o&&o.constructor,E=typeof d=="function"&&d.prototype||ut;return o===E}function an(o){return Gn.call(o)}function D(o){if(o!=null){try{return Nn.call(o)}catch{}try{return o+""}catch{}}return""}function V(o,d){return o===d||o!==o&&d!==d}var ae=Sn(function(){return arguments}())?Sn:function(o){return kt(o)&&rt.call(o,"callee")&&!Jt.call(o,"callee")},ge=Array.isArray;function qe(o){return o!=null&&Or(o.length)&&!Jn(o)}var Qe=Tn||qs;function xr(o,d){return xn(o,d)}function Jn(o){if(!Xr(o))return!1;var d=je(o);return d==g||d==y||d==u||d==U}function Or(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=a}function Xr(o){var d=typeof o;return o!=null&&(d=="object"||d=="function")}function kt(o){return o!=null&&typeof o=="object"}var Jr=De?gr(De):wr;function Lr(o){return qe(o)?ft(o):Sr(o)}function Bs(){return[]}function qs(){return!1}n.exports=xr}(kr,kr.exports)),kr.exports}var ss={},Ta;function Tf(){if(Ta)return ss;Ta=1,Object.defineProperty(ss,"__esModule",{value:!0});const n=$o(),e=Po();var t;return function(r){function s(c={},u={},f=!1){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});let p=n(u);f||(p=Object.keys(p).reduce(((h,g)=>(p[g]!=null&&(h[g]=p[g]),h)),{}));for(const h in c)c[h]!==void 0&&u[h]===void 0&&(p[h]=c[h]);return Object.keys(p).length>0?p:void 0}r.compose=s;function i(c={},u={}){typeof c!="object"&&(c={}),typeof u!="object"&&(u={});const f=Object.keys(c).concat(Object.keys(u)).reduce(((p,h)=>(e(c[h],u[h])||(p[h]=u[h]===void 0?null:u[h]),p)),{});return Object.keys(f).length>0?f:void 0}r.diff=i;function a(c={},u={}){c=c||{};const f=Object.keys(u).reduce(((p,h)=>(u[h]!==c[h]&&c[h]!==void 0&&(p[h]=u[h]),p)),{});return Object.keys(c).reduce(((p,h)=>(c[h]!==u[h]&&u[h]===void 0&&(p[h]=null),p)),f)}r.invert=a;function l(c,u,f=!1){if(typeof c!="object")return u;if(typeof u!="object")return;if(!f)return u;const p=Object.keys(u).reduce(((h,g)=>(c[g]===void 0&&(h[g]=u[g]),h)),{});return Object.keys(p).length>0?p:void 0}r.transform=l}(t||(t={})),ss.default=t,ss}var is={},Aa;function Uo(){if(Aa)return is;Aa=1,Object.defineProperty(is,"__esModule",{value:!0});var n;return function(e){function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t}(n||(n={})),is.default=n,is}var as={},wa;function Af(){if(wa)return as;wa=1,Object.defineProperty(as,"__esModule",{value:!0});const n=Uo();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const i=this.offset,a=n.default.length(s);if(r>=a-i?(r=a-i,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const l={};return s.attributes&&(l.attributes=s.attributes),typeof s.retain=="number"?l.retain=r:typeof s.retain=="object"&&s.retain!==null?l.retain=s.retain:typeof s.insert=="string"?l.insert=s.insert.substr(i,r):l.insert=s.insert,l}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?n.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,i=this.next(),a=this.ops.slice(this.index);return this.offset=r,this.index=s,[i].concat(a)}}else return[]}}return as.default=e,as}var Sa;function wf(){return Sa||(Sa=1,function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const t=Nf(),r=$o(),s=Po(),i=Tf();e.AttributeMap=i.default;const a=Uo();e.Op=a.default;const l=Af();e.OpIterator=l.default;const c="\0",u=(p,h)=>{if(typeof p!="object"||p===null)throw new Error(`cannot retain a ${typeof p}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const g=Object.keys(p)[0];if(!g||g!==Object.keys(h)[0])throw new Error(`embed types not matched: ${g} != ${Object.keys(h)[0]}`);return[g,p[g],h[g]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,g){this.handlers[h]=g}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const g=this.handlers[h];if(!g)throw new Error(`no handlers for embed type "${h}"`);return g}insert(h,g){const y={};return typeof h=="string"&&h.length===0?this:(y.insert=h,g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,g){if(typeof h=="number"&&h<=0)return this;const y={retain:h};return g!=null&&typeof g=="object"&&Object.keys(g).length>0&&(y.attributes=g),this.push(y)}push(h){let g=this.ops.length,y=this.ops[g-1];if(h=r(h),typeof y=="object"){if(typeof h.delete=="number"&&typeof y.delete=="number")return this.ops[g-1]={delete:y.delete+h.delete},this;if(typeof y.delete=="number"&&h.insert!=null&&(g-=1,y=this.ops[g-1],typeof y!="object"))return this.ops.unshift(h),this;if(s(h.attributes,y.attributes)){if(typeof h.insert=="string"&&typeof y.insert=="string")return this.ops[g-1]={insert:y.insert+h.insert},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof y.retain=="number")return this.ops[g-1]={retain:y.retain+h.retain},typeof h.attributes=="object"&&(this.ops[g-1].attributes=h.attributes),this}}return g===this.ops.length?this.ops.push(h):this.ops.splice(g,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const g=[],y=[];return this.forEach((_=>{(h(_)?g:y).push(_)})),[g,y]}reduce(h,g){return this.ops.reduce(h,g)}changeLength(){return this.reduce(((h,g)=>g.insert?h+a.default.length(g):g.delete?h-g.delete:h),0)}length(){return this.reduce(((h,g)=>h+a.default.length(g)),0)}slice(h=0,g=1/0){const y=[],_=new l.default(this.ops);let N=0;for(;N<g&&_.hasNext();){let T;N<h?T=_.next(h-N):(T=_.next(g-N),y.push(T)),N+=a.default.length(T)}return new f(y)}compose(h){const g=new l.default(this.ops),y=new l.default(h.ops),_=[],N=y.peek();if(N!=null&&typeof N.retain=="number"&&N.attributes==null){let L=N.retain;for(;g.peekType()==="insert"&&g.peekLength()<=L;)L-=g.peekLength(),_.push(g.next());N.retain-L>0&&y.next(N.retain-L)}const T=new f(_);for(;g.hasNext()||y.hasNext();)if(y.peekType()==="insert")T.push(y.next());else if(g.peekType()==="delete")T.push(g.next());else{const L=Math.min(g.peekLength(),y.peekLength()),C=g.next(L),U=y.next(L);if(U.retain){const F={};if(typeof C.retain=="number")F.retain=typeof U.retain=="number"?L:U.retain;else if(typeof U.retain=="number")C.retain==null?F.insert=C.insert:F.retain=C.retain;else{const P=C.retain==null?"insert":"retain",[ne,ce,pe]=u(C[P],U.retain),b=f.getHandler(ne);F[P]={[ne]:b.compose(ce,pe,P==="retain")}}const W=i.default.compose(C.attributes,U.attributes,typeof C.retain=="number");if(W&&(F.attributes=W),T.push(F),!y.hasNext()&&s(T.ops[T.ops.length-1],F)){const P=new f(g.rest());return T.concat(P).chop()}}else typeof U.delete=="number"&&(typeof C.retain=="number"||typeof C.retain=="object"&&C.retain!==null)&&T.push(U)}return T.chop()}concat(h){const g=new f(this.ops.slice());return h.ops.length>0&&(g.push(h.ops[0]),g.ops=g.ops.concat(h.ops.slice(1))),g}diff(h,g){if(this.ops===h.ops)return new f;const y=[this,h].map((C=>C.map((U=>{if(U.insert!=null)return typeof U.insert=="string"?U.insert:c;const F=C===h?"on":"with";throw new Error("diff() called "+F+" non-document")})).join(""))),_=new f,N=t(y[0],y[1],g,!0),T=new l.default(this.ops),L=new l.default(h.ops);return N.forEach((C=>{let U=C[1].length;for(;U>0;){let F=0;switch(C[0]){case t.INSERT:F=Math.min(L.peekLength(),U),_.push(L.next(F));break;case t.DELETE:F=Math.min(U,T.peekLength()),T.next(F),_.delete(F);break;case t.EQUAL:F=Math.min(T.peekLength(),L.peekLength(),U);const W=T.next(F),P=L.next(F);s(W.insert,P.insert)?_.retain(F,i.default.diff(W.attributes,P.attributes)):_.push(P).delete(F);break}U-=F}})),_.chop()}eachLine(h,g=`\n`){const y=new l.default(this.ops);let _=new f,N=0;for(;y.hasNext();){if(y.peekType()!=="insert")return;const T=y.peek(),L=a.default.length(T)-y.peekLength(),C=typeof T.insert=="string"?T.insert.indexOf(g,L)-L:-1;if(C<0)_.push(y.next());else if(C>0)_.push(y.next(C));else{if(h(_,y.next(1).attributes||{},N)===!1)return;N+=1,_=new f}}_.length()>0&&h(_,{},N)}invert(h){const g=new f;return this.reduce(((y,_)=>{if(_.insert)g.delete(a.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return g.retain(_.retain),y+_.retain;if(_.delete||typeof _.retain=="number"){const N=_.delete||_.retain;return h.slice(y,y+N).forEach((L=>{_.delete?g.push(L):_.retain&&_.attributes&&g.retain(a.default.length(L),i.default.invert(_.attributes,L.attributes))})),y+N}else if(typeof _.retain=="object"&&_.retain!==null){const N=h.slice(y,y+1),T=new l.default(N.ops).next(),[L,C,U]=u(_.retain,T.insert),F=f.getHandler(L);return g.retain({[L]:F.invert(C,U)},i.default.invert(_.attributes,T.attributes)),y+1}}return y}),0),g.chop()}transform(h,g=!1){if(g=!!g,typeof h=="number")return this.transformPosition(h,g);const y=h,_=new l.default(this.ops),N=new l.default(y.ops),T=new f;for(;_.hasNext()||N.hasNext();)if(_.peekType()==="insert"&&(g||N.peekType()!=="insert"))T.retain(a.default.length(_.next()));else if(N.peekType()==="insert")T.push(N.next());else{const L=Math.min(_.peekLength(),N.peekLength()),C=_.next(L),U=N.next(L);if(C.delete)continue;if(U.delete)T.push(U);else{const F=C.retain,W=U.retain;let P=typeof W=="object"&&W!==null?W:L;if(typeof F=="object"&&F!==null&&typeof W=="object"&&W!==null){const ne=Object.keys(F)[0];if(ne===Object.keys(W)[0]){const ce=f.getHandler(ne);ce&&(P={[ne]:ce.transform(F[ne],W[ne],g)})}}T.retain(P,i.default.transform(C.attributes,U.attributes,g))}}return T.chop()}transformPosition(h,g=!1){g=!!g;const y=new l.default(this.ops);let _=0;for(;y.hasNext()&&_<=h;){const N=y.peekLength(),T=y.peekType();if(y.next(),T==="delete"){h-=Math.min(N,h-_);continue}else T==="insert"&&(_<h||!g)&&(h+=N);_+=N}return h}}f.Op=a.default,f.OpIterator=l.default,f.AttributeMap=i.default,f.handlers={},e.default=f,n.exports=f,n.exports.default=f}(rs,rs.exports)),rs.exports}var Et=wf();const G=Ii(Et);class Ct extends ct{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Ct.blotName="break";Ct.tagName="BR";let Ot=class extends _s{};const Sf={"&":"&","<":"<",">":">",'"':""","'":"'"};function Is(n){return n.replace(/[&<>"']/g,(e=>Sf[e]))}let bn=class In extends Li{static allowedChildren=[In,Ct,ct,Ot];static order=["cursor","inline","link","underline","strike","italic","bold","script","code"];static compare(e,t){const r=In.order.indexOf(e),s=In.order.indexOf(t);return r>=0||s>=0?r-s:e===t?0:e<t?-1:1}formatAt(e,t,r,s){if(In.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Z.BLOT)){const i=this.isolate(e,t);s&&i.wrap(r,s)}else super.formatAt(e,t,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof In&&In.compare(this.statics.blotName,this.parent.statics.blotName)>0){const t=this.parent.isolate(this.offset(),this.length());this.moveChildren(t),t.wrap(this)}}};const xa=1;class Ze extends Ur{cache={};delta(){return this.cache.delta==null&&(this.cache.delta=Fo(this)),this.cache.delta}deleteAt(e,t){super.deleteAt(e,t),this.cache={}}formatAt(e,t,r,s){t<=0||(this.scroll.query(r,Z.BLOCK)?e+t===this.length()&&this.format(r,s):super.formatAt(e,Math.min(t,this.length()-e-1),r,s),this.cache={})}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r),this.cache={};return}if(t.length===0)return;const s=t.split(`\n`),i=s.shift();i.length>0&&(e<this.length()-1||this.children.tail==null?super.insertAt(Math.min(e,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let a=this;s.reduce(((l,c)=>(a=a.split(l,!0),a.insertAt(0,c),c.length)),e+i.length)}insertBefore(e,t){const{head:r}=this.children;super.insertBefore(e,t),r instanceof Ct&&r.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+xa),this.cache.length}moveChildren(e,t){super.moveChildren(e,t),this.cache={}}optimize(e){super.optimize(e),this.cache={}}path(e){return super.path(e,!0)}removeChild(e){super.removeChild(e),this.cache={}}split(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(t&&(e===0||e>=this.length()-xa)){const s=this.clone();return e===0?(this.parent.insertBefore(s,this),this):(this.parent.insertBefore(s,this.next),s)}const r=super.split(e,t);return this.cache={},r}}Ze.blotName="block";Ze.tagName="P";Ze.defaultChild=Ct;Ze.allowedChildren=[Ct,bn,ct,Ot];let bt=class extends ct{attach(){super.attach(),this.attributes=new Ls(this.domNode)}delta(){return(new G).insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,t){const r=this.scroll.query(e,Z.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,t)}formatAt(e,t,r,s){this.format(r,s)}insertAt(e,t,r){if(r!=null){super.insertAt(e,t,r);return}const s=t.split(`\n`),i=s.pop(),a=s.map((c=>{const u=this.scroll.create(Ze.blotName);return u.insertAt(0,c),u})),l=this.split(e);a.forEach((c=>{this.parent.insertBefore(c,l)})),i&&this.parent.insertBefore(this.scroll.create("text",i),l)}};bt.scope=Z.BLOCK_BLOT;function Fo(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.descendants(et).reduce(((t,r)=>r.length()===0?t:t.insert(r.value(),pt(r,{},e))),new G).insert(`\n`,pt(n))}function pt(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return n==null||("formats"in n&&typeof n.formats=="function"&&(e={...e,...n.formats()},t&&delete e["code-token"]),n.parent==null||n.parent.statics.blotName==="scroll"||n.parent.statics.scope!==n.statics.scope)?e:pt(n.parent,e,t)}class wt extends ct{static blotName="cursor";static className="ql-cursor";static tagName="span";static CONTENTS="\ufeff";static value(){}constructor(e,t,r){super(e,t),this.selection=r,this.textNode=document.createTextNode(wt.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,t){if(this.savedLength!==0){super.format(e,t);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Z.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=wt.CONTENTS.length,r.optimize(),r.formatAt(s,wt.CONTENTS.length,e,t),this.savedLength=0)}index(e,t){return e===this.textNode?0:super.index(e,t)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const t=this.prev instanceof Ot?this.prev:null,r=t?t.length():0,s=this.next instanceof Ot?this.next:null,i=s?s.text:"",{textNode:a}=this,l=a.data.split(wt.CONTENTS).join("");a.data=wt.CONTENTS;let c;if(t)c=t,(l||s)&&(t.insertAt(t.length(),l+i),s&&s.remove());else if(s)c=s,s.insertAt(0,l);else{const u=document.createTextNode(l);c=this.scroll.create(u),this.parent.insertBefore(c,this)}if(this.remove(),e){const u=(h,g)=>t&&h===t.domNode?g:h===a?r+g-1:s&&h===s.domNode?r+l.length+g:null,f=u(e.start.node,e.start.offset),p=u(e.end.node,e.end.offset);if(f!==null&&p!==null)return{startNode:c.domNode,startOffset:f,endNode:c.domNode,endOffset:p}}return null}update(e,t){if(e.some((r=>r.type==="characterData"&&r.target===this.textNode))){const r=this.restore();r&&(t.range=r)}}optimize(e){super.optimize(e);let{parent:t}=this;for(;t;){if(t.domNode.tagName==="A"){this.savedLength=wt.CONTENTS.length,t.isolate(this.offset(t),this.length()).unwrap(),this.savedLength=0;break}t=t.parent}}value(){return""}}var zs={exports:{}},Oa;function xf(){return Oa||(Oa=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(t=!1));function s(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,p,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var g=new s(f,p||c,h),y=t?t+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],g]:c._events[y].push(g):(c._events[y]=g,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)e.call(f,p)&&u.push(t?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=t?t+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,g=p.length,y=new Array(g);h<g;h++)y[h]=p[h].fn;return y},l.prototype.listenerCount=function(u){var f=t?t+u:u,p=this._events[f];return p?p.fn?1:p.length:0},l.prototype.emit=function(u,f,p,h,g,y){var _=t?t+u:u;if(!this._events[_])return!1;var N=this._events[_],T=arguments.length,L,C;if(N.fn){switch(N.once&&this.removeListener(u,N.fn,void 0,!0),T){case 1:return N.fn.call(N.context),!0;case 2:return N.fn.call(N.context,f),!0;case 3:return N.fn.call(N.context,f,p),!0;case 4:return N.fn.call(N.context,f,p,h),!0;case 5:return N.fn.call(N.context,f,p,h,g),!0;case 6:return N.fn.call(N.context,f,p,h,g,y),!0}for(C=1,L=new Array(T-1);C<T;C++)L[C-1]=arguments[C];N.fn.apply(N.context,L)}else{var U=N.length,F;for(C=0;C<U;C++)switch(N[C].once&&this.removeListener(u,N[C].fn,void 0,!0),T){case 1:N[C].fn.call(N[C].context);break;case 2:N[C].fn.call(N[C].context,f);break;case 3:N[C].fn.call(N[C].context,f,p);break;case 4:N[C].fn.call(N[C].context,f,p,h);break;default:if(!L)for(F=1,L=new Array(T-1);F<T;F++)L[F-1]=arguments[F];N[C].fn.apply(N[C].context,L)}}return!0},l.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},l.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},l.prototype.removeListener=function(u,f,p,h){var g=t?t+u:u;if(!this._events[g])return this;if(!f)return a(this,g),this;var y=this._events[g];if(y.fn)y.fn===f&&(!h||y.once)&&(!p||y.context===p)&&a(this,g);else{for(var _=0,N=[],T=y.length;_<T;_++)(y[_].fn!==f||h&&!y[_].once||p&&y[_].context!==p)&&N.push(y[_]);N.length?this._events[g]=N.length===1?N[0]:N:a(this,g)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=t?t+u:u,this._events[f]&&a(this,f)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l}(zs)),zs.exports}var Of=xf();const Lf=Ii(Of),gi=new WeakMap,pi=["error","warn","log","info"];let mi="warn";function Ho(n){if(mi&&pi.indexOf(n)<=pi.indexOf(mi)){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];console[n](...t)}}function Yt(n){return pi.reduce(((e,t)=>(e[t]=Ho.bind(console,t,n),e)),{})}Yt.level=n=>{mi=n};Ho.level=Yt.level;const Ks=Yt("quill:events"),Cf=["selectionchange","mousedown","mouseup","click"];Cf.forEach((n=>{document.addEventListener(n,(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach((s=>{const i=gi.get(s);i&&i.emitter&&i.emitter.handleDOM(...t)}))}))}));class j extends Lf{static events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"};static sources={API:"api",SILENT:"silent",USER:"user"};constructor(){super(),this.domListeners={},this.on("error",Ks.error)}emit(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ks.log.call(Ks,...t),super.emit(...t)}handleDOM(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach((i=>{let{node:a,handler:l}=i;(e.target===a||a.contains(e.target))&&l(e,...r)}))}listenDOM(e,t,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:t,handler:r})}}const Gs=Yt("quill:selection");class Mn{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=t}}class If{constructor(e,t){this.emitter=t,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Mn(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,(()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,j.sources.USER),1)})),this.emitter.on(j.events.SCROLL_BEFORE_UPDATE,(()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(j.events.SCROLL_UPDATE,((s,i)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const a=i.some((l=>l.type==="characterData"||l.type==="childList"||l.type==="attributes"&&l.target===this.root));this.update(a?j.sources.SILENT:s)}catch{}}))})),this.emitter.on(j.events.SCROLL_OPTIMIZE,((r,s)=>{if(s.range){const{startNode:i,startOffset:a,endNode:l,endOffset:c}=s.range;this.setNativeRange(i,a,l,c),this.update(j.sources.SILENT)}})),this.update(j.sources.SILENT)}handleComposition(){this.emitter.on(j.events.COMPOSITION_BEFORE_START,(()=>{this.composing=!0})),this.emitter.on(j.events.COMPOSITION_END,(()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout((()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)}),1)}}))}handleDragging(){this.emitter.listenDOM("mousedown",document.body,(()=>{this.mouseDown=!0})),this.emitter.listenDOM("mouseup",document.body,(()=>{this.mouseDown=!1,this.update(j.sources.USER)}))}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,t){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Z.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof et){const i=s.split(r.start.offset);s.parent.insertBefore(this.cursor,i)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),t=Math.min(e+t,r-1)-e;let s,[i,a]=this.scroll.leaf(e);if(i==null)return null;if(t>0&&a===i.length()){const[f]=this.scroll.leaf(e+1);if(f){const[p]=this.scroll.line(e),[h]=this.scroll.line(e+1);p===h&&(i=f,a=0)}}[s,a]=i.position(a,!0);const l=document.createRange();if(t>0)return l.setStart(s,a),[i,a]=this.scroll.leaf(e+t),i==null?null:([s,a]=i.position(a,!0),l.setEnd(s,a),l.getBoundingClientRect());let c="left",u;if(s instanceof Text){if(!s.data.length)return null;a<s.data.length?(l.setStart(s,a),l.setEnd(s,a+1)):(l.setStart(s,a-1),l.setEnd(s,a),c="right"),u=l.getBoundingClientRect()}else{if(!(i.domNode instanceof Element))return null;u=i.domNode.getBoundingClientRect(),a>0&&(c="right")}return{bottom:u.top+u.height,height:u.height,left:u[c],right:u[c],top:u.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const t=e.getRangeAt(0);if(t==null)return null;const r=this.normalizeNative(t);return Gs.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const t=this.getNativeRange();return t==null?[null,null]:[this.normalizedToRange(t),t]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&js(this.root,document.activeElement)}normalizedToRange(e){const t=[[e.start.node,e.start.offset]];e.native.collapsed||t.push([e.end.node,e.end.offset]);const r=t.map((a=>{const[l,c]=a,u=this.scroll.find(l,!0),f=u.offset(this.scroll);return c===0?f:u instanceof et?f+u.index(l,c):f+u.length()})),s=Math.min(Math.max(...r),this.scroll.length()-1),i=Math.min(s,...r);return new Mn(i,s-i)}normalizeNative(e){if(!js(this.root,e.startContainer)||!e.collapsed&&!js(this.root,e.endContainer))return null;const t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach((r=>{let{node:s,offset:i}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>i)s=s.childNodes[i],i=0;else if(s.childNodes.length===i)s=s.lastChild,s instanceof Text?i=s.data.length:s.childNodes.length>0?i=s.childNodes.length:i=s.childNodes.length+1;else break;r.node=s,r.offset=i})),t}rangeToNative(e){const t=this.scroll.length(),r=(s,i)=>{s=Math.min(t-1,s);const[a,l]=this.scroll.leaf(s);return a?a.position(l,i):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:t,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Gs.info("setNativeRange",e,t,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const a=document.getSelection();if(a!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:l}=this.getNativeRange()||{};if(l==null||i||e!==l.startContainer||t!==l.startOffset||r!==l.endContainer||s!==l.endOffset){e instanceof Element&&e.tagName==="BR"&&(t=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const c=document.createRange();c.setStart(e,t),c.setEnd(r,s),a.removeAllRanges(),a.addRange(c)}}else a.removeAllRanges(),this.root.blur()}setRange(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j.sources.API;if(typeof t=="string"&&(r=t,t=!1),Gs.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,t)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j.sources.USER;const t=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Oi(t,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const a=this.cursor.restore();a&&this.setNativeRange(a.startNode,a.startOffset,a.endNode,a.endOffset)}const i=[j.events.SELECTION_CHANGE,ar(this.lastRange),ar(t),e];this.emitter.emit(j.events.EDITOR_CHANGE,...i),e!==j.sources.SILENT&&this.emitter.emit(...i)}}}function js(n,e){try{e.parentNode}catch{return!1}return n.contains(e)}const Rf=/^[ -~]*$/;class kf{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let t=this.scroll.length();this.scroll.batchStart();const r=La(e),s=new G;return Df(r.ops.slice()).reduce(((a,l)=>{const c=Et.Op.length(l);let u=l.attributes||{},f=!1,p=!1;if(l.insert!=null){if(s.retain(c),typeof l.insert=="string"){const y=l.insert;p=!y.endsWith(`\n`)&&(t<=a||!!this.scroll.descendant(bt,a)[0]),this.scroll.insertAt(a,y);const[_,N]=this.scroll.line(a);let T=hn({},pt(_));if(_ instanceof Ze){const[L]=_.descendant(et,N);L&&(T=hn(T,pt(L)))}u=Et.AttributeMap.diff(T,u)||{}}else if(typeof l.insert=="object"){const y=Object.keys(l.insert)[0];if(y==null)return a;const _=this.scroll.query(y,Z.INLINE)!=null;if(_)(t<=a||this.scroll.descendant(bt,a)[0])&&(p=!0);else if(a>0){const[N,T]=this.scroll.descendant(et,a-1);N instanceof Ot?N.value()[T]!==`\n`&&(f=!0):N instanceof ct&&N.statics.scope===Z.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(a,y,l.insert[y]),_){const[N]=this.scroll.descendant(et,a);if(N){const T=hn({},pt(N));u=Et.AttributeMap.diff(T,u)||{}}}}t+=c}else if(s.push(l),l.retain!==null&&typeof l.retain=="object"){const y=Object.keys(l.retain)[0];if(y==null)return a;this.scroll.updateEmbedAt(a,y,l.retain[y])}Object.keys(u).forEach((y=>{this.scroll.formatAt(a,c,y,u[y])}));const h=f?1:0,g=p?1:0;return t+=h+g,s.retain(h),s.delete(g),a+c+h+g}),0),s.reduce(((a,l)=>typeof l.delete=="number"?(this.scroll.deleteAt(a,l.delete),a):a+Et.Op.length(l)),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,t){return this.scroll.deleteAt(e,t),this.update((new G).retain(e).delete(t))}formatLine(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach((i=>{this.scroll.lines(e,Math.max(t,1)).forEach((a=>{a.format(i,r[i])}))})),this.scroll.optimize();const s=(new G).retain(e).retain(t,ar(r));return this.update(s)}formatText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach((i=>{this.scroll.formatAt(e,t,i,r[i])}));const s=(new G).retain(e).retain(t,ar(r));return this.update(s)}getContents(e,t){return this.delta.slice(e,e+t)}getDelta(){return this.scroll.lines().reduce(((e,t)=>e.concat(t.delta())),new G)}getFormat(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];t===0?this.scroll.path(e).forEach((l=>{const[c]=l;c instanceof Ze?r.push(c):c instanceof et&&s.push(c)})):(r=this.scroll.lines(e,t),s=this.scroll.descendants(et,e,t));const[i,a]=[r,s].map((l=>{const c=l.shift();if(c==null)return{};let u=pt(c);for(;Object.keys(u).length>0;){const f=l.shift();if(f==null)return u;u=Mf(pt(f),u)}return u}));return{...i,...a}}getHTML(e,t){const[r,s]=this.scroll.line(e);if(r){const i=r.length();return r.length()>=s+t&&!(s===0&&t===i)?Fr(r,s,t,!0):Fr(this.scroll,e,t,!0)}return""}getText(e,t){return this.getContents(e,t).filter((r=>typeof r.insert=="string")).map((r=>r.insert)).join("")}insertContents(e,t){const r=La(t),s=(new G).retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,t,r){return this.scroll.insertAt(e,t,r),this.update((new G).retain(e).insert({[t]:r}))}insertText(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return t=t.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`),this.scroll.insertAt(e,t),Object.keys(r).forEach((s=>{this.scroll.formatAt(e,t.length,s,r[s])})),this.update((new G).retain(e).insert(t,ar(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if(e?.statics.blotName!==Ze.blotName)return!1;const t=e;return t.children.length>1?!1:t.children.head instanceof Ct}removeFormat(e,t){const r=this.getText(e,t),[s,i]=this.scroll.line(e+t);let a=0,l=new G;s!=null&&(a=s.length()-i,l=s.delta().slice(i,i+a-1).insert(`\n`));const u=this.getContents(e,t+a).diff((new G).insert(r).concat(l)),f=(new G).retain(e).concat(u);return this.applyDelta(f)}update(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(t.length===1&&t[0].type==="characterData"&&t[0].target.data.match(Rf)&&this.scroll.find(t[0].target)){const i=this.scroll.find(t[0].target),a=pt(i),l=i.offset(this.scroll),c=t[0].oldValue.replace(wt.CONTENTS,""),u=(new G).insert(c),f=(new G).insert(i.value()),p=r&&{oldRange:Ca(r.oldRange,-l),newRange:Ca(r.newRange,-l)};e=(new G).retain(l).concat(u.diff(f,p)).reduce(((g,y)=>y.insert?g.insert(y.insert,a):g.push(y)),new G),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Oi(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function sr(n,e,t){if(n.length===0){const[g]=Vs(t.pop());return e<=0?`</li></${g}>`:`</li></${g}>${sr([],e-1,t)}`}const[{child:r,offset:s,length:i,indent:a,type:l},...c]=n,[u,f]=Vs(l);if(a>e)return t.push(l),a===e+1?`<${u}><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`:`<${u}><li>${sr(n,e+1,t)}`;const p=t[t.length-1];if(a===e&&l===p)return`</li><li${f}>${Fr(r,s,i)}${sr(c,a,t)}`;const[h]=Vs(t.pop());return`</li></${h}>${sr(n,e-1,t)}`}function Fr(n,e,t){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in n&&typeof n.html=="function")return n.html(e,t);if(n instanceof Ot)return Is(n.value().slice(e,e+t)).replaceAll(" "," ");if(n instanceof xt){if(n.statics.blotName==="list-container"){const u=[];return n.children.forEachAt(e,t,((f,p,h)=>{const g="formats"in f&&typeof f.formats=="function"?f.formats():{};u.push({child:f,offset:p,length:h,indent:g.indent||0,type:g.list})})),sr(u,-1,[])}const s=[];if(n.children.forEachAt(e,t,((u,f,p)=>{s.push(Fr(u,f,p))})),r||n.statics.blotName==="list")return s.join("");const{outerHTML:i,innerHTML:a}=n.domNode,[l,c]=i.split(`>${a}<`);return l==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${c}`:`${l}>${s.join("")}<${c}`}return n.domNode instanceof Element?n.domNode.outerHTML:""}function Mf(n,e){return Object.keys(e).reduce(((t,r)=>{if(n[r]==null)return t;const s=e[r];return s===n[r]?t[r]=s:Array.isArray(s)?s.indexOf(n[r])<0?t[r]=s.concat([n[r]]):t[r]=s:t[r]=[s,n[r]],t}),{})}function Vs(n){const e=n==="ordered"?"ol":"ul";switch(n){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function La(n){return n.reduce(((e,t)=>{if(typeof t.insert=="string"){const r=t.insert.replace(/\r\n/g,`\n`).replace(/\r/g,`\n`);return e.insert(r,t.attributes)}return e.push(t)}),new G)}function Ca(n,e){let{index:t,length:r}=n;return new Mn(t+e,r)}function Df(n){const e=[];return n.forEach((t=>{typeof t.insert=="string"?t.insert.split(`\n`).forEach(((s,i)=>{i&&e.push({insert:`\n`,attributes:t.attributes}),s&&e.push({insert:s,attributes:t.attributes})})):e.push(t)})),e}class $t{static DEFAULTS={};constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=t}}const os="\ufeff";class Ri extends ct{constructor(e,t){super(e,t),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach((r=>{this.contentNode.appendChild(r)})),this.leftGuard=document.createTextNode(os),this.rightGuard=document.createTextNode(os),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,t){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,t)}restore(e){let t=null,r;const s=e.data.split(os).join("");if(e===this.leftGuard)if(this.prev instanceof Ot){const i=this.prev.length();this.prev.insertAt(i,s),t={startNode:this.prev.domNode,startOffset:i+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),t={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Ot?(this.next.insertAt(0,s),t={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),t={startNode:r,startOffset:s.length}));return e.data=os,t}update(e,t){e.forEach((r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(t.range=s)}}))}}class Bf{isComposing=!1;constructor(e,t){this.scroll=e,this.emitter=t,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",(e=>{this.isComposing||this.handleCompositionStart(e)})),this.scroll.domNode.addEventListener("compositionend",(e=>{this.isComposing&&queueMicrotask((()=>{this.handleCompositionEnd(e)}))}))}handleCompositionStart(e){const t=e.target instanceof Node?this.scroll.find(e.target,!0):null;t&&!(t instanceof Ri)&&(this.emitter.emit(j.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(j.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(j.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(j.events.COMPOSITION_END,e),this.isComposing=!1}}class hr{static DEFAULTS={modules:{}};static themes={default:hr};modules={};constructor(e,t){this.quill=e,this.options=t}init(){Object.keys(this.options.modules).forEach((e=>{this.modules[e]==null&&this.addModule(e)}))}addModule(e){const t=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new t(this.quill,this.options.modules[e]||{}),this.modules[e]}}const qf=n=>n.parentElement||n.getRootNode().host||null,$f=n=>{const e=n.getBoundingClientRect(),t="offsetWidth"in n&&Math.abs(e.width)/n.offsetWidth||1,r="offsetHeight"in n&&Math.abs(e.height)/n.offsetHeight||1;return{top:e.top,right:e.left+n.clientWidth*t,bottom:e.top+n.clientHeight*r,left:e.left}},ls=n=>{const e=parseInt(n,10);return Number.isNaN(e)?0:e},Ia=(n,e,t,r,s,i)=>n<t&&e>r?0:n<t?-(t-n+s):e>r?e-n>r-t?n+s-t:e-r+i:0,Pf=(n,e)=>{const t=n.ownerDocument;let r=e,s=n;for(;s;){const i=s===t.body,a=i?{top:0,right:window.visualViewport?.width??t.documentElement.clientWidth,bottom:window.visualViewport?.height??t.documentElement.clientHeight,left:0}:$f(s),l=getComputedStyle(s),c=Ia(r.left,r.right,a.left,a.right,ls(l.scrollPaddingLeft),ls(l.scrollPaddingRight)),u=Ia(r.top,r.bottom,a.top,a.bottom,ls(l.scrollPaddingTop),ls(l.scrollPaddingBottom));if(c||u)if(i)t.defaultView?.scrollBy(c,u);else{const{scrollLeft:f,scrollTop:p}=s;u&&(s.scrollTop+=u),c&&(s.scrollLeft+=c);const h=s.scrollLeft-f,g=s.scrollTop-p;r={left:r.left-h,top:r.top-g,right:r.right-h,bottom:r.bottom-g}}s=i||l.position==="fixed"?null:qf(s)}},Uf=100,Ff=["block","break","cursor","inline","scroll","text"],Hf=(n,e,t)=>{const r=new ur;return Ff.forEach((s=>{const i=e.query(s);i&&r.register(i)})),n.forEach((s=>{let i=e.query(s);i||t.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let a=0;for(;i;)if(r.register(i),i="blotName"in i?i.requiredContainer??null:null,a+=1,a>Uf){t.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}})),r},lr=Yt("quill"),cs=new ur;xt.uiClass="ql-ui";class A{static DEFAULTS={bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:cs,theme:"default"};static events=j.events;static sources=j.sources;static version="2.0.3";static imports={delta:G,parchment:vf,"core/module":$t,"core/theme":hr};static debug(e){e===!0&&(e="log"),Yt.level(e)}static find(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return gi.get(e)||cs.find(e,t)}static import(e){return this.imports[e]==null&&lr.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],t=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,t):Object.keys(e).forEach((s=>{this.register(s,e[s],t)}))}else{const e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&lr.warn(`Overwriting ${e} with`,t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&t&&typeof t!="boolean"&&t.blotName!=="abstract"&&cs.register(t),typeof t.register=="function"&&t.register(cs)}}constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=zf(e,t),this.container=this.options.container,this.container==null){lr.error("Invalid Quill container",e);return}this.options.debug&&A.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",gi.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new j;const s=Ci.blotName,i=this.options.registry.query(s);if(!i||!("blotName"in i))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new i(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new kf(this.scroll),this.selection=new If(this.scroll,this.emitter),this.composition=new Bf(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(j.events.EDITOR_CHANGE,(a=>{a===j.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())})),this.emitter.on(j.events.SCROLL_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>this.editor.update(null,l,f)),a)})),this.emitter.on(j.events.SCROLL_EMBED_UPDATE,((a,l)=>{const c=this.selection.lastRange,[u]=this.selection.getRange(),f=c&&u?{oldRange:c,newRange:u}:void 0;Tt.call(this,(()=>{const p=(new G).retain(a.offset(this)).retain({[a.statics.blotName]:l});return this.editor.update(p,[],f)}),A.sources.USER)})),r){const a=this.clipboard.convert({html:`${r}<p><br></p>`,text:`\n`});this.setContents(a)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,t),e}blur(){this.selection.setRange(null)}deleteText(e,t,r){return[e,t,,r]=Gt(e,t,r),Tt.call(this,(()=>this.editor.deleteText(e,t)),r,e,-1*t)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const t=e();return this.allowReadOnlyEdits=!1,t}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:j.sources.API;return Tt.call(this,(()=>{const s=this.getSelection(!0);let i=new G;if(s==null)return i;if(this.scroll.query(e,Z.BLOCK))i=this.editor.formatLine(s.index,s.length,{[e]:t});else{if(s.length===0)return this.selection.format(e,t),i;i=this.editor.formatText(s.index,s.length,{[e]:t})}return this.setSelection(s,j.sources.SILENT),i}),r)}formatLine(e,t,r,s,i){let a;return[e,t,a,i]=Gt(e,t,r,s,i),Tt.call(this,(()=>this.editor.formatLine(e,t,a)),i,e,0)}formatText(e,t,r,s,i){let a;return[e,t,a,i]=Gt(e,t,r,s,i),Tt.call(this,(()=>this.editor.formatText(e,t,a)),i,e,0)}getBounds(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,t):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,t]=Gt(e,t),this.editor.getContents(e,t)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Gt(e,t),this.editor.getHTML(e,t)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(t=t??this.getLength()-e),[e,t]=Gt(e,t),this.editor.getText(e,t)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,t,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A.sources.API;return Tt.call(this,(()=>this.editor.insertEmbed(e,t,r)),s,e)}insertText(e,t,r,s,i){let a;return[e,,a,i]=Gt(e,0,r,s,i),Tt.call(this,(()=>this.editor.insertText(e,t,a)),i,e,t.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,t,r){return[e,t,,r]=Gt(e,t,r),Tt.call(this,(()=>this.editor.removeFormat(e,t)),r,e)}scrollRectIntoView(e){Pf(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,t=e&&this.selection.getBounds(e.index,e.length);t&&this.scrollRectIntoView(t)}setContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j.sources.API;return Tt.call(this,(()=>{e=new G(e);const r=this.getLength(),s=this.editor.deleteText(0,r),i=this.editor.insertContents(0,e),a=this.editor.deleteText(this.getLength()-1,1);return s.compose(i).compose(a)}),t)}setSelection(e,t,r){e==null?this.selection.setRange(null,t||A.sources.API):([e,t,,r]=Gt(e,t,r),this.selection.setRange(new Mn(Math.max(0,e),t),r),r!==j.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j.sources.API;const r=(new G).insert(e);return this.setContents(r,t)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j.sources.USER;const t=this.scroll.update(e);return this.selection.update(e),t}updateContents(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:j.sources.API;return Tt.call(this,(()=>(e=new G(e),this.editor.applyDelta(e))),t,!0)}}function Ra(n){return typeof n=="string"?document.querySelector(n):n}function Ws(n){return Object.entries(n??{}).reduce(((e,t)=>{let[r,s]=t;return{...e,[r]:s===!0?{}:s}}),{})}function ka(n){return Object.fromEntries(Object.entries(n).filter((e=>e[1]!==void 0)))}function zf(n,e){const t=Ra(n);if(!t)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===A.DEFAULTS.theme?hr:A.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:i,...a}=A.DEFAULTS,{modules:l,...c}=s.DEFAULTS;let u=Ws(e.modules);u!=null&&u.toolbar&&u.toolbar.constructor!==Object&&(u={...u,toolbar:{container:u.toolbar}});const f=hn({},Ws(i),Ws(l),u),p={...a,...ka(c),...ka(e)};let h=e.registry;return h?e.formats&&lr.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?Hf(e.formats,p.registry,lr):p.registry,{...p,registry:h,container:t,theme:s,modules:Object.entries(f).reduce(((g,y)=>{let[_,N]=y;if(!N)return g;const T=A.import(`modules/${_}`);return T==null?(lr.error(`Cannot load ${_} module. Are you sure you registered it?`),g):{...g,[_]:hn({},T.DEFAULTS||{},N)}}),{}),bounds:Ra(p.bounds)}}function Tt(n,e,t,r){if(!this.isEnabled()&&e===j.sources.USER&&!this.allowReadOnlyEdits)return new G;let s=t==null?null:this.getSelection();const i=this.editor.delta,a=n();if(s!=null&&(t===!0&&(t=s.index),r==null?s=Ma(s,a,e):r!==0&&(s=Ma(s,t,r,e)),this.setSelection(s,j.sources.SILENT)),a.length()>0){const l=[j.events.TEXT_CHANGE,a,i,e];this.emitter.emit(j.events.EDITOR_CHANGE,...l),e!==j.sources.SILENT&&this.emitter.emit(...l)}return a}function Gt(n,e,t,r,s){let i={};return typeof n.index=="number"&&typeof n.length=="number"?typeof e!="number"?(s=r,r=t,t=e,e=n.length,n=n.index):(e=n.length,n=n.index):typeof e!="number"&&(s=r,r=t,t=e,e=0),typeof t=="object"?(i=t,s=r):typeof t=="string"&&(r!=null?i[t]=r:s=t),s=s||j.sources.API,[n,e,i,s]}function Ma(n,e,t,r){const s=typeof t=="number"?t:0;if(n==null)return null;let i,a;return e&&typeof e.transformPosition=="function"?[i,a]=[n.index,n.index+n.length].map((l=>e.transformPosition(l,r!==j.sources.USER))):[i,a]=[n.index,n.index+n.length].map((l=>l<e||l===e&&r===j.sources.USER?l:s>=0?l+s:Math.max(e,l+s))),new Mn(i,a-i)}class Pn extends Cs{}function Da(n){return n instanceof Ze||n instanceof bt}function Ba(n){return typeof n.updateContent=="function"}class Kf extends Ci{static blotName="scroll";static className="ql-editor";static tagName="DIV";static defaultChild=Ze;static allowedChildren=[Ze,bt,Pn];constructor(e,t,r){let{emitter:s}=r;super(e,t),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",(i=>this.handleDragStart(i)))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(j.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(j.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,t){this.emitter.emit(j.events.SCROLL_EMBED_UPDATE,e,t)}deleteAt(e,t){const[r,s]=this.line(e),[i]=this.line(e+t);if(super.deleteAt(e,t),i!=null&&r!==i&&s>0){if(r instanceof bt||i instanceof bt){this.optimize();return}const a=i.children.head instanceof Ct?null:i.children.head;r.moveChildren(i,a),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,t,r,s){super.formatAt(e,t,r,s),this.optimize()}insertAt(e,t,r){if(e>=this.length())if(r==null||this.scroll.query(t,Z.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&t.endsWith(`\n`)?s.insertAt(0,t.slice(0,-1),r):s.insertAt(0,t,r)}else{const s=this.scroll.create(t,r);this.appendChild(s)}else super.insertAt(e,t,r);this.optimize()}insertBefore(e,t){if(e.statics.scope===Z.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,t)}else super.insertBefore(e,t)}insertContents(e,t){const r=this.deltaToRenderBlocks(t.concat((new G).insert(`\n`))),s=r.pop();if(s==null)return;this.batchStart();const i=r.shift();if(i){const c=i.type==="block"&&(i.delta.length()===0||!this.descendant(bt,e)[0]&&e<this.length()),u=i.type==="block"?i.delta:(new G).insert({[i.key]:i.value});Zs(this,e,u);const f=i.type==="block"?1:0,p=e+u.length()+f;c&&this.insertAt(p-1,`\n`);const h=pt(this.line(e)[0]),g=Et.AttributeMap.diff(h,i.attributes)||{};Object.keys(g).forEach((y=>{this.formatAt(p-1,1,y,g[y])})),e=p}let[a,l]=this.children.find(e);if(r.length&&(a&&(a=a.split(l),l=0),r.forEach((c=>{if(c.type==="block"){const u=this.createBlock(c.attributes,a||void 0);Zs(u,0,c.delta)}else{const u=this.create(c.key,c.value);this.insertBefore(u,a||void 0),Object.keys(c.attributes).forEach((f=>{u.format(f,c.attributes[f])}))}}))),s.type==="block"&&s.delta.length()){const c=a?a.offset(a.scroll)+l:this.length();Zs(this,c,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const t=this.path(e).pop();if(!t)return[null,-1];const[r,s]=t;return r instanceof et?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(Da,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,i,a)=>{let l=[],c=a;return s.children.forEachAt(i,a,((u,f,p)=>{Da(u)?l.push(u):u instanceof Cs&&(l=l.concat(r(u,f,c))),c-=p})),l};return r(this,e,t)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,t),e.length>0&&this.emitter.emit(j.events.SCROLL_OPTIMIZE,e,t))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let t=j.sources.USER;typeof e=="string"&&(t=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter((r=>{let{target:s}=r;const i=this.find(s,!0);return i&&!Ba(i)})),e.length>0&&this.emitter.emit(j.events.SCROLL_BEFORE_UPDATE,t,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(j.events.SCROLL_UPDATE,t,e)}updateEmbedAt(e,t,r){const[s]=this.descendant((i=>i instanceof bt),e);s&&s.statics.blotName===t&&Ba(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const t=[];let r=new G;return e.forEach((s=>{const i=s?.insert;if(i)if(typeof i=="string"){const a=i.split(`\n`);a.slice(0,-1).forEach((c=>{r.insert(c,s.attributes),t.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new G}));const l=a[a.length-1];l&&r.insert(l,s.attributes)}else{const a=Object.keys(i)[0];if(!a)return;this.query(a,Z.INLINE)?r.push(s):(r.length()&&t.push({type:"block",delta:r,attributes:{}}),r=new G,t.push({type:"blockEmbed",key:a,value:i[a],attributes:s.attributes??{}}))}})),r.length()&&t.push({type:"block",delta:r,attributes:{}}),t}createBlock(e,t){let r;const s={};Object.entries(e).forEach((l=>{let[c,u]=l;this.query(c,Z.BLOCK&Z.BLOT)!=null?r=c:s[c]=u}));const i=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(i,t||void 0);const a=i.length();return Object.entries(s).forEach((l=>{let[c,u]=l;i.formatAt(0,a,c,u)})),i}}function Zs(n,e,t){t.reduce(((r,s)=>{const i=Et.Op.length(s);let a=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const l=s.insert;n.insertAt(r,l);const[c]=n.descendant(et,r),u=pt(c);a=Et.AttributeMap.diff(u,a)||{}}else if(typeof s.insert=="object"){const l=Object.keys(s.insert)[0];if(l==null)return r;if(n.insertAt(r,l,s.insert[l]),n.scroll.query(l,Z.INLINE)!=null){const[u]=n.descendant(et,r),f=pt(u);a=Et.AttributeMap.diff(f,a)||{}}}}return Object.keys(a).forEach((l=>{n.formatAt(r,i,l,a[l])})),r+i}),e)}const ki={scope:Z.BLOCK,whitelist:["right","center","justify"]},Gf=new Bt("align","align",ki),zo=new Lt("align","ql-align",ki),Ko=new mn("align","text-align",ki);class Go extends mn{value(e){let t=super.value(e);return t.startsWith("rgb(")?(t=t.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${t.split(",").map((s=>`00${parseInt(s,10).toString(16)}`.slice(-2))).join("")}`):t}}const jf=new Lt("color","ql-color",{scope:Z.INLINE}),Mi=new Go("color","color",{scope:Z.INLINE}),Vf=new Lt("background","ql-bg",{scope:Z.INLINE}),Di=new Go("background","background-color",{scope:Z.INLINE});class Un extends Pn{static create(e){const t=super.create(e);return t.setAttribute("spellcheck","false"),t}code(e,t){return this.children.map((r=>r.length()<=1?"":r.domNode.innerText)).join(`\n`).slice(e,e+t)}html(e,t){return`<pre>\n${Is(this.code(e,t))}\n</pre>`}}class nt extends Ze{static TAB=" ";static register(){A.register(Un)}}class Bi extends bn{}Bi.blotName="code";Bi.tagName="CODE";nt.blotName="code-block";nt.className="ql-code-block";nt.tagName="DIV";Un.blotName="code-block-container";Un.className="ql-code-block-container";Un.tagName="DIV";Un.allowedChildren=[nt];nt.allowedChildren=[Ot,Ct,wt];nt.requiredContainer=Un;const qi={scope:Z.BLOCK,whitelist:["rtl"]},jo=new Bt("direction","dir",qi),Vo=new Lt("direction","ql-direction",qi),Wo=new mn("direction","direction",qi),Zo={scope:Z.INLINE,whitelist:["serif","monospace"]},Yo=new Lt("font","ql-font",Zo);class Wf extends mn{value(e){return super.value(e).replace(/["']/g,"")}}const Qo=new Wf("font","font-family",Zo),Xo=new Lt("size","ql-size",{scope:Z.INLINE,whitelist:["small","large","huge"]}),Jo=new mn("size","font-size",{scope:Z.INLINE,whitelist:["10px","18px","32px"]}),Zf=Yt("quill:keyboard"),Yf=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class Rs extends $t{static match(e,t){return["altKey","ctrlKey","metaKey","shiftKey"].some((r=>!!t[r]!==e[r]&&t[r]!==null))?!1:t.key===e.key||t.key===e.which}constructor(e,t){super(e,t),this.bindings={},Object.keys(this.options.bindings).forEach((r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])})),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},(()=>{})),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=Xf(e);if(s==null){Zf.warn("Attempted to add invalid keyboard binding",s);return}typeof t=="function"&&(t={handler:t}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach((a=>{const l={...s,key:a,...t,...r};this.bindings[l.key]=this.bindings[l.key]||[],this.bindings[l.key].push(l)}))}listen(){this.quill.root.addEventListener("keydown",(e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter((T=>Rs.match(e,T)));if(s.length===0)return;const i=A.find(e.target,!0);if(i&&i.scroll!==this.quill.scroll)return;const a=this.quill.getSelection();if(a==null||!this.quill.hasFocus())return;const[l,c]=this.quill.getLine(a.index),[u,f]=this.quill.getLeaf(a.index),[p,h]=a.length===0?[u,f]:this.quill.getLeaf(a.index+a.length),g=u instanceof _s?u.value().slice(0,f):"",y=p instanceof _s?p.value().slice(h):"",_={collapsed:a.length===0,empty:a.length===0&&l.length()<=1,format:this.quill.getFormat(a),line:l,offset:c,prefix:g,suffix:y,event:e};s.some((T=>{if(T.collapsed!=null&&T.collapsed!==_.collapsed||T.empty!=null&&T.empty!==_.empty||T.offset!=null&&T.offset!==_.offset)return!1;if(Array.isArray(T.format)){if(T.format.every((L=>_.format[L]==null)))return!1}else if(typeof T.format=="object"&&!Object.keys(T.format).every((L=>T.format[L]===!0?_.format[L]!=null:T.format[L]===!1?_.format[L]==null:Oi(T.format[L],_.format[L]))))return!1;return T.prefix!=null&&!T.prefix.test(_.prefix)||T.suffix!=null&&!T.suffix.test(_.suffix)?!1:T.handler.call(this,a,_,T)!==!0}))&&e.preventDefault()}))}handleBackspace(e,t){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new G).retain(e.index-r).delete(r);if(t.offset===0){const[l]=this.quill.getLine(e.index-1);if(l&&!(l.statics.blotName==="block"&&l.length()<=1)){const u=i.formats(),f=this.quill.getFormat(e.index-1,1);if(s=Et.AttributeMap.diff(u,f)||{},Object.keys(s).length>0){const p=(new G).retain(e.index+i.length()-2).retain(1,s);a=a.compose(p)}}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDelete(e,t){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[i]=this.quill.getLine(e.index);let a=(new G).retain(e.index).delete(r);if(t.offset>=i.length()-1){const[l]=this.quill.getLine(e.index+1);if(l){const c=i.formats(),u=this.quill.getFormat(e.index,1);s=Et.AttributeMap.diff(c,u)||{},Object.keys(s).length>0&&(a=a.retain(l.length()-1).retain(1,s))}}this.quill.updateContents(a,A.sources.USER),this.quill.focus()}handleDeleteRange(e){$i({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,t){const r=Object.keys(t.format).reduce(((i,a)=>(this.quill.scroll.query(a,Z.BLOCK)&&!Array.isArray(t.format[a])&&(i[a]=t.format[a]),i)),{}),s=(new G).retain(e.index).delete(e.length).insert(`\n`,r);this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(e.index+1,A.sources.SILENT),this.quill.focus()}}const Qf={bindings:{bold:Ys("bold"),italic:Ys("italic"),underline:Ys("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",A.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(n,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",A.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(n,e){e.format.indent!=null?this.quill.format("indent","-1",A.sources.USER):e.format.list!=null&&this.quill.format("list",!1,A.sources.USER)}},"indent code-block":qa(!0),"outdent code-block":qa(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(n){this.quill.deleteText(n.index-1,1,A.sources.USER)}},tab:{key:"Tab",handler(n,e){if(e.format.table)return!0;this.quill.history.cutoff();const t=(new G).retain(n.index).delete(n.length).insert("\t");return this.quill.updateContents(t,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index+1,A.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,A.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(n,e){const t={list:!1};e.format.indent&&(t.indent=!1),this.quill.formatLine(n.index,n.length,t,A.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(n){const[e,t]=this.quill.getLine(n.index),r={...e.formats(),list:"checked"},s=(new G).retain(n.index).insert(`\n`,r).retain(e.length()-t-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(n,e){const[t,r]=this.quill.getLine(n.index),s=(new G).retain(n.index).insert(`\n`,e.format).retain(t.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(n.index+1,A.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(n){const e=this.quill.getModule("table");if(e){const[t,r,s,i]=e.getTable(n),a=Jf(t,r,s,i);if(a==null)return;let l=t.offset();if(a<0){const c=(new G).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(n.index+1,n.length,A.sources.SILENT)}else if(a>0){l+=t.length();const c=(new G).retain(l).insert(`\n`);this.quill.updateContents(c,A.sources.USER),this.quill.setSelection(l,A.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(n,e){const{event:t,line:r}=e,s=r.offset(this.quill.scroll);t.shiftKey?this.quill.setSelection(s-1,A.sources.USER):this.quill.setSelection(s+r.length(),A.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(n,e){if(this.quill.scroll.query("list")==null)return!0;const{length:t}=e.prefix,[r,s]=this.quill.getLine(n.index);if(s>t)return!0;let i;switch(e.prefix.trim()){case"[]":case"[ ]":i="unchecked";break;case"[x]":i="checked";break;case"-":case"*":i="bullet";break;default:i="ordered"}this.quill.insertText(n.index," ",A.sources.USER),this.quill.history.cutoff();const a=(new G).retain(n.index-s).delete(t+1).retain(r.length()-2-s).retain(1,{list:i});return this.quill.updateContents(a,A.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(n.index-t,A.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(n){const[e,t]=this.quill.getLine(n.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const i=(new G).retain(n.index+e.length()-t-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(i,A.sources.USER),this.quill.setSelection(n.index-1,A.sources.SILENT),!1}return!0}},"embed left":us("ArrowLeft",!1),"embed left shift":us("ArrowLeft",!0),"embed right":us("ArrowRight",!1),"embed right shift":us("ArrowRight",!0),"table down":$a(!1),"table up":$a(!0)}};Rs.DEFAULTS=Qf;function qa(n){return{key:"Tab",shiftKey:!n,format:{"code-block":!0},handler(e,t){let{event:r}=t;const s=this.quill.scroll.query("code-block"),{TAB:i}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,i,A.sources.USER),this.quill.setSelection(e.index+i.length,A.sources.SILENT);return}const a=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:l,length:c}=e;a.forEach(((u,f)=>{n?(u.insertAt(0,i),f===0?l+=i.length:c+=i.length):u.domNode.textContent.startsWith(i)&&(u.deleteAt(0,i.length),f===0?l-=i.length:c-=i.length)})),this.quill.update(A.sources.USER),this.quill.setSelection(l,c,A.sources.SILENT)}}}function us(n,e){return{key:n,shiftKey:e,altKey:null,[n==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;n==="ArrowRight"&&(s+=r.length+1);const[i]=this.quill.getLeaf(s);return i instanceof ct?(n==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,A.sources.USER):this.quill.setSelection(r.index-1,A.sources.USER):e?this.quill.setSelection(r.index,r.length+1,A.sources.USER):this.quill.setSelection(r.index+r.length+1,A.sources.USER),!1):!0}}}function Ys(n){return{key:n[0],shortKey:!0,handler(e,t){this.quill.format(n,!t.format[n],A.sources.USER)}}}function $a(n){return{key:n?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,t){const r=n?"prev":"next",s=t.line,i=s.parent[r];if(i!=null){if(i.statics.blotName==="table-row"){let a=i.children.head,l=s;for(;l.prev!=null;)l=l.prev,a=a.next;const c=a.offset(this.quill.scroll)+Math.min(t.offset,a.length()-1);this.quill.setSelection(c,0,A.sources.USER)}}else{const a=s.table()[r];a!=null&&(n?this.quill.setSelection(a.offset(this.quill.scroll)+a.length()-1,0,A.sources.USER):this.quill.setSelection(a.offset(this.quill.scroll),0,A.sources.USER))}return!1}}}function Xf(n){if(typeof n=="string"||typeof n=="number")n={key:n};else if(typeof n=="object")n=ar(n);else return null;return n.shortKey&&(n[Yf]=n.shortKey,delete n.shortKey),n}function $i(n){let{quill:e,range:t}=n;const r=e.getLines(t);let s={};if(r.length>1){const i=r[0].formats(),a=r[r.length-1].formats();s=Et.AttributeMap.diff(a,i)||{}}e.deleteText(t,A.sources.USER),Object.keys(s).length>0&&e.formatLine(t.index,1,s,A.sources.USER),e.setSelection(t.index,A.sources.SILENT)}function Jf(n,e,t,r){return e.prev==null&&e.next==null?t.prev==null&&t.next==null?r===0?-1:1:t.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const eg=/font-weight:\s*normal/,tg=["P","OL","UL"],Pa=n=>n&&tg.includes(n.tagName),ng=n=>{Array.from(n.querySelectorAll("br")).filter((e=>Pa(e.previousElementSibling)&&Pa(e.nextElementSibling))).forEach((e=>{e.parentNode?.removeChild(e)}))},rg=n=>{Array.from(n.querySelectorAll('b[style*="font-weight"]')).filter((e=>e.getAttribute("style")?.match(eg))).forEach((e=>{const t=n.createDocumentFragment();t.append(...e.childNodes),e.parentNode?.replaceChild(t,e)}))};function sg(n){n.querySelector('[id^="docs-internal-guid-"]')&&(rg(n),ng(n))}const ig=/\bmso-list:[^;]*ignore/i,ag=/\bmso-list:[^;]*\bl(\d+)/i,og=/\bmso-list:[^;]*\blevel(\d+)/i,lg=(n,e)=>{const t=n.getAttribute("style"),r=t?.match(ag);if(!r)return null;const s=Number(r[1]),i=t?.match(og),a=i?Number(i[1]):1,l=new RegExp(`@list l${s}:level${a}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),c=e.match(l),u=c&&c[1]==="bullet"?"bullet":"ordered";return{id:s,indent:a,type:u,element:n}},cg=n=>{const e=Array.from(n.querySelectorAll("[style*=mso-list]")),t=[],r=[];e.forEach((a=>{(a.getAttribute("style")||"").match(ig)?t.push(a):r.push(a)})),t.forEach((a=>a.parentNode?.removeChild(a)));const s=n.documentElement.innerHTML,i=r.map((a=>lg(a,s))).filter((a=>a));for(;i.length;){const a=[];let l=i.shift();for(;l;)a.push(l),l=i.length&&i[0]?.element===l.element.nextElementSibling&&i[0].id===l.id?i.shift():null;const c=document.createElement("ul");a.forEach((p=>{const h=document.createElement("li");h.setAttribute("data-list",p.type),p.indent>1&&h.setAttribute("class",`ql-indent-${p.indent-1}`),h.innerHTML=p.element.innerHTML,c.appendChild(h)}));const u=a[0]?.element,{parentNode:f}=u??{};u&&f?.replaceChild(c,u),a.slice(1).forEach((p=>{let{element:h}=p;f?.removeChild(h)}))}};function ug(n){n.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&cg(n)}const dg=[ug,sg],hg=n=>{n.documentElement&&dg.forEach((e=>{e(n)}))},fg=Yt("quill:clipboard"),gg=[[Node.TEXT_NODE,xg],[Node.TEXT_NODE,Fa],["br",_g],[Node.ELEMENT_NODE,Fa],[Node.ELEMENT_NODE,yg],[Node.ELEMENT_NODE,Eg],[Node.ELEMENT_NODE,wg],["li",Tg],["ol, ul",Ag],["pre",vg],["tr",Sg],["b",Qs("bold")],["i",Qs("italic")],["strike",Qs("strike")],["style",Ng]],pg=[Gf,jo].reduce(((n,e)=>(n[e.keyName]=e,n)),{}),Ua=[Ko,Di,Mi,Wo,Qo,Jo].reduce(((n,e)=>(n[e.keyName]=e,n)),{});class mg extends $t{static DEFAULTS={matchers:[]};constructor(e,t){super(e,t),this.quill.root.addEventListener("copy",(r=>this.onCaptureCopy(r,!1))),this.quill.root.addEventListener("cut",(r=>this.onCaptureCopy(r,!0))),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],gg.concat(this.options.matchers??[]).forEach((r=>{let[s,i]=r;this.addMatcher(s,i)}))}addMatcher(e,t){this.matchers.push([e,t])}convert(e){let{html:t,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[nt.blotName])return(new G).insert(r||"",{[nt.blotName]:s[nt.blotName]});if(!t)return(new G).insert(r||"",s);const i=this.convertHTML(t);return Vr(i,`\n`)&&(i.ops[i.ops.length-1].attributes==null||s.table)?i.compose((new G).retain(i.length()-1).delete(1)):i}normalizeHTML(e){hg(e)}convertHTML(e){const t=(new DOMParser).parseFromString(e,"text/html");this.normalizeHTML(t);const r=t.body,s=new WeakMap,[i,a]=this.prepareMatching(r,s);return Pi(this.quill.scroll,r,i,a,s)}dangerouslyPasteHTML(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:A.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,t),this.quill.setSelection(0,A.sources.SILENT)}else{const s=this.convert({html:t,text:""});this.quill.updateContents((new G).retain(e).concat(s),r),this.quill.setSelection(e+s.length(),A.sources.SILENT)}}onCaptureCopy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:i}=this.onCopy(r,t);e.clipboardData?.setData("text/plain",i),e.clipboardData?.setData("text/html",s),t&&$i({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter((t=>t[0]!=="#")).join(`\n`)}onCapturePaste(e){if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const t=this.quill.getSelection(!0);if(t==null)return;const r=e.clipboardData?.getData("text/html");let s=e.clipboardData?.getData("text/plain");if(!r&&!s){const a=e.clipboardData?.getData("text/uri-list");a&&(s=this.normalizeURIList(a))}const i=Array.from(e.clipboardData?.files||[]);if(!r&&i.length>0){this.quill.uploader.upload(t,i);return}if(r&&i.length>0){const a=(new DOMParser).parseFromString(r,"text/html");if(a.body.childElementCount===1&&a.body.firstElementChild?.tagName==="IMG"){this.quill.uploader.upload(t,i);return}}this.onPaste(t,{html:r,text:s})}onCopy(e){const t=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:t}}onPaste(e,t){let{text:r,html:s}=t;const i=this.quill.getFormat(e.index),a=this.convert({text:r,html:s},i);fg.log("onPaste",a,{text:r,html:s});const l=(new G).retain(e.index).delete(e.length).concat(a);this.quill.updateContents(l,A.sources.USER),this.quill.setSelection(l.length()-e.length,A.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,t){const r=[],s=[];return this.matchers.forEach((i=>{const[a,l]=i;switch(a){case Node.TEXT_NODE:s.push(l);break;case Node.ELEMENT_NODE:r.push(l);break;default:Array.from(e.querySelectorAll(a)).forEach((c=>{t.has(c)?t.get(c)?.push(l):t.set(c,[l])}));break}})),[r,s]}}function Fn(n,e,t,r){return r.query(e)?n.reduce(((s,i)=>{if(!i.insert)return s;if(i.attributes&&i.attributes[e])return s.push(i);const a=t?{[e]:t}:{};return s.insert(i.insert,{...a,...i.attributes})}),new G):n}function Vr(n,e){let t="";for(let r=n.ops.length-1;r>=0&&t.length<e.length;--r){const s=n.ops[r];if(typeof s.insert!="string")break;t=s.insert+t}return t.slice(-1*e.length)===e}function dn(n,e){if(!(n instanceof Element))return!1;const t=e.query(n);return t&&t.prototype instanceof ct?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(n.tagName.toLowerCase())}function bg(n,e){return n.previousElementSibling&&n.nextElementSibling&&!dn(n.previousElementSibling,e)&&!dn(n.nextElementSibling,e)}const ds=new WeakMap;function el(n){return n==null?!1:(ds.has(n)||(n.tagName==="PRE"?ds.set(n,!0):ds.set(n,el(n.parentNode))),ds.get(n))}function Pi(n,e,t,r,s){return e.nodeType===e.TEXT_NODE?r.reduce(((i,a)=>a(e,i,n)),new G):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce(((i,a)=>{let l=Pi(n,a,t,r,s);return a.nodeType===e.ELEMENT_NODE&&(l=t.reduce(((c,u)=>u(a,c,n)),l),l=(s.get(a)||[]).reduce(((c,u)=>u(a,c,n)),l)),i.concat(l)}),new G):new G}function Qs(n){return(e,t,r)=>Fn(t,n,!0,r)}function Eg(n,e,t){const r=Bt.keys(n),s=Lt.keys(n),i=mn.keys(n),a={};return r.concat(s).concat(i).forEach((l=>{let c=t.query(l,Z.ATTRIBUTE);c!=null&&(a[c.attrName]=c.value(n),a[c.attrName])||(c=pg[l],c!=null&&(c.attrName===l||c.keyName===l)&&(a[c.attrName]=c.value(n)||void 0),c=Ua[l],c!=null&&(c.attrName===l||c.keyName===l)&&(c=Ua[l],a[c.attrName]=c.value(n)||void 0))})),Object.entries(a).reduce(((l,c)=>{let[u,f]=c;return Fn(l,u,f,t)}),e)}function yg(n,e,t){const r=t.query(n);if(r==null)return e;if(r.prototype instanceof ct){const s={},i=r.value(n);if(i!=null)return s[r.blotName]=i,(new G).insert(s,r.formats(n,t))}else if(r.prototype instanceof Ur&&!Vr(e,`\n`)&&e.insert(`\n`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Fn(e,r.blotName,r.formats(n,t),t);return e}function _g(n,e){return Vr(e,`\n`)||e.insert(`\n`),e}function vg(n,e,t){const r=t.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(n,t):!0;return Fn(e,"code-block",s,t)}function Ng(){return new G}function Tg(n,e,t){const r=t.query(n);if(r==null||r.blotName!=="list"||!Vr(e,`\n`))return e;let s=-1,i=n.parentNode;for(;i!=null;)["OL","UL"].includes(i.tagName)&&(s+=1),i=i.parentNode;return s<=0?e:e.reduce(((a,l)=>l.insert?l.attributes&&typeof l.attributes.indent=="number"?a.push(l):a.insert(l.insert,{indent:s,...l.attributes||{}}):a),new G)}function Ag(n,e,t){const r=n;let s=r.tagName==="OL"?"ordered":"bullet";const i=r.getAttribute("data-checked");return i&&(s=i==="true"?"checked":"unchecked"),Fn(e,"list",s,t)}function Fa(n,e,t){if(!Vr(e,`\n`)){if(dn(n,t)&&(n.childNodes.length>0||n instanceof HTMLParagraphElement))return e.insert(`\n`);if(e.length()>0&&n.nextSibling){let r=n.nextSibling;for(;r!=null;){if(dn(r,t))return e.insert(`\n`);const s=t.query(r);if(s&&s.prototype instanceof bt)return e.insert(`\n`);r=r.firstChild}}}return e}function wg(n,e,t){const r={},s=n.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),(s.fontWeight?.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce(((i,a)=>{let[l,c]=a;return Fn(i,l,c,t)}),e),parseFloat(s.textIndent||0)>0?(new G).insert("\t").concat(e):e}function Sg(n,e,t){const r=n.parentElement?.tagName==="TABLE"?n.parentElement:n.parentElement?.parentElement;if(r!=null){const i=Array.from(r.querySelectorAll("tr")).indexOf(n)+1;return Fn(e,"table",i,t)}return e}function xg(n,e,t){let r=n.data;if(n.parentElement?.tagName==="O:P")return e.insert(r.trim());if(!el(n)){if(r.trim().length===0&&r.includes(`\n`)&&!bg(n,t))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(n.previousSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.previousSibling instanceof Element&&dn(n.previousSibling,t))&&(r=r.replace(/^ /,"")),(n.nextSibling==null&&n.parentElement!=null&&dn(n.parentElement,t)||n.nextSibling instanceof Element&&dn(n.nextSibling,t))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Og extends $t{static DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};lastRecorded=0;ignoreChange=!1;stack={undo:[],redo:[]};currentRange=null;constructor(e,t){super(e,t),this.quill.on(A.events.EDITOR_CHANGE,((r,s,i,a)=>{r===A.events.SELECTION_CHANGE?s&&a!==A.sources.SILENT&&(this.currentRange=s):r===A.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||a===A.sources.USER?this.record(s,i):this.transform(s)),this.currentRange=bi(this.currentRange,s))})),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",(r=>{r.inputType==="historyUndo"?(this.undo(),r.preventDefault()):r.inputType==="historyRedo"&&(this.redo(),r.preventDefault())}))}change(e,t){if(this.stack[e].length===0)return;const r=this.stack[e].pop();if(!r)return;const s=this.quill.getContents(),i=r.delta.invert(s);this.stack[t].push({delta:i,range:bi(r.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(r.delta,A.sources.USER),this.ignoreChange=!1,this.restoreSelection(r)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(e,t){if(e.ops.length===0)return;this.stack.redo=[];let r=e.invert(t),s=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const a=this.stack.undo.pop();a&&(r=r.compose(a.delta),s=a.range)}else this.lastRecorded=i;r.length()!==0&&(this.stack.undo.push({delta:r,range:s}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(e){Ha(this.stack.undo,e),Ha(this.stack.redo,e)}undo(){this.change("undo","redo")}restoreSelection(e){if(e.range)this.quill.setSelection(e.range,A.sources.USER);else{const t=Cg(this.quill.scroll,e.delta);this.quill.setSelection(t,A.sources.USER)}}}function Ha(n,e){let t=e;for(let r=n.length-1;r>=0;r-=1){const s=n[r];n[r]={delta:t.transform(s.delta,!0),range:s.range&&bi(s.range,t)},t=s.delta.transform(t),n[r].delta.length()===0&&n.splice(r,1)}}function Lg(n,e){const t=e.ops[e.ops.length-1];return t==null?!1:t.insert!=null?typeof t.insert=="string"&&t.insert.endsWith(`\n`):t.attributes!=null?Object.keys(t.attributes).some((r=>n.query(r,Z.BLOCK)!=null)):!1}function Cg(n,e){const t=e.reduce(((s,i)=>s+(i.delete||0)),0);let r=e.length()-t;return Lg(n,e)&&(r-=1),r}function bi(n,e){if(!n)return n;const t=e.transformPosition(n.index),r=e.transformPosition(n.index+n.length);return{index:t,length:r-t}}class tl extends $t{constructor(e,t){super(e,t),e.root.addEventListener("drop",(r=>{r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const a=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(a.offsetNode,a.offset),s.setEnd(a.offsetNode,a.offset)}const i=s&&e.selection.normalizeNative(s);if(i){const a=e.selection.normalizedToRange(i);r.dataTransfer?.files&&this.upload(a,r.dataTransfer.files)}}))}upload(e,t){const r=[];Array.from(t).forEach((s=>{s&&this.options.mimetypes?.includes(s.type)&&r.push(s)})),r.length>0&&this.options.handler.call(this,e,r)}}tl.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(n,e){if(!this.quill.scroll.query("image"))return;const t=e.map((r=>new Promise((s=>{const i=new FileReader;i.onload=()=>{s(i.result)},i.readAsDataURL(r)}))));Promise.all(t).then((r=>{const s=r.reduce(((i,a)=>i.insert({image:a})),(new G).retain(n.index).delete(n.length));this.quill.updateContents(s,j.sources.USER),this.quill.setSelection(n.index+r.length,j.sources.SILENT)}))}};const Ig=["insertText","insertReplacementText"];class Rg extends $t{constructor(e,t){super(e,t),e.root.addEventListener("beforeinput",(r=>{this.handleBeforeInput(r)})),/Android/i.test(navigator.userAgent)||e.on(A.events.COMPOSITION_BEFORE_START,(()=>{this.handleCompositionStart()}))}deleteRange(e){$i({range:e,quill:this.quill})}replaceText(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(t){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents((new G).retain(e.index).insert(t,r),A.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+t.length,0,A.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Ig.includes(e.inputType))return;const t=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!t||t.collapsed===!0)return;const r=kg(e);if(r==null)return;const s=this.quill.selection.normalizeNative(t),i=s?this.quill.selection.normalizedToRange(s):null;i&&this.replaceText(i,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function kg(n){return typeof n.data=="string"?n.data:n.dataTransfer?.types.includes("text/plain")?n.dataTransfer.getData("text/plain"):null}const Mg=/Mac/i.test(navigator.platform),Dg=100,Bg=n=>!!(n.key==="ArrowLeft"||n.key==="ArrowRight"||n.key==="ArrowUp"||n.key==="ArrowDown"||n.key==="Home"||Mg&&n.key==="a"&&n.ctrlKey===!0);class qg extends $t{isListening=!1;selectionChangeDeadline=0;constructor(e,t){super(e,t),this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(e,t){let{line:r,event:s}=t;if(!(r instanceof xt)||!r.uiNode)return!0;const i=getComputedStyle(r.domNode).direction==="rtl";return i&&s.key!=="ArrowRight"||!i&&s.key!=="ArrowLeft"?!0:(this.quill.setSelection(e.index-1,e.length+(s.shiftKey?1:0),A.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",(e=>{!e.defaultPrevented&&Bg(e)&&this.ensureListeningToSelectionChange()}))}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Dg,this.isListening)return;this.isListening=!0;const e=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",e,{once:!0})}handleSelectionChange(){const e=document.getSelection();if(!e)return;const t=e.getRangeAt(0);if(t.collapsed!==!0||t.startOffset!==0)return;const r=this.quill.scroll.find(t.startContainer);if(!(r instanceof xt)||!r.uiNode)return;const s=document.createRange();s.setStartAfter(r.uiNode),s.setEndAfter(r.uiNode),e.removeAllRanges(),e.addRange(s)}}A.register({"blots/block":Ze,"blots/block/embed":bt,"blots/break":Ct,"blots/container":Pn,"blots/cursor":wt,"blots/embed":Ri,"blots/inline":bn,"blots/scroll":Kf,"blots/text":Ot,"modules/clipboard":mg,"modules/history":Og,"modules/keyboard":Rs,"modules/uploader":tl,"modules/input":Rg,"modules/uiNode":qg});class $g extends Lt{add(e,t){let r=0;if(t==="+1"||t==="-1"){const s=this.value(e)||0;r=t==="+1"?s+1:s-1}else typeof t=="number"&&(r=t);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,t){return super.canAdd(e,t)||super.canAdd(e,parseInt(t,10))}value(e){return parseInt(super.value(e),10)||void 0}}const Pg=new $g("indent","ql-indent",{scope:Z.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Ug extends Ze{static blotName="blockquote";static tagName="blockquote"}class Fg extends Ze{static blotName="header";static tagName=["H1","H2","H3","H4","H5","H6"];static formats(e){return this.tagName.indexOf(e.tagName)+1}}class Wr extends Pn{}Wr.blotName="list-container";Wr.tagName="OL";class Zr extends Ze{static create(e){const t=super.create();return t.setAttribute("data-list",e),t}static formats(e){return e.getAttribute("data-list")||void 0}static register(){A.register(Wr)}constructor(e,t){super(e,t);const r=t.ownerDocument.createElement("span"),s=i=>{if(!e.isEnabled())return;const a=this.statics.formats(t,e);a==="checked"?(this.format("list","unchecked"),i.preventDefault()):a==="unchecked"&&(this.format("list","checked"),i.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-list",t):super.format(e,t)}}Zr.blotName="list";Zr.tagName="LI";Wr.allowedChildren=[Zr];Zr.requiredContainer=Wr;class Ui extends bn{static blotName="bold";static tagName=["STRONG","B"];static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}class Hg extends Ui{static blotName="italic";static tagName=["EM","I"]}class vs extends bn{static blotName="link";static tagName="A";static SANITIZED_URL="about:blank";static PROTOCOL_WHITELIST=["http","https","mailto","tel","sms"];static create(e){const t=super.create(e);return t.setAttribute("href",this.sanitize(e)),t.setAttribute("rel","noopener noreferrer"),t.setAttribute("target","_blank"),t}static formats(e){return e.getAttribute("href")}static sanitize(e){return nl(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,t){e!==this.statics.blotName||!t?super.format(e,t):this.domNode.setAttribute("href",this.constructor.sanitize(t))}}function nl(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}class zg extends bn{static blotName="script";static tagName=["SUB","SUP"];static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}class Kg extends Ui{static blotName="strike";static tagName=["S","STRIKE"]}class Gg extends bn{static blotName="underline";static tagName="U"}class jg extends Ri{static blotName="formula";static className="ql-formula";static tagName="SPAN";static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const t=super.create(e);return typeof e=="string"&&(window.katex.render(e,t,{throwOnError:!1,errorColor:"#f00"}),t.setAttribute("data-value",e)),t}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}const za=["alt","height","width"];let Vg=class extends ct{static blotName="image";static tagName="IMG";static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("src",this.sanitize(e)),t}static formats(e){return za.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return nl(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,t){za.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}};const Ka=["height","width"];class Wg extends bt{static blotName="video";static className="ql-video";static tagName="IFRAME";static create(e){const t=super.create(e);return t.setAttribute("frameborder","0"),t.setAttribute("allowfullscreen","true"),t.setAttribute("src",this.sanitize(e)),t}static formats(e){return Ka.reduce(((t,r)=>(e.hasAttribute(r)&&(t[r]=e.getAttribute(r)),t)),{})}static sanitize(e){return vs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,t){Ka.indexOf(e)>-1?t?this.domNode.setAttribute(e,t):this.domNode.removeAttribute(e):super.format(e,t)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}const Mr=new Lt("code-token","hljs",{scope:Z.INLINE});class Wt extends bn{static formats(e,t){for(;e!=null&&e!==t.domNode;){if(e.classList&&e.classList.contains(nt.className))return super.formats(e,t);e=e.parentNode}}constructor(e,t,r){super(e,t,r),Mr.add(this.domNode,r)}format(e,t){e!==Wt.blotName?super.format(e,t):t?Mr.add(this.domNode,t):(Mr.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),Mr.value(this.domNode)||this.unwrap()}}Wt.blotName="code-token";Wt.className="ql-token";class mt extends nt{static create(e){const t=super.create(e);return typeof e=="string"&&t.setAttribute("data-language",e),t}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,t){e===this.statics.blotName&&t?this.domNode.setAttribute("data-language",t):super.format(e,t)}replaceWith(e,t){return this.formatAt(0,this.length(),Wt.blotName,!1),super.replaceWith(e,t)}}class Br extends Un{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,t){e===mt.blotName&&(this.forceNext=!0,this.children.forEach((r=>{r.format(e,t)})))}formatAt(e,t,r,s){r===mt.blotName&&(this.forceNext=!0),super.formatAt(e,t,r,s)}highlight(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter((a=>a!==this.uiNode)).map((a=>a.textContent)).join(`\n`)}\n`,i=mt.formats(this.children.head.domNode);if(t||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const a=this.children.reduce(((c,u)=>c.concat(Fo(u,!1))),new G),l=e(s,i);a.diff(l).reduce(((c,u)=>{let{retain:f,attributes:p}=u;return f?(p&&Object.keys(p).forEach((h=>{[mt.blotName,Wt.blotName].includes(h)&&this.formatAt(c,f,h,p[h])})),c+f):c}),0)}this.cachedText=s,this.forceNext=!1}}html(e,t){const[r]=this.children.find(e);return`<pre data-language="${r?mt.formats(r.domNode):"plain"}">\n${Is(this.code(e,t))}\n</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const t=mt.formats(this.children.head.domNode);t!==this.uiNode.value&&(this.uiNode.value=t)}}}Br.allowedChildren=[mt];mt.requiredContainer=Br;mt.allowedChildren=[Wt,wt,Ot,Ct];const Zg=(n,e,t)=>{if(typeof n.versionString=="string"){const r=n.versionString.split(".")[0];if(parseInt(r,10)>=11)return n.highlight(t,{language:e}).value}return n.highlight(e,t).value};class rl extends $t{static register(){A.register(Wt,!0),A.register(mt,!0),A.register(Br,!0)}constructor(e,t){if(super(e,t),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce(((r,s)=>{let{key:i}=s;return r[i]=!0,r}),{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(A.events.SCROLL_BLOT_MOUNT,(e=>{if(!(e instanceof Br))return;const t=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach((r=>{let{key:s,label:i}=r;const a=t.ownerDocument.createElement("option");a.textContent=i,a.setAttribute("value",s),t.appendChild(a)})),t.addEventListener("change",(()=>{e.format(mt.blotName,t.value),this.quill.root.focus(),this.highlight(e,!0)})),e.uiNode==null&&(e.attachUI(t),e.children.head&&(t.value=mt.formats(e.children.head.domNode)))}))}initTimer(){let e=null;this.quill.on(A.events.SCROLL_OPTIMIZE,(()=>{e&&clearTimeout(e),e=setTimeout((()=>{this.highlight(),e=null}),this.options.interval)}))}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(A.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Br):[e]).forEach((i=>{i.highlight(this.highlightBlot,t)})),this.quill.update(A.sources.SILENT),r!=null&&this.quill.setSelection(r,A.sources.SILENT)}highlightBlot(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(t=this.languages[t]?t:"plain",t==="plain")return Is(e).split(`\n`).reduce(((s,i,a)=>(a!==0&&s.insert(`\n`,{[nt.blotName]:t}),s.insert(i))),new G);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(nt.className),r.innerHTML=Zg(this.options.hljs,t,e),Pi(this.quill.scroll,r,[(s,i)=>{const a=Mr.value(s);return a?i.compose((new G).retain(i.length(),{[Wt.blotName]:a})):i}],[(s,i)=>s.data.split(`\n`).reduce(((a,l,c)=>(c!==0&&a.insert(`\n`,{[nt.blotName]:t}),a.insert(l))),i)],new WeakMap)}}rl.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class St extends Ze{static blotName="table";static tagName="TD";static create(e){const t=super.create();return e?t.setAttribute("data-row",e):t.setAttribute("data-row",Fi()),t}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,t){e===St.blotName&&t?this.domNode.setAttribute("data-row",t):super.format(e,t)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class Dn extends Pn{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),t=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===t.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach((t=>{if(t.next==null)return;const r=t.formats(),s=t.next.formats();if(r.table!==s.table){const i=this.splitAfter(t);i&&i.optimize(),this.prev&&this.prev.optimize()}}))}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class fn extends Pn{static blotName="table-body";static tagName="TBODY"}class Ns extends Pn{static blotName="table-container";static tagName="TABLE";balanceCells(){const e=this.descendants(Dn),t=e.reduce(((r,s)=>Math.max(s.children.length,r)),0);e.forEach((r=>{new Array(t-r.children.length).fill(0).forEach((()=>{let s;r.children.head!=null&&(s=St.formats(r.children.head.domNode));const i=this.scroll.create(St.blotName,s);r.appendChild(i),i.optimize()}))}))}cells(e){return this.rows().map((t=>t.children.at(e)))}deleteColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e);s?.remove()}))}insertColumn(e){const[t]=this.descendant(fn);t==null||t.children.head==null||t.children.forEach((r=>{const s=r.children.at(e),i=St.formats(r.children.head.domNode),a=this.scroll.create(St.blotName,i);r.insertBefore(a,s)}))}insertRow(e){const[t]=this.descendant(fn);if(t==null||t.children.head==null)return;const r=Fi(),s=this.scroll.create(Dn.blotName);t.children.head.children.forEach((()=>{const a=this.scroll.create(St.blotName,r);s.appendChild(a)}));const i=t.children.at(e);t.insertBefore(s,i)}rows(){const e=this.children.head;return e==null?[]:e.children.map((t=>t))}}Ns.allowedChildren=[fn];fn.requiredContainer=Ns;fn.allowedChildren=[Dn];Dn.requiredContainer=fn;Dn.allowedChildren=[St];St.requiredContainer=Dn;function Fi(){return`row-${Math.random().toString(36).slice(2,6)}`}class Yg extends $t{static register(){A.register(St),A.register(Dn),A.register(fn),A.register(Ns)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ns).forEach((e=>{e.balanceCells()}))}deleteColumn(){const[e,,t]=this.getTable();t!=null&&(e.deleteColumn(t.cellOffset()),this.quill.update(A.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(A.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const t=e.offset();e.remove(),this.quill.update(A.sources.USER),this.quill.setSelection(t,A.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[t,r]=this.quill.getLine(e.index);if(t==null||t.statics.blotName!==St.blotName)return[null,null,null,-1];const s=t.parent;return[s.parent.parent,s,t,r]}insertColumn(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=i.cellOffset();r.insertColumn(a+e),this.quill.update(A.sources.USER);let l=s.rowOffset();e===0&&(l+=1),this.quill.setSelection(t.index+l,t.length,A.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const t=this.quill.getSelection();if(!t)return;const[r,s,i]=this.getTable(t);if(i==null)return;const a=s.rowOffset();r.insertRow(a+e),this.quill.update(A.sources.USER),e>0?this.quill.setSelection(t,A.sources.SILENT):this.quill.setSelection(t.index+s.children.length,t.length,A.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,t){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce((i=>{const a=new Array(t).fill(`\n`).join("");return i.insert(a,{table:Fi()})}),(new G).retain(r.index));this.quill.updateContents(s,A.sources.USER),this.quill.setSelection(r.index,A.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(A.events.SCROLL_OPTIMIZE,(e=>{e.some((t=>["TD","TR","TBODY","TABLE"].includes(t.target.tagName)?(this.quill.once(A.events.TEXT_CHANGE,((r,s,i)=>{i===A.sources.USER&&this.balanceTables()})),!0):!1))}))}}const Ga=Yt("quill:toolbar");class Hi extends $t{constructor(e,t){if(super(e,t),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Qg(r,this.options.container),e.container?.parentNode?.insertBefore(r,e.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){Ga.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach((r=>{const s=this.options.handlers?.[r];s&&this.addHandler(r,s)})),Array.from(this.container.querySelectorAll("button, select")).forEach((r=>{this.attach(r)})),this.quill.on(A.events.EDITOR_CHANGE,(()=>{const[r]=this.quill.selection.getRange();this.update(r)}))}addHandler(e,t){this.handlers[e]=t}attach(e){let t=Array.from(e.classList).find((s=>s.indexOf("ql-")===0));if(!t)return;if(t=t.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[t]==null&&this.quill.scroll.query(t)==null){Ga.warn("ignoring attaching to nonexistent format",t,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,(s=>{let i;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const l=e.options[e.selectedIndex];l.hasAttribute("selected")?i=!1:i=l.value||!1}else e.classList.contains("ql-active")?i=!1:i=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[a]=this.quill.selection.getRange();if(this.handlers[t]!=null)this.handlers[t].call(this,i);else if(this.quill.scroll.query(t).prototype instanceof ct){if(i=prompt(`Enter ${t}`),!i)return;this.quill.updateContents((new G).retain(a.index).delete(a.length).insert({[t]:i}),A.sources.USER)}else this.quill.format(t,i,A.sources.USER);this.update(a)})),this.controls.push([t,e])}update(e){const t=e==null?{}:this.quill.getFormat(e);this.controls.forEach((r=>{const[s,i]=r;if(i.tagName==="SELECT"){let a=null;if(e==null)a=null;else if(t[s]==null)a=i.querySelector("option[selected]");else if(!Array.isArray(t[s])){let l=t[s];typeof l=="string"&&(l=l.replace(/"/g,'\\"')),a=i.querySelector(`option[value="${l}"]`)}a==null?(i.value="",i.selectedIndex=-1):a.selected=!0}else if(e==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const a=t[s],l=a===i.getAttribute("value")||a!=null&&a.toString()===i.getAttribute("value")||a==null&&!i.getAttribute("value");i.classList.toggle("ql-active",l),i.setAttribute("aria-pressed",l.toString())}else{const a=t[s]!=null;i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}}))}}Hi.DEFAULTS={};function ja(n,e,t){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),t!=null?(r.value=t,r.setAttribute("aria-label",`${e}: ${t}`)):r.setAttribute("aria-label",e),n.appendChild(r)}function Qg(n,e){Array.isArray(e[0])||(e=[e]),e.forEach((t=>{const r=document.createElement("span");r.classList.add("ql-formats"),t.forEach((s=>{if(typeof s=="string")ja(r,s);else{const i=Object.keys(s)[0],a=s[i];Array.isArray(a)?Xg(r,i,a):ja(r,i,a)}})),n.appendChild(r)}))}function Xg(n,e,t){const r=document.createElement("select");r.classList.add(`ql-${e}`),t.forEach((s=>{const i=document.createElement("option");s!==!1?i.setAttribute("value",String(s)):i.setAttribute("selected","selected"),r.appendChild(i)})),n.appendChild(r)}Hi.DEFAULTS={container:null,handlers:{clean(){const n=this.quill.getSelection();if(n!=null)if(n.length===0){const e=this.quill.getFormat();Object.keys(e).forEach((t=>{this.quill.scroll.query(t,Z.INLINE)!=null&&this.quill.format(t,!1,A.sources.USER)}))}else this.quill.removeFormat(n.index,n.length,A.sources.USER)},direction(n){const{align:e}=this.quill.getFormat();n==="rtl"&&e==null?this.quill.format("align","right",A.sources.USER):!n&&e==="right"&&this.quill.format("align",!1,A.sources.USER),this.quill.format("direction",n,A.sources.USER)},indent(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e),r=parseInt(t.indent||0,10);if(n==="+1"||n==="-1"){let s=n==="+1"?1:-1;t.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,A.sources.USER)}},link(n){n===!0&&(n=prompt("Enter link URL:")),this.quill.format("link",n,A.sources.USER)},list(n){const e=this.quill.getSelection(),t=this.quill.getFormat(e);n==="check"?t.list==="checked"||t.list==="unchecked"?this.quill.format("list",!1,A.sources.USER):this.quill.format("list","unchecked",A.sources.USER):this.quill.format("list",n,A.sources.USER)}}};const Jg='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',ep='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',tp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',np='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',rp='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',sp='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',ip='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',ap='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',Va='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',op='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',lp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',cp='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',up='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',dp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',hp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',fp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',gp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',pp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',mp='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',bp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',Ep='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',yp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',_p='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',vp='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',Np='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',Tp='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',Ap='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',wp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',Sp='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',xp='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',Op='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',Lp='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Cp='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Hr={align:{"":Jg,center:ep,right:tp,justify:np},background:rp,blockquote:sp,bold:ip,clean:ap,code:Va,"code-block":Va,color:op,direction:{"":lp,rtl:cp},formula:up,header:{1:dp,2:hp,3:fp,4:gp,5:pp,6:mp},italic:bp,image:Ep,indent:{"+1":yp,"-1":_p},link:vp,list:{bullet:Np,check:Tp,ordered:Ap},script:{sub:wp,super:Sp},strike:xp,table:Op,underline:Lp,video:Cp},Ip='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Wa=0;function Za(n,e){n.setAttribute(e,`${n.getAttribute(e)!=="true"}`)}class ks{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",(()=>{this.togglePicker()})),this.label.addEventListener("keydown",(t=>{switch(t.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),t.preventDefault();break}})),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Za(this.label,"aria-expanded"),Za(this.options,"aria-hidden")}buildItem(e){const t=document.createElement("span");t.tabIndex="0",t.setAttribute("role","button"),t.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&t.setAttribute("data-value",r),e.textContent&&t.setAttribute("data-label",e.textContent),t.addEventListener("click",(()=>{this.selectItem(t,!0)})),t.addEventListener("keydown",(s=>{switch(s.key){case"Enter":this.selectItem(t,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}})),t}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=Ip,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Wa}`,Wa+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach((t=>{const r=this.buildItem(t);e.appendChild(r),t.selected===!0&&this.selectItem(r)})),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach((e=>{this.container.setAttribute(e.name,e.value)})),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout((()=>this.label.focus()),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r?.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const t=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",t)}}class sl extends ks{constructor(e,t){super(e),this.label.innerHTML=t,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach((r=>{r.classList.add("ql-primary")}))}buildItem(e){const t=super.buildItem(e);return t.style.backgroundColor=e.getAttribute("value")||"",t}selectItem(e,t){super.selectItem(e,t);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class il extends ks{constructor(e,t){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach((r=>{r.innerHTML=t[r.getAttribute("data-value")||""]})),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,t){super.selectItem(e,t);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Rp=n=>{const{overflowY:e}=getComputedStyle(n,null);return e!=="visible"&&e!=="clip"};let al=class{constructor(e,t){this.quill=e,this.boundsContainer=t||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Rp(this.quill.root)&&this.quill.root.addEventListener("scroll",(()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`})),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const t=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${t}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let a=0;if(i.right>s.right&&(a=s.right-i.right,this.root.style.left=`${t+a}px`),i.left<s.left&&(a=s.left-i.left,this.root.style.left=`${t+a}px`),i.bottom>s.bottom){const l=i.bottom-i.top,c=e.bottom-e.top+l;this.root.style.top=`${r-c}px`,this.root.classList.add("ql-flip")}return a}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}};const kp=[!1,"center","right","justify"],Mp=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Dp=[!1,"serif","monospace"],Bp=["1","2","3",!1],qp=["small",!1,"large","huge"];class Yr extends hr{constructor(e,t){super(e,t);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach((i=>{i.container.contains(s.target)||i.close()}))};e.emitter.listenDOM("click",document.body,r)}addModule(e){const t=super.addModule(e);return e==="toolbar"&&this.extendToolbar(t),t}buildButtons(e,t){Array.from(e).forEach((r=>{(r.getAttribute("class")||"").split(/\s+/).forEach((i=>{if(i.startsWith("ql-")&&(i=i.slice(3),t[i]!=null))if(i==="direction")r.innerHTML=t[i][""]+t[i].rtl;else if(typeof t[i]=="string")r.innerHTML=t[i];else{const a=r.value||"";a!=null&&t[i][a]&&(r.innerHTML=t[i][a])}}))}))}buildPickers(e,t){this.pickers=Array.from(e).map((s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&Ir(s,kp),typeof t.align=="object"))return new il(s,t.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const i=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&Ir(s,Mp,i==="background"?"#ffffff":"#000000"),new sl(s,t[i])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?Ir(s,Dp):s.classList.contains("ql-header")?Ir(s,Bp):s.classList.contains("ql-size")&&Ir(s,qp)),new ks(s)}));const r=()=>{this.pickers.forEach((s=>{s.update()}))};this.quill.on(j.events.EDITOR_CHANGE,r)}}Yr.DEFAULTS=hn({},hr.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let n=this.container.querySelector("input.ql-image[type=file]");n==null&&(n=document.createElement("input"),n.setAttribute("type","file"),n.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),n.classList.add("ql-image"),n.addEventListener("change",(()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,n.files),n.value=""})),this.container.appendChild(n)),n.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class ol extends al{constructor(e,t){super(e,t),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",(e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())}))}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;t!=null?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:t}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,j.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,j.sources.USER)),this.quill.root.scrollTop=t;break}case"video":e=$p(e);case"formula":{if(!e)break;const t=this.quill.getSelection(!0);if(t!=null){const r=t.index+t.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,j.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",j.sources.USER),this.quill.setSelection(r+2,j.sources.USER)}break}}this.textbox.value="",this.hide()}}function $p(n){let e=n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||n.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=n.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:n}function Ir(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach((r=>{const s=document.createElement("option");r===t?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),n.appendChild(s)}))}const Pp=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Up extends ol{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(e,t){super(e,t),this.quill.on(j.events.EDITOR_CHANGE,((r,s,i,a)=>{if(r===j.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&a===j.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const l=this.quill.getLines(s.index,s.length);if(l.length===1){const c=this.quill.getBounds(s);c!=null&&this.position(c)}else{const c=l[l.length-1],u=this.quill.getIndex(c),f=Math.min(c.length()-1,s.index+s.length-u),p=this.quill.getBounds(new Mn(u,f));p!=null&&this.position(p)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()}))}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",(()=>{this.root.classList.remove("ql-editing")})),this.quill.on(j.events.SCROLL_OPTIMIZE,(()=>{setTimeout((()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const t=this.quill.getBounds(e);t!=null&&this.position(t)}}),1)}))}cancel(){this.show()}position(e){const t=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",t!==0&&(r.style.marginLeft=`${-1*t-r.offsetWidth/2}px`),t}}class ll extends Yr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Pp),super(e,t),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Up(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr))}}ll.DEFAULTS=hn({},Yr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){n?this.quill.theme.tooltip.edit():this.quill.format("link",!1,A.sources.USER)}}}}});const Fp=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Hp extends ol{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",(e=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),e.preventDefault()})),this.root.querySelector("a.ql-remove").addEventListener("click",(e=>{if(this.linkRange!=null){const t=this.linkRange;this.restoreFocus(),this.quill.formatText(t,"link",!1,j.sources.USER),delete this.linkRange}e.preventDefault(),this.hide()})),this.quill.on(j.events.SELECTION_CHANGE,((e,t,r)=>{if(e!=null){if(e.length===0&&r===j.sources.USER){const[s,i]=this.quill.scroll.descendant(vs,e.index);if(s!=null){this.linkRange=new Mn(e.index-i,s.length());const a=vs.formats(s.domNode);this.preview.textContent=a,this.preview.setAttribute("href",a),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}}))}show(){super.show(),this.root.removeAttribute("data-mode")}}class cl extends Yr{constructor(e,t){t.modules.toolbar!=null&&t.modules.toolbar.container==null&&(t.modules.toolbar.container=Fp),super(e,t),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Hr),this.buildPickers(e.container.querySelectorAll("select"),Hr),this.tooltip=new Hp(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},((t,r)=>{e.handlers.link.call(e,!r.format.link)})))}}cl.DEFAULTS=hn({},Yr.DEFAULTS,{modules:{toolbar:{handlers:{link(n){if(n){const e=this.quill.getSelection();if(e==null||e.length===0)return;let t=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(t)&&t.indexOf("mailto:")!==0&&(t=`mailto:${t}`);const{tooltip:r}=this.quill.theme;r.edit("link",t)}else this.quill.format("link",!1,A.sources.USER)}}}}});A.register({"attributors/attribute/direction":jo,"attributors/class/align":zo,"attributors/class/background":Vf,"attributors/class/color":jf,"attributors/class/direction":Vo,"attributors/class/font":Yo,"attributors/class/size":Xo,"attributors/style/align":Ko,"attributors/style/background":Di,"attributors/style/color":Mi,"attributors/style/direction":Wo,"attributors/style/font":Qo,"attributors/style/size":Jo},!0);A.register({"formats/align":zo,"formats/direction":Vo,"formats/indent":Pg,"formats/background":Di,"formats/color":Mi,"formats/font":Yo,"formats/size":Xo,"formats/blockquote":Ug,"formats/code-block":nt,"formats/header":Fg,"formats/list":Zr,"formats/bold":Ui,"formats/code":Bi,"formats/italic":Hg,"formats/link":vs,"formats/script":zg,"formats/strike":Kg,"formats/underline":Gg,"formats/formula":jg,"formats/image":Vg,"formats/video":Wg,"modules/syntax":rl,"modules/table":Yg,"modules/toolbar":Hi,"themes/bubble":ll,"themes/snow":cl,"ui/icons":Hr,"ui/picker":ks,"ui/icon-picker":il,"ui/color-picker":sl,"ui/tooltip":al},!0);var gt={generateFilename(){return btoa(String(Math.random()*1e6)+String(+new Date)).replace("=","")},urlIsImage(n,e=3e3){return this.validURL(n)?/\.(jpeg|jpg|gif|png|webp|tiff|bmp)$/.test(n)?Promise.resolve(!0):new Promise(((t,r)=>{let s;const i=new Image;i.onerror=i.onabort=()=>{clearTimeout(s),r(!1)},i.onload=()=>{clearTimeout(s),t(!0)},s=setTimeout((()=>{i.src="//!/an/invalid.jpg",r(!1)}),e),i.src=n})):Promise.reject(!1)},urlIsImageDataUrl(n){return/^data:image\/\w+;base64,/.test(n)},validURL(n){try{return!!new URL(n)}catch{return!1}},isRichText(n){let e=!1,t=!1;return Array.prototype.forEach.call(n,(r=>{r.kind==="string"&&r.type.match(/^text\/html$/i)&&(e=!0),r.kind==="file"&&r.type.match(/^image\/\w+$/i)&&(t=!0)})),e&&!t},resolveDataUrl(n,e){let t="";return typeof n=="string"?t=n:n instanceof ArrayBuffer&&(t=this.arrayBufferToBase64Url(n,e)),t},binaryStringToArrayBuffer(n){const e=n.length,t=new ArrayBuffer(e),r=new Uint8Array(t);let s=-1;for(;++s<e;)r[s]=n.charCodeAt(s);return t},arrayBufferToBase64Url(n,e){return`data:${e};base64,`+btoa(new Uint8Array(n).reduce(((t,r)=>t+String.fromCharCode(r)),""))},copyText(n,e=document.body){const t=document.createElement("textarea"),r=document.activeElement;t.value=n,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection();let i=!1;s&&s.rangeCount>0&&(i=s.getRangeAt(0)),e.append(t),t.select(),t.selectionStart=0,t.selectionEnd=n.length;let a=!1;try{a=document.execCommand("copy")}catch{}return t.remove(),s&&i&&(s.removeAllRanges(),s.addRange(i)),r&&r.focus(),a},isType(n,e){return Object.prototype.toString.call(n)===`[object ${e}]`},isObject(n){return this.isType(n,"Object")}};class zp{constructor(e,t,r){this.dataUrl=e,this.type=t,this.name=r||""}}class zr extends zp{constructor(e,t,r){super(e,t,r),this.dataUrl=e,this.type=t,this.name=r||`${gt.generateFilename()}.${this.getSuffix()}`}minify(e){return new Promise(((t,r)=>{const s=e.maxWidth||800,i=e.maxHeight||800,a=e.quality||.8;if(!this.dataUrl)return r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, dataUrl should not be empty."});const l=new Image;l.onload=()=>{const c=l.width,u=l.height;c>u?c>s&&(l.height=u*s/c,l.width=s):u>i&&(l.width=c*i/u,l.height=i);const f=document.createElement("canvas");f.width=l.width,f.height=l.height;const p=f.getContext("2d");if(p){p.drawImage(l,0,0,l.width,l.height);const h=this.type||"image/png",g=f.toDataURL(h,a);t(new zr(g,h,this.name))}else r({message:"[error] QuillImageDropAndPaste: Fail to minify the image, create canvas context failure."})},l.src=gt.resolveDataUrl(this.dataUrl,this.type)}))}toFile(e){return e=e||this.name,window.File?new File([this.toBlob()],e,{type:this.type}):(console.error("[error] QuillImageDropAndPaste: Your browser didnot support File API."),null)}toBlob(){const e=gt.resolveDataUrl(this.dataUrl,this.type).replace(/^[^,]+,/,""),t=gt.binaryStringToArrayBuffer(atob(e));return this.createBlob([t],{type:this.type})}createBlob(e,t){t||(t={}),typeof t=="string"&&(t={type:t});try{return new Blob(e,t)}catch(r){if(r.name!=="TypeError")throw r;const s="BlobBuilder"in window?window.BlobBuilder:"MSBlobBuilder"in window?window.MSBlobBuilder:"MozBlobBuilder"in window?window.MozBlobBuilder:window.WebKitBlobBuilder,i=new s;for(let a=0;a<e.length;a++)i.append(e[a]);return i.getBlob(t.type)}}getSuffix(){const e=this.type.match(/^image\/(\w+)$/);return e?e[1]:"png"}}class Kp{constructor(e,t){this.quill=e,this.option=t}}class Ms extends Kp{constructor(e,t){var r;super(e,t),typeof t.autoConvert!="boolean"&&(t.autoConvert=!0),t.enableNativeUploader!==!0&>.isObject(e.uploader)&>.isObject((r=e.uploader)===null||r===void 0?void 0:r.options)&&(e.uploader.options.handler=()=>{}),this.quill=e,this.option=t,this.handleDrop=this.handleDrop.bind(this),this.handlePaste=this.handlePaste.bind(this),this.insert=this.insert.bind(this),this.quill.root.addEventListener("drop",this.handleDrop,!1),this.quill.root.addEventListener("paste",this.handlePaste,!1)}handleDrop(e){if(e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files.length){if(e.preventDefault(),document.caretRangeFromPoint){const t=document.getSelection(),r=document.caretRangeFromPoint(e.clientX,e.clientY);t&&r&&t.setBaseAndExtent(r.startContainer,r.startOffset,r.startContainer,r.startOffset)}this.readFiles(e.dataTransfer.files,((t,r="image/png",s)=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new zr(t,r,s)):this.insert.call(this,gt.resolveDataUrl(t,r),r)}),e)}}handlePaste(e){if(e.clipboardData&&e.clipboardData.items&&e.clipboardData.items.length){if(gt.isRichText(e.clipboardData.items))return;this.readFiles(e.clipboardData.items,((t,r="image/png")=>{typeof this.option.handler=="function"?this.option.handler.call(this,t,r,new zr(t,r)):this.insert(gt.resolveDataUrl(t,r),"image")}),e)}}readFiles(e,t,r){Array.prototype.forEach.call(e,(s=>{gt.isType(s,"DataTransferItem")?this.handleDataTransfer(s,t,r):s instanceof File&&this.handleDroppedFile(s,t,r)}))}handleDataTransfer(e,t,r){const s=this,{type:i}=e;if(i.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=c=>{c.target&&c.target.result&&t(c.target.result,i)};const l=e.getAsFile?e.getAsFile():e;l instanceof Blob&&a.readAsDataURL(l)}else i.match(/^text\/plain$/i)&&e.getAsString((a=>{if(gt.urlIsImageDataUrl(a)){const l=a.match(/^data:(image\/\w+);base64,/),c=l?l[1]:"image/png",u=this.getIndex();t(a,c),this.quill.deleteText(u,a.length,"user"),this.quill.setSelection(u)}else this.option.autoConvert&>.urlIsImage(a).then((()=>{setTimeout((()=>{const l=this.getIndex();this.quill.deleteText(l-a.length,a.length,"user"),s.insert(a,"image",l-a.length)}))})).catch((()=>{}))}))}handleDroppedFile(e,t,r){const{type:s,name:i=""}=e;if(s.match(/^image\/(gif|jpe?g|a?png|svg|webp|bmp)/i)){r.preventDefault();const a=new FileReader;a.onload=l=>{l.target&&l.target.result&&t(l.target.result,s,i)},a.readAsDataURL(e)}}insert(e,t,r){r=r===void 0?this.getIndex():r;let s;t.startsWith("image")?(s=r+1,this.quill.insertEmbed(r,"image",e,"user")):t.startsWith("text")&&(s=r+e.length,this.quill.insertText(r,e,"user")),setTimeout((()=>{this.quill.setSelection(s)}))}getIndex(){let e=(this.quill.getSelection(!0)||{}).index;return(e===void 0||e<0)&&(e=this.quill.getLength()),e}}Ms.ImageData=zr;window.QuillImageDropAndPaste=Ms;"Quill"in window&&window.Quill.register("modules/imageDropAndPaste",Ms);function Ts(n){return n.varName?` for '${n.varName}'`:""}function Gp(n){return!isNaN(n)&&!isNaN(parseFloat(n))}function jp(n,e={}){if(n==null||n===""&&!e.allowEmpty)throw new Error(`Missing string value${Ts(e)}`);return typeof n=="string"?n:n.toString()}function Vp(n,e={}){return n==null||n===""&&!e.allowEmpty?void 0:jp(n,e)}function Wp(n,e={}){if(typeof n=="number")return n;if(n==null)throw new Error(`Missing number value${Ts(e)}`);if(typeof n=="string"&&Gp(n))return Number(n);throw new Error(`Cannot convert to number the value of type '${typeof n}'${Ts(e)}`)}function Ya(n,e={}){return n==null?void 0:Wp(n,e)}function Zp(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Yp(n,e={}){if(Zp(n))return n;const t=n===null?"null":Array.isArray(n)?"array":typeof n;throw new Error(`invalid object value '${t}'${Ts(e)}`)}var ul=n=>n!=null&&(n=Object.getPrototypeOf(n),n===Array.prototype||n===Object.prototype);function dl(n,e,t){for(const[r,s]of Object.entries(e)){const i=`${t}.${r}`;n[i]=s,ul(s)&&dl(n,s,i)}}function Qp(n){const e={...n};for(const[t,r]of Object.entries(n))ul(r)&&dl(e,r,t);return e}var Xp=(n,e)=>{if(e)for(const[t,r]of Object.entries(e))n=n.replace(new RegExp(`{{\\s*${t}\\s*}}`,"g"),r);return n},Jp=n=>n;function em(n,e=Jp){return(t,...r)=>{t[0]==="."&&(t=t.slice(1));const s=n()?.[t];switch(typeof s){case"function":return s(...r);case"string":return e(s,r[0]);default:return s}}}const tm={insertHtmlSnippetMessage:"Insert a HTML Snippet",obfuscate:"Obfuscate"},nm="image",rm="Validate",sm="Cancel",im="Remove",am="Done",om="Image not inserted, place cursor in editor first",lm="HTML Snippet",cm="Confirm Deletion",um={content:"Are you sure you want to delete this HTML Snippet?"},dm={variantLabel:"Size {{ n }}",sizes:"Sizes",imageProperties:"Image properties",left:"Left",right:"Right",center:"Center",alignment:"Alignment",options:"Options",enableZoom:"Enable zoom",link:"Link"},hm={obfuscator:"Obfuscator",content:"Content:",asALink:"As a link",doNotObfuscate:"Do not obfuscate"},fm={insertVideo:"Insert a Video",dialog:{title:"Set a video"}},gm={insertLink:"Insert an internal link"},pm={CustomToolbar:tm,image:nm,validate:rm,delete:"Delete",cancel:sm,remove:im,done:am,editorFocusLost:om,htmlSnippetLabel:lm,confirmDeletion:cm,comfirmSnippetDeletionDialog:um,makeImagePropertiesDialog:dm,openObfuscatorDialog:hm,videoPlugin:fm,internalLinkPlugin:gm},mm={insertHtmlSnippetMessage:"Insérer un extrait de code HTML",obfuscate:"Obfusquer"},bm="image",Em="Valider",ym="Annuler",_m="Terminé",vm="L'image n'a pas été insérée, mettre d'abord le curseur dans l'éditeur",Nm="Code HTML",Tm="Confirmer la suppression",Am="Retirer",wm={content:"Voulez-vous vraiment supprimer ce code HTML ?"},Sm={variantLabel:"Taille {{ n }}",sizes:"Tailles",imageProperties:"Propriétés de l'image",left:"À gauche",right:"À droite",center:"Centrer",alignment:"Alignement",options:"Options",enableZoom:"Activer le zoom",link:"Lien"},xm={obfuscator:"Obfusqueur",content:"Contenu:",asALink:"En tant que lien",doNotObfuscate:"Ne pas obfusquer"},Om={insertVideo:"Insérer une vidéo",dialog:{title:"Définir une vidéo"}},Lm={insertLink:"Insérer un lien interne"},Cm={CustomToolbar:mm,image:bm,validate:Em,delete:"Supprimer",cancel:ym,done:_m,editorFocusLost:vm,htmlSnippetLabel:Nm,confirmDeletion:Tm,remove:Am,comfirmSnippetDeletionDialog:wm,makeImagePropertiesDialog:Sm,openObfuscatorDialog:xm,videoPlugin:Om,internalLinkPlugin:Lm},Qa={en:pm,fr:Cm};function En(n){const e=ti((()=>{const r=n()in Qa?n():"en";return Qp(Qa[r])}));return{t:em(e,Xp)}}var Im=be('<textarea autofocus class="QpInput QpHtmlSnippetInput"rows=8 cols=80>'),hl=be('<button class="QpBtn secondary"type=button>'),Rm=be("<button class=QpBtn type=button>"),km=be('<button class="QpBtn danger outlined"type=button>'),Mm=be("<p>"),Dm=be('<button class="QpBtn danger"type=button>');async function fl({service:n,language:e,mode:t,html:r}){const{t:s}=En(e),[i,a]=lt(r??""),l=()=>{c.close({action:"remove"})},c=n.createModalDialog({content:(()=>{var u=Im();return u.addEventListener("change",(f=>a(f.target.value))),cn((()=>u.value=i())),u})(),footer:[t==="update"&&(()=>{var u=km();return u.$$click=()=>{Bm({deleteSnippet:l,closeDialog:()=>{c.close()},language:e,service:n})},he(u,(()=>s("delete"))),u})(),(()=>{var u=hl();return u.$$click=()=>c.close(),he(u,(()=>s("cancel"))),u})(),(()=>{var u=Rm();return u.$$click=()=>c.close({action:t,values:{html:i()}}),he(u,(()=>s("validate"))),u})()],header:s("htmlSnippetLabel")});return await c.open()}function Bm({closeDialog:n,deleteSnippet:e,language:t,service:r}){const{t:s}=En(t),i=r.createModalDialog({header:s("confirmDeletion"),content:(()=>{var a=Mm();return he(a,(()=>s("comfirmSnippetDeletionDialog.content"))),a})(),footer:[(()=>{var a=hl();return a.$$click=()=>{i.hide()},he(a,(()=>s("cancel"))),a})(),(()=>{var a=Dm();return a.$$click=()=>{i.hide(),e()},he(a,(()=>s("validate"))),a})()]});i.show()}ws(["click"]);var qm=be("<div class=QpSpinner>");function $m(){return qm()}var Pm=be('<button class="QpBtn outlined danger"type=button>'),Um=be("<button class=QpBtn type=button>"),Xs=be("<h2 class=FieldLabel>"),Xa=be("<div class=QpOption>"),Fm=be("<input class=QpOption-input type=text>"),Hm=be("<label><input type=checkbox name=enableZoom>"),zm=be('<div><div class=QpOption><label class=""><input type=checkbox name=enableLinkOnImage></label></div><div class=QpOption>'),Km=be("<button type=button> <small class=ml-1>(<!>)"),Gm=be("<button type=button>");async function jm({language:n,imageUid:e,themeConf:t,service:r,...s}){const{t:i}=En(n),[a,l]=lt(!1),[c,u]=lt(),[f,p]=lt(),[h,g]=lt(s.zoom),[y,_]=lt(!!s.href),[N,T]=lt(s.href??""),L=ti((()=>t.fTextImages.map(((P,ne)=>({size:P,label:i("makeImagePropertiesDialog.variantLabel",{n:ne+1})})))),[t,n()]),C=ti((()=>[{align:"left",label:i("makeImagePropertiesDialog.left")},{align:"center",label:i("makeImagePropertiesDialog.center")},{align:"right",label:i("makeImagePropertiesDialog.right")}]),[n()]),U=async()=>{const P=c();if(!e||!P)throw new Error("missing a find variant name");l(!0);const{url:ne,displayWidth:ce,displayHeight:pe}=await r.useImage(e,P.displaySize);l(!1),W.close({action:"update",values:{uid:e,src:ne,align:f(),variant:P.displaySize,width:ce,height:pe,zoom:h()?void 0:"none",href:y()&&N().trim()||void 0}})};ps((()=>{s.align&&p(s.align)})),ps((()=>{if(s.imageSize){const P=L().find((ne=>ne.size.displaySize===s.imageSize));P&&u(P.size)}})),ps((()=>{y()&&g(!y())}));let F=Mt($m,{});a()||(F=[(()=>{var P=Pm();return P.$$click=()=>{W.close({action:"remove"})},he(P,(()=>i("remove"))),P})(),(()=>{var P=Um();return P.$$click=U,P.disabled=!e||f===void 0||c===void 0,he(P,(()=>i("validate"))),P})()]);const W=r.createModalDialog({header:i("makeImagePropertiesDialog.imageProperties"),content:[(()=>{var P=Xs();return he(P,(()=>i("makeImagePropertiesDialog.sizes"))),P})(),(()=>{var P=Xa();return he(P,Mt(Gi,{get each(){return L()},children:ne=>(()=>{var ce=Km(),pe=ce.firstChild,b=pe.nextSibling,x=b.firstChild,v=x.nextSibling;return v.nextSibling,ce.$$click=()=>u(ne.size),ce.disabled=!e,he(ce,(()=>ne.label),pe),he(b,(()=>ne.size.displaySize),v),cn((()=>ei(ce,`QpBtn secondary ${ne.size.displaySize!==c()?.displaySize?"outlined":""}`))),ce})()})),P})(),(()=>{var P=Xs();return he(P,(()=>i("makeImagePropertiesDialog.alignment"))),P})(),(()=>{var P=Xa();return he(P,Mt(Gi,{get each(){return C()},children:ne=>(()=>{var ce=Gm();return ce.$$click=()=>p(ne.align),ce.disabled=!e,he(ce,(()=>ne.label)),cn((()=>ei(ce,`QpBtn secondary ${ne.align!==f()?"outlined":""}`))),ce})()})),P})(),(()=>{var P=Xs();return he(P,(()=>i("makeImagePropertiesDialog.options"))),P})(),(()=>{var P=zm(),ne=P.firstChild,ce=ne.firstChild,pe=ce.firstChild,b=ne.nextSibling;return pe.addEventListener("change",(()=>{_(!y())})),he(ce,(()=>i("makeImagePropertiesDialog.link")),null),he(ce,Mt(ji,{get when(){return y()},get children(){var x=Fm();return x.addEventListener("change",(v=>{T(v.currentTarget.value)})),cn((()=>x.value=N())),x}}),null),he(b,Mt(ji,{get when(){return!y()},get children(){var x=Hm(),v=x.firstChild;return v.addEventListener("change",(()=>{g(!h())})),he(x,(()=>i("makeImagePropertiesDialog.enableZoom")),null),cn((()=>v.checked=h())),x}})),cn((()=>pe.checked=y())),P})()],footer:F});return await W.open()}ws(["click"]);async function gl({language:n,value:e,internalLinkPluginHook:t}){if(!t)return;const r=await t.openDialog(e??"",{getLanguage:n});if(e&&r)return r.documentId?{action:"update",value:r.documentId}:{action:"remove"};if(!e&&r?.documentId)return{action:"insert",value:r.documentId}}function pl(n){return Vm(n)||zi(n)}function zi(n){return!!n.match(/^[a-zA-Z0-9. _-]+@[a-zA-Z0-9. -]+\.[a-zA-Z]{2,4}$/g)}function Vm(n){return!!n.match(/^(\+|00)[1-9][0-9 \-\(\)\.]{7,32}$/)}function Wm(n){return pl(n)?zi(n)?"mailto":"tel":"raw"}function ml(n){if(n==="raw")return"raw";if(n==="mailto")return"mailto";if(n==="tel")return"tel";throw new Error(`invalid link-type '${n}'`)}var Zm=be("<label class=ObfuscatorDialog-label><input type=text class=ml-2>"),Ym=be('<label class="ObfuscatorDialog-label mt-4"><input type=checkbox name=asALink class=mr-2>'),Qm=be('<button class="QpBtn danger outlined"type=button>'),Xm=be("<button class=QpBtn type=button>");async function Jm({service:n,language:e,value:t}){const{t:r}=En(e),[s,i]=lt(t.asALink),[a,l]=lt(t.content),c=f=>{l(f),pl(f)?i(!0):i(!1)},u=n.createModalDialog({header:r("openObfuscatorDialog.obfuscator"),content:[(()=>{var f=Zm(),p=f.firstChild;return he(f,(()=>r("openObfuscatorDialog.content")),p),p.$$input=h=>c(h.currentTarget.value),cn((()=>p.value=a())),f})(),(()=>{var f=Ym(),p=f.firstChild;return p.addEventListener("change",(()=>i(!s()))),he(f,(()=>r("openObfuscatorDialog.asALink")),null),cn((()=>p.checked=s())),f})()],footer:[(()=>{var f=Qm();return f.$$click=()=>u.close({action:"remove"}),he(f,(()=>r("openObfuscatorDialog.doNotObfuscate"))),f})(),(()=>{var f=Xm();return f.$$click=()=>u.close({action:"update",content:a(),asALink:s()?zi(a())?"mailto":"tel":"raw"}),he(f,(()=>r("done"))),f})()]});return await u.open()}ws(["input","click"]);var eb=be('<button class="QpBtn outlined danger"type=button>'),tb=be('<button class="QpBtn secondary"type=button>'),nb=be("<button class=QpBtn type=button>");async function bl({service:n,language:e,mode:t,value:r,videoPluginHook:s}){if(!s)return;const{t:i}=En(e),[a,l]=lt(r??""),{dispose:c,element:u}=s.createComponent(r??"",{onChange(p){l(p)},getLanguage:e}),f=n.createModalDialog({content:u,footer:[(()=>{var p=eb();return p.$$click=()=>{f.close({action:"remove"}),c()},he(p,(()=>i("remove"))),p})(),(()=>{var p=tb();return p.$$click=()=>{f.close(),c()},he(p,(()=>i("cancel"))),p})(),(()=>{var p=nb();return p.$$click=()=>{f.close({action:t,value:a()??""}),c()},he(p,(()=>i("validate"))),p})()],header:i("videoPlugin.dialog.title")});return await f.open()}ws(["click"]);function rb(n,{label:e,url:t}){let r=e??t;const s=n.getSelection();s&&s.length!==0&&(r=n.getText(s.index,s.length),n.deleteText(s.index,s.length)),n.insertText(Ds(n)??0,r,"link",t)}function El({editor:n,values:e,service:t,index:r,language:s}){const{t:i}=En(s),a=r??Ds(n);if(a===void 0){t.showToast(i("editorFocusLost"),{severity:"warn"});return}n.insertEmbed(a,"img",e)}function Ei(n){const e=Ds(n)??0,[t]=n.getLeaf(e);if(!t)throw new Error("editor.getLeaf() returns undefined");return t.domNode}function yl({values:n,editor:e,index:t}){if(n.html===void 0)throw new Error("html is undefined");e.insertEmbed(t,"html-snippet",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function _l({values:n,editor:e,index:t}){e.insertText(t,n,"internal-link-plugin",n)}function vl({values:n,editor:e,index:t}){e.insertEmbed(t,"video-plugin",n);const[r]=e.getLeaf(t+1);if(!r)throw new Error("missing last inserted element");return r.domNode}function Ds(n){const e=n.getSelection();if(e!==null)return e.index+e.length}function sb(n){const{uid:e}=n.dataset;if(e)return e;const t=n.getAttribute("src");if(!t)return;const{pathname:r}=new URL(t),s=r.split("/"),a=s[s.length-1].match(/^([0-9a-f-]{36})\-([0-9]+x[0-9]+)\.([0-9a-z]+$)/);if(!a)return;const[,l]=a;return l}function ib(n){const e=Nl(n);return{imageSize:n.dataset.variant,align:e}}function Nl(n){const e=n.classList;if(e.contains("center"))return"center";if(e.contains("left"))return"left";if(e.contains("right"))return"right"}function ab(n){if(n==="center")return"center";if(n==="left")return"left";if(n==="right")return"right"}async function ob({editor:n,htmlSnippetBtn:e,service:t,language:r}){const s=e.dataset.html,i=await fl({service:t,html:s,mode:"update",language:r});i&&Qr({editor:n,element:e,data:i,insertElementHandler:yl,service:t,language:r})}async function lb({editor:n,internalLinkElement:e,language:t,service:r,internalLinkPluginHook:s}){const i=e.dataset.documentId,a=await gl({language:t,value:i,internalLinkPluginHook:s});if(!a)return;const l=A.find(e);if(!l||l instanceof A)throw new Error("missing link blot");if(a.action==="update"){if(!a.value)return;const c=n.getIndex(l);l.deleteAt(0,l.length()),_l({values:a.value,editor:n,index:c})}else a.action==="remove"&&l.deleteAt(0,l.length())}async function cb({editor:n,videoElement:e,language:t,service:r,videoPluginHook:s}){const i=e.dataset.videoId,a=await bl({service:r,language:t,mode:"update",value:i,videoPluginHook:s});a&&Qr({editor:n,element:e,data:{action:a.action,values:a.value},insertElementHandler:vl,service:r,language:t})}async function Tl({obfuscatorSpan:n,service:e,language:t,editor:r}){const s=n.innerText,i=n.dataset.asALink?ml(n.dataset.asALink):void 0,a=await Jm({service:e,language:t,value:{content:s,asALink:i?i!=="raw":!1}});if(!a)return;const l=A.find(n);if(!l||l instanceof A)throw new Error("missing embed blot");const c=r.getIndex(l);a.action==="remove"&&(l.remove(),r.insertText(c,s)),a.action==="update"&&(l.remove(),r.insertText(c,a.content??"",{obfuscate:a.asALink??"raw"}))}async function ub({element:n,editor:e,themeConf:t,service:r,language:s}){if(!n.querySelector("img"))return;const a=sb(n),{align:l,imageSize:c}=ib(n),u=await jm({imageSize:c,align:l,imageUid:a,themeConf:t,width:Ya(n.getAttribute("width")),height:Ya(n.getAttribute("height")),zoom:n.dataset.zoom!=="none",href:n.dataset.href,service:r,language:s});u&&Qr({editor:e,element:n,data:u,insertElementHandler:El,service:r,language:s})}function db({quillEditor:n,service:e,language:t,videoPluginHook:r,internalLinkPluginHook:s}){const{themeConf:i,useImage:a}=e;return{insertHtmlSnippetHandler:async h=>{if(!n)return;const g=Ei(n);await fb({editorContent:g,quillEditor:n,service:e,language:t})},insertMedia:async h=>{if(!n)return;if(!pb(h)){rb(n,{label:h.originalName,url:h.url});return}const g=i.fTextImages[0],{displaySize:y}=g,_="center",{url:N,displayWidth:T,displayHeight:L}=await a(h.uid,y);El({editor:n,values:{uid:h.uid,src:N,width:T,height:L,variant:y,align:_},service:e,language:t})},insertObfuscateBlotHandler:()=>{if(!n)return;const h=n.getSelection();!h||h.length===0||hb({userSelection:h,quillEditor:n,service:e,language:t})},insertVideoHandler:async()=>{if(!n)return;const h=Ei(n);await Al({editorContent:h,quillEditor:n,service:e,language:t,videoPluginHook:r})},insertInternalLinkHandler:async()=>{if(!n)return;const h=Ds(n);h!==void 0&&await gb({quillEditor:n,service:e,language:t,internalLinkPluginHook:s,index:h})}}}async function hb({userSelection:n,quillEditor:e,language:t,service:r}){const s=e.getText(n.index,n.length),i=Wm(s);e.formatText(n,"obfuscate",i);const a=e.root.querySelectorAll("span.ObfuscateBlot");if(a.length===0)throw new Error("missing element 'span' with class 'ObfuscateBlot'");for(const l of a)if(l.innerText===s){await Tl({obfuscatorSpan:l,service:r,language:t,editor:e});break}}async function fb({editorContent:n,quillEditor:e,service:t,language:r}){const s=await fl({service:t,language:r,mode:"insert"});s&&Qr({editor:e,element:n,data:s,insertElementHandler:yl,service:t,language:r})}async function Al({editorContent:n,quillEditor:e,service:t,language:r,videoPluginHook:s,value:i}){const a=await bl({service:t,language:r,mode:i?"update":"insert",value:i,videoPluginHook:s});!a||a.action==="remove"||Qr({editor:e,element:n,data:{action:a.action,values:a.value,updateOptions:{textToReplaceLength:i?.length}},insertElementHandler:vl,service:t,language:r})}async function gb({quillEditor:n,service:e,language:t,internalLinkPluginHook:r,value:s,index:i}){const a=await gl({language:t,value:s,internalLinkPluginHook:r});!a||a.action==="remove"||!a.value||_l({editor:n,values:a.value,index:i})}function Qr({editor:n,element:e,data:{values:t,action:r,updateOptions:s},insertElementHandler:i,service:a,language:l}){const c=A.find(e);if(!c||c instanceof A)throw new Error("missing embed blot");const u=n.getIndex(c),f=new G;if(!(u===void 0||u===-1)){if(r==="insert"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l})}else if(r==="update"){if(!t)return;i({editor:n,values:t,service:a,index:u,language:l}),f.retain(u+1),f.delete(s?.textToReplaceLength??1)}else r==="remove"&&(f.retain(u),f.delete(1));n.updateContents(f)}}function pb(n){return"width"in n&&"height"in n}var Js,Ja;function mb(){if(Ja)return Js;Ja=1;function n(m){return m instanceof Map?m.clear=m.delete=m.set=function(){throw new Error("map is read-only")}:m instanceof Set&&(m.add=m.clear=m.delete=function(){throw new Error("set is read-only")}),Object.freeze(m),Object.getOwnPropertyNames(m).forEach((S=>{const $=m[S],re=typeof $;(re==="object"||re==="function")&&!Object.isFrozen($)&&n($)})),m}class e{constructor(S){S.data===void 0&&(S.data={}),this.data=S.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(m){return m.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(m,...S){const $=Object.create(null);for(const re in m)$[re]=m[re];return S.forEach((function(re){for(const Te in re)$[Te]=re[Te]})),$}const s="</span>",i=m=>!!m.scope,a=(m,{prefix:S})=>{if(m.startsWith("language:"))return m.replace("language:","language-");if(m.includes(".")){const $=m.split(".");return[`${S}${$.shift()}`,...$.map(((re,Te)=>`${re}${"_".repeat(Te+1)}`))].join(" ")}return`${S}${m}`};class l{constructor(S,$){this.buffer="",this.classPrefix=$.classPrefix,S.walk(this)}addText(S){this.buffer+=t(S)}openNode(S){if(!i(S))return;const $=a(S.scope,{prefix:this.classPrefix});this.span($)}closeNode(S){i(S)&&(this.buffer+=s)}value(){return this.buffer}span(S){this.buffer+=`<span class="${S}">`}}const c=(m={})=>{const S={children:[]};return Object.assign(S,m),S};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(S){this.top.children.push(S)}openNode(S){const $=c({scope:S});this.add($),this.stack.push($)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(S){return this.constructor._walk(S,this.rootNode)}static _walk(S,$){return typeof $=="string"?S.addText($):$.children&&(S.openNode($),$.children.forEach((re=>this._walk(S,re))),S.closeNode($)),S}static _collapse(S){typeof S!="string"&&S.children&&(S.children.every(($=>typeof $=="string"))?S.children=[S.children.join("")]:S.children.forEach(($=>{u._collapse($)})))}}class f extends u{constructor(S){super(),this.options=S}addText(S){S!==""&&this.add(S)}startScope(S){this.openNode(S)}endScope(){this.closeNode()}__addSublanguage(S,$){const re=S.root;$&&(re.scope=`language:${$}`),this.add(re)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(m){return m?typeof m=="string"?m:m.source:null}function h(m){return _("(?=",m,")")}function g(m){return _("(?:",m,")*")}function y(m){return _("(?:",m,")?")}function _(...m){return m.map(($=>p($))).join("")}function N(m){const S=m[m.length-1];return typeof S=="object"&&S.constructor===Object?(m.splice(m.length-1,1),S):{}}function T(...m){return"("+(N(m).capture?"":"?:")+m.map((re=>p(re))).join("|")+")"}function L(m){return new RegExp(m.toString()+"|").exec("").length-1}function C(m,S){const $=m&&m.exec(S);return $&&$.index===0}const U=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function F(m,{joinWith:S}){let $=0;return m.map((re=>{$+=1;const Te=$;let Ce=p(re),z="";for(;Ce.length>0;){const K=U.exec(Ce);if(!K){z+=Ce;break}z+=Ce.substring(0,K.index),Ce=Ce.substring(K.index+K[0].length),K[0][0]==="\\"&&K[1]?z+="\\"+String(Number(K[1])+Te):(z+=K[0],K[0]==="("&&$++)}return z})).map((re=>`(${re})`)).join(S)}const W=/\b\B/,P="[a-zA-Z]\\w*",ne="[a-zA-Z_]\\w*",ce="\\b\\d+(\\.\\d+)?",pe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",b="\\b(0b[01]+)",x="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",v=(m={})=>{const S=/^#![ ]*\//;return m.binary&&(m.begin=_(S,/.*\b/,m.binary,/\b.*/)),r({scope:"meta",begin:S,end:/$/,relevance:0,"on:begin":($,re)=>{$.index!==0&&re.ignoreMatch()}},m)},I={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[I]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[I]},B={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M=function(m,S,$={}){const re=r({scope:"comment",begin:m,end:S,contains:[]},$);re.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Te=T("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return re.contains.push({begin:_(/[ ]+/,"(",Te,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),re},H=M("//","$"),q=M("/\\*","\\*/"),ee=M("#","$"),J={scope:"number",begin:ce,relevance:0},ie={scope:"number",begin:pe,relevance:0},de={scope:"number",begin:b,relevance:0},X={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[I,{begin:/\[/,end:/\]/,relevance:0,contains:[I]}]},Oe={scope:"title",begin:P,relevance:0},Le={scope:"title",begin:ne,relevance:0},le={begin:"\\.\\s*"+ne,relevance:0};var fe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:I,BINARY_NUMBER_MODE:de,BINARY_NUMBER_RE:b,COMMENT:M,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:H,C_NUMBER_MODE:ie,C_NUMBER_RE:pe,END_SAME_AS_BEGIN:function(m){return Object.assign(m,{"on:begin":(S,$)=>{$.data._beginMatch=S[1]},"on:end":(S,$)=>{$.data._beginMatch!==S[1]&&$.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:P,MATCH_NOTHING_RE:W,METHOD_GUARD:le,NUMBER_MODE:J,NUMBER_RE:ce,PHRASAL_WORDS_MODE:B,QUOTE_STRING_MODE:O,REGEXP_MODE:X,RE_STARTERS_RE:x,SHEBANG:v,TITLE_MODE:Oe,UNDERSCORE_IDENT_RE:ne,UNDERSCORE_TITLE_MODE:Le});function Ee(m,S){m.input[m.index-1]==="."&&S.ignoreMatch()}function ve(m,S){m.className!==void 0&&(m.scope=m.className,delete m.className)}function Ne(m,S){S&&m.beginKeywords&&(m.begin="\\b("+m.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",m.__beforeBegin=Ee,m.keywords=m.keywords||m.beginKeywords,delete m.beginKeywords,m.relevance===void 0&&(m.relevance=0))}function De(m,S){Array.isArray(m.illegal)&&(m.illegal=T(...m.illegal))}function ze(m,S){if(m.match){if(m.begin||m.end)throw new Error("begin & end are not supported with match");m.begin=m.match,delete m.match}}function yn(m,S){m.relevance===void 0&&(m.relevance=1)}const Hn=(m,S)=>{if(!m.beforeMatch)return;if(m.starts)throw new Error("beforeMatch cannot be used with starts");const $=Object.assign({},m);Object.keys(m).forEach((re=>{delete m[re]})),m.keywords=$.keywords,m.begin=_($.beforeMatch,h($.begin)),m.starts={relevance:0,contains:[Object.assign($,{endsParent:!0})]},m.relevance=0,delete $.beforeMatch},fr=["of","and","for","in","not","or","if","then","parent","list","value"],gr="keyword";function Pt(m,S,$=gr){const re=Object.create(null);return typeof m=="string"?Te($,m.split(" ")):Array.isArray(m)?Te($,m):Object.keys(m).forEach((function(Ce){Object.assign(re,Pt(m[Ce],S,Ce))})),re;function Te(Ce,z){S&&(z=z.map((K=>K.toLowerCase()))),z.forEach((function(K){const se=K.split("|");re[se[0]]=[Ce,_n(se[0],se[1])]}))}}function _n(m,S){return S?Number(S):zn(m)?0:1}function zn(m){return fr.includes(m.toLowerCase())}const vn={},Ke=m=>{console.error(m)},Ut=(m,...S)=>{console.log(`WARN: ${m}`,...S)},It=(m,S)=>{vn[`${m}/${S}`]||(console.log(`Deprecated as of ${m}. ${S}`),vn[`${m}/${S}`]=!0)},ut=new Error;function Ft(m,S,{key:$}){let re=0;const Te=m[$],Ce={},z={};for(let K=1;K<=S.length;K++)z[K+re]=Te[K],Ce[K+re]=!0,re+=L(S[K-1]);m[$]=z,m[$]._emit=Ce,m[$]._multi=!0}function Nn(m){if(Array.isArray(m.begin)){if(m.skip||m.excludeBegin||m.returnBegin)throw Ke("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ut;if(typeof m.beginScope!="object"||m.beginScope===null)throw Ke("beginScope must be object"),ut;Ft(m,m.begin,{key:"beginScope"}),m.begin=F(m.begin,{joinWith:""})}}function rt(m){if(Array.isArray(m.end)){if(m.skip||m.excludeEnd||m.returnEnd)throw Ke("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ut;if(typeof m.endScope!="object"||m.endScope===null)throw Ke("endScope must be object"),ut;Ft(m,m.end,{key:"endScope"}),m.end=F(m.end,{joinWith:""})}}function Kn(m){m.scope&&typeof m.scope=="object"&&m.scope!==null&&(m.beginScope=m.scope,delete m.scope)}function Gn(m){Kn(m),typeof m.beginScope=="string"&&(m.beginScope={_wrap:m.beginScope}),typeof m.endScope=="string"&&(m.endScope={_wrap:m.endScope}),Nn(m),rt(m)}function pr(m){function S(z,K){return new RegExp(p(z),"m"+(m.case_insensitive?"i":"")+(m.unicodeRegex?"u":"")+(K?"g":""))}class ${constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(K,se){se.position=this.position++,this.matchIndexes[this.matchAt]=se,this.regexes.push([se,K]),this.matchAt+=L(K)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const K=this.regexes.map((se=>se[1]));this.matcherRe=S(F(K,{joinWith:"|"}),!0),this.lastIndex=0}exec(K){this.matcherRe.lastIndex=this.lastIndex;const se=this.matcherRe.exec(K);if(!se)return null;const Be=se.findIndex(((_t,$e)=>$e>0&&_t!==void 0)),Re=this.matchIndexes[Be];return se.splice(0,Be),Object.assign(se,Re)}}class re{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(K){if(this.multiRegexes[K])return this.multiRegexes[K];const se=new $;return this.rules.slice(K).forEach((([Be,Re])=>se.addRule(Be,Re))),se.compile(),this.multiRegexes[K]=se,se}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(K,se){this.rules.push([K,se]),se.type==="begin"&&this.count++}exec(K){const se=this.getMatcher(this.regexIndex);se.lastIndex=this.lastIndex;let Be=se.exec(K);if(this.resumingScanAtSamePosition()&&!(Be&&Be.index===this.lastIndex)){const Re=this.getMatcher(0);Re.lastIndex=this.lastIndex+1,Be=Re.exec(K)}return Be&&(this.regexIndex+=Be.position+1,this.regexIndex===this.count&&this.considerAll()),Be}}function Te(z){const K=new re;return z.contains.forEach((se=>K.addRule(se.begin,{rule:se,type:"begin"}))),z.terminatorEnd&&K.addRule(z.terminatorEnd,{type:"end"}),z.illegal&&K.addRule(z.illegal,{type:"illegal"}),K}function Ce(z,K){const se=z;if(z.isCompiled)return se;[ve,ze,Gn,Hn].forEach((Re=>Re(z,K))),m.compilerExtensions.forEach((Re=>Re(z,K))),z.__beforeBegin=null,[Ne,De,yn].forEach((Re=>Re(z,K))),z.isCompiled=!0;let Be=null;return typeof z.keywords=="object"&&z.keywords.$pattern&&(z.keywords=Object.assign({},z.keywords),Be=z.keywords.$pattern,delete z.keywords.$pattern),Be=Be||/\w+/,z.keywords&&(z.keywords=Pt(z.keywords,m.case_insensitive)),se.keywordPatternRe=S(Be,!0),K&&(z.begin||(z.begin=/\B|\b/),se.beginRe=S(se.begin),!z.end&&!z.endsWithParent&&(z.end=/\B|\b/),z.end&&(se.endRe=S(se.end)),se.terminatorEnd=p(se.end)||"",z.endsWithParent&&K.terminatorEnd&&(se.terminatorEnd+=(z.end?"|":"")+K.terminatorEnd)),z.illegal&&(se.illegalRe=S(z.illegal)),z.contains||(z.contains=[]),z.contains=[].concat(...z.contains.map((function(Re){return Xt(Re==="self"?z:Re)}))),z.contains.forEach((function(Re){Ce(Re,se)})),z.starts&&Ce(z.starts,K),se.matcher=Te(se),se}if(m.compilerExtensions||(m.compilerExtensions=[]),m.contains&&m.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return m.classNameAliases=r(m.classNameAliases||{}),Ce(m)}function Qt(m){return m?m.endsWithParent||Qt(m.starts):!1}function Xt(m){return m.variants&&!m.cachedVariants&&(m.cachedVariants=m.variants.map((function(S){return r(m,{variants:null},S)}))),m.cachedVariants?m.cachedVariants:Qt(m)?r(m,{starts:m.starts?r(m.starts):null}):Object.isFrozen(m)?r(m):m}var jn="11.10.0";class Jt extends Error{constructor(S,$){super(S),this.name="HTMLInjectionError",this.html=$}}const yt=t,st=r,Ht=Symbol("nomatch"),Tn=7,Rt=function(m){const S=Object.create(null),$=Object.create(null),re=[];let Te=!0;const Ce="Could not find the language '{}', did you forget to load/include a language module?",z={disableAutodetect:!0,name:"Plain text",contains:[]};let K={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:f};function se(R){return K.noHighlightRe.test(R)}function Be(R){let Y=R.className+" ";Y+=R.parentNode?R.parentNode.className:"";const ue=K.languageDetectRe.exec(Y);if(ue){const Ae=ht(ue[1]);return Ae||(Ut(Ce.replace("{}",ue[1])),Ut("Falling back to no-highlight mode for this block.",R)),Ae?ue[1]:"no-highlight"}return Y.split(/\s+/).find((Ae=>se(Ae)||ht(Ae)))}function Re(R,Y,ue){let Ae="",Me="";typeof Y=="object"?(Ae=R,ue=Y.ignoreIllegals,Me=Y.language):(It("10.7.0","highlight(lang, code, ...args) has been deprecated."),It("10.7.0",`Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277`),Me=R,Ae=Y),ue===void 0&&(ue=!0);const tt={code:Ae,language:Me};zt("before:highlight",tt);const ft=tt.result?tt.result:_t(tt.language,tt.code,ue);return ft.code=tt.code,zt("after:highlight",ft),ft}function _t(R,Y,ue,Ae){const Me=Object.create(null);function tt(D,V){return D.keywords[V]}function ft(){if(!te.keywords){xe.addText(Se);return}let D=0;te.keywordPatternRe.lastIndex=0;let V=te.keywordPatternRe.exec(Se),ae="";for(;V;){ae+=Se.substring(D,V.index);const ge=Ve.case_insensitive?V[0].toLowerCase():V[0],qe=tt(te,ge);if(qe){const[Qe,xr]=qe;if(xe.addText(ae),ae="",Me[ge]=(Me[ge]||0)+1,Me[ge]<=Tn&&(sn+=xr),Qe.startsWith("_"))ae+=V[0];else{const Jn=Ve.classNameAliases[Qe]||Qe;je(V[0],Jn)}}else ae+=V[0];D=te.keywordPatternRe.lastIndex,V=te.keywordPatternRe.exec(Se)}ae+=Se.substring(D),xe.addText(ae)}function vt(){if(Se==="")return;let D=null;if(typeof te.subLanguage=="string"){if(!S[te.subLanguage]){xe.addText(Se);return}D=_t(te.subLanguage,Se,!0,Xn[te.subLanguage]),Xn[te.subLanguage]=D._top}else D=An(Se,te.subLanguage.length?te.subLanguage:null);te.relevance>0&&(sn+=D.relevance),xe.__addSublanguage(D._emitter,D.language)}function Ue(){te.subLanguage!=null?vt():ft(),Se=""}function je(D,V){D!==""&&(xe.startScope(V),xe.addText(D),xe.endScope())}function Sn(D,V){let ae=1;const ge=V.length-1;for(;ae<=ge;){if(!D._emit[ae]){ae++;continue}const qe=Ve.classNameAliases[D[ae]]||D[ae],Qe=V[ae];qe?je(Qe,qe):(Se=Qe,ft(),Se=""),ae++}}function xn(D,V){return D.scope&&typeof D.scope=="string"&&xe.openNode(Ve.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(je(Se,Ve.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),Se=""):D.beginScope._multi&&(Sn(D.beginScope,V),Se="")),te=Object.create(D,{parent:{value:te}}),te}function Yn(D,V,ae){let ge=C(D.endRe,ae);if(ge){if(D["on:end"]){const qe=new e(D);D["on:end"](V,qe),qe.isMatchIgnored&&(ge=!1)}if(ge){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return Yn(D.parent,V,ae)}function Ar(D){return te.matcher.regexIndex===0?(Se+=D[0],1):(an=!0,0)}function wr(D){const V=D[0],ae=D.rule,ge=new e(ae),qe=[ae.__beforeBegin,ae["on:begin"]];for(const Qe of qe)if(Qe&&(Qe(D,ge),ge.isMatchIgnored))return Ar(V);return ae.skip?Se+=V:(ae.excludeBegin&&(Se+=V),Ue(),!ae.returnBegin&&!ae.excludeBegin&&(Se=V)),xn(ae,D),ae.returnBegin?0:V.length}function Sr(D){const V=D[0],ae=Y.substring(D.index),ge=Yn(te,D,ae);if(!ge)return Ht;const qe=te;te.endScope&&te.endScope._wrap?(Ue(),je(V,te.endScope._wrap)):te.endScope&&te.endScope._multi?(Ue(),Sn(te.endScope,D)):qe.skip?Se+=V:(qe.returnEnd||qe.excludeEnd||(Se+=V),Ue(),qe.excludeEnd&&(Se=V));do{te.scope&&xe.closeNode(),!te.skip&&!te.subLanguage&&(sn+=te.relevance),te=te.parent}while(te!==ge.parent);return ge.starts&&xn(ge.starts,D),qe.returnEnd?0:V.length}function On(){const D=[];for(let V=te;V!==Ve;V=V.parent)V.scope&&D.unshift(V.scope);D.forEach((V=>xe.openNode(V)))}let rn={};function Qn(D,V){const ae=V&&V[0];if(Se+=D,ae==null)return Ue(),0;if(rn.type==="begin"&&V.type==="end"&&rn.index===V.index&&ae===""){if(Se+=Y.slice(V.index,V.index+1),!Te){const ge=new Error(`0 width match regex (${R})`);throw ge.languageName=R,ge.badRule=rn.rule,ge}return 1}if(rn=V,V.type==="begin")return wr(V);if(V.type==="illegal"&&!ue){const ge=new Error('Illegal lexeme "'+ae+'" for mode "'+(te.scope||"<unnamed>")+'"');throw ge.mode=te,ge}else if(V.type==="end"){const ge=Sr(V);if(ge!==Ht)return ge}if(V.type==="illegal"&&ae==="")return 1;if(Ln>1e5&&Ln>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ae,ae.length}const Ve=ht(R);if(!Ve)throw Ke(Ce.replace("{}",R)),new Error('Unknown language: "'+R+'"');const at=pr(Ve);let ot="",te=Ae||at;const Xn={},xe=new K.__emitter(K);On();let Se="",sn=0,Nt=0,Ln=0,an=!1;try{if(Ve.__emitTokens)Ve.__emitTokens(Y,xe);else{for(te.matcher.considerAll();;){Ln++,an?an=!1:te.matcher.considerAll(),te.matcher.lastIndex=Nt;const D=te.matcher.exec(Y);if(!D)break;const V=Y.substring(Nt,D.index),ae=Qn(V,D);Nt=D.index+ae}Qn(Y.substring(Nt))}return xe.finalize(),ot=xe.toHTML(),{language:R,value:ot,relevance:sn,illegal:!1,_emitter:xe,_top:te}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:R,value:yt(Y),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:Nt,context:Y.slice(Nt-100,Nt+100),mode:D.mode,resultSoFar:ot},_emitter:xe};if(Te)return{language:R,value:yt(Y),illegal:!1,relevance:0,errorRaised:D,_emitter:xe,_top:te};throw D}}function $e(R){const Y={value:yt(R),illegal:!1,relevance:0,_top:z,_emitter:new K.__emitter(K)};return Y._emitter.addText(R),Y}function An(R,Y){Y=Y||K.languages||Object.keys(S);const ue=$e(R),Ae=Y.filter(ht).filter(Zn).map((Ue=>_t(Ue,R,!1)));Ae.unshift(ue);const Me=Ae.sort(((Ue,je)=>{if(Ue.relevance!==je.relevance)return je.relevance-Ue.relevance;if(Ue.language&&je.language){if(ht(Ue.language).supersetOf===je.language)return 1;if(ht(je.language).supersetOf===Ue.language)return-1}return 0})),[tt,ft]=Me,vt=tt;return vt.secondBest=ft,vt}function mr(R,Y,ue){const Ae=Y&&$[Y]||ue;R.classList.add("hljs"),R.classList.add(`language-${Ae}`)}function wn(R){let Y=null;const ue=Be(R);if(se(ue))return;if(zt("before:highlightElement",{el:R,language:ue}),R.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",R);return}if(R.children.length>0&&(K.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(R)),K.throwUnescapedHTML))throw new Jt("One of your code blocks includes unescaped HTML.",R.innerHTML);Y=R;const Ae=Y.textContent,Me=ue?Re(Ae,{language:ue,ignoreIllegals:!0}):An(Ae);R.innerHTML=Me.value,R.dataset.highlighted="yes",mr(R,ue,Me.language),R.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(R.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),zt("after:highlightElement",{el:R,result:Me,text:Ae})}function br(R){K=st(K,R)}const Er=()=>{en(),It("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ge(){en(),It("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Vn=!1;function en(){if(document.readyState==="loading"){Vn=!0;return}document.querySelectorAll(K.cssSelector).forEach(wn)}function yr(){Vn&&en()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",yr,!1);function _r(R,Y){let ue=null;try{ue=Y(m)}catch(Ae){if(Ke("Language definition for '{}' could not be registered.".replace("{}",R)),Te)Ke(Ae);else throw Ae;ue=z}ue.name||(ue.name=R),S[R]=ue,ue.rawDefinition=Y.bind(null,m),ue.aliases&&Wn(ue.aliases,{languageName:R})}function vr(R){delete S[R];for(const Y of Object.keys($))$[Y]===R&&delete $[Y]}function Ye(){return Object.keys(S)}function ht(R){return R=(R||"").toLowerCase(),S[R]||S[$[R]]}function Wn(R,{languageName:Y}){typeof R=="string"&&(R=[R]),R.forEach((ue=>{$[ue.toLowerCase()]=Y}))}function Zn(R){const Y=ht(R);return Y&&!Y.disableAutodetect}function Nr(R){R["before:highlightBlock"]&&!R["before:highlightElement"]&&(R["before:highlightElement"]=Y=>{R["before:highlightBlock"](Object.assign({block:Y.el},Y))}),R["after:highlightBlock"]&&!R["after:highlightElement"]&&(R["after:highlightElement"]=Y=>{R["after:highlightBlock"](Object.assign({block:Y.el},Y))})}function Tr(R){Nr(R),re.push(R)}function tn(R){const Y=re.indexOf(R);Y!==-1&&re.splice(Y,1)}function zt(R,Y){const ue=R;re.forEach((function(Ae){Ae[ue]&&Ae[ue](Y)}))}function nn(R){return It("10.7.0","highlightBlock will be removed entirely in v12.0"),It("10.7.0","Please use highlightElement now."),wn(R)}Object.assign(m,{highlight:Re,highlightAuto:An,highlightAll:en,highlightElement:wn,highlightBlock:nn,configure:br,initHighlighting:Er,initHighlightingOnLoad:Ge,registerLanguage:_r,unregisterLanguage:vr,listLanguages:Ye,getLanguage:ht,registerAliases:Wn,autoDetection:Zn,inherit:st,addPlugin:Tr,removePlugin:tn}),m.debugMode=function(){Te=!1},m.safeMode=function(){Te=!0},m.versionString=jn,m.regex={concat:_,lookahead:h,either:T,optional:y,anyNumberOfTimes:g};for(const R in fe)typeof fe[R]=="object"&&n(fe[R]);return Object.assign(m,fe),m},dt=Rt({});return dt.newInstance=()=>Rt({}),Js=dt,dt.HighlightJS=dt,dt.default=dt,Js}var bb=mb();const He=Ii(bb);function Eb(n){const e=n.regex,t={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},i=n.inherit(n.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=n.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),y={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],N=["true","false"],T={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],U=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],F=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:N,built_in:[...L,...C,"set","shopt",...U,...F]},contains:[g,n.SHEBANG(),y,p,i,a,T,l,c,u,f,t]}}function yb(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",N={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:T.concat([{begin:/\(/,end:/\)/,keywords:N,contains:T.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:g,returnBegin:!0,contains:[n.inherit(h,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(L,C,T,[p,{begin:n.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:N}}}function _b(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+r+"|"+e.optional(s)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},n.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},h={className:"title",begin:e.optional(s)+n.IDENT_RE,relevance:0},g=e.optional(s)+n.IDENT_RE+"\\s*\\(",y=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],U={type:_,keyword:y,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},F={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},W=[F,p,l,t,n.C_BLOCK_COMMENT_MODE,f,u],P={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:U,contains:W.concat([{begin:/\(/,end:/\)/,keywords:U,contains:W.concat(["self"]),relevance:0}]),relevance:0},ne={className:"function",begin:"("+a+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:U,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:U,relevance:0},{begin:g,returnBegin:!0,contains:[h],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,u,f,l,{begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,u,f,l]}]},l,t,n.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:U,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(P,ne,F,W,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:U,contains:["self",l]},{begin:n.IDENT_RE+"::",keywords:U},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function vb(n){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],i=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(i),built_in:e,literal:r},l=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=n.inherit(f,{illegal:/\n/}),h={className:"subst",begin:/\{/,end:/\}/,keywords:a},g=n.inherit(h,{illegal:/\n/}),y={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,g]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},h]},N=n.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},g]});h.contains=[_,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.C_BLOCK_COMMENT_MODE],g.contains=[N,y,p,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,c,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[u,_,y,f,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},L={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},C=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",U={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},T,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,L,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,L,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+C+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,L],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[T,c,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},U]}}const Nb=n=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:n.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Tb=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Ab=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],wb=[...Tb,...Ab],Sb=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xb=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Ob=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Lb=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();function Cb(n){const e=n.regex,t=Nb(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",i=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,r,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+xb.join("|")+")"},{begin:":(:)?("+Ob.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Lb.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Sb.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+wb.join("|")+")\\b"}]}}var ir="[0-9](_*[0-9])*",hs=`\\.(${ir})`,fs="[0-9a-fA-F](_*[0-9a-fA-F])*",eo={className:"number",variants:[{begin:`(\\b(${ir})((${hs})|\\.)?|(${hs}))[eE][+-]?(${ir})[fFdD]?\\b`},{begin:`\\b(${ir})((${hs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${hs})[fFdD]?\\b`},{begin:`\\b(${ir})[fFdD]\\b`},{begin:`\\b0[xX]((${fs})\\.?|(${fs})?\\.(${fs}))[pP][+-]?(${ir})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${fs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wl(n,e,t){return t===-1?"":n.replace(e,(r=>wl(n,e,t-1)))}function Ib(n){const e=n.regex,t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=t+wl("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},f={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[n.BACKSLASH_ESCAPE]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[e.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[f,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",n.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,eo,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},eo,u]}}const to="[A-Za-z$_][0-9A-Za-z$_]*",Rb=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],kb=["true","false","null","undefined","NaN","Infinity"],Sl=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ol=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Mb=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Db=[].concat(Ol,Sl,xl);function Bb(n){const e=n.regex,t=(M,{after:H})=>{const q="</"+M[0].slice(1);return M.input.indexOf(q,H)!==-1},r=to,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const q=M[0].length+M.index,ee=M.input[q];if(ee==="<"||ee===","){H.ignoreMatch();return}ee===">"&&(t(M,{after:q})||H.ignoreMatch());let J;const ie=M.input.substring(q);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:to,keyword:Rb,literal:kb,built_in:Db,"variable.language":Mb},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},C=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,{match:/\$\d+/},p];h.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const U=[].concat(L,h.contains),F=U.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(U)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:F},P={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Sl,...xl]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,x([...Ol,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,L,{match:/\$\d+/},p,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},v,b,P,k,{match:/\$[(.]/}]}}function qb(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,s,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function $b(n){const e=n.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=n.inherit(u,{contains:[]}),h=n.inherit(f,{contains:[]});u.contains.push(h),f.contains.push(p);let g=[t,c];return[u,f,p,h].forEach((T=>{T.contains=T.contains.concat(g)})),g=g.concat(u,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:g}]}]},t,i,u,f,{className:"quote",begin:"^>\\s+",contains:g,end:"$"},s,r,c,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Pb(n){const e=n.regex,t=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),s=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i={scope:"variable",match:"\\$+"+r},a={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=n.inherit(n.APOS_STRING_MODE,{illegal:null}),u=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(l)}),f={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(v,I)=>{I.data._beginMatch=v[1]||v[2]},"on:end":(v,I)=>{I.data._beginMatch!==v[1]&&I.ignoreMatch()}},p=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h=`[ \t\n]`,g={scope:"string",variants:[u,c,f,p]},y={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},_=["false","null","true"],N=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],T=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:N,literal:(v=>{const I=[];return v.forEach((k=>{I.push(k),k.toLowerCase()===k?I.push(k.toUpperCase()):I.push(k.toLowerCase())})),I})(_),built_in:T},U=v=>v.map((I=>I.replace(/\|\d+$/,""))),F={variants:[{match:[/new/,e.concat(h,"+"),e.concat("(?!",U(T).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},W=e.concat(r,"\\b(?!\\()"),P={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),W],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,e.concat(/::/,e.lookahead(/(?!class\b)/)),W],scope:{1:"title.class",3:"variable.constant"}},{match:[s,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},ne={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},ce={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[ne,i,P,n.C_BLOCK_COMMENT_MODE,g,y,F]},pe={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",U(N).join("\\b|"),"|",U(T).join("\\b|"),"\\b)"),r,e.concat(h,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[ce]};ce.contains.push(pe);const b=[ne,P,n.C_BLOCK_COMMENT_MODE,g,y,F],x={begin:e.concat(/#\[\s*/,s),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:_,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:_,keyword:["new","array"]},contains:["self",...b]},...b,{scope:"meta",match:s}]};return{case_insensitive:!1,keywords:C,contains:[x,n.HASH_COMMENT_MODE,n.COMMENT("//","$"),n.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:n.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},a,{scope:"variable.language",match:/\$this\b/},i,pe,P,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},F,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},n.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",i,P,n.C_BLOCK_COMMENT_MODE,g,y]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},n.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[n.inherit(n.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},n.UNDERSCORE_TITLE_MODE]},g,y]}}function Ub(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Fb(n){const e=n.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},p={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,c,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,c,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[n.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,f,u]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},h="[0-9](_?[0-9])*",g=`(\\b(${h}))?\\.(${h})|\\b(${h})\\.`,y=`\\b|${r.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${h})|(${g}))[eE][+-]?(${h})[jJ]?(?=${y})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${y})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${y})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${y})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${y})`},{begin:`\\b(${h})[jJ](?=${y})`}]},N={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},T={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,_,p,n.HASH_COMMENT_MODE]}]};return u.contains=[p,_,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,N,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[T]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,T,p]}]}}function Hb(n){const e=n.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=e.concat(r,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[n.COMMENT("#","$",{contains:[l]}),n.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:a},p={className:"string",contains:[n.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[n.BACKSLASH_ESCAPE,f]})]}]},h="[1-9](_?[0-9])*|0",g="[0-9](_?[0-9])*",y={className:"number",relevance:0,variants:[{begin:`\\b(${h})(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},W=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},y,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);f.contains=W,_.contains=W;const pe=[{begin:/^\s*=>/,starts:{end:"$",contains:W}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:W}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(pe).concat(u).concat(W)}}function zb(n){const e=n.regex,t=/(r#)?/,r=e.concat(t,n.UNDERSCORE_IDENT_RE),s=e.concat(t,n.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,e.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:n.IDENT_RE+"!?",type:f,keyword:l,literal:c,built_in:u},illegal:"</",contains:[n.C_LINE_COMMENT_MODE,n.COMMENT("/\\*","\\*/",{contains:["self"]}),n.inherit(n.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:n.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:f}},{className:"punctuation",begin:"->"},i]}}function Kb(n){const e=n.regex,t=n.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},s={begin:/"/,end:/"/,contains:[{begin:/""/}]},i=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],h=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],g=f,y=[...u,...c].filter((C=>!f.includes(C))),_={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},N={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},T={begin:e.concat(/\b/,e.either(...g),/\s*\(/),relevance:0,keywords:{built_in:g}};function L(C,{exceptions:U,when:F}={}){const W=F;return U=U||[],C.map((P=>P.match(/\|\d+$/)||U.includes(P)?P:W(P)?`${P}|0`:P))}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:L(y,{when:C=>C.length<3}),literal:i,type:l,built_in:p},contains:[{begin:e.either(...h),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:y.concat(h),literal:i,type:l}},{className:"type",begin:e.either(...a)},T,_,r,s,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,N]}}const As="[A-Za-z$_][0-9A-Za-z$_]*",Ll=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Cl=["true","false","null","undefined","NaN","Infinity"],Il=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Rl=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],kl=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ml=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Dl=[].concat(kl,Il,Rl);function Gb(n){const e=n.regex,t=(M,{after:H})=>{const q="</"+M[0].slice(1);return M.input.indexOf(q,H)!==-1},r=As,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,H)=>{const q=M[0].length+M.index,ee=M.input[q];if(ee==="<"||ee===","){H.ignoreMatch();return}ee===">"&&(t(M,{after:q})||H.ignoreMatch());let J;const ie=M.input.substring(q);if(J=ie.match(/^\s*=/)){H.ignoreMatch();return}if((J=ie.match(/^\s+extends\s+/))&&J.index===0){H.ignoreMatch();return}}},l={$pattern:As,keyword:Ll,literal:Cl,built_in:Dl,"variable.language":Ml},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},h={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"xml"}},y={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,h],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,h]},L={className:"comment",variants:[n.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),n.C_BLOCK_COMMENT_MODE,n.C_LINE_COMMENT_MODE]},C=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,{match:/\$\d+/},p];h.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const U=[].concat(L,h.contains),F=U.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(U)}]),W={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:F},P={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,e.concat(r,"(",e.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},ne={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Il,...Rl]}},ce={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},pe={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[W],illegal:/%/},b={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function x(M){return e.concat("(?!",M.join("|"),")")}const v={match:e.concat(/\b/,x([...kl,"super","import"].map((M=>`${M}\\s*\\(`))),r,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},W]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[W]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:F,CLASS_REFERENCE:ne},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),ce,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,g,y,_,N,L,{match:/\$\d+/},p,ne,{className:"attr",begin:r+e.lookahead(":"),relevance:0},B,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[L,n.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:F}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:i},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},pe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[W,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[W]},v,b,P,k,{match:/\$[(.]/}]}}function jb(n){const e=Gb(n),t=As,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,n.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:As,keyword:Ll.concat(l),literal:Cl,built_in:Dl.concat(r),"variable.language":Ml},u={className:"meta",begin:"@"+t},f=(g,y,_)=>{const N=g.contains.findIndex((T=>T.label===y));if(N===-1)throw new Error("can not find mode to replace");g.contains.splice(N,1,_)};Object.assign(e.keywords,c),e.exports.PARAMS_CONTAINS.push(u);const p=e.contains.find((g=>g.className==="attr"));e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,p]),e.contains=e.contains.concat([u,s,i]),f(e,"shebang",n.SHEBANG()),f(e,"use_strict",a);const h=e.contains.find((g=>g.label==="func.def"));return h.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}function Vb(n){const e=n.regex,t=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=n.inherit(i,{begin:/\(/,end:/\)/}),l=n.inherit(n.APOS_STRING_MODE,{className:"string"}),c=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,c,l,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,a,c,l]}]}]},n.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(/</,e.lookahead(e.concat(t,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Wb(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/\w[\w :()\./-]*:(?=[ \t]|$)/},{begin:/"\w[\w :()\./-]*":(?=[ \t]|$)/},{begin:/'\w[\w :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,s]},a=n.inherit(i,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},y={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},_=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+n.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+n.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},n.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},p,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},g,y,i],N=[..._];return N.pop(),N.push(a),h.contains=N,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:_}}He.registerLanguage("bash",Eb);He.registerLanguage("c",yb);He.registerLanguage("cpp",_b);He.registerLanguage("cs",vb);He.registerLanguage("css",Cb);He.registerLanguage("java",Ib);He.registerLanguage("javascript",Bb);He.registerLanguage("json",qb);He.registerLanguage("markdown",$b);He.registerLanguage("plain",Ub);He.registerLanguage("php",Pb);He.registerLanguage("python",Fb);He.registerLanguage("sql",Kb);He.registerLanguage("typescript",jb);He.registerLanguage("ruby",Hb);He.registerLanguage("rust",zb);He.registerLanguage("xml",Vb);He.registerLanguage("yaml",Wb);const Zb=[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"c",label:"C"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"json",label:"JSON"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"sql",label:"SQL"},{key:"typescript",label:"TypeScript"},{key:"ruby",label:"Ruby"},{key:"rust",label:"Rust"},{key:"xml",label:"HTML/XML"},{key:"yaml",label:"YAML"}];var Yb=be("<button type=button><span class=QpTooltip-text>");function gs({children:n,btnClass:e,tooltipText:t,btnText:r}){return(()=>{var s=Yb(),i=s.firstChild;return ei(s,`QpTooltip ${e}`),he(s,n,i),he(s,r,i),he(i,t),s})()}var Qb=be("<button type=button class=ql-code>"),Xb=be("<button type=button class=ql-code-block>"),Jb=be('<span class="pi pi-hashtag">'),e1=be('<span class="pi pi-pencil">'),t1=be('<div><select class=ql-header><option value=2></option><option value=3></option><option value=4></option><option value=""selected></option></select><button type=button class=ql-bold></button><button type=button class=ql-italic></button><button type=button class=ql-strike></button><button type=button class=ql-blockquote></button><button type=button class=ql-list value=ordered></button><button type=button class=ql-list value=bullet></button><button type=button class=ql-link></button><select class=ql-align><option value=""selected></option><option value=center></option><option value=right></option></select><select class=ql-size><option value=small></option><option value=""selected></option><option value=large></option><option value=huge></option></select><button type=button class=ql-clean>'),n1=be('<span class="pi pi-youtube">'),r1=be('<span class="pi pi-link">');function s1({language:n,configuration:e,videoPluginHook:t,internalLinkPluginHook:r}){const{t:s}=En(n),i=[Qb(),(()=>{var a=Xb();return a.style.setProperty("border","1px dotted #999"),a})()];return(()=>{var a=t1(),l=a.firstChild,c=l.nextSibling,u=c.nextSibling,f=u.nextSibling,p=f.nextSibling,h=p.nextSibling,g=h.nextSibling,y=g.nextSibling,_=y.nextSibling,N=_.nextSibling,T=N.nextSibling;return he(a,(()=>e?.code&&i),_),he(a,Mt(gs,{btnClass:"ql-html-snippet",get tooltipText(){return s("CustomToolbar.insertHtmlSnippetMessage")},get children(){return Jb()}}),T),he(a,Mt(gs,{btnClass:"ql-obfuscate",get tooltipText(){return s("CustomToolbar.obfuscate")},get children(){return e1()}}),T),he(a,t&&Mt(gs,{btnClass:"ql-video-plugin",get tooltipText(){return s("videoPlugin.insertVideo")},get children(){return n1()}}),T),he(a,r&&Mt(gs,{btnClass:"ql-internal-link-plugin",get tooltipText(){return s("internalLinkPlugin.insertLink")},get children(){return r1()}}),T),a})()}var i1=be("<div>"),a1=be("<div class=QuillEditor>");function o1({onSetQuillInst:n,language:e,setValue:t,value:r,service:s,insertMedia:i,videoPluginHook:a,internalLinkPluginHook:l}){const{t:c}=En(e),u=s.configuration,p=s.fieldType.backOffice?.editorRows??26,h=s1({language:e,configuration:u,videoPluginHook:a,internalLinkPluginHook:l}),g=(()=>{var _=i1();return`calc(${p}rem + 24px)`!=null?_.style.setProperty("height",`calc(${p}rem + 24px)`):_.style.removeProperty("height"),_})();async function y(_,N){if(!s.uploadMedia)return;const T=N.toBlob(),L=new File([T],`${c("image")}-${(new Date).getTime()}.${_.split("/")[1]}`,{type:_}),C=await s.uploadMedia(L);C&&i(C)}return Bl((()=>{A.register("modules/imageDropAndPaste",Ms,!0);const _=new A(g,{modules:{toolbar:h,syntax:u.code?{hljs:He,languages:Zb,interval:1e3}:!1,imageDropAndPaste:{handler:(T,L,C)=>{y(L,C).catch(s.logger.error)}}},theme:"snow"});_.on("text-change",((T,L,C)=>{C==="user"&&T.ops.forEach((async U=>{if(U.insert&&typeof U.insert=="string"){const F=U.insert;if(!a?.recognizeUrl(F))return;const P=Ei(_);await Al({editorContent:P,quillEditor:_,service:s,language:e,videoPluginHook:a,value:F})}}))})),n(_),_.on("text-change",((T,L)=>{const C={delta:_.getContents(),html:_.getSemanticHTML()};t(C)}));const N=r();N&&_.setContents(N.delta??new G)})),(()=>{var _=a1();return he(_,h,null),he(_,g,null),_})()}function no(n){if(n===void 0)return{};const e=Yp(n);return{handle:Vp(e.handle),delta:e.delta}}function l1(){const n={videoPlugin:void 0,internalLinkPlugin:void 0};return{get videoPlugin(){return n.videoPlugin},get internalLinkPlugin(){return n.internalLinkPlugin},service:{registerVideoPlugin(e){if(n.videoPlugin)throw new Error("Video plugin already registered");n.videoPlugin=e},registerInternalLinkPlugin(e){if(n.internalLinkPlugin)throw new Error("Internal link plugin already registered");n.internalLinkPlugin=e}}}}const c1=A.import("blots/block/embed");function u1(){return class extends c1{static blotName="html-snippet";static tagName="BUTTON";static className="HtmlSnippet";static create(e){const t=super.create(e);return t.innerText="<HTML>",e.html&&t.setAttribute("data-html",e.html),t}static value(e){const{html:t}=e.dataset;return{html:t}}}}const d1=A.import("blots/block/embed"),ro=["alt","height","width"];function h1({publicSiteUrl:n}){return class extends d1{static blotName="img";static tagName="figure";static create(s){const i=super.create(s);i.classList.add("Img"),i.setAttribute("contenteditable","false");const a=document.createElement("img");if(s.src&&a.setAttribute("src",e(s.src)),s.width&&a.setAttribute("width",String(s.width)),s.height&&a.setAttribute("height",String(s.height)),a.classList.add("Img-image"),s.align){const l=ab(s.align);l&&i.classList.add(l)}return s.zoom==="none"?i.setAttribute("data-zoom","none"):i.classList.add("zoomable"),s.href&&(i.setAttribute("data-href",s.href),i.classList.add("asLink")),s.uid&&(i.setAttribute("data-uid",s.uid),s.variant&&i.setAttribute("data-variant",s.variant??"")),i.appendChild(a),i}static formats(s){return ro.reduce(((i,a)=>(s.hasAttribute(a)&&(i[a]=s.getAttribute(a)),i)),{})}static match(s){return/\.(jpe?g|gif|png|webp)$/.test(s)||/^data:image\/.+;base64/.test(s)}static value(s){const i=s.querySelector(".Img-image");if(!i)throw new Error("missing img node");const{uid:a,variant:l}=s.dataset;if(!a)throw new Error("missing uid");const c=i.getAttribute("src")||void 0,u=i.getAttribute("width")||void 0,f=u===void 0?void 0:Number(u),p=i.getAttribute("height")||void 0,h=p===void 0?void 0:Number(p),g=Nl(s),y=s.dataset.zoom==="none"?"none":void 0,_=s.dataset.href?s.dataset.href:void 0;return{uid:a,src:c?t(c):void 0,width:f,height:h,align:g,variant:l,zoom:y,href:_}}format(s,i){ro.indexOf(s)>-1?i?this.domNode.setAttribute(s,i):this.domNode.removeAttribute(s):super.format(s,i)}};function e(r){return r.startsWith("/")?`${n}${r}`:f1(r)}function t(r){return r.startsWith(n)?r.substring(n.length):r}}function f1(n){return g1(n,["http","https","data"])?n:"//:0"}function g1(n,e){const t=document.createElement("a");t.href=n;const r=t.href.slice(0,t.href.indexOf(":"));return e.indexOf(r)>-1}const p1=A.import("blots/inline");function m1(n){return class extends p1{static blotName="internal-link-plugin";static tagName="SPAN";static className="InternalLinkPlugin";static create(t){const r=super.create(t);return n?.getDocumentTitle(t).then((s=>{r.innerHTML=`${s}`})),t&&r.setAttribute("data-document-id",t),r.setAttribute("contenteditable","false"),r}static formats(t){const{documentId:r}=t.dataset;return r}}}const b1=A.import("blots/inline");function E1(){return class extends b1{static blotName="obfuscate";static tagName="SPAN";static className="ObfuscateBlot";static create(e){const t=super.create();return t.setAttribute("data-as-a-link",e),t}static formats(e){const{asALink:t}=e.dataset;if(!t)throw new Error("No data attribute data-as-a-link");return ml(t)}}}const y1=A.import("blots/block/embed");function _1(n){return class extends y1{static blotName="video-plugin";static tagName="DIV";static className="VideoPlugin";static create(t){const r=super.create(t),s=n?.getThumbnailUrl(t);return r.style.backgroundImage=`url(${s})`,r.classList.add("VideoPlugin"),r.innerHTML='<span class="pi pi-youtube VideoPlugin-playButton"></span>',t&&r.setAttribute("data-video-id",t),r.querySelector("span")?.addEventListener("click",(()=>{r.dispatchEvent(new CustomEvent("click",{bubbles:!0}))})),r}static value(t){const{videoId:r}=t.dataset;return r}}}function v1({publicSiteUrl:n,videoPluginHook:e,internalLinkPluginHook:t}){A.register("formats/img",h1({publicSiteUrl:n}),!0),A.register("formats/html-snippet",u1(),!0),A.register("formats/obfuscate",E1(),!0),A.register("formats/video-plugin",_1(e),!0),A.register("formats/internal-link-plugin",m1(t),!0)}const U1={create:T1,init:N1},jt=l1();function N1(n){const e=`${n.pluginBaseUrl}/bo-plugin.css`,t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t),n.registerHook("htmlEditorServiceProvider",(()=>jt.service))}function T1(n){if(n.fieldType.dataType!=="quillDelta")throw new Error(`data type '${n.fieldType.dataType}' is incompatible, should be 'quillDelta'`);return ql((e=>{const[t,r]=lt(no(n.initialValue)),[s,i]=lt(n.language),[a,l]=lt();v1({publicSiteUrl:n.publicSiteUrl,videoPluginHook:jt.videoPlugin,internalLinkPluginHook:jt.internalLinkPlugin});let c;ps((()=>{if(!a())return;const f=db({quillEditor:a(),service:n,language:s,videoPluginHook:jt.videoPlugin,internalLinkPluginHook:jt.internalLinkPlugin});c=f.insertMedia;const p=a();if(!p)return;const h=p.getModule("toolbar");h.addHandler("html-snippet",f.insertHtmlSnippetHandler),h.addHandler("obfuscate",f.insertObfuscateBlotHandler),h.addHandler("video-plugin",f.insertVideoHandler),h.addHandler("internal-link-plugin",f.insertInternalLinkHandler);const g=p.root,y=_=>u(_,p,n.themeConf);g.addEventListener("click",y),$l((()=>g.removeEventListener("click",y)))}));const u=async(f,p,h)=>{const g=f.target;g.classList.contains("Img-image")&&(f.stopPropagation(),g.closest(".Img").click()),g.tagName==="FIGURE"&&await ub({editor:p,themeConf:h,service:n,element:g,language:s}),g.tagName==="BUTTON"&&g.classList.contains("HtmlSnippet")&&await ob({language:s,editor:p,service:n,htmlSnippetBtn:g}),g.tagName==="SPAN"&&g.classList.contains("ObfuscateBlot")&&await Tl({language:s,editor:p,service:n,obfuscatorSpan:g}),g.tagName==="DIV"&&g.classList.contains("VideoPlugin")&&await cb({editor:p,videoElement:g,language:s,service:n,videoPluginHook:jt.videoPlugin}),g.tagName==="SPAN"&&g.classList.contains("InternalLinkPlugin")&&await lb({editor:p,internalLinkElement:g,language:s,service:n,internalLinkPluginHook:jt.internalLinkPlugin})};return{element:Mt(o1,{language:s,onSetQuillInst:f=>{l(f)},value:t,setValue:f=>{const p=t()?.delta;r(f),A1(f.delta,p)||n.setModifiedValue(f)},service:n,get videoPluginHook(){return jt.videoPlugin},get internalLinkPluginHook(){return jt.internalLinkPlugin},insertMedia:f=>c?.(f)}),setValue:f=>r(no(f)),setLanguage:i,getValue:t,dispose:e,insertMedia:f=>c?.(f)}}))}function A1(n,e){return!n||!e?n===e:JSON.stringify(n)===JSON.stringify(e)}export{U1 as default};
|