4a5feb12465f66947af2f40a4785344e/******/////*///// 请勿使用非法用途


过安全狗、云锁、阿里云、360、护卫神、D盾、百度云、各种杀软!

iamH4CKEERRRRRRRRRRRS

I am a hacker in the dark of a very cold night

path :/home/drive/domains/drive.vcenetwork.com/public_html/public

upload file:

List of files:

name file size edit permission action
.htaccess1125 KBFebruary 26 2023 04:58:260644
1.zip1856 KBMay 26 2025 03:52:060644
arl.txt1 KBMay 26 2025 03:58:190644
build-August 19 2024 20:27:470755
cabs.jpg.phtml34996 KBMay 25 2025 13:50:430644
cool30203 KBMay 26 2025 03:49:270644
cool.php44 KBMay 26 2025 03:50:140644
favicon-May 26 2025 07:38:380755
favicon.ico502 KBAugust 19 2024 21:12:300644
htaccess.example1125 KBMay 20 2024 07:03:520755
images-August 19 2024 20:27:470755
index.php1949 KBMay 20 2024 07:03:520755
install_files-July 31 2023 19:05:060755
invoice.css99133 KBMay 20 2024 07:03:520644
manifest.json1055 KBAugust 19 2024 21:25:160644
robots.txt1154 KBJune 07 2025 12:24:520755
storage-May 25 2025 13:49:550755
style.php26 KBMay 26 2025 03:52:280644
swagger.yaml33646 KBMay 20 2024 07:03:520755
web.config914 KBMay 20 2024 07:03:520755
import{R as Pr,cp as Ju,j as J,af as Ai,a as m,r as fe,cr as Zu,ce as ju,u as Xu,c as Se,w as Qu,B as St,T as X,G as ed,L as td,J as dl,d as Ro,g as De,t as Ci,q as Ks,n as fl,D as hl,o as pl,p as gl,F as ml,W as zr,ap as nd,I as re,U as bl,cF as rd,cG as id,cH as sd,aN as wi,aO as xi,cj as od,bI as ad,K as ld,m as Sr,e as El,A as cd,l as ud,X as dd,aB as fd,v as yl,ah as Vs,H as hd,a9 as pd,az as gd,cI as md}from"./main.fcd554a6.js";import{a as bd}from"./format.eba72cc5.js";import{E as Ed}from"./Edit.5be662f9.js";import{L as Sl,M as yd}from"./file-entry-index-filters.398da9db.js";import{D as Sd,A as Dd,C as _d,u as Nd}from"./admin-routes.80e2a08a.js";import{A as kd}from"./ArrowBack.953d9159.js";import{U as Ad,R as Cd,C as Dl,F as wd,a as xd,b as Td,c as vd,d as Md,I as Od,e as Rd,H as Id,S as Ld,P as Bd,N as Fd,f as Pd,g as zd,h as Ud,i as $d,j as Hd,k as Kd,l as Vd,m as Wd,n as Gd}from"./UnfoldLess.0d39fb88.js";import{U as qd}from"./UnfoldMore.a50d7b82.js";import"./use-resume-subscription.c9b7d602.js";function Ae(n){this.content=n}Ae.prototype={constructor:Ae,find:function(n){for(var e=0;e>1}};Ae.from=function(n){if(n instanceof Ae)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ae(e)};function _l(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=_l(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Nl(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;ce&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{a.isText?(s+=a.text.slice(Math.max(e,l)-l,t-l),o=!r):a.isLeaf?(i?s+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(s+=a.type.spec.leafText(a)),o=!r):!o&&a.isBlock&&(s+=r,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new A(r,i)}cutByIndex(e,t){return e==t?A.empty:e==0&&t==this.content.length?this:new A(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new A(i,s)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Dr(r+1,o):Dr(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return A.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}}te.none=[];class $r extends Error{}class R{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Al(this.content,e+this.openStart,t);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,t){return new R(kl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return R.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(A.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new R(e,r,i)}}R.empty=new R(A.empty,0,0);function kl(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(kl(s.content,e-i-1,t-i-1)))}function Al(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),o=n.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let a=Al(o.content,e-s-1,t);return a&&n.replaceChild(i,o.copy(a))}function Yd(n,e,t){if(t.openStart>n.depth)throw new $r("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new $r("Inconsistent open depths");return Cl(n,e,t,0)}function Cl(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function tr(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Zt(n.nodeAfter,r),s++));for(let a=s;ai&&_s(n,e,i+1),o=r.depth>i&&_s(t,r,i+1),a=[];return tr(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(wl(s,o),Zt(jt(s,xl(n,e,t,r,i+1)),a)):(s&&Zt(jt(s,Hr(n,e,i+1)),a),tr(e,t,i,a),o&&Zt(jt(o,Hr(t,r,i+1)),a)),tr(r,null,i,a),new A(a)}function Hr(n,e,t){let r=[];if(tr(null,n,t,r),n.depth>t){let i=_s(n,e,t+1);Zt(jt(i,Hr(n,e,t+1)),r)}return tr(e,null,t,r),new A(r)}function Jd(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(A.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class cr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Kr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new cr(t,r,s)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Tl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=A.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=A.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}}ft.prototype.text=void 0;class Vr extends ft{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Tl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Vr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Tl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Xd(e,t);if(r.next==null)return nn.empty;let i=vl(r);r.next&&r.err("Unexpected trailing text");let s=of(sf(i));return af(s,r),s}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return s}).join(` `)}}nn.empty=new nn(!0);class Xd{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function vl(n){let e=[];do e.push(Qd(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Qd(n){let e=[];do e.push(ef(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ef(n){let e=rf(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=tf(n,e);else break;return e}function Io(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function tf(n,e){let t=Io(n),r=t;return n.eat(",")&&(n.next!="}"?r=Io(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function nf(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function rf(n){if(n.eat("(")){let e=vl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=nf(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function sf(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c{n[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new nn(r.indexOf(n.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[s]=new Wr(s,t,o));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class lf{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ti{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Il(i.attrs),this.excluded=null;let s=Ol(this.attrs);this.instance=s?new te(this,s):null}create(e=null){return!e&&this.instance?this.instance:new te(this,Rl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Ti(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class cf{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ae.from(e.nodes),t.marks=Ae.from(e.marks||{}),this.nodes=Wr.compile(this.spec.nodes,this),this.marks=Ti.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;s.contentMatch=r[o]||(r[o]=nn.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=a=="_"?null:a?Bo(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Bo(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Wr){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Vr(r,r.defaultAttrs,e,te.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ft.fromJSON(this,e)}markFromJSON(e){return te.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Bo(n,e){let t=[];for(let r=0;r-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class In{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Po(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Po(this,t,!0);return r.addAll(e,t.from,t.to),R.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o{r(o=zo(o)),o.mark=i})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=zo(o)),o.node=i})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new In(e,In.schemaRules(e)))}}const Ll={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},uf={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Bl={ol:!0,ul:!0},Gr=1,qr=2,nr=4;function Fo(n,e,t){return e!=null?(e?Gr:0)|(e==="full"?qr:0):n&&n.whitespace=="pre"?Gr|qr:t&~nr}class _r{constructor(e,t,r,i,s,o,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=s,this.options=a,this.content=[],this.activeMarks=te.none,this.stashMarks=[],this.match=o||(a&nr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Gr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;tthis.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}addAll(e,t,r){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=r==null?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,r=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(r);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=gf(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function df(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Bl.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function ff(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function hf(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function zo(n){let e={};for(let t in n)e[t]=n[t];return e}function pf(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=a=>{s.push(a);for(let l=0;l{if(s.length||o.marks.length){let a=0,l=0;for(;a=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&ut.renderSpec(Ji(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,a=r?e.createElementNS(r,i):e.createElement(i),l=t[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let d=u.indexOf(" ");d>0?a.setAttributeNS(u.slice(0,d),u.slice(d+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:h}=ut.renderSpec(e,d,r);if(a.appendChild(f),h){if(o)throw new RangeError("Multiple content holes");o=h}}}return{dom:a,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ut(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Uo(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Uo(e.marks)}}function Uo(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ji(n){return n.document||window.document}const Fl=65535,Pl=Math.pow(2,16);function mf(n,e){return n+e*Pl}function $o(n){return n&Fl}function bf(n){return(n-(n&Fl))/Pl}const zl=1,Ul=2,Rr=4,$l=8;class Ns{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&$l)>0}get deletedBefore(){return(this.delInfo&(zl|Rr))>0}get deletedAfter(){return(this.delInfo&(Ul|Rr))>0}get deletedAcross(){return(this.delInfo&Rr)>0}}class Je{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Je.empty)return Je.empty}recover(e){let t=0,r=$o(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:t:t,h=l+i+(f<0?0:u);if(r)return h;let p=e==(t<0?l:d)?null:mf(a/3,e-l),g=e==l?Ul:e==d?zl:Rr;return(t<0?e!=l:e!=d)&&(g|=$l),new Ns(h,g,p)}i+=u-c}return r?e+i:new Ns(e+i,0,null)}touches(e,t){let r=0,i=$o(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Tn;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;rs&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return be.fromReplace(e,this.from,this.to,s)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new wt(t.pos,r.pos,this.mark)}merge(e){return e instanceof wt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new wt(t.from,t.to,e.markFromJSON(t.mark))}}Ke.jsonID("addMark",wt);class dt extends Ke{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new R(Ws(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return be.fromReplace(e,this.from,this.to,r)}invert(){return new wt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new dt(t.from,t.to,e.markFromJSON(t.mark))}}Ke.jsonID("removeMark",dt);class xt extends Ke{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return be.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return be.fromReplace(e,this.pos,this.pos+1,new R(A.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new _e(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new _e(t.from,t.to,t.gapFrom,t.gapTo,R.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ke.jsonID("replaceAround",_e);function ks(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Ef(n,e,t,r){let i=[],s=[],o,a;n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,t),p=r.addToSet(d);for(let g=0;gn.step(l)),s.forEach(l=>n.step(l))}function yf(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof Ti){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;un.step(new dt(o.from,o.to,o.style)))}function Sf(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),s=[],o=e+1;for(let a=0;a=0;a--)n.step(s[a])}function Df(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Hn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),o=n.$to.indexAfter(r);if(rt;p--)g||r.index(p)>0?(g=!0,u=A.from(r.node(p).copy(u)),d++):l--;let f=A.empty,h=0;for(let p=s,g=!1;p>t;p--)g||i.after(p+1)=0;o--){if(r.size){let a=t[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=A.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new _e(i,s,i,s,new R(r,0,0),t.length,!0))}function Cf(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{if(o.isTextblock&&!o.hasMarkup(r,i)&&wf(n.doc,n.mapping.slice(s).map(a),r)){n.clearIncompatible(n.mapping.slice(s).map(a,1),r);let l=n.mapping.slice(s),c=l.map(a,1),u=l.map(a+o.nodeSize,1);return n.step(new _e(c,u,c+1,u-1,new R(A.from(r.create(i,null,o.marks)),0,0),1,!0)),!1}})}function wf(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function xf(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new _e(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new R(A.from(o),0,0),1,!0))}function vn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>s;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=r&&r[u]||d;if(p!=d&&(h=h.replaceChild(0,p.type.create(p.attrs))),!d.canReplace(f+1,d.childCount)||!p.type.validContent(h))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function Tf(n,e,t=1,r){let i=n.doc.resolve(e),s=A.empty,o=A.empty;for(let a=i.depth,l=i.depth-t,c=t-1;a>l;a--,c--){s=A.from(i.node(a).copy(s));let u=r&&r[c];o=A.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}n.step(new Re(e,e,new R(s.append(o),t,t),!0))}function Kn(n,e){let t=n.resolve(e),r=t.index();return vf(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function vf(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function Mf(n,e,t){let r=new Re(e-t,e+t,R.empty,!0);n.step(r)}function Of(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function qs(n,e,t=e,r=R.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return Kl(i,s,r)?new Re(e,t,r):new Rf(i,s,r).fit()}function Kl(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Rf{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=A.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=A.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new R(s,o,a);return e>-1?new _e(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new Re(r.pos,i.pos,l):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=ji(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let s=r.firstChild;for(let o=this.depth;o>=0;o--){let{type:a,match:l}=this.frontier[o],c,u=null;if(e==1&&(s?l.matchType(s.type)||(u=l.fillBefore(A.from(s),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:o,parent:i,inject:u};if(e==2&&s&&(c=l.findWrapping(s.type)))return{sliceDepth:t,frontierDepth:o,parent:i,wrap:c};if(i&&l.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ji(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=ji(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new R(Xn(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new R(Xn(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let g=0;g1||l==0||g.content.size)&&(d=b,u.push(Vl(g.mark(f.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?h:-1)))}let p=c==a.childCount;p||(h=-1),this.placed=Qn(this.placed,t,A.from(u)),this.frontier[t].match=d,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,b=a;g1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t=0;a--){let{match:l,type:c}=this.frontier[a],u=Xi(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Qn(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Qn(this.placed,this.depth,A.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(A.empty,!0);t.childCount&&(this.placed=Qn(this.placed,this.frontier.length,t))}}function Xn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Xn(n.firstChild.content,e-1,t)))}function Qn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Qn(n.lastChild.content,e-1,t)))}function ji(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Vl(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(A.empty,!0)))),n.copy(r)}function Xi(n,e,t,r,i){let s=n.node(e),o=i?n.indexAfter(e):n.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!If(t,s.content,o)?a:null}function If(n,e,t){for(let r=t;r0;f--,h--){let p=i.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(f)>-1?a=f:i.before(f)==h&&o.splice(1,0,-f)}let l=o.indexOf(a),c=[],u=r.openStart;for(let f=r.content,h=0;;h++){let p=f.firstChild;if(c.push(p),h==r.openStart)break;f=p.content}for(let f=u-1;f>=0;f--){let h=c[f].type,p=Lf(h);if(p&&i.node(l).type!=h)u=f;else if(p||!h.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),p=c[h];if(!!p)for(let g=0;g=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let h=o[f];h<0||(e=i.before(h),t=s.after(h))}}function Wl(n,e,t,r,i){if(er){let s=i.contentMatchAt(0),o=s.fillBefore(n).append(n);n=o.append(s.matchFragment(o).fillBefore(A.empty,!0))}return n}function Ff(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Of(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new R(A.from(r),0,0))}function Pf(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=Gl(r,i);for(let o=0;o0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return n.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&i.end(o)-t!=i.depth-o)return n.delete(r.before(o),t);n.delete(e,t)}function Gl(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(se.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Mn extends Ke{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return be.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return be.fromReplace(e,this.pos,this.pos+1,new R(A.from(i),0,t.isLeaf?0:1))}getMap(){return Je.empty}invert(e){return new Mn(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Mn(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mn(t.pos,t.attr,t.value)}}Ke.jsonID("attr",Mn);let Bn=class extends Error{};Bn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Bn.prototype=Object.create(Error.prototype);Bn.prototype.constructor=Bn;Bn.prototype.name="TransformError";class ql{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Tn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Bn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=R.empty){let i=qs(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new R(A.from(r),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Bf(this,e,t,r),this}replaceRangeWith(e,t,r){return Ff(this,e,t,r),this}deleteRange(e,t){return Pf(this,e,t),this}lift(e,t){return _f(this,e,t),this}join(e,t=1){return Mf(this,e,t),this}wrap(e,t){return Af(this,e,t),this}setBlockType(e,t=e,r,i=null){return Cf(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i=[]){return xf(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Mn(e,t,r)),this}addNodeMark(e,t){return this.step(new xt(e,t)),this}removeNodeMark(e,t){if(!(t instanceof te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Ln(e,t)),this}split(e,t=1,r){return Tf(this,e,t,r),this}addMark(e,t,r){return Ef(this,e,t,r),this}removeMark(e,t,r){return yf(this,e,t,r),this}clearIncompatible(e,t,r){return Sf(this,e,t,r),this}}const Qi=Object.create(null);class q{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new zf(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;s--){let o=t<0?mn(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):mn(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ze(e.node(0))}static atStart(e){return mn(e,e,0,0,1)||new Ze(e)}static atEnd(e){return mn(e,e,e.content.size,e.childCount,-1)||new Ze(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Qi[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Qi)throw new RangeError("Duplicate use of selection JSON ID "+e);return Qi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}q.prototype.visible=!0;class zf{constructor(e,t){this.$from=e,this.$to=t}}let Ko=!1;function Vo(n){!Ko&&!n.parent.inlineContent&&(Ko=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Y extends q{constructor(e,t=e){Vo(e),Vo(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return q.near(r);let i=e.resolve(t.map(this.anchor));return new Y(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Y&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new vi(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=q.findFrom(t,r,!0)||q.findFrom(t,-r,!0);if(s)t=s.$head;else return q.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(q.findFrom(e,-r,!0)||q.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&V.isSelectable(a))return V.create(n,t-(i<0?a.nodeSize:0))}else{let l=mn(n,a,t+i,i<0?a.childCount:0,i,s);if(l)return l}t+=a.nodeSize*i}return null}function Wo(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(q.near(n.doc.resolve(o),t))}const Go=1,Nr=2,qo=4;class $f extends ql{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Nr,this}ensureMarks(e){return te.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Nr)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Nr,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||te.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r==null?t:r,!e)return this.deleteRange(t,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,s)),this.selection.empty||this.setSelection(q.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=qo,this}get scrolledIntoView(){return(this.updated&qo)>0}}function Yo(n,e){return!e||!n?n:n.bind(e)}class er{constructor(e,t,r){this.name=e,this.init=Yo(t.init,r),this.apply=Yo(t.apply,r)}}const Hf=[new er("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new er("selection",{init(n,e){return n.selection||q.atStart(e.doc)},apply(n){return n.selection}}),new er("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new er("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class es{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Hf.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new er(r.key,r.spec.state,r))})}}class Sn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(t[r]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new es(e.schema,e.plugins),s=new Sn(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=ft.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=q.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,a)){s[o.name]=c.fromJSON.call(l,e,t[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Yl(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Yl(i,e,{})),t[r]=i}return t}class Ie{constructor(e){this.spec=e,this.props={},e.props&&Yl(e.props,this,this.props),this.key=e.key?e.key.key:Jl("plugin")}getState(e){return e[this.key]}}const ts=Object.create(null);function Jl(n){return n in ts?n+"$"+ ++ts[n]:(ts[n]=0,n+"$")}class je{constructor(e="key"){this.key=Jl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Ve=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},ur=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Jo=null;const mt=function(n,e,t){let r=Jo||(Jo=document.createRange());return r.setEnd(n,t==null?n.nodeValue.length:t),r.setStart(n,e||0),r},rn=function(n,e,t,r){return t&&(Zo(n,e,t,r,-1)||Zo(n,e,t,r,1))},Kf=/^(img|br|input|textarea|hr)$/i;function Zo(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:lt(n))){let s=n.parentNode;if(!s||s.nodeType!=1||Wf(n)||Kf.test(n.nodeName)||n.contentEditable=="false")return!1;e=Ve(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?lt(n):0}else return!1}}function lt(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Vf(n,e,t){for(let r=e==0,i=e==lt(n);r||i;){if(n==t)return!0;let s=Ve(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==lt(n)}}function Wf(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Mi=function(n){return n.focusNode&&rn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Dn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Gf(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}const Lt=typeof navigator<"u"?navigator:null,jo=typeof document<"u"?document:null,Ft=Lt&&Lt.userAgent||"",As=/Edge\/(\d+)/.exec(Ft),Zl=/MSIE \d/.exec(Ft),Cs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ft),He=!!(Zl||Cs||As),Ot=Zl?document.documentMode:Cs?+Cs[1]:As?+As[1]:0,it=!He&&/gecko\/(\d+)/i.test(Ft);it&&+(/Firefox\/(\d+)/.exec(Ft)||[0,0])[1];const ws=!He&&/Chrome\/(\d+)/.exec(Ft),$e=!!ws,qf=ws?+ws[1]:0,Fe=!He&&!!Lt&&/Apple Computer/.test(Lt.vendor),Fn=Fe&&(/Mobile\/\w+/.test(Ft)||!!Lt&&Lt.maxTouchPoints>2),Ye=Fn||(Lt?/Mac/.test(Lt.platform):!1),ct=/Android \d/.test(Ft),Oi=!!jo&&"webkitFontSmoothing"in jo.documentElement.style,Yf=Oi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Jf(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Dt(n,e){return typeof n=="number"?n:n[e]}function Zf(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Xo(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let o=t||n.dom;o;o=ur(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,c=l?Jf(s):Zf(a),u=0,d=0;if(e.topc.bottom-Dt(r,"bottom")&&(d=e.bottom-c.bottom+Dt(i,"bottom")),e.leftc.right-Dt(r,"right")&&(u=e.right-c.right+Dt(i,"right")),u||d)if(l)s.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,h=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let p=a.scrollLeft-f,g=a.scrollTop-h;e={left:e.left-p,top:e.top-g,right:e.right-p,bottom:e.bottom-g}}if(l)break}}function jf(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=t+1;o=t-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:jl(n.dom)}}function jl(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=ur(r));return e}function Xf({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Xl(t,r==0?0:r-e)}function Xl(n,e){for(let t=0;t=a){o=Math.max(f.bottom,o),a=Math.min(f.top,a);let h=f.left>e.left?f.left-e.left:f.right=(f.left+f.right)/2?1:0));continue}}!t&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(s=c+1)}}return t&&t.nodeType==3?eh(t,i):!t||r&&t.nodeType==1?{node:n,offset:s}:Ql(t,i)}function eh(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:n,offset:0}}function Js(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function th(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,i,s)}function rh(n,e,t,r){let i=-1;for(let s=e;s!=n.dom;){let o=n.docView.nearestDesc(s,!0);if(!o)return null;if(o.node.isBlock&&o.parent){let a=o.dom.getBoundingClientRect();if(a.left>r.left||a.top>r.top)i=o.posBefore;else if(a.right-1?i:n.docView.posFromDOM(e,t,1)}function ec(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?o=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(o=rh(n,r,i,e))}o==null&&(o=nh(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function _t(n,e){let t=n.getClientRects();return t.length?t[e<0?0:t.length-1]:n.getBoundingClientRect()}const sh=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tc(n,e,t){let{node:r,offset:i,atom:s}=n.docView.domFromPos(e,t<0?-1:1),o=Oi||it;if(r.nodeType==3)if(o&&(sh.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let l=_t(mt(r,i,i),t);if(it&&i&&/\s/.test(r.nodeValue[i-1])&&i=0&&i==r.nodeValue.length?(l--,u=1):t<0?l--:c++,qn(_t(mt(r,l,c),1),u<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==lt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return ns(l.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==lt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?mt(l,lt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return qn(_t(c,1),!1)}if(s==null&&i=0)}function qn(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ns(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function nc(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function oh(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return nc(n,e,()=>{let{node:s}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.dom;break}s=a.dom.parentNode}let o=tc(n,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=mt(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const ah=/[\u0590-\u08ac]/;function lh(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=n.domSelection();return!ah.test(r.parent.textContent)||!a.modify?t=="left"||t=="backward"?s:o:nc(n,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:g}=n.domSelectionRange(),b=p&&!h.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return f!=null&&(a.caretBidiLevel=f),b})}let Qo=null,ea=null,ta=!1;function ch(n,e,t){return Qo==e&&ea==t?ta:(Qo=e,ea=t,ta=t=="up"||t=="down"?oh(n,e,t):lh(n,e,t))}const rt=0,na=1,_n=2,ht=3;class yr{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=rt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tVe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return(i==null?r>0:i)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||o instanceof ic){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof rc&&s.side>=0;r--);if(t<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?Ve(s.dom)+1:0}}else{let s,o=!0;for(;s=r=u&&t<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,u);e=o;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=Ve(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(let u=a+1;uh&&ot){let h=a;a=l,l=h}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let a=r+s.border,l=o-s.border;if(e>=a&&t<=l){this.dirty=e==r||t==o?_n:na,e==a&&t==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=ht:s.markDirty(e-a,t-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?_n:ht}r=o}this.dirty=_n}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?_n:na;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==rt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class uh extends yr{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class sn extends yr{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,r);return(!o||!o.dom)&&(o=ut.renderSpec(document,t.type.spec.toDOM(t,r))),new sn(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&ht||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=ht&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=rt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(s=vs(s,0,e,r));for(let a=0;a{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=ut.renderSpec(document,t.type.spec.toDOM(t)));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=ac(u,r,t),c?l=new dh(e,t,r,i,u,d||null,f,c,s,o+1):t.isText?new Ri(e,t,r,i,u,f,s):new on(e,t,r,i,u,d||null,f,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,t,r){return this.dirty==rt&&e.eq(this.node)&&Ts(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new hh(this,o&&o.node,e);mh(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?te.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,d,f)=>{l.syncToMarks(c.marks,r,e);let h;l.findNodeMatch(c,u,d,f)||a&&e.state.selection.from>i&&e.state.selection.to-1&&l.updateNodeAt(c,u,d,h,e)||l.updateNextNode(c,u,d,e,f)||l.addNode(c,u,d,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==_n)&&(o&&this.protectLocalComposition(e,o),sc(this.contentDOM,this.children,e),Fn&&bh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Y)||rt+this.node.content.size)return null;let s=e.domSelectionRange(),o=Eh(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let a=o.nodeValue,l=yh(this.node.content,a,r-t,i-t);return l<0?null:{node:o,pos:l,text:a}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new uh(this,s,t,i);e.input.compositionNodes.push(o),this.children=vs(this.children,r,r+i.length,e,o)}update(e,t,r,i){return this.dirty==ht||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=rt}updateOuterDeco(e){if(Ts(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=oc(this.dom,this.nodeDOM,xs(this.outerDeco,this.node,t),xs(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function ra(n,e,t,r,i){return ac(r,e,n),new on(void 0,n,e,t,r,r,r,i,0)}class Ri extends on{constructor(e,t,r,i,s,o,a){super(e,t,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==ht||this.dirty!=rt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=rt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=rt,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new Ri(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=ht)}get domAtom(){return!1}}class ic extends yr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==rt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class dh extends on{constructor(e,t,r,i,s,o,a,l,c,u){super(e,t,r,i,s,o,a,c,u),this.spec=l}update(e,t,r,i){if(this.dirty==ht)return!1;if(this.spec.update){let s=this.spec.update(e,t,r);return s&&this.updateInner(e,t,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function sc(n,e,t){let r=n.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=sn.create(this.top,e[s],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let c=t.children[r-1];if(c instanceof sn)t=c,r=c.children.length;else{a=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let l=a.node;if(!!l){if(l!=n.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function gh(n,e){return n.type.side-e.type.side}function mh(n,e,t,r){let i=e.locals(n),s=0;if(i.length==0){for(let c=0;cs;)a.push(i[o++]);let f=s+u.nodeSize;if(u.isText){let p=f;o!p.inline):a.slice();r(u,h,e.forChild(s,u),d),s=f}}function bh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Eh(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=lt(n)}else if(n.nodeType==1&&e=t){let c=a=0&&c+e.length+a>=t)return a+c;if(t==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function vs(n,e,t,r,i){let s=[];for(let o=0,a=0;o=t||u<=e?s.push(l):(ct&&s.push(l.slice(t-c,l.size,r)))}return s}function Zs(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Mi(t)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&V.isSelectable(u)&&i.parent&&!(u.isInline&&Vf(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new V(o==d?a:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!lc(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Dh(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,Ve(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&He&&Ot<=11&&(r.disabled=!0,r.disabled=!1)}function cc(n,e){if(e instanceof V){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(la(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else la(n)}function la(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function js(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||Y.between(e,t,r)}function ca(n){return n.editable&&!n.hasFocus()?!1:uc(n)}function uc(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function _h(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return rn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Ms(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&q.findFrom(s,e)}function Gt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function ua(n,e,t){let r=n.state.selection;if(r instanceof Y){if(!r.empty||t.indexOf("s")>-1)return!1;if(n.endOfTextblock(e>0?"right":"left")){let i=Ms(n.state,e);return i&&i instanceof V?Gt(n,i):!1}else if(!(Ye&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=n.docView.descAt(a))&&!o.contentDOM?V.isSelectable(s)?Gt(n,new V(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):Oi?Gt(n,new Y(n.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else{if(r instanceof V&&r.node.isInline)return Gt(n,new Y(e>0?r.$to:r.$from));{let i=Ms(n.state,e);return i?Gt(n,i):!1}}}function Yr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ir(n){let e=n.pmViewDesc;return e&&e.size==0&&(n.nextSibling||n.nodeName!="BR")}function is(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,o=!1;for(it&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let a=t.childNodes[r-1];if(ir(a))i=t,s=--r;else if(a.nodeType==3)t=a,r=t.nodeValue.length;else break}}else{if(dc(t))break;{let a=t.previousSibling;for(;a&&ir(a);)i=t.parentNode,s=Ve(a),a=a.previousSibling;if(a)t=a,r=Yr(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?Os(n,t,r):i&&Os(n,i,s)}function ss(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Yr(t),s,o;for(;;)if(r{n.state==i&&yt(n)},50)}function da(n,e,t){let r=n.state.selection;if(r instanceof Y&&!r.empty||t.indexOf("s")>-1||Ye&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=Ms(n.state,e);if(o&&o instanceof V)return Gt(n,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Ze?q.near(o,e):q.findFrom(o,e);return a?Gt(n,a):!1}return!1}function fa(n,e){if(!(n.state.selection instanceof Y))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=n.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),n.dispatch(o),!0}return!1}function ha(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Nh(n){if(!Fe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;ha(n,r,"true"),setTimeout(()=>ha(n,r,"false"),20)}return!1}function kh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ah(n,e){let t=e.keyCode,r=kh(e);return t==8||Ye&&t==72&&r=="c"?fa(n,-1)||is(n):t==46||Ye&&t==68&&r=="c"?fa(n,1)||ss(n):t==13||t==27?!0:t==37||Ye&&t==66&&r=="c"?ua(n,-1,r)||is(n):t==39||Ye&&t==70&&r=="c"?ua(n,1,r)||ss(n):t==38||Ye&&t==80&&r=="c"?da(n,-1,r)||is(n):t==40||Ye&&t==78&&r=="c"?Nh(n)||da(n,1,r)||ss(n):r==(Ye?"m":"c")&&(t==66||t==73||t==89||t==90)}function fc(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let o=n.someProp("clipboardSerializer")||ut.fromSchema(n.state.schema),a=Ec(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=bc[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=a.createElement(u[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:f}}function hc(n,e,t,r,i){let s=i.parent.type.spec.code,o,a;if(!t&&!e)return null;let l=e&&(r||s||!t);if(l){if(n.someProp("transformPastedText",f=>{e=f(e,s||r,n)}),s)return e?new R(A.from(n.state.schema.text(e.replace(/\r\n?/g,` `))),0,0):R.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)a=d;else{let f=i.marks(),{schema:h}=n.state,p=ut.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let b=o.appendChild(document.createElement("p"));g&&b.appendChild(p.serializeNode(h.text(g,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=xh(t),Oi&&Th(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||In.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!Ch.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)a=vh(pa(a,+u[1],+u[2]),u[4]);else if(a=R.maxOpen(wh(a.content,i),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d{a=d(a,n)}),a}const Ch=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function wh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(n.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&gc(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=mc(o[o.length-1],s.length));let u=pc(a,l);o.push(u),i=i.matchType(u.type),s=l}}),o)return A.from(o)}return n}function pc(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,A.from(n));return n}function gc(n,e,t,r,i){if(i=t&&(a=e<0?o.contentMatchAt(0).fillBefore(a,n.childCount>1||s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(A.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(a))}function pa(n,e,t){return e]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Ec().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&bc[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"").reverse().join("")),t.innerHTML=n,i)for(let s=0;s=0;a-=2){let l=t.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=A.from(l.create(r[a+1],i)),s++,o++}return new R(i,s,o)}const Pe={},ze={},Mh={touchstart:!0,touchmove:!0};class Oh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Rh(n){for(let e in Pe){let t=Pe[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Lh(n,r)&&!Xs(n,r)&&(n.editable||!(r.type in ze))&&t(n,r)},Mh[e]?{passive:!0}:void 0)}Fe&&n.dom.addEventListener("input",()=>null),Is(n)}function Tt(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Ih(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Is(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Xs(n,r))})}function Xs(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Lh(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Bh(n,e){!Xs(n,e)&&Pe[e.type]&&(n.editable||!(e.type in ze))&&Pe[e.type](n,e)}ze.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Sc(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(ct&&$e&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Fn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Dn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ah(n,t)?t.preventDefault():Tt(n,"key")};ze.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};ze.keypress=(n,e)=>{let t=e;if(Sc(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Ye&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Ii(n){return{left:n.clientX,top:n.clientY}}function Fh(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Qs(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(n.someProp(e,a=>o>s.depth?a(n,t,s.nodeAfter,s.before(o),i,!0):a(n,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function On(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Ph(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&V.isSelectable(r)?(On(n,new V(t),"pointer"),!0):!1}function zh(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof V&&(r=t.node);let s=n.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(V.isSelectable(a)){r&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(On(n,V.create(n.state.doc,i),"pointer"),!0):!1}function Uh(n,e,t,r,i){return Qs(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?zh(n,t):Ph(n,t))}function $h(n,e,t,r){return Qs(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Hh(n,e,t,r){return Qs(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Kh(n,t,r)}function Kh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(On(n,Y.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)On(n,Y.create(r,a+1,a+1+o.content.size),"pointer");else if(V.isSelectable(o))On(n,V.create(r,a),"pointer");else continue;return!0}}function eo(n){return Jr(n)}const yc=Ye?"metaKey":"ctrlKey";Pe.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=eo(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&Fh(t,n.input.lastClick)&&!t[yc]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=n.posAtCoords(Ii(t));!o||(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Vh(n,o,t,!!r)):(s=="doubleClick"?$h:Hh)(n,o.pos,o.inside,t)?t.preventDefault():Tt(n,"pointer"))};class Vh{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[yc],this.allowDefault=r.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof V&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&it&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Tt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>yt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ii(e))),this.updateAllowDefault(e),this.allowDefault||!t?Tt(this.view,"pointer"):Uh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Fe&&this.mightDrag&&!this.mightDrag.node.isAtom||$e&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(On(this.view,q.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Tt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Tt(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Pe.touchstart=n=>{n.input.lastTouch=Date.now(),eo(n),Tt(n,"pointer")};Pe.touchmove=n=>{n.input.lastTouch=Date.now(),Tt(n,"pointer")};Pe.contextmenu=n=>eo(n);function Sc(n,e){return n.composing?!0:Fe&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Wh=ct?5e3:-1;ze.compositionstart=ze.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Jr(n,!0),n.markCursor=null;else if(Jr(n),it&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){n.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}n.input.composing=!0}Dc(n,Wh)};ze.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,Dc(n,20))};function Dc(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Jr(n),e))}function _c(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Gh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Gh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Jr(n,e=!1){if(!(ct&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),_c(n),e||n.docView&&n.docView.dirty){let t=Zs(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function qh(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Pn=He&&Ot<15||Fn&&Yf<604;Pe.copy=ze.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=Pn?null:t.clipboardData,o=r.content(),{dom:a,text:l}=fc(n,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):qh(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Yh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Jh(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Ls(n,r.value,null,e):Ls(n,r.textContent,r.innerHTML,e)},50)}function Ls(n,e,t,r){let i=hc(n,e,t,n.input.shiftKey,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,r,i||R.empty)))return!0;if(!i)return!1;let s=Yh(i),o=s?n.state.tr.replaceSelectionWith(s,n.input.shiftKey):n.state.tr.replaceSelection(i);return n.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ze.paste=(n,e)=>{let t=e;if(n.composing&&!ct)return;let r=Pn?null:t.clipboardData;r&&Ls(n,r.getData("text/plain"),r.getData("text/html"),t)?t.preventDefault():Jh(n,t)};class Zh{constructor(e,t){this.slice=e,this.move=t}}const Nc=Ye?"altKey":"ctrlKey";Pe.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Ii(t));if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof V?i.to-1:i.to))){if(r&&r.mightDrag)n.dispatch(n.state.tr.setSelection(V.create(n.state.doc,r.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let c=n.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=n.docView&&n.dispatch(n.state.tr.setSelection(V.create(n.state.doc,c.posBefore)))}}let o=n.state.selection.content(),{dom:a,text:l}=fc(n,o);t.dataTransfer.clearData(),t.dataTransfer.setData(Pn?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Pn||t.dataTransfer.setData("text/plain",l),n.dragging=new Zh(o,!t[Nc])};Pe.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};ze.dragover=ze.dragenter=(n,e)=>e.preventDefault();ze.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ii(t));if(!i)return;let s=n.state.doc.resolve(i.pos),o=r&&r.slice;o?n.someProp("transformPasted",p=>{o=p(o,n)}):o=hc(n,t.dataTransfer.getData(Pn?"Text":"text/plain"),Pn?null:t.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!t[Nc]);if(n.someProp("handleDrop",p=>p(n,t,o||R.empty,a))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?Hl(n.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let c=n.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,o.content.firstChild):c.replaceRange(u,u,o),c.doc.eq(f))return;let h=c.doc.resolve(u);if(d&&V.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new V(h));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,b,S,_)=>p=_),c.setSelection(js(n,h,c.doc.resolve(p)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Pe.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&yt(n)},20))};Pe.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Pe.beforeinput=(n,e)=>{if($e&&ct&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,Dn(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in ze)Pe[n]=ze[n];function dr(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class to{constructor(e,t){this.toDOM=e,this.spec=t||Xt,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new We(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof to&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&dr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Rt{constructor(e,t){this.attrs=e,this.spec=t||Xt}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new We(s,o,this)}valid(e,t){return t.from=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;oe){let a=this.children[o]+1;this.children[o+2].findInner(e-a,t-a,r,i+a,s)}}map(e,t,r){return this==Oe||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Xt)}mapInner(e,t,r,i,s){let o;for(let a=0;a{let c=l+r,u;if(!!(u=Ac(t,a,c))){for(i||(i=this.children.slice());sa&&d.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+t.content.size;for(let a=0;as&&l.type instanceof Rt){let c=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;ci.map(e,t,Xt));return Ct.from(r)}forChild(e,t){if(t.isLeaf)return pe.empty;let r=[];for(let i=0;it instanceof pe)?e:e.reduce((t,r)=>t.concat(r instanceof pe?r:r.members),[]))}}}function jh(n,e,t,r,i,s,o){let a=n.slice();for(let c=0,u=s;c{let b=g-p-(h-f);for(let S=0;S_+u-d)continue;let T=a[S]+u-d;h>=T?a[S+1]=f<=T?-2:-1:p>=i&&b&&(a[S]+=b,a[S+1]+=b)}d+=b}),u=t.maps[c].map(u,-1)}let l=!1;for(let c=0;c=r.content.size){l=!0;continue}let f=t.map(n[c+1]+s,-1),h=f-i,{index:p,offset:g}=r.content.findIndex(d),b=r.maybeChild(p);if(b&&g==d&&g+b.nodeSize==h){let S=a[c+2].mapInner(t,b,u+1,n[c]+s+1,o);S!=Oe?(a[c]=d,a[c+1]=h,a[c+2]=S):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Xh(a,n,e,t,i,s,o),u=Zr(c,r,0,o);e=u.local;for(let d=0;dt&&o.to{let c=Ac(n,a,l+t);if(c){s=!0;let u=Zr(c,a,t+l+1,r);u!=Oe&&i.push(l,l+a.nodeSize,u)}});let o=kc(s?Cc(n):n,-t).sort(Qt);for(let a=0;a0;)e++;n.splice(e,0,t)}function as(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=Oe&&e.push(r)}),n.cursorWrapper&&e.push(pe.create(n.state.doc,[n.cursorWrapper.deco])),Ct.from(e)}const Qh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ep=He&&Ot<=11;class tp{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class np{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tp,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),ep&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Qh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(!!ca(this.view)){if(this.suppressingSelectionUpdates)return yt(this.view);if(He&&Ot<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&rn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let s=e.focusNode;s;s=ur(s))t.add(s);for(let s=e.anchorNode;s;s=ur(s))if(t.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&ca(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u1){let u=l.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&e.input.lastTouch-1||i)&&(s>-1&&(e.docView.markDirty(s,o),rp(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||yt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;b--){let S=r.childNodes[b-1],_=S.pmViewDesc;if(S.nodeName=="BR"&&!_){s=b;break}if(!_||_.size)break}let d=n.state.doc,f=n.someProp("domParser")||In.fromSchema(n.state.schema),h=d.resolve(o),p=null,g=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:op,context:h});if(c&&c[0].pos!=null){let b=c[0].pos,S=c[1]&&c[1].pos;S==null&&(S=b),p={anchor:b+o,head:S+o}}return{doc:g,sel:p,from:o,to:a}}function op(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Fe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Fe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}function ap(n,e,t,r,i){if(e<0){let O=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,K=Zs(n,O);if(K&&!n.state.selection.eq(K)){let oe=n.state.tr.setSelection(K);O=="pointer"?oe.setMeta("pointer",!0):O=="key"&&oe.scrollIntoView(),n.dispatch(oe)}return}let s=n.state.doc.resolve(e),o=s.sharedDepth(t);e=s.before(o+1),t=n.state.doc.resolve(t).after(o+1);let a=n.state.selection,l=sp(n,e,t),c=n.state.doc,u=c.slice(l.from,l.to),d,f;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||ct)&&i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"||O.nodeName=="LI")&&(!h||h.endA>=h.endB)&&n.someProp("handleKeyDown",O=>O(n,Dn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof Y&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(l.sel){let O=ya(n,n.state.doc,l.sel);O&&!O.eq(n.state.selection)&&n.dispatch(n.state.tr.setSelection(O))}return}if($e&&n.cursorWrapper&&l.sel&&l.sel.anchor==n.cursorWrapper.deco.from&&l.sel.head==l.sel.anchor){let O=h.endB-h.start;l.sel={anchor:l.sel.anchor+O,head:l.sel.anchor+O}}n.input.domChangeCount++,n.state.selection.fromn.state.selection.from&&h.start<=n.state.selection.from+2&&n.state.selection.from>=l.from?h.start=n.state.selection.from:h.endA=n.state.selection.to-2&&n.state.selection.to<=l.to&&(h.endB+=n.state.selection.to-h.endA,h.endA=n.state.selection.to)),He&&Ot<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>l.from&&l.doc.textBetween(h.start-l.from-1,h.start-l.from+1)==" \xA0"&&(h.start--,h.endA--,h.endB--);let p=l.doc.resolveNoCache(h.start-l.from),g=l.doc.resolveNoCache(h.endB-l.from),b=c.resolve(h.start),S=p.sameParent(g)&&p.parent.inlineContent&&b.end()>=h.endA,_;if((Fn&&n.input.lastIOSEnter>Date.now()-225&&(!S||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!S&&p.posO(n,Dn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>h.start&&cp(c,h.start,h.endA,p,g)&&n.someProp("handleKeyDown",O=>O(n,Dn(8,"Backspace")))){ct&&$e&&n.domObserver.suppressSelectionUpdates();return}$e&&ct&&h.endB==h.start&&(n.input.lastAndroidDelete=Date.now()),ct&&!S&&p.start()!=g.start()&&g.parentOffset==0&&p.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==h.endA&&(h.endB-=2,g=l.doc.resolveNoCache(h.endB-l.from),setTimeout(()=>{n.someProp("handleKeyDown",function(O){return O(n,Dn(13,"Enter"))})},20));let T=h.start,x=h.endA,L,P,$;if(S){if(p.pos==g.pos)He&&Ot<=11&&p.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>yt(n),20)),L=n.state.tr.delete(T,x),P=c.resolve(h.start).marksAcross(c.resolve(h.endA));else if(h.endA==h.endB&&($=lp(p.parent.content.cut(p.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))L=n.state.tr,$.type=="add"?L.addMark(T,x,$.mark):L.removeMark(T,x,$.mark);else if(p.parent.child(p.index()).isText&&p.index()==g.index()-(g.textOffset?0:1)){let O=p.parent.textBetween(p.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",K=>K(n,T,x,O)))return;L=n.state.tr.insertText(O,T,x)}}if(L||(L=n.state.tr.replace(T,x,l.doc.slice(h.start-l.from,h.endB-l.from))),l.sel){let O=ya(n,L.doc,l.sel);O&&!($e&&ct&&n.composing&&O.empty&&(h.start!=h.endB||n.input.lastAndroidDeletee.content.size?null:js(n,e.resolve(t.anchor),e.resolve(t.head))}function lp(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,s=r,o,a,l;for(let u=0;uu.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||ls(o,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let s=n.node(r).maybeChild(n.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function up(n,e,t,r,i){let s=n.findDiffStart(e,t);if(s==null)return null;let{a:o,b:a}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o=o?s-r:0;s-=l,a=s+(a-o),o=s}else if(a=a?s-r:0;s-=l,o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}class dp{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Oh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ka),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=_a(this),Da(this),this.nodeViews=Na(this),this.docView=ra(this.state.doc,Sa(this),as(this),this.dom,this),this.domObserver=new np(this,(r,i,s,o)=>ap(this,r,i,s,o)),this.domObserver.start(),Rh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Is(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ka),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let r=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(_c(this),s=!0),this.state=e;let o=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=Na(this);hp(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&Is(this),this.editable=_a(this),Da(this);let a=as(this),l=Sa(this),c=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",u=i||!this.docView.matchesNode(e.doc,l,a);(u||!e.selection.eq(r.selection))&&(s=!0);let d=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&jf(this);if(s){this.domObserver.stop();let f=u&&(He||$e)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&fp(r.selection,e.selection);if(u){let h=$e?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,l,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ra(e.doc,l,a,this.dom,this)),h&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&_h(this))?yt(this,f):(cc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():d&&Xf(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof V){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Xo(this,t.getBoundingClientRect(),e)}else Xo(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;tt.ownerDocument.getSelection()),this._root=t}return e||document}posAtCoords(e){return ih(this,e)}coordsAtPos(e,t=1){return tc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return ch(this,t||this.state,e)}destroy(){!this.docView||(Ih(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],as(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Bh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Fe&&this.root.nodeType===11&&Gf(this.dom.ownerDocument)==this.dom?ip(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Sa(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),e.translate="no",n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"&&(e.class+=" "+t[r]),r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),[We.node(0,n.state.doc.content.size,e)]}function Da(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:We.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function _a(n){return!n.someProp("editable",e=>e(n.state)===!1)}function fp(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Na(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function hp(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function ka(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Bt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},jr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Aa=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent);typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent);var pp=typeof navigator<"u"&&/Mac/.test(navigator.platform),gp=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mp=pp||Aa&&+Aa[1]<57;for(var Ce=0;Ce<10;Ce++)Bt[48+Ce]=Bt[96+Ce]=String(Ce);for(var Ce=1;Ce<=24;Ce++)Bt[Ce+111]="F"+Ce;for(var Ce=65;Ce<=90;Ce++)Bt[Ce]=String.fromCharCode(Ce+32),jr[Ce]=String.fromCharCode(Ce);for(var cs in Bt)jr.hasOwnProperty(cs)||(jr[cs]=Bt[cs]);function bp(n){var e=mp&&(n.ctrlKey||n.altKey||n.metaKey)||gp&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?jr:Bt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Ep=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function yp(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,o;for(let a=0;a127)&&(o=Bt[r.keyCode])&&o!=i){let l=e[us(o,r,!0)];if(l&&l(t.state,t.dispatch,t))return!0}else if(s&&r.shiftKey){let l=e[us(i,r,!0)];if(l&&l(t.state,t.dispatch,t))return!0}return!1}}const _p=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0),Np=(n,e,t)=>{let{$cursor:r}=n.selection;if(!r||(t?!t.endOfTextblock("backward",n):r.parentOffset>0))return!1;let i=xc(r);if(!i){let o=r.blockRange(),a=o&&Hn(o);return a==null?!1:(e&&e(n.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&Mc(n,i,e))return!0;if(r.parent.content.size==0&&(zn(s,"end")||V.isSelectable(s))){let o=qs(n.doc,r.before(),r.after(),R.empty);if(o&&o.slice.size{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=xc(r)}let o=s&&s.nodeBefore;return!o||!V.isSelectable(o)?!1:(e&&e(n.tr.setSelection(V.create(n.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function xc(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}const Ap=(n,e,t)=>{let{$cursor:r}=n.selection;if(!r||(t?!t.endOfTextblock("forward",n):r.parentOffset{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Hn(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},xp=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` `).scrollIntoView()),!0)};function vc(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=vc(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,o.createAndFill());l.setSelection(q.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},vp=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ze||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=vc(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(vn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Hn(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},Op=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(V.create(n.doc,i))),!0)};function Rp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Kn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Mc(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s,o;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Rp(n,e,t))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(o=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let d=e.pos+i.nodeSize,f=A.empty;for(let g=s.length-1;g>=0;g--)f=A.from(s[g].create(null,f));f=A.from(r.copy(f));let h=n.tr.step(new _e(e.pos-1,d,e.pos,d,new R(f,1,0),s.length,!0)),p=d+2*s.length;Kn(h.doc,p)&&h.join(p),t(h.scrollIntoView())}return!0}let l=q.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Hn(c);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(c,u).scrollIntoView()),!0;if(a&&zn(i,"start",!0)&&zn(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let h=i,p=1;for(;!h.isTextblock;h=h.firstChild)p++;if(d.canReplace(d.childCount,d.childCount,h.content)){if(t){let g=A.empty;for(let S=f.length-1;S>=0;S--)g=A.from(f[S].copy(g));let b=n.tr.step(new _e(e.pos-f.length,e.pos+i.nodeSize,e.pos+p,e.pos+i.nodeSize-p,new R(g,f.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function Oc(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(Y.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const Ip=Oc(-1),Lp=Oc(1);function Bp(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=o&&Gs(o,n,e);return a?(r&&r(t.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Ca(n,e=null){return function(t,r){let{from:i,to:s}=t.selection,o=!1;return t.doc.nodesBetween(i,s,(a,l)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)o=!0;else{let c=t.doc.resolve(l),u=c.index();o=c.parent.canReplaceWith(u,u+1,n)}}),o?(r&&r(t.tr.setBlockType(i,s,n,e).scrollIntoView()),!0):!1}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Fp(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(n)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let u=t.doc.resolve(o.start-2);l=new Kr(u,u,o.depth),o.endIndex=0;u--)s=A.from(t[u].type.create(t[u].attrs,s));n.step(new _e(e.start-(r?2:0),e.end,e.start,e.end,new R(s,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?Up(e,t,n,s):$p(e,t,s):!0:!1}}function Up(n,e,t,r){let i=n.tr,s=r.end,o=r.$to.end(r.depth);sg;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let s=r.doc.resolve(t.start),o=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let a=t.startIndex==0,l=t.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?A.empty:A.from(i))))return!1;let d=s.pos,f=d+o.nodeSize;return r.step(new _e(d-(a?1:0),f+(l?1:0),d+1,f-1,new R((a?A.empty:A.from(i.copy(A.empty))).append(l?A.empty:A.from(i.copy(A.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function Hp(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=n)return!1;if(t){let c=l.lastChild&&l.lastChild.type==a.type,u=A.from(c?n.create():null),d=new R(A.from(n.create(null,A.from(a.type.create(null,u)))),c?3:1,0),f=s.start,h=s.end;t(e.tr.step(new _e(f-(c?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}function Li(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class Bi{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,c=e||s.tr,u=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...g)=>{const b=this.buildProps(c,t),S=h(...g)(b);return a.push(S),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...u)=>c(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i;s.storedMarks&&e.setStoredMarks(s.storedMarks);const a={tr:e,editor:i,view:o,state:Li({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class Kp{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function B(n,e,t){return n.config[e]===void 0&&n.parent?B(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?B(n.parent,e,t):null}):n.config[e]}function Fi(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Rc(n){const e=[],{nodeExtensions:t,markExtensions:r}=Fi(n),i=[...t,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=B(o,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:d,name:f,attribute:{...s,...h}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=B(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const f={...s,...d};(d==null?void 0:d.isRequired)&&(d==null?void 0:d.default)===void 0&&delete f.default,e.push({type:o.name,name:u,attribute:f})})}),e}function Ne(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function ue(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}i==="class"?r[i]=[r[i],s].join(" "):i==="style"?r[i]=[r[i],s].join("; "):r[i]=s}),r},{})}function Bs(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>ue(t,r),{})}function Ic(n){return typeof n=="function"}function G(n,e=void 0,...t){return Ic(n)?e?n.bind(e)(...t):n(...t):n}function Vp(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Wp(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function wa(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(t):Wp(t.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function xa(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Vp(t)?!1:t!=null))}function Gp(n){var e;const t=Rc(n),{nodeExtensions:r,markExtensions:i}=Fi(n),s=(e=r.find(l=>B(l,"topNode")))===null||e===void 0?void 0:e.name,o=Object.fromEntries(r.map(l=>{const c=t.filter(b=>b.type===l.name),u={name:l.name,options:l.options,storage:l.storage},d=n.reduce((b,S)=>{const _=B(S,"extendNodeSchema",u);return{...b,..._?_(l):{}}},{}),f=xa({...d,content:G(B(l,"content",u)),marks:G(B(l,"marks",u)),group:G(B(l,"group",u)),inline:G(B(l,"inline",u)),atom:G(B(l,"atom",u)),selectable:G(B(l,"selectable",u)),draggable:G(B(l,"draggable",u)),code:G(B(l,"code",u)),defining:G(B(l,"defining",u)),isolating:G(B(l,"isolating",u)),attrs:Object.fromEntries(c.map(b=>{var S;return[b.name,{default:(S=b==null?void 0:b.attribute)===null||S===void 0?void 0:S.default}]}))}),h=G(B(l,"parseHTML",u));h&&(f.parseDOM=h.map(b=>wa(b,c)));const p=B(l,"renderHTML",u);p&&(f.toDOM=b=>p({node:b,HTMLAttributes:Bs(b,c)}));const g=B(l,"renderText",u);return g&&(f.toText=g),[l.name,f]})),a=Object.fromEntries(i.map(l=>{const c=t.filter(g=>g.type===l.name),u={name:l.name,options:l.options,storage:l.storage},d=n.reduce((g,b)=>{const S=B(b,"extendMarkSchema",u);return{...g,...S?S(l):{}}},{}),f=xa({...d,inclusive:G(B(l,"inclusive",u)),excludes:G(B(l,"excludes",u)),group:G(B(l,"group",u)),spanning:G(B(l,"spanning",u)),code:G(B(l,"code",u)),attrs:Object.fromEntries(c.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),h=G(B(l,"parseHTML",u));h&&(f.parseDOM=h.map(g=>wa(g,c)));const p=B(l,"renderHTML",u);return p&&(f.toDOM=g=>p({mark:g,HTMLAttributes:Bs(g,c)})),[l.name,f]}));return new cf({topNode:s,nodes:o,marks:a})}function ds(n,e){return e.nodes[n]||e.marks[n]||null}function Ta(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const qp=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-s))}),t};function io(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Pi{constructor(e){this.find=e.find,this.handler=e.handler}}const Yp=(n,e)=>{if(io(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[];return r.push(t.text),r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function fs(n){var e;const{editor:t,from:r,to:i,text:s,rules:o,plugin:a}=n,{view:l}=t;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!!(!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code)))return!1;let u=!1;const d=qp(c)+s;return o.forEach(f=>{if(u)return;const h=Yp(d,f.find);if(!h)return;const p=l.state.tr,g=Li({state:l.state,transaction:p}),b={from:r-(h[0].length-s.length),to:i},{commands:S,chain:_,can:T}=new Bi({editor:t,state:g});f.handler({state:g,range:b,match:h,commands:S,chain:_,can:T})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:i,text:s}),l.dispatch(p),u=!0)}),u}function Jp(n){const{editor:e,rules:t}=n,r=new Ie({state:{init(){return null},apply(i,s){const o=i.getMeta(r);return o||(i.selectionSet||i.docChanged?null:s)}},props:{handleTextInput(i,s,o,a){return fs({editor:e,from:s,to:o,text:a,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&fs({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?fs({editor:e,from:o.pos,to:o.pos,text:` `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function Zp(n){return typeof n=="number"}class jp{constructor(e){this.find=e.find,this.handler=e.handler}}const Xp=(n,e)=>{if(io(e))return[...n.matchAll(e)];const t=e(n);return t?t.map(r=>{const i=[];return i.push(r.text),i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function Qp(n){const{editor:e,state:t,from:r,to:i,rule:s}=n,{commands:o,chain:a,can:l}=new Bi({editor:e,state:t}),c=[];return t.doc.nodesBetween(r,i,(d,f)=>{if(!d.isTextblock||d.type.spec.code)return;const h=Math.max(r,f),p=Math.min(i,f+d.content.size),g=d.textBetween(h-f,p-f,void 0,"\uFFFC");Xp(g,s.find).forEach(S=>{if(S.index===void 0)return;const _=h+S.index+1,T=_+S[0].length,x={from:t.tr.mapping.map(_),to:t.tr.mapping.map(T)},L=s.handler({state:t,range:x,match:S,commands:o,chain:a,can:l});c.push(L)})}),c.every(d=>d!==null)}function eg(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1;return t.map(a=>new Ie({view(l){const c=u=>{var d;r=!((d=l.dom.parentElement)===null||d===void 0)&&d.contains(u.target)?l.dom.parentElement:null};return window.addEventListener("dragstart",c),{destroy(){window.removeEventListener("dragstart",c)}}},props:{handleDOMEvents:{drop:l=>(s=r===l.dom.parentElement,!1),paste:(l,c)=>{var u;const d=(u=c.clipboardData)===null||u===void 0?void 0:u.getData("text/html");return i=!!(d!=null&&d.includes("data-pm-slice")),!1}}},appendTransaction:(l,c,u)=>{const d=l[0],f=d.getMeta("uiEvent")==="paste"&&!i,h=d.getMeta("uiEvent")==="drop"&&!s;if(!f&&!h)return;const p=c.doc.content.findDiffStart(u.doc.content),g=c.doc.content.findDiffEnd(u.doc.content);if(!Zp(p)||!g||p===g.b)return;const b=u.tr,S=Li({state:u,transaction:b});if(!(!Qp({editor:e,state:S,from:Math.max(p-1,0),to:g.b-1,rule:a})||!b.steps.length))return b}}))}function tg(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class Nn{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Nn.resolve(e),this.schema=Gp(this.extensions),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const s={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:ds(r.name,this.schema)};r.type==="mark"&&((i=G(B(r,"keepOnSplit",s)))!==null&&i!==void 0?i:!0)&&this.splittableMarks.push(r.name);const o=B(r,"onBeforeCreate",s);o&&this.editor.on("beforeCreate",o);const a=B(r,"onCreate",s);a&&this.editor.on("create",a);const l=B(r,"onUpdate",s);l&&this.editor.on("update",l);const c=B(r,"onSelectionUpdate",s);c&&this.editor.on("selectionUpdate",c);const u=B(r,"onTransaction",s);u&&this.editor.on("transaction",u);const d=B(r,"onFocus",s);d&&this.editor.on("focus",d);const f=B(r,"onBlur",s);f&&this.editor.on("blur",f);const h=B(r,"onDestroy",s);h&&this.editor.on("destroy",h)})}static resolve(e){const t=Nn.sort(Nn.flatten(e)),r=tg(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=B(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=B(r,"priority")||100,o=B(i,"priority")||100;return s>o?-1:s{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ds(t.name,this.schema)},i=B(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Nn.sort([...this.extensions].reverse()),r=[],i=[],s=t.map(o=>{const a={name:o.name,options:o.options,storage:o.storage,editor:e,type:ds(o.name,this.schema)},l=[],c=B(o,"addKeyboardShortcuts",a);let u={};if(o.type==="mark"&&o.config.exitable&&(u.ArrowRight=()=>Ge.handleExit({editor:e,mark:o})),c){const g=Object.fromEntries(Object.entries(c()).map(([b,S])=>[b,()=>S({editor:e})]));u={...u,...g}}const d=Dp(u);l.push(d);const f=B(o,"addInputRules",a);Ta(o,e.options.enableInputRules)&&f&&r.push(...f());const h=B(o,"addPasteRules",a);Ta(o,e.options.enablePasteRules)&&h&&i.push(...h());const p=B(o,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[Jp({editor:e,rules:r}),...eg({editor:e,rules:i}),...s]}get attributes(){return Rc(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Fi(this.extensions);return Object.fromEntries(t.filter(r=>!!B(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ne(r.name,this.schema)},o=B(r,"addNodeView",s);if(!o)return[];const a=(l,c,u,d)=>{const f=Bs(l,i);return o()({editor:e,node:l,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,a]}))}}function ng(n){return Object.prototype.toString.call(n).slice(8,-1)}function hs(n){return ng(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function zi(n,e){const t={...n};return hs(n)&&hs(e)&&Object.keys(e).forEach(r=>{hs(e[r])?r in n?t[r]=zi(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class xe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(B(this,"addOptions",{name:this.name}))),this.storage=G(B(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new xe(e)}configure(e={}){const t=this.extend();return t.options=zi(this.options,e),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new xe(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=G(B(t,"addOptions",{name:t.name})),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}}function Lc(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=` `,textSerializers:o={}}=t||{};let a="",l=!0;return n.nodesBetween(r,i,(c,u,d,f)=>{var h;const p=o==null?void 0:o[c.type.name];p?(c.isBlock&&!l&&(a+=s,l=!0),d&&(a+=p({node:c,pos:u,parent:d,index:f,range:e}))):c.isText?(a+=(h=c==null?void 0:c.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),l=!1):c.isBlock&&!l&&(a+=s,l=!0)}),a}function Bc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const rg=xe.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Ie({key:new je("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(u=>u.$from.pos)),a=Math.max(...s.map(u=>u.$to.pos)),l=Bc(t);return Lc(r,{from:o,to:a},{textSerializers:l})}}})]}}),ig=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),sg=(n=!1)=>({commands:e})=>e.setContent("",n),og=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:o})=>{n.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),f=c.resolve(u.map(l+a.nodeSize)),h=d.blockRange(f);if(!h)return;const p=Hn(h);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(h.start,g)}(p||p===0)&&e.lift(h,p)})}),!0},ag=n=>e=>n(e),lg=()=>({state:n,dispatch:e})=>vp(n,e),cg=n=>({tr:e,state:t,dispatch:r})=>{const i=Ne(n,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},ug=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},dg=()=>({state:n,dispatch:e})=>_p(n,e),fg=()=>({commands:n})=>n.keyboardShortcut("Enter"),hg=()=>({state:n,dispatch:e})=>Tp(n,e);function Xr(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:io(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Fs(n,e,t={}){return n.find(r=>r.type===e&&Xr(r.attrs,t))}function pg(n,e,t={}){return!!Fs(n,e,t)}function so(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Fs([...r.node.marks],e,t);if(!i)return;let s=r.index,o=n.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(Fs([...r.node.marks],e,t);s>0&&i.isInSet(n.parent.child(s-1).marks);)s-=1,o-=n.parent.child(s).nodeSize;for(;a({tr:t,state:r,dispatch:i})=>{const s=Pt(n,r.schema),{doc:o,selection:a}=t,{$from:l,from:c,to:u}=a;if(i){const d=so(l,s,e);if(d&&d.from<=c&&d.to>=u){const f=Y.create(o,d.from,d.to);t.setSelection(f)}}return!0},mg=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{oo()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!Fc(t.state.selection))return o(),!0;const a=Pc(i.doc,n)||t.state.selection,l=t.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Eg=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),yg=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function va(n){const e=`${n}`;return new window.DOMParser().parseFromString(e,"text/html").body}function Qr(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)?A.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),Qr("",e,t)}if(typeof n=="string"){const r=In.fromSchema(e);return t.slice?r.parseSlice(va(n),t.parseOptions).content:r.parse(va(n),t.parseOptions)}return Qr("",e,t)}function Sg(n,e,t){const r=n.steps.length-1;if(r{o===0&&(o=u)}),n.setSelection(q.near(n.doc.resolve(o),t))}const Dg=n=>n.toString().startsWith("<"),_g=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=Qr(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:a,to:l}=typeof n=="number"?{from:n,to:n}:n,c=!0,u=!0;if((Dg(o)?o:[o]).forEach(f=>{f.check(),c=c?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),a===l&&u){const{parent:f}=r.doc.resolve(a);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(a-=1,l+=1)}c?r.insertText(e,a,l):r.replaceWith(a,l,o),t.updateSelection&&Sg(r,r.steps.length-1,-1)}return!0},Ng=()=>({state:n,dispatch:e})=>Np(n,e),kg=()=>({state:n,dispatch:e})=>Ap(n,e);function zc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Ag(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,o;for(let a=0;a({editor:e,view:t,tr:r,dispatch:i})=>{const s=Ag(n).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function fr(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,o=e?Ne(e,n.schema):null,a=[];n.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const h=Math.max(r,f),p=Math.min(i,f+d.nodeSize);a.push({node:d,from:h,to:p})});const l=i-r,c=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Xr(d.node.attrs,t,{strict:!1}));return s?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=l}const wg=(n,e={})=>({state:t,dispatch:r})=>{const i=Ne(n,t.schema);return fr(t,i,e)?wp(t,r):!1},xg=()=>({state:n,dispatch:e})=>Mp(n,e),Tg=n=>({state:e,dispatch:t})=>{const r=Ne(n,e.schema);return zp(r)(e,t)},vg=()=>({state:n,dispatch:e})=>xp(n,e);function Ui(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Ma(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const Mg=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=Ui(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(s=Ne(n,r.schema)),a==="mark"&&(o=Pt(n,r.schema)),i&&t.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{s&&s===c.type&&t.setNodeMarkup(u,void 0,Ma(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(d=>{o===d.type&&t.addMark(u,u+c.nodeSize,o.create(Ma(d.attrs,e)))})})}),!0):!1},Og=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Rg=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),Ig=()=>({state:n,dispatch:e})=>kp(n,e),Lg=()=>({state:n,dispatch:e})=>Cp(n,e),Bg=()=>({state:n,dispatch:e})=>Op(n,e),Fg=()=>({state:n,dispatch:e})=>Lp(n,e),Pg=()=>({state:n,dispatch:e})=>Ip(n,e);function Uc(n,e,t={}){return Qr(n,e,{slice:!1,parseOptions:t})}const zg=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:s})=>{const{doc:o}=r,a=Uc(n,i.schema,t);return s&&r.replaceWith(0,o.content.size,a).setMeta("preventUpdate",!e),!0};function Ug(n,e){const t=new ql(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function $g(n){for(let e=0;e{e(r)&&t.push({node:r,pos:i})}),t}function Hg(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function Kg(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function ao(n){return e=>Kg(e.$from,n)}function Vg(n,e){const t=ut.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Wg(n,e){const t={from:0,to:n.content.size};return Lc(n,t,e)}function lo(n,e){const t=Pt(e,n.schema),{from:r,to:i,empty:s}=n.selection,o=[];s?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===t.name);return a?{...a.attrs}:{}}function Gg(n,e){const t=Ne(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===t.name);return o?{...o.attrs}:{}}function $c(n,e){const t=Ui(typeof e=="string"?e:e.name,n.schema);return t==="node"?Gg(n,e):t==="mark"?lo(n,e):{}}function qg(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Yg(n){const e=qg(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,o)=>o!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function Jg(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=t[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const c=e.slice(s).map(a,-1),u=e.slice(s).map(l),d=e.invert().map(c,-1),f=e.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),Yg(r)}function ei(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n-1),o=so(s,i.type);!o||r.push({mark:i,...o})}):t.nodesBetween(n,e,(i,s)=>{r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function zs(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?Pt(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Xr(d.attrs,t,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:d,$to:f})=>{const h=d.pos,p=f.pos;n.doc.nodesBetween(h,p,(g,b)=>{if(!g.isText&&!g.marks.length)return;const S=Math.max(h,b),_=Math.min(p,b+g.nodeSize),T=_-S;o+=T,a.push(...g.marks.map(x=>({mark:x,from:S,to:_})))})}),o===0)return!1;const l=a.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Xr(d.mark.attrs,t,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=a.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,f)=>d+f.to-f.from,0);return(l>0?l+c:l)>=o}function Zg(n,e,t={}){if(!e)return fr(n,null,t)||zs(n,null,t);const r=Ui(e,n.schema);return r==="node"?fr(n,e,t):r==="mark"?zs(n,e,t):!1}function Oa(n,e){const{nodeExtensions:t}=Fi(e),r=t.find(o=>o.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=G(B(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function jg(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function Xg(n,e,t){var r;const{selection:i}=e;let s=null;if(Fc(i)&&(s=i.$cursor),s){const a=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(a)||!a.some(l=>l.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(a.pos,l.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(t));c=h&&p}return!c}),c})}const Qg=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:a}=s,l=Pt(n,r.schema);if(i)if(o){const c=lo(r,l);t.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,h)=>{const p=Math.max(h,u),g=Math.min(h+f.nodeSize,d);f.marks.find(S=>S.type===l)?f.marks.forEach(S=>{l===S.type&&t.addMark(p,g,l.create({...S.attrs,...e}))}):t.addMark(p,g,l.create(e))})});return Xg(r,t,l)},em=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),tm=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=Ne(n,t.schema);return s.isTextblock?i().command(({commands:o})=>Ca(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Ca(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},nm=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Jt(n,0,r.content.size),s=V.create(r,i);e.setSelection(s)}return!0},rm=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,o=Y.atStart(r).from,a=Y.atEnd(r).to,l=Jt(i,o,a),c=Jt(s,o,a),u=Y.create(r,l,c);e.setSelection(u)}return!0},im=n=>({state:e,dispatch:t})=>{const r=Ne(n,e.schema);return Hp(r)(e,t)};function Ir(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ra(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const sm=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,u=Ir(c,a.node().type.name,a.node().attrs);if(s instanceof V&&s.node.isBlock)return!a.parentOffset||!vn(o,a.pos)?!1:(r&&(n&&Ra(t,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const d=l.parentOffset===l.parent.content.size;s instanceof Y&&e.deleteSelection();const f=a.depth===0?void 0:$g(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=d&&f?[{type:f,attrs:u}]:void 0,p=vn(e.doc,e.mapping.map(a.pos),1,h);if(!h&&!p&&vn(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(p=!0,h=f?[{type:f,attrs:u}]:void 0),p&&(e.split(e.mapping.map(a.pos),1,h),f&&!d&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),b=e.doc.resolve(g);a.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}n&&Ra(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},om=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var s;const o=Ne(n,t.schema),{$from:a,$to:l}=t.selection,c=t.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==o)return!1;const d=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let b=A.empty;const S=a.index(-1)?1:a.index(-2)?2:3;for(let $=a.depth-S;$>=a.depth-3;$-=1)b=A.from(a.node($).copy(b));const _=a.indexAfter(-1){if(P>-1)return!1;$.isTextblock&&$.content.size===0&&(P=O+1)}),P>-1&&e.setSelection(Y.near(e.doc.resolve(P))),e.scrollIntoView()}return!0}const f=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,h=Ir(d,u.type.name,u.attrs),p=Ir(d,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=f?[{type:o,attrs:h},{type:f,attrs:p}]:[{type:o,attrs:h}];return vn(e.doc,a.pos,2)?(r&&e.split(a.pos,2,g).scrollIntoView(),!0):!1},Ia=(n,e)=>{const t=ao(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Kn(n.doc,t.pos)&&n.join(t.pos),!0},La=(n,e)=>{const t=ao(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Kn(n.doc,r)&&n.join(r),!0},am=(n,e)=>({editor:t,tr:r,state:i,dispatch:s,chain:o,commands:a,can:l})=>{const{extensions:c}=t.extensionManager,u=Ne(n,i.schema),d=Ne(e,i.schema),{selection:f}=i,{$from:h,$to:p}=f,g=h.blockRange(p);if(!g)return!1;const b=ao(S=>Oa(S.type.name,c))(f);if(g.depth>=1&&b&&g.depth-b.depth<=1){if(b.node.type===u)return a.liftListItem(d);if(Oa(b.node.type.name,c)&&u.validContent(b.node.content)&&s)return o().command(()=>(r.setNodeMarkup(b.pos,u),!0)).command(()=>Ia(r,u)).command(()=>La(r,u)).run()}return o().command(()=>l().wrapInList(u)?!0:a.clearNodes()).wrapInList(u).command(()=>Ia(r,u)).command(()=>La(r,u)).run()},lm=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=Pt(n,r.schema);return zs(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},cm=(n,e,t={})=>({state:r,commands:i})=>{const s=Ne(n,r.schema),o=Ne(e,r.schema);return fr(r,s,t)?i.setNode(o):i.setNode(s,t)},um=(n,e={})=>({state:t,commands:r})=>{const i=Ne(n,t.schema);return fr(t,i,e)?r.lift(i):r.wrapIn(i,e)},dm=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,n.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},fm=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},hm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=t,l=Pt(n,r.schema),{$from:c,empty:u,ranges:d}=a;if(!i)return!0;if(u&&o){let{from:f,to:h}=a;const p=(s=c.marks().find(b=>b.type===l))===null||s===void 0?void 0:s.attrs,g=so(c,l,p);g&&(f=g.from,h=g.to),t.removeMark(f,h,l)}else d.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,l)});return t.removeStoredMark(l),!0},pm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,o=null;const a=Ui(typeof n=="string"?n:n.name,r.schema);return a?(a==="node"&&(s=Ne(n,r.schema)),a==="mark"&&(o=Pt(n,r.schema)),i&&t.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(d,f)=>{s&&s===d.type&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),o&&d.marks.length&&d.marks.forEach(h=>{if(o===h.type){const p=Math.max(f,c),g=Math.min(f+d.nodeSize,u);t.addMark(p,g,o.create({...h.attrs,...e}))}})})}),!0):!1},gm=(n,e={})=>({state:t,dispatch:r})=>{const i=Ne(n,t.schema);return Bp(i,e)(t,r)},mm=(n,e={})=>({state:t,dispatch:r})=>{const i=Ne(n,t.schema);return Fp(i,e)(t,r)};var bm=Object.freeze({__proto__:null,blur:ig,clearContent:sg,clearNodes:og,command:ag,createParagraphNear:lg,deleteNode:cg,deleteRange:ug,deleteSelection:dg,enter:fg,exitCode:hg,extendMarkRange:gg,first:mg,focus:bg,forEach:Eg,insertContent:yg,insertContentAt:_g,joinBackward:Ng,joinForward:kg,keyboardShortcut:Cg,lift:wg,liftEmptyBlock:xg,liftListItem:Tg,newlineInCode:vg,resetAttributes:Mg,scrollIntoView:Og,selectAll:Rg,selectNodeBackward:Ig,selectNodeForward:Lg,selectParentNode:Bg,selectTextblockEnd:Fg,selectTextblockStart:Pg,setContent:zg,setMark:Qg,setMeta:em,setNode:tm,setNodeSelection:nm,setTextSelection:rm,sinkListItem:im,splitBlock:sm,splitListItem:om,toggleList:am,toggleMark:lm,toggleNode:cm,toggleWrap:um,undoInputRule:dm,unsetAllMarks:fm,unsetMark:hm,updateAttributes:pm,wrapIn:gm,wrapInList:mm});const Em=xe.create({name:"commands",addCommands(){return{...bm}}}),ym=xe.create({name:"editable",addProseMirrorPlugins(){return[new Ie({key:new je("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Sm=xe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Ie({key:new je("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Dm=xe.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:f,parent:h}=d,p=q.atStart(c).from===f;return!u||!p||!h.type.isTextblock||h.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return oo()||zc()?s:i},addProseMirrorPlugins(){return[new Ie({key:new je("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(p=>p.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,a=q.atStart(e.doc).from,l=q.atEnd(e.doc).to,c=s===a&&o===l,u=t.doc.textBetween(0,t.doc.content.size," "," ").length===0;if(i||!c||!u)return;const d=t.tr,f=Li({state:t,transaction:d}),{commands:h}=new Bi({editor:this.editor,state:f});if(h.clearNodes(),!!d.steps.length)return d}})]}}),_m=xe.create({name:"tabindex",addProseMirrorPlugins(){return[new Ie({key:new je("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var Nm=Object.freeze({__proto__:null,ClipboardTextSerializer:rg,Commands:Em,Editable:ym,FocusEvents:Sm,Keymap:Dm,Tabindex:_m});const km=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 1px !important; height: 1px !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function Am(n,e){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r),r}class Cm extends Kp{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=Am(km,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e){this.setOptions({editable:e}),this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Ic(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(Nm):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Nn(t,this)}createCommandManager(){this.commandManager=new Bi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Uc(this.options.content,this.schema,this.options.parseOptions),t=Pc(e,this.options.autofocus);this.view=new dp(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:Sn.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(o)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return $c(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return Zg(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Vg(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` `,textSerializers:r={}}=e||{};return Wg(this.state.doc,{blockSeparator:t,textSerializers:{...r,...Bc(this.schema)}})}get isEmpty(){return jg(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}}function Un(n){return new Pi({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];let l=t.to;if(o){const c=a.search(/\S/),u=t.from+a.indexOf(o),d=u+o.length;if(ei(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;dt.from&&s.delete(t.from+c,u),l=t.from+c+o.length,s.addMark(t.from+c,l,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function Hc(n){return new Pi({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r)||{},{tr:s}=e,o=t.from;let a=t.to;if(r[1]){const l=r[0].lastIndexOf(r[1]);let c=o+l;c>a?c=a:a=c+r[1].length;const u=r[0][r[0].length-1];s.insertText(u,o+r[0].length-1),s.replaceWith(c,a,n.type.create(i))}else r[0]&&s.replaceWith(o,a,n.type.create(i))}})}function Us(n){return new Pi({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=G(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)}})}function co(n){return new Pi({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),a=s.doc.resolve(t.from).blockRange(),l=a&&Gs(a,n.type,i);if(!l)return null;s.wrap(a,l);const c=s.doc.resolve(t.from-1).nodeBefore;c&&c.type===n.type&&Kn(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,c))&&s.join(t.from-1)}})}class Ge{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(B(this,"addOptions",{name:this.name}))),this.storage=G(B(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ge(e)}configure(e={}){const t=this.extend();return t.options=zi(this.options,e),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ge(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=G(B(t,"addOptions",{name:t.name})),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===t.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}class Te{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=G(B(this,"addOptions",{name:this.name}))),this.storage=G(B(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Te(e)}configure(e={}){const t=this.extend();return t.options=zi(this.options,e),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Te(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=G(B(t,"addOptions",{name:t.name})),t.storage=G(B(t,"addStorage",{name:t.name,options:t.options})),t}}function an(n){return new jp({find:n.find,handler:({state:e,range:t,match:r})=>{const i=G(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];let l=t.to;if(o){const c=a.search(/\S/),u=t.from+a.indexOf(o),d=u+o.length;if(ei(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>u).length)return null;dt.from&&s.delete(t.from+c,u),l=t.from+c+o.length,s.addMark(t.from+c,l,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}class wm extends Cm{constructor(){super(...arguments),this.contentComponent=null}}const xm=({renderers:n})=>m(Ai,{children:Object.entries(n).map(([e,t])=>Zu.createPortal(t.reactElement,t.element,e))});class Tm extends Pr.Component{constructor(e){super(e),this.editorContentRef=Pr.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?Ju.exports.flushSync(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(({renderers:r})=>({renderers:{...r,[e]:t}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:t})=>{const r={...t};return delete r[e],{renderers:r}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...t}=this.props;return J(Ai,{children:[m("div",{ref:this.editorContentRef,...t}),m(xm,{renderers:this.state.renderers})]})}}const vm=Pr.memo(Tm),Mm=fe.exports.createContext({onDragStart:void 0}),Om=()=>fe.exports.useContext(Mm);Pr.forwardRef((n,e)=>{const{onDragStart:t}=Om(),r=n.as||"div";return m(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function Rm(){const[,n]=fe.exports.useState(0);return()=>n(e=>e+1)}const Im=(n={},e=[])=>{const[t,r]=fe.exports.useState(null),i=Rm();return fe.exports.useEffect(()=>{let s=!0;const o=new wm(n);return r(o),o.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{s&&i()})})}),()=>{o.destroy(),s=!1}},e),t},Lm=/^\s*>\s$/,Bm=Te.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[co({find:Lm,type:this.type})]}}),Fm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Pm=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,zm=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Um=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,$m=Ge.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Un({find:Fm,type:this.type}),Un({find:zm,type:this.type})]},addPasteRules(){return[an({find:Pm,type:this.type}),an({find:Um,type:this.type})]}}),Hm=/^\s*([-+*])\s$/,Km=Te.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){return[co({find:Hm,type:this.type})]}}),Vm=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Wm=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Gm=Ge.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Un({find:Vm,type:this.type})]},addPasteRules(){return[an({find:Wm,type:this.type})]}}),qm=/^```([a-z]+)?[\s\n]$/,Ym=/^~~~([a-z]+)?[\s\n]$/,Kc=Te.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",ue(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` `);return!s||!o?!1:n.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:n.commands.exitCode()}}},addInputRules(){return[Us({find:qm,type:this.type,getAttributes:n=>({language:n[1]})}),Us({find:Ym,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Ie({key:new je("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o}=n.state;return o.replaceSelectionWith(this.type.create({language:s})),o.setSelection(Y.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(t.replace(/\r\n?/g,` `)),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),Jm=Te.create({name:"doc",topNode:!0,content:"block+"});function Zm(n={}){return new Ie({view(e){return new jm(e,n)}})}class jm{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=s=>{this[r](s)};return e.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t;if(!e.parent.inlineContent){let o=e.nodeBefore,a=e.nodeAfter;if(o||a){let l=this.editorView.nodeDOM(this.cursorPos-(o?o.nodeSize:0)).getBoundingClientRect(),c=o?l.bottom:l.top;o&&a&&(c=(c+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:l.left,right:l.right,top:c-this.width/2,bottom:c+this.width/2}}}if(!t){let o=this.editorView.coordsAtPos(this.cursorPos);t={left:o.left-this.width/2,right:o.left+this.width/2,top:o.top,bottom:o.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color);let i,s;if(!r||r==document.body&&getComputedStyle(r).position=="static")i=-pageXOffset,s=-pageYOffset;else{let o=r.getBoundingClientRect();i=o.left-r.scrollLeft,s=o.top-r.scrollTop}this.element.style.left=t.left-i+"px",this.element.style.top=t.top-s+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&(o=Hl(this.editorView.state.doc,o,this.editorView.dragging.slice),o==null))return this.setCursor(null);this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Xm=xe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Zm(this.options)]}});class de extends q{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return de.valid(r)?new de(r):q.near(r)}content(){return R.empty}eq(e){return e instanceof de&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new de(e.resolve(t.pos))}getBookmark(){return new uo(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Qm(e)||!eb(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&de.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let a=e.node(o);if(t>0?e.indexAfter(o)0){s=a.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(de.valid(l))return l}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!V.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),r=!1;continue e}break}s=o,i+=t;let a=e.doc.resolve(i);if(de.valid(a))return a}return null}}}de.prototype.visible=!1;de.findFrom=de.findGapCursorFrom;q.jsonID("gapcursor",de);class uo{constructor(e){this.pos=e}map(e){return new uo(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return de.valid(t)?new de(t):q.near(t)}}function Qm(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function eb(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function tb(){return new Ie({props:{decorations:sb,createSelectionBetween(n,e,t){return e.pos==t.pos&&de.valid(t)?new de(t):null},handleClick:rb,handleKeyDown:nb,handleDOMEvents:{beforeinput:ib}}})}const nb=wc({ArrowLeft:kr("horiz",-1),ArrowRight:kr("horiz",1),ArrowUp:kr("vert",-1),ArrowDown:kr("vert",1)});function kr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,s){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Y){if(!s.endOfTextblock(t)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=de.findGapCursorFrom(a,e,l);return c?(i&&i(r.tr.setSelection(new de(c))),!0):!1}}function rb(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!de.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&V.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new de(r))),!0)}function ib(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof de))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=A.empty;for(let o=r.length-1;o>=0;o--)i=A.from(r[o].createAndFill(null,i));let s=n.state.tr.replace(t.pos,t.pos,new R(i,0,0));return s.setSelection(Y.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function sb(n){if(!(n.selection instanceof de))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",pe.create(n.doc,[We.widget(n.selection.head,e,{key:"gapcursor"})])}const ob=xe.create({name:"gapCursor",addProseMirrorPlugins(){return[tb()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=G(B(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),ab=Te.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",ue(this.options.HTMLAttributes,n)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){const d=l.filter(f=>a.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),lb=Te.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,ue(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Us({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var ti=200,we=function(){};we.prototype.append=function(e){return e.length?(e=we.from(e),!this.length&&e||e.length=t?we.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};we.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};we.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};we.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,r),i};we.from=function(e){return e instanceof we?e:e&&e.length?new Vc(e):we.empty};var Vc=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=ti)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=ti)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(we);we.empty=new Vc([]);var cb=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(we),Wc=we;const ub=500;class tt{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),s=i.maps.length),s--,u.push(d);return}if(i){u.push(new ot(d.map));let h=d.step.map(i.slice(s)),p;h&&o.maybeStep(h).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new ot(p,void 0,void 0,c.length+u.length))),s--,p&&i.appendMap(p,s)}else o.maybeStep(d.step);if(d.selection)return a=i?d.selection.map(i.slice(s)):d.selection,l=new tt(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,t,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;ufb&&(a=db(a,c),o-=c),new tt(a.append(s),o)}remapping(e,t){let r=new Tn;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new tt(this.items.append(e.map(t=>new ot(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},i);let l=t;this.items.forEach(f=>{let h=s.getMirror(--l);if(h==null)return;o=Math.min(o,h);let p=s.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),b=f.selection&&f.selection.map(s.slice(l+1,h));b&&a++,r.push(new ot(p,g,b))}else r.push(new ot(p))},i);let c=[];for(let f=t;fub&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(t.slice(r)),c=l&&l.getMap();if(r--,c&&t.appendMap(c,r),l){let u=o.selection&&o.selection.map(t.slice(r));u&&s++;let d=new ot(c.invert(),l,u),f,h=i.length-1;(f=i.length&&i[h].merge(d))?i[h]=f:i.push(d)}}else o.map&&r--},this.items.length,0),new tt(Wc.from(i.reverse()),s)}}tt.empty=new tt(Wc.empty,0);function db(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class ot{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ot(t.getMap().invert(),t,this.selection)}}}class kt{constructor(e,t,r,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i}}const fb=20;function hb(n,e,t,r){let i=t.getMeta(It),s;if(i)return i.historyState;t.getMeta(gb)&&(n=new kt(n.done,n.undone,null,0));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(It))return o.getMeta(It).redo?new kt(n.done.addTransform(t,void 0,r,Lr(e)),n.undone,Ba(t.mapping.maps[t.steps.length-1]),n.prevTime):new kt(n.done,n.undone.addTransform(t,void 0,r,Lr(e)),null,n.prevTime);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.prevTime==0||!o&&(n.prevTime<(t.time||0)-r.newGroupDelay||!pb(t,n.prevRanges)),l=o?ps(n.prevRanges,t.mapping):Ba(t.mapping.maps[t.steps.length-1]);return new kt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Lr(e)),tt.empty,l,t.time)}else return(s=t.getMeta("rebased"))?new kt(n.done.rebased(t,s),n.undone.rebased(t,s),ps(n.prevRanges,t.mapping),n.prevTime):new kt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ps(n.prevRanges,t.mapping),n.prevTime)}function pb(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s=e[s]&&(t=!0)}),t}function Ba(n){let e=[];return n.forEach((t,r,i,s)=>e.push(i,s)),e}function ps(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=It.getState(n);return!t||t.done.eventCount==0?!1:(e&&Gc(t,n,e,!1),!0)},Yc=(n,e)=>{let t=It.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Gc(t,n,e,!0),!0)},bb=xe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qc(n,e),redo:()=>({state:n,dispatch:e})=>Yc(n,e)}},addProseMirrorPlugins(){return[mb(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}}),Eb=Te.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",ue(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n})=>n().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var r;if(t){const{$to:i}=e.selection,s=i.end();if(i.nodeAfter)e.setSelection(Y.create(e.doc,i.pos));else{const o=(r=i.parent.type.contentMatch.defaultType)===null||r===void 0?void 0:r.create();o&&(e.insert(s,o),e.setSelection(Y.create(e.doc,s)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[Hc({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),yb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,Sb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Db=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,_b=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Nb=Ge.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Un({find:yb,type:this.type}),Un({find:Db,type:this.type})]},addPasteRules(){return[an({find:Sb,type:this.type}),an({find:_b,type:this.type})]}}),kb=Te.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",ue(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ab=/^(\d+)\.\s$/,Cb=Te.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",ue(this.options.HTMLAttributes,t),0]:["ol",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){return[co({find:Ab,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:(n,e)=>e.childCount+e.attrs.start===+n[1]})]}}),wb=Te.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),xb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,Tb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,vb=Ge.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Un({find:xb,type:this.type})]},addPasteRules(){return[an({find:Tb,type:this.type})]}}),Mb=Te.create({name:"text",group:"inline"}),Ob=xe.create({name:"starterKit",addExtensions(){var n,e,t,r,i,s,o,a,l,c,u,d,f,h,p,g,b,S;const _=[];return this.options.blockquote!==!1&&_.push(Bm.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&_.push($m.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&_.push(Km.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&_.push(Gm.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&_.push(Kc.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&_.push(Jm.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&_.push(Xm.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&_.push(ob.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&_.push(ab.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&_.push(lb.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&_.push(bb.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&_.push(Eb.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&_.push(Nb.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&_.push(kb.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&_.push(Cb.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&_.push(wb.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&_.push(vb.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&_.push(Mb.configure((S=this.options)===null||S===void 0?void 0:S.text)),_}}),Rb=Ge.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function fo(n){this.j={},this.jr=[],this.jd=null,this.t=n}fo.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var r=t,i=this.j[e];if(i)return r&&(i.t=r),i;i=ne();var s=ni(this,e);return s?(Object.assign(i.j,s.j),i.jr.append(s.jr),i.jr=s.jd,i.t=r||s.t):i.t=r,this.j[e]=i,i}};var ne=function(){return new fo},U=function(e){return new fo(e)},v=function(e,t,r){e.j[t]||(e.j[t]=r)},Ee=function(e,t,r){e.jr.push([t,r])},ni=function(e,t){var r=e.j[t];if(r)return r;for(var i=0;i=o)return[];for(;s0&&arguments[0]!==void 0?arguments[0]:[],e=ne(),t=U(qe),r=U(et),i=ne(),s=U(Jc),o=[[jn,r],[Yn,r],[Jn,r],[Zn,r]],a=function(){var x=U(et);return x.j={"-":i},x.jr=[].concat(o),x},l=function(x){var L=a();return L.t=x,L};Ib(e,[["'",U(ii)],["{",U(kn)],["[",U(sr)],["<",U(or)],["(",U(ar)],["}",U(qt)],["]",U(An)],[">",U(Cn)],[")",U(wn)],["&",U(ri)],["*",U(si)],["@",U(xn)],["`",U(ai)],["^",U(li)],[":",U(lr)],[",",U(go)],["$",U(ci)],[".",U(At)],["=",U(ui)],["!",U(mo)],["-",U(di)],["%",U(fi)],["|",U(hi)],["+",U(pi)],["#",U(gi)],["?",U(mi)],['"',U(bo)],["/",U(Et)],[";",U(Eo)],["~",U(bi)],["_",U(Ei)],["\\",U(oi)]]),v(e,` `,U(po)),Ee(e,za,s),v(s,` `,ne()),Ee(s,za,s);for(var c=0;c=0&&(d+=t[o].length,f++),c+=t[o].length,s+=t[o].length,o++;s-=d,o-=f,c-=d,i.push({t:u.t,v:e.substr(s-c,c),s:s-c,e:s})}return i}function Pb(n){for(var e=[],t=n.length,r=0;r56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function Br(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Br=function(e){return typeof e}:Br=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Br(n)}var Me={defaultProtocol:"http",events:null,format:Ua,formatHref:Ua,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:0,className:null,attributes:null,ignoreTags:[]};function zb(n){n=n||{},this.defaultProtocol="defaultProtocol"in n?n.defaultProtocol:Me.defaultProtocol,this.events="events"in n?n.events:Me.events,this.format="format"in n?n.format:Me.format,this.formatHref="formatHref"in n?n.formatHref:Me.formatHref,this.nl2br="nl2br"in n?n.nl2br:Me.nl2br,this.tagName="tagName"in n?n.tagName:Me.tagName,this.target="target"in n?n.target:Me.target,this.rel="rel"in n?n.rel:Me.rel,this.validate="validate"in n?n.validate:Me.validate,this.truncate="truncate"in n?n.truncate:Me.truncate,this.className="className"in n?n.className:Me.className,this.attributes=n.attributes||Me.attributes,this.ignoreTags=[];for(var e=("ignoreTags"in n)?n.ignoreTags:Me.ignoreTags,t=0;t2&&arguments[2]!==void 0?arguments[2]:{},r=Object.create(n.prototype);for(var i in t)r[i]=t[i];return r.constructor=e,e.prototype=r,e}function Si(){}Si.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};function ln(n,e){function t(r,i){this.t=n,this.v=r,this.tk=i}return Ub(Si,t,e),t}var Zc=ln("email",{isLink:!0}),$s=ln("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),Hs=ln("text"),jc=ln("nl"),Nt=ln("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me.defaultProtocol,t=this.tk,r=!1,i=!1,s=[],o=0;t[o].t===$n;)r=!0,s.push(t[o].v),o++;for(;t[o].t===Et;)i=!0,s.push(t[o].v),o++;for(;o=0&&f++,i++,u++;if(f<0)for(var h=i-u;h0&&(s.push(ms(Hs,e,o)),o=[]),i-=f,u-=f;var p=d.t,g=t.slice(i-u,i);s.push(ms(p,e,g))}}return o.length>0&&s.push(ms(Hs,e,o)),s}function ms(n,e,t){var r=t[0].s,i=t[t.length-1].e,s=e.substr(r,i-r);return new n(s,t)}var Vb=typeof console<"u"&&console&&console.warn||function(){},ye={scanner:null,parser:null,pluginQueue:[],customProtocols:[],initialized:!1};function Wb(){ye.scanner=null,ye.parser=null,ye.pluginQueue=[],ye.customProtocols=[],ye.initialized=!1}function Gb(n){if(ye.initialized&&Vb('linkifyjs: already initialized - will not register custom protocol "'.concat(n,'" until you manually call linkify.init(). To avoid this warning, please register all custom protocols before invoking linkify the first time.')),!/^[a-z-]+$/.test(n))throw Error("linkifyjs: protocols containing characters other than a-z or - (hyphen) are not supported");ye.customProtocols.push(n)}function qb(){ye.scanner={start:Bb(ye.customProtocols),tokens:Lb},ye.parser={start:Hb(),tokens:$b};for(var n={createTokenClass:ln},e=0;e1&&arguments[1]!==void 0?arguments[1]:null,t=Xc(n),r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:null,t=Xc(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}function Yb(n){return new Ie({key:new je("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(u=>u.docChanged)&&!t.doc.eq(r.doc),s=e.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,a=Ug(t.doc,[...e]),{mapping:l}=a;if(Jg(a).forEach(({oldRange:u,newRange:d})=>{ei(u.from,u.to,t.doc).filter(g=>g.mark.type===n.type).forEach(g=>{const b=l.map(g.from),S=l.map(g.to),_=ei(b,S,r.doc).filter(O=>O.mark.type===n.type);if(!_.length)return;const T=_[0],x=t.doc.textBetween(g.from,g.to,void 0," "),L=r.doc.textBetween(T.from,T.to,void 0," "),P=$a(x),$=$a(L);P&&!$&&o.removeMark(T.from,T.to,n.type)});const f=Hg(r.doc,d,g=>g.isTextblock);let h,p;if(f.length>1?(h=f[0],p=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(d.from,d.to," "," ").endsWith(" ")&&(h=f[0],p=r.doc.textBetween(h.pos,d.to,void 0," ")),h&&p){const g=p.split(" ").filter(_=>_!=="");if(g.length<=0)return!1;const b=g[g.length-1],S=h.pos+p.lastIndexOf(b);if(!b)return!1;yo(b).filter(_=>_.isLink).filter(_=>n.validate?n.validate(_.value):!0).map(_=>({..._,from:S+_.start+1,to:S+_.end+1})).forEach(_=>{o.addMark(_.from,_.to,n.type.create({href:_.href}))})}}),!!o.steps.length)return o}})}function Jb(n){return new Ie({key:new je("handleClickLink"),props:{handleClick:(e,t,r)=>{var i;const s=$c(e.state,n.type.name);return((i=r.target)===null||i===void 0?void 0:i.closest("a"))&&s.href?(window.open(s.href,s.target),!0):!1}}})}function Zb(n){return new Ie({key:new je("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:o}=s;if(o)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=yo(a).find(c=>c.isLink&&c.value===a);return!a||!l?!1:(n.editor.commands.setMark(n.type,{href:l.href}),!0)}}})}const jb=Ge.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(Gb)},onDestroy(){Wb()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){return["a",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[an({find:n=>yo(n).filter(e=>this.options.validate?this.options.validate(e.value):!0).filter(e=>e.isLink).map(e=>({text:e.value,index:e.start,data:e})),type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(Yb({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Jb({type:this.type})),this.options.linkOnPaste&&n.push(Zb({editor:this.editor,type:this.type})),n}}),Xb=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Qb=Te.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",ue(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Hc({find:Xb,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),eE=Ge.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),tE=Ge.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),nE=Ge.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",ue(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=lo(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),rE=xe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:n=>{var e;return(e=n.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:n=>n.color?{style:`color: ${n.color}`}:{}}}}]},addCommands(){return{setColor:n=>({chain:e})=>e().setMark("textStyle",{color:n}).run(),unsetColor:()=>({chain:n})=>n().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),iE=xe.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var So={exports:{}};function Do(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];typeof t=="object"&&!Object.isFrozen(t)&&Do(t)}),n}So.exports=Do;So.exports.default=Do;class Ha{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Qc(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function vt(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach(function(r){for(const i in r)t[i]=r[i]}),t}const sE="",Ka=n=>!!n.scope||n.sublanguage&&n.language,oE=(n,{prefix:e})=>{if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${n}`};class aE{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Qc(e)}openNode(e){if(!Ka(e))return;let t="";e.sublanguage?t=`language-${e.language}`:t=oE(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){!Ka(e)||(this.buffer+=sE)}value(){return this.buffer}span(e){this.buffer+=``}}const Va=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class _o{constructor(){this.rootNode=Va(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=Va({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(r=>this._walk(e,r)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&(!e.children||(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{_o._collapse(t)})))}}class lE extends _o{constructor(e){super(),this.options=e}addKeyword(e,t){e!==""&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,t){const r=e.root;r.sublanguage=!0,r.language=t,this.add(r)}toHTML(){return new aE(this,this.options).value()}finalize(){return!0}}function hr(n){return n?typeof n=="string"?n:n.source:null}function eu(n){return cn("(?=",n,")")}function cE(n){return cn("(?:",n,")*")}function uE(n){return cn("(?:",n,")?")}function cn(...n){return n.map(t=>hr(t)).join("")}function dE(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function No(...n){return"("+(dE(n).capture?"":"?:")+n.map(r=>hr(r)).join("|")+")"}function tu(n){return new RegExp(n.toString()+"|").exec("").length-1}function fE(n,e){const t=n&&n.exec(e);return t&&t.index===0}const hE=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ko(n,{joinWith:e}){let t=0;return n.map(r=>{t+=1;const i=t;let s=hr(r),o="";for(;s.length>0;){const a=hE.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&t++)}return o}).map(r=>`(${r})`).join(e)}const pE=/\b\B/,nu="[a-zA-Z]\\w*",Ao="[a-zA-Z_]\\w*",ru="\\b\\d+(\\.\\d+)?",iu="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",su="\\b(0b[01]+)",gE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",mE=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=cn(e,/.*\b/,n.binary,/\b.*/)),vt({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},pr={begin:"\\\\[\\s\\S]",relevance:0},bE={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[pr]},EE={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[pr]},yE={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/},$i=function(n,e,t={}){const r=vt({scope:"comment",begin:n,end:e,contains:[]},t);r.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 i=No("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 r.contains.push({begin:cn(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},SE=$i("//","$"),DE=$i("/\\*","\\*/"),_E=$i("#","$"),NE={scope:"number",begin:ru,relevance:0},kE={scope:"number",begin:iu,relevance:0},AE={scope:"number",begin:su,relevance:0},CE={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[pr,{begin:/\[/,end:/\]/,relevance:0,contains:[pr]}]}]},wE={scope:"title",begin:nu,relevance:0},xE={scope:"title",begin:Ao,relevance:0},TE={begin:"\\.\\s*"+Ao,relevance:0},vE=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Ar=Object.freeze({__proto__:null,MATCH_NOTHING_RE:pE,IDENT_RE:nu,UNDERSCORE_IDENT_RE:Ao,NUMBER_RE:ru,C_NUMBER_RE:iu,BINARY_NUMBER_RE:su,RE_STARTERS_RE:gE,SHEBANG:mE,BACKSLASH_ESCAPE:pr,APOS_STRING_MODE:bE,QUOTE_STRING_MODE:EE,PHRASAL_WORDS_MODE:yE,COMMENT:$i,C_LINE_COMMENT_MODE:SE,C_BLOCK_COMMENT_MODE:DE,HASH_COMMENT_MODE:_E,NUMBER_MODE:NE,C_NUMBER_MODE:kE,BINARY_NUMBER_MODE:AE,REGEXP_MODE:CE,TITLE_MODE:wE,UNDERSCORE_TITLE_MODE:xE,METHOD_GUARD:TE,END_SAME_AS_BEGIN:vE});function ME(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function OE(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function RE(n,e){!e||!n.beginKeywords||(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=ME,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function IE(n,e){!Array.isArray(n.illegal)||(n.illegal=No(...n.illegal))}function LE(n,e){if(!!n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function BE(n,e){n.relevance===void 0&&(n.relevance=1)}const FE=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(r=>{delete n[r]}),n.keywords=t.keywords,n.begin=cn(t.beforeMatch,eu(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},PE=["of","and","for","in","not","or","if","then","parent","list","value"],zE="keyword";function ou(n,e,t=zE){const r=Object.create(null);return typeof n=="string"?i(t,n.split(" ")):Array.isArray(n)?i(t,n):Object.keys(n).forEach(function(s){Object.assign(r,ou(n[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,UE(l[0],l[1])]})}}function UE(n,e){return e?Number(e):$E(n)?0:1}function $E(n){return PE.includes(n.toLowerCase())}const Wa={},en=n=>{console.error(n)},Ga=(n,...e)=>{console.log(`WARN: ${n}`,...e)},pn=(n,e)=>{Wa[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),Wa[`${n}/${e}`]=!0)},Di=new Error;function au(n,e,{key:t}){let r=0;const i=n[t],s={},o={};for(let a=1;a<=e.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=tu(e[a-1]);n[t]=o,n[t]._emit=s,n[t]._multi=!0}function HE(n){if(!!Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw en("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Di;if(typeof n.beginScope!="object"||n.beginScope===null)throw en("beginScope must be object"),Di;au(n,n.begin,{key:"beginScope"}),n.begin=ko(n.begin,{joinWith:""})}}function KE(n){if(!!Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw en("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Di;if(typeof n.endScope!="object"||n.endScope===null)throw en("endScope must be object"),Di;au(n,n.end,{key:"endScope"}),n.end=ko(n.end,{joinWith:""})}}function VE(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function WE(n){VE(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),HE(n),KE(n)}function GE(n){function e(o,a){return new RegExp(hr(o),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=tu(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(ko(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new t;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[OE,LE,WE,FE].forEach(u=>u(o,a)),n.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[RE,IE,BE].forEach(u=>u(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=ou(o.keywords,n.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=hr(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return qE(u==="self"?o:u)})),o.contains.forEach(function(u){s(u,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=vt(n.classNameAliases||{}),s(n)}function lu(n){return n?n.endsWithParent||lu(n.starts):!1}function qE(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return vt(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:lu(n)?vt(n,{starts:n.starts?vt(n.starts):null}):Object.isFrozen(n)?vt(n):n}var YE="11.6.0";class JE extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const bs=Qc,qa=vt,Ya=Symbol("nomatch"),ZE=7,jE=function(n){const e=Object.create(null),t=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:lE};function l(E){return a.noHighlightRe.test(E)}function c(E){let D=E.className+" ";D+=E.parentNode?E.parentNode.className:"";const k=a.languageDetectRe.exec(D);if(k){const w=K(k[1]);return w||(Ga(s.replace("{}",k[1])),Ga("Falling back to no-highlight mode for this block.",E)),w?k[1]:"no-highlight"}return D.split(/\s+/).find(w=>l(w)||K(w))}function u(E,D,k){let w="",I="";typeof D=="object"?(w=E,k=D.ignoreIllegals,I=D.language):(pn("10.7.0","highlight(lang, code, ...args) has been deprecated."),pn("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),I=E,w=D),k===void 0&&(k=!0);const W={code:w,language:I};ae("before:highlight",W);const le=W.result?W.result:d(W.language,W.code,k);return le.code=W.code,ae("after:highlight",le),le}function d(E,D,k,w){const I=Object.create(null);function W(y,N){return y.keywords[N]}function le(){if(!C.keywords){Z.addText(z);return}let y=0;C.keywordPatternRe.lastIndex=0;let N=C.keywordPatternRe.exec(z),M="";for(;N;){M+=z.substring(y,N.index);const F=ke.case_insensitive?N[0].toLowerCase():N[0],Q=W(C,F);if(Q){const[me,Vi]=Q;if(Z.addText(M),M="",I[F]=(I[F]||0)+1,I[F]<=ZE&&(pt+=Vi),me.startsWith("_"))M+=N[0];else{const Wi=ke.classNameAliases[me]||me;Z.addKeyword(N[0],Wi)}}else M+=N[0];y=C.keywordPatternRe.lastIndex,N=C.keywordPatternRe.exec(z)}M+=z.substring(y),Z.addText(M)}function Xe(){if(z==="")return;let y=null;if(typeof C.subLanguage=="string"){if(!e[C.subLanguage]){Z.addText(z);return}y=d(C.subLanguage,z,!0,Gn[C.subLanguage]),Gn[C.subLanguage]=y._top}else y=h(z,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(pt+=y.relevance),Z.addSublanguage(y._emitter,y.language)}function ee(){C.subLanguage!=null?Xe():le(),z=""}function ge(y,N){let M=1;const F=N.length-1;for(;M<=F;){if(!y._emit[M]){M++;continue}const Q=ke.classNameAliases[y[M]]||y[M],me=N[M];Q?Z.addKeyword(me,Q):(z=me,le(),z=""),M++}}function zt(y,N){return y.scope&&typeof y.scope=="string"&&Z.openNode(ke.classNameAliases[y.scope]||y.scope),y.beginScope&&(y.beginScope._wrap?(Z.addKeyword(z,ke.classNameAliases[y.beginScope._wrap]||y.beginScope._wrap),z=""):y.beginScope._multi&&(ge(y.beginScope,N),z="")),C=Object.create(y,{parent:{value:C}}),C}function Ut(y,N,M){let F=fE(y.endRe,M);if(F){if(y["on:end"]){const Q=new Ha(y);y["on:end"](N,Q),Q.isMatchIgnored&&(F=!1)}if(F){for(;y.endsParent&&y.parent;)y=y.parent;return y}}if(y.endsWithParent)return Ut(y.parent,N,M)}function Vn(y){return C.matcher.regexIndex===0?(z+=y[0],1):(Kt=!0,0)}function se(y){const N=y[0],M=y.rule,F=new Ha(M),Q=[M.__beforeBegin,M["on:begin"]];for(const me of Q)if(!!me&&(me(y,F),F.isMatchIgnored))return Vn(N);return M.skip?z+=N:(M.excludeBegin&&(z+=N),ee(),!M.returnBegin&&!M.excludeBegin&&(z=N)),zt(M,y),M.returnBegin?0:N.length}function dn(y){const N=y[0],M=D.substring(y.index),F=Ut(C,y,M);if(!F)return Ya;const Q=C;C.endScope&&C.endScope._wrap?(ee(),Z.addKeyword(N,C.endScope._wrap)):C.endScope&&C.endScope._multi?(ee(),ge(C.endScope,y)):Q.skip?z+=N:(Q.returnEnd||Q.excludeEnd||(z+=N),ee(),Q.excludeEnd&&(z=N));do C.scope&&Z.closeNode(),!C.skip&&!C.subLanguage&&(pt+=C.relevance),C=C.parent;while(C!==F.parent);return F.starts&&zt(F.starts,y),Q.returnEnd?0:N.length}function fn(){const y=[];for(let N=C;N!==ke;N=N.parent)N.scope&&y.unshift(N.scope);y.forEach(N=>Z.openNode(N))}let Qe={};function Wn(y,N){const M=N&&N[0];if(z+=y,M==null)return ee(),0;if(Qe.type==="begin"&&N.type==="end"&&Qe.index===N.index&&M===""){if(z+=D.slice(N.index,N.index+1),!i){const F=new Error(`0 width match regex (${E})`);throw F.languageName=E,F.badRule=Qe.rule,F}return 1}if(Qe=N,N.type==="begin")return se(N);if(N.type==="illegal"&&!k){const F=new Error('Illegal lexeme "'+M+'" for mode "'+(C.scope||"")+'"');throw F.mode=C,F}else if(N.type==="end"){const F=dn(N);if(F!==Ya)return F}if(N.type==="illegal"&&M==="")return 1;if(Ht>1e5&&Ht>N.index*3)throw new Error("potential infinite loop, way more iterations than matches");return z+=M,M.length}const ke=K(E);if(!ke)throw en(s.replace("{}",E)),new Error('Unknown language: "'+E+'"');const Ki=GE(ke);let $t="",C=w||Ki;const Gn={},Z=new a.__emitter(a);fn();let z="",pt=0,Be=0,Ht=0,Kt=!1;try{for(C.matcher.considerAll();;){Ht++,Kt?Kt=!1:C.matcher.considerAll(),C.matcher.lastIndex=Be;const y=C.matcher.exec(D);if(!y)break;const N=D.substring(Be,y.index),M=Wn(N,y);Be=y.index+M}return Wn(D.substring(Be)),Z.closeAllNodes(),Z.finalize(),$t=Z.toHTML(),{language:E,value:$t,relevance:pt,illegal:!1,_emitter:Z,_top:C}}catch(y){if(y.message&&y.message.includes("Illegal"))return{language:E,value:bs(D),illegal:!0,relevance:0,_illegalBy:{message:y.message,index:Be,context:D.slice(Be-100,Be+100),mode:y.mode,resultSoFar:$t},_emitter:Z};if(i)return{language:E,value:bs(D),illegal:!1,relevance:0,errorRaised:y,_emitter:Z,_top:C};throw y}}function f(E){const D={value:bs(E),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return D._emitter.addText(E),D}function h(E,D){D=D||a.languages||Object.keys(e);const k=f(E),w=D.filter(K).filter(ve).map(ee=>d(ee,E,!1));w.unshift(k);const I=w.sort((ee,ge)=>{if(ee.relevance!==ge.relevance)return ge.relevance-ee.relevance;if(ee.language&&ge.language){if(K(ee.language).supersetOf===ge.language)return 1;if(K(ge.language).supersetOf===ee.language)return-1}return 0}),[W,le]=I,Xe=W;return Xe.secondBest=le,Xe}function p(E,D,k){const w=D&&t[D]||k;E.classList.add("hljs"),E.classList.add(`language-${w}`)}function g(E){let D=null;const k=c(E);if(l(k))return;if(ae("before:highlightElement",{el:E,language:k}),E.children.length>0&&(a.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(E)),a.throwUnescapedHTML))throw new JE("One of your code blocks includes unescaped HTML.",E.innerHTML);D=E;const w=D.textContent,I=k?u(w,{language:k,ignoreIllegals:!0}):h(w);E.innerHTML=I.value,p(E,k,I.language),E.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(E.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),ae("after:highlightElement",{el:E,result:I,text:w})}function b(E){a=qa(a,E)}const S=()=>{x(),pn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _(){x(),pn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let T=!1;function x(){if(document.readyState==="loading"){T=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function L(){T&&x()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",L,!1);function P(E,D){let k=null;try{k=D(n)}catch(w){if(en("Language definition for '{}' could not be registered.".replace("{}",E)),i)en(w);else throw w;k=o}k.name||(k.name=E),e[E]=k,k.rawDefinition=D.bind(null,n),k.aliases&&oe(k.aliases,{languageName:E})}function $(E){delete e[E];for(const D of Object.keys(t))t[D]===E&&delete t[D]}function O(){return Object.keys(e)}function K(E){return E=(E||"").toLowerCase(),e[E]||e[t[E]]}function oe(E,{languageName:D}){typeof E=="string"&&(E=[E]),E.forEach(k=>{t[k.toLowerCase()]=D})}function ve(E){const D=K(E);return D&&!D.disableAutodetect}function Le(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=D=>{E["before:highlightBlock"](Object.assign({block:D.el},D))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=D=>{E["after:highlightBlock"](Object.assign({block:D.el},D))})}function ie(E){Le(E),r.push(E)}function ae(E,D){const k=E;r.forEach(function(w){w[k]&&w[k](D)})}function he(E){return pn("10.7.0","highlightBlock will be removed entirely in v12.0"),pn("10.7.0","Please use highlightElement now."),g(E)}Object.assign(n,{highlight:u,highlightAuto:h,highlightAll:x,highlightElement:g,highlightBlock:he,configure:b,initHighlighting:S,initHighlightingOnLoad:_,registerLanguage:P,unregisterLanguage:$,listLanguages:O,getLanguage:K,registerAliases:oe,autoDetection:ve,inherit:qa,addPlugin:ie}),n.debugMode=function(){i=!1},n.safeMode=function(){i=!0},n.versionString=YE,n.regex={concat:cn,lookahead:eu,either:No,optional:uE,anyNumberOfTimes:cE};for(const E in Ar)typeof Ar[E]=="object"&&So.exports(Ar[E]);return Object.assign(n,Ar),n};var gr=jE({}),XE=gr;gr.HighlightJS=gr;gr.default=gr;var QE=XE;function cu(n,e=[]){return n.map(t=>{const r=[...e,...t.properties?t.properties.className:[]];return t.children?cu(t.children,r):{text:t.value,classes:r}}).flat()}function Ja(n){return n.value||n.children||[]}function ey(n){return Boolean(QE.getLanguage(n))}function Za({doc:n,name:e,lowlight:t,defaultLanguage:r}){const i=[];return Ps(n,s=>s.type.name===e).forEach(s=>{let o=s.pos+1;const a=s.node.attrs.language||r,l=t.listLanguages(),c=a&&(l.includes(a)||ey(a))?Ja(t.highlight(a,s.node.textContent)):Ja(t.highlightAuto(s.node.textContent));cu(c).forEach(u=>{const d=o+u.text.length;if(u.classes.length){const f=We.inline(o,d,{class:u.classes.join(" ")});i.push(f)}o=d})}),pe.create(n,i)}function ty(n){return typeof n=="function"}function ny({name:n,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(i=>ty(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Ie({key:new je("lowlight"),state:{init:(i,{doc:s})=>Za({doc:s,name:n,lowlight:e,defaultLanguage:t}),apply:(i,s,o,a)=>{const l=o.selection.$head.parent.type.name,c=a.selection.$head.parent.type.name,u=Ps(o.doc,f=>f.type.name===n),d=Ps(a.doc,f=>f.type.name===n);return i.docChanged&&([l,c].includes(n)||d.length!==u.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(h=>h.pos>=f.from&&h.pos+h.node.nodeSize<=f.to)))?Za({doc:i.doc,name:n,lowlight:e,defaultLanguage:t}):s.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const ry=Kc.extend({addOptions(){var n;return{...(n=this.parent)===null||n===void 0?void 0:n.call(this),lowlight:{},defaultLanguage:null}},addProseMirrorPlugins(){var n;return[...((n=this.parent)===null||n===void 0?void 0:n.call(this))||[],ny({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),iy=xe.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:n=>n.style.backgroundColor.replace(/['"]+/g,""),renderHTML:n=>n.backgroundColor?{style:`background-color: ${n.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:n=>({chain:e})=>e().setMark("textStyle",{backgroundColor:n}).run(),unsetBackgroundColor:()=>({chain:n})=>n().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),sy=xe.create({name:"indent",addOptions:()=>({types:["listItem","paragraph"],minLevel:0,maxLevel:6}),addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{renderHTML:n=>(n==null?void 0:n.indent)>this.options.minLevel?{"data-indent":n.indent}:null,parseHTML:n=>{const e=Number(n.getAttribute("data-indent"));return e&&e>this.options.minLevel?e:null}}}}]},addCommands(){const n=(r,i,s)=>{var a;const o=(a=r==null?void 0:r.doc)==null?void 0:a.nodeAt(i);if(o){const l=(o.attrs.indent||0)+s,{minLevel:c,maxLevel:u}=this.options,d=lu?u:l;if(d!==o.attrs.indent){const{indent:f,...h}=o.attrs,p=d>c?{...h,indent:d}:h;return r.setNodeMarkup(i,o.type,p,o.marks)}}return r},e=(r,i)=>{const{doc:s,selection:o}=r;if(s&&o&&(o instanceof Y||o instanceof Ze)){const{from:a,to:l}=o;s.nodesBetween(a,l,(c,u)=>this.options.types.includes(c.type.name)?(r=n(r,u,i),!1):!0)}return r},t=r=>()=>({tr:i,state:s,dispatch:o})=>{const{selection:a}=s;return i=i.setSelection(a),i=e(i,r),i.docChanged?(o==null||o(i),!0):!1};return{indent:t(1),outdent:t(-1)}},addKeyboardShortcuts(){return{Tab:({editor:n})=>n.state.selection.to>n.state.selection.from?this.editor.commands.indent():!1,"Shift-Tab":({editor:n})=>n.state.selection.to>n.state.selection.from?this.editor.commands.outdent():!1}}}),oy=Te.create({name:"embed",group:"block",atom:!0,addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:n}){return["iframe",ue(this.options.HTMLAttributes,n)]},addCommands(){return{setEmbed:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}}});function ay(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="<[^<>]+>",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(s)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={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},d={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(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+n.IDENT_RE,relevance:0},h=e.optional(i)+n.IDENT_RE+"\\s*\\(",p=["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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["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"],S=["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"],x={type:g,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},L={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},P=[L,d,a,t,n.C_BLOCK_COMMENT_MODE,u,c],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:P.concat([{begin:/\(/,end:/\)/,keywords:x,contains:P.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"",keywords:x,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ly(n){const e={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=ay(n),r=t.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function uu(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 i={className:"subst",begin:/\$\(/,end:/\)/,contains:[n.BACKSLASH_ESCAPE]},s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[n.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,t,i]};i.contains.push(o);const a={className:"",begin:/\\"/},l={className:"string",begin:/'/,end:/'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},n.NUMBER_MODE,t]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=n.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),f={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[n.inherit(n.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},h=["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],p=["true","false"],g={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],_=["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"],T=["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"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:h,literal:p,built_in:[...b,...S,"set","shopt",..._,...T]},contains:[d,n.SHEBANG(),f,c,n.HASH_COMMENT_MODE,s,g,o,a,l,t]}}function du(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="<[^<>]+>",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(s)+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={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},d={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(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+n.IDENT_RE,relevance:0},h=e.optional(i)+n.IDENT_RE+"\\s*\\(",b={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","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","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","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"},S=[d,a,t,n.C_BLOCK_COMMENT_MODE,u,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:S.concat([{begin:/\(/,end:/\)/,keywords:b,contains:S.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:b,relevance:0},{begin:h,returnBegin:!0,contains:[n.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:b,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},n.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:b}}}function cy(n){const e=n.regex,t=n.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="<[^<>]+>",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional(s)+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l="\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)",c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+l+"|.)",end:"'",illegal:"."},n.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={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},d={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(c,{className:"string"}),{className:"string",begin:/<.*?>/},t,n.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:e.optional(i)+n.IDENT_RE,relevance:0},h=e.optional(i)+n.IDENT_RE+"\\s*\\(",p=["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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["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"],S=["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"],x={type:g,keyword:p,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},L={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,n.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},P=[L,d,a,t,n.C_BLOCK_COMMENT_MODE,u,c],$={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:P.concat([{begin:/\(/,end:/\)/,keywords:x,contains:P.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:h,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[t,n.C_BLOCK_COMMENT_MODE,c,u,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",t,n.C_BLOCK_COMMENT_MODE,c,u,a]}]},a,t,n.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"",keywords:x,contains:["self",a]},{begin:n.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function uy(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"],i=["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"],s=["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"],o={keyword:i.concat(s),built_in:e,literal:r},a=n.inherit(n.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={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},c={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},u=n.inherit(c,{illegal:/\n/}),d={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=n.inherit(d,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},n.BACKSLASH_ESCAPE,f]},p={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]},g=n.inherit(p,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});d.contains=[p,h,c,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,l,n.C_BLOCK_COMMENT_MODE],f.contains=[g,h,u,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,l,n.inherit(n.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const b={variants:[p,h,c,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},S={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},_=n.IDENT_RE+"(<"+n.IDENT_RE+"(\\s*,\\s*"+n.IDENT_RE+")*>)?(\\[\\])?",T={begin:"@"+n.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[n.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),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"}},b,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,S,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,S,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:"("+_+"\\s+)+"+n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:n.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[n.TITLE_MODE,S],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[b,l,n.C_BLOCK_COMMENT_MODE]},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},T]}}const dy=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_-]*/}}),fy=["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","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hy=["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"],py=["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"],gy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],my=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","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-right-color","border-right-style","border-right-width","border-spacing","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","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","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","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","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-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","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","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","resize","rest","rest-after","rest-before","right","row-gap","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","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","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-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","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","z-index"].reverse();function fu(n){const e=n.regex,t=dy(n),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[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:"\\."+o,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+py.join("|")+")"},{begin:":(:)?("+gy.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+my.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:hy.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+fy.join("|")+")\\b"}]}}function by(n){const e=n.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Ey(n){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"hu(n,e,t-1))}function pu(n){const e=n.regex,t="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",r=t+hu("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),l={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"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[n.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,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:[u,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:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[c,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,c]}}const Xa="[A-Za-z$_][0-9A-Za-z$_]*",Dy=["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"],_y=["true","false","null","undefined","NaN","Infinity"],gu=["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"],mu=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],bu=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ny=["arguments","this","super","console","window","document","localStorage","module","global"],ky=[].concat(bu,gu,mu);function Eu(n){const e=n.regex,t=(D,{after:k})=>{const w="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,k)=>{const w=D[0].length+D.index,I=D.input[w];if(I==="<"||I===","){k.ignoreMatch();return}I===">"&&(t(D,{after:w})||k.ignoreMatch());let W;const le=D.input.substring(w);if(W=le.match(/^\s*=/)){k.ignoreMatch();return}if((W=le.match(/^\s+extends\s+/))&&W.index===0){k.ignoreMatch();return}}},a={$pattern:Xa,keyword:Dy,literal:_y,built_in:ky,"variable.language":Ny},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},S={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]},_=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,p,g,{match:/\$\d+/},d];f.contains=_.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(_)});const T=[].concat(S,f.contains),x=T.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),L={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},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"}}]},$={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:{_:[...gu,...mu]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},oe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ve(D){return e.concat("(?!",D.join("|"),")")}const Le={match:e.concat(/\b/,ve([...bu,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},ie={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},he="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(he)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,p,g,S,{match:/\$\d+/},d,$,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:he,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},Le,oe,P,ae,{match:/\$[(.]/}]}}function Ay(n){const e={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",keywords:{literal:r},contains:[e,t,n.QUOTE_STRING_MODE,i,n.C_NUMBER_MODE,n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var yn="[0-9](_*[0-9])*",xr=`\\.(${yn})`,Tr="[0-9a-fA-F](_*[0-9a-fA-F])*",Cy={className:"number",variants:[{begin:`(\\b(${yn})((${xr})|\\.)?|(${xr}))[eE][+-]?(${yn})[fFdD]?\\b`},{begin:`\\b(${yn})((${xr})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${xr})[fFdD]?\\b`},{begin:`\\b(${yn})[fFdD]\\b`},{begin:`\\b0[xX]((${Tr})\\.?|(${Tr})?\\.(${Tr}))[pP][+-]?(${yn})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Tr})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function wy(n){const e={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[n.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+n.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+n.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+n.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[n.inherit(o,{className:"string"}),"self"]}]},c=Cy,u=n.COMMENT("/\\*","\\*/",{contains:[n.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:n.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:e,contains:[n.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),n.C_LINE_COMMENT_MODE,u,t,r,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:e,relevance:5,contains:[{begin:n.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[n.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,n.C_LINE_COMMENT_MODE,u],relevance:0},n.C_LINE_COMMENT_MODE,u,a,l,o,n.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,n.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},n.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` `},c]}}const xy=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_-]*/}}),Ty=["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","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],vy=["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"],yu=["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"],Su=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],My=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","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-right-color","border-right-style","border-right-width","border-spacing","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","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","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","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","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-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","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","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","resize","rest","rest-after","rest-before","right","row-gap","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","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","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-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","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","z-index"].reverse(),Oy=yu.concat(Su);function Ry(n){const e=xy(n),t=Oy,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],l=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},c=function(T,x,L){return{className:T,begin:x,relevance:L}},u={$pattern:/[a-z-]+/,keyword:r,attribute:vy.join(" ")},d={begin:"\\(",end:"\\)",contains:a,keywords:u,relevance:0};a.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,l("'"),l('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const f=a.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},p={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+My.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:a,relevance:0}},b={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,h,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+Ty.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+yu.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Su.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},e.FUNCTION_DISPATCH]},_={begin:i+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[S]};return o.push(n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,g,b,_,p,S,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Iy(n){const e="\\[=*\\[",t="\\]=*\\]",r={begin:e,end:t,contains:["self"]},i=[n.COMMENT("--(?!"+e+")","$"),n.COMMENT("--"+e,t,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:n.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[n.inherit(n.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},n.C_NUMBER_MODE,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,{className:"string",begin:e,end:t,contains:[r],relevance:5}])}}function Ly(n){const e={className:"variable",variants:[{begin:"\\$\\("+n.UNDERSCORE_IDENT_RE+"\\)",contains:[n.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={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}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),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}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=n.inherit(c,{contains:[]}),f=n.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let h=[t,l];return[c,u,d,f].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},t,s,c,u,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},i,r,l,o]}}function Fy(n){const e={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"/,end:/$/,illegal:"\\n"},n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[n.UNDERSCORE_TITLE_MODE]},{begin:"\\."+n.UNDERSCORE_IDENT_RE,relevance:0}]}}function Py(n){const e=n.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:t.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},a={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[n.BACKSLASH_ESCAPE,s,a],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(h,p,g="\\1")=>{const b=g==="\\1"?g:e.concat(g,p);return e.concat(e.concat("(?:",h,")"),p,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,g,r)},d=(h,p,g)=>e.concat(e.concat("(?:",h,")"),p,/(?:\\.|[^\\\/])*?/,g,r),f=[a,n.HASH_COMMENT_MODE,n.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[n.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+n.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[n.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",e.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",e.either(...c,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[n.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=f,o.contains=f,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:f}}function Du(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),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),s={scope:"variable",match:"\\$+"+r},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=n.inherit(n.APOS_STRING_MODE,{illegal:null}),c=n.inherit(n.QUOTE_STRING_MODE,{illegal:null,contains:n.QUOTE_STRING_MODE.contains.concat(a)}),u=n.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:n.QUOTE_STRING_MODE.contains.concat(a)}),d=`[ ]`,f={scope:"string",variants:[c,l,u]},h={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},p=["false","null","true"],g=["__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"],b=["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"],_={keyword:g,literal:(Le=>{const ie=[];return Le.forEach(ae=>{ie.push(ae),ae.toLowerCase()===ae?ie.push(ae.toUpperCase()):ie.push(ae.toLowerCase())}),ie})(p),built_in:b},T=Le=>Le.map(ie=>ie.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,e.concat(d,"+"),e.concat("(?!",T(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},L=e.concat(r,"\\b(?!\\()"),P={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},O={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[$,s,P,n.C_BLOCK_COMMENT_MODE,f,h,x]},K={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",T(g).join("\\b|"),"|",T(b).join("\\b|"),"\\b)"),r,e.concat(d,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[O]};O.contains.push(K);const oe=[$,P,n.C_BLOCK_COMMENT_MODE,f,h,x],ve={begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:p,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:p,keyword:["new","array"]},contains:["self",...oe]},...oe,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:_,contains:[ve,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}]}},o,{scope:"variable.language",match:/\$this\b/},s,K,P,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{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:_,contains:["self",s,P,n.C_BLOCK_COMMENT_MODE,f,h]}]},{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]},f,h]}}function zy(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Uy(n){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function _u(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"],a={$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"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[n.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[n.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[n.BACKSLASH_ESCAPE,l,u,c]},{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,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[n.BACKSLASH_ESCAPE,u,c]},n.APOS_STRING_MODE,n.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,p=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${p})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${f})[jJ](?=${p})`}]},b={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,g,d,n.HASH_COMMENT_MODE]}]};return c.contains=[d,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|->|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},d,b,n.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[S]},{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:[g,S,d]}]}}function $y(n){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Hy(n){const e=n.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=e.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[n.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),n.HASH_COMMENT_MODE,{scope:"string",contains:[n.BACKSLASH_ESCAPE],variants:[n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),n.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Nu(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]+/),i=e.concat(r,/(::\w+)*/),o={"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"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[n.COMMENT("#","$",{contains:[a]}),n.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),n.COMMENT("^__END__",n.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[n.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{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,u]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|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"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},P=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.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:[g]},{begin:n.IDENT_RE+"::"},{className:"symbol",begin:n.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:t}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+n.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[n.BACKSLASH_ESCAPE,u],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(l,c),relevance:0}].concat(l,c);u.contains=P,g.contains=P;const $="[>?]>",O="[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]",K="(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>",oe=[{begin:/^\s*=>/,starts:{end:"$",contains:P}},{className:"meta.prompt",begin:"^("+$+"|"+O+"|"+K+")(?=[ ])",starts:{end:"$",keywords:o,contains:P}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[n.SHEBANG({binary:"ruby"})].concat(oe).concat(c).concat(P)}}function Ky(n){const e=n.regex,t={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,n.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["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","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],o=["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!","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!"],a=["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:a,keyword:i,literal:s,built_in:o},illegal:""},t]}}const Vy=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_-]*/}}),Wy=["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","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Gy=["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"],qy=["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"],Yy=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Jy=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","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-right-color","border-right-style","border-right-width","border-spacing","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","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","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","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","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-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","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","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","resize","rest","rest-after","rest-before","right","row-gap","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","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","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-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","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","z-index"].reverse();function Zy(n){const e=Vy(n),t=Yy,r=qy,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Wy.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Jy.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[e.BLOCK_COMMENT,a,e.HEXCOLOR,e.CSS_NUMBER_MODE,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Gy.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,n.QUOTE_STRING_MODE,n.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}}function ku(n){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function jy(n){const e=n.regex,t=n.COMMENT("--","$"),r={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["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"],l=["add","asc","collation","desc","final","first","last","view"],c=["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"],u=["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"],d=["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"],f=["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"],h=u,p=[...c,...l].filter(T=>!u.includes(T)),g={className:"variable",begin:/@[a-z0-9]+/},b={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={begin:e.concat(/\b/,e.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function _(T,{exceptions:x,when:L}={}){const P=L;return x=x||[],T.map($=>$.match(/\|\d+$/)||x.includes($)?$:P($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(p,{when:T=>T.length<3}),literal:s,type:a,built_in:d},contains:[{begin:e.either(...f),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:p.concat(f),literal:s,type:a}},{className:"type",begin:e.either(...o)},S,g,r,i,n.C_NUMBER_MODE,n.C_BLOCK_COMMENT_MODE,t,b]}}function Au(n){return n?typeof n=="string"?n:n.source:null}function vr(n){return ce("(?=",n,")")}function ce(...n){return n.map(t=>Au(t)).join("")}function Xy(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function Ue(...n){return"("+(Xy(n).capture?"":"?:")+n.map(r=>Au(r)).join("|")+")"}const Co=n=>ce(/\b/,n,/\w$/.test(n)?/\b/:/\B/),Qy=["Protocol","Type"].map(Co),Qa=["init","self"].map(Co),e0=["Any","Self"],Es=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],el=["false","nil","true"],t0=["assignment","associativity","higherThan","left","lowerThan","none","right"],n0=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],tl=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Cu=Ue(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),wu=Ue(Cu,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ys=ce(Cu,wu,"*"),xu=Ue(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_i=Ue(xu,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),gt=ce(xu,_i,"*"),Ss=ce(/[A-Z]/,_i,"*"),r0=["autoclosure",ce(/convention\(/,Ue("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ce(/objc\(/,gt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],i0=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function s0(n){const e={match:/\s+/,relevance:0},t=n.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[n.C_LINE_COMMENT_MODE,t],i={match:[/\./,Ue(...Qy,...Qa)],className:{2:"keyword"}},s={match:ce(/\./,Ue(...Es)),relevance:0},o=Es.filter(se=>typeof se=="string").concat(["_|0"]),a=Es.filter(se=>typeof se!="string").concat(e0).map(Co),l={variants:[{className:"keyword",match:Ue(...a,...Qa)}]},c={$pattern:Ue(/\b\w+/,/#\w+/),keyword:o.concat(n0),literal:el},u=[i,s,l],d={match:ce(/\./,Ue(...tl)),relevance:0},f={className:"built_in",match:ce(/\b/,Ue(...tl),/(?=\()/)},h=[d,f],p={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:ys},{match:`\\.(\\.|${wu})+`}]},b=[p,g],S="([0-9]_*)+",_="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${_})(\\.(${_}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},x=(se="")=>({className:"subst",variants:[{match:ce(/\\/,se,/[0\\tnr"']/)},{match:ce(/\\/,se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),L=(se="")=>({className:"subst",match:ce(/\\/,se,/[\t ]*(?:[\r\n]|\r\n)/)}),P=(se="")=>({className:"subst",label:"interpol",begin:ce(/\\/,se,/\(/),end:/\)/}),$=(se="")=>({begin:ce(se,/"""/),end:ce(/"""/,se),contains:[x(se),L(se),P(se)]}),O=(se="")=>({begin:ce(se,/"/),end:ce(/"/,se),contains:[x(se),P(se)]}),K={className:"string",variants:[$(),$("#"),$("##"),$("###"),O(),O("#"),O("##"),O("###")]},oe={match:ce(/`/,gt,/`/)},ve={className:"variable",match:/\$\d+/},Le={className:"variable",match:`\\$${_i}+`},ie=[oe,ve,Le],ae={match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:i0,contains:[...b,T,K]}]}},he={className:"keyword",match:ce(/@/,Ue(...r0))},E={className:"meta",match:ce(/@/,gt)},D=[ae,he,E],k={match:vr(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ce(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_i,"+")},{className:"type",match:Ss,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ce(/\s+&\s+/,vr(Ss)),relevance:0}]},w={begin://,keywords:c,contains:[...r,...u,...D,p,k]};k.contains.push(w);const I={match:ce(gt,/\s*:/),keywords:"_|0",relevance:0},W={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",I,...r,...u,...h,...b,T,K,...ie,...D,k]},le={begin://,contains:[...r,k]},Xe={begin:Ue(vr(ce(gt,/\s*:/)),vr(ce(gt,/\s+/,gt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:gt}]},ee={begin:/\(/,end:/\)/,keywords:c,contains:[Xe,...r,...u,...b,T,K,...D,k,W],endsParent:!0,illegal:/["']/},ge={match:[/func/,/\s+/,Ue(oe.match,gt,ys)],className:{1:"keyword",3:"title.function"},contains:[le,ee,e],illegal:[/\[/,/%/]},zt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[le,ee,e],illegal:/\[|%/},Ut={match:[/operator/,/\s+/,ys],className:{1:"keyword",3:"title"}},Vn={begin:[/precedencegroup/,/\s+/,Ss],className:{1:"keyword",3:"title"},contains:[k],keywords:[...t0,...el],end:/}/};for(const se of K.variants){const dn=se.contains.find(Qe=>Qe.label==="interpol");dn.keywords=c;const fn=[...u,...h,...b,T,K,...ie];dn.contains=[...fn,{begin:/\(/,end:/\)/,contains:["self",...fn]}]}return{name:"Swift",keywords:c,contains:[...r,ge,zt,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:c,contains:[n.inherit(n.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...u]},Ut,Vn,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...u,...h,...b,T,K,...ie,...D,k,W]}}const Ni="[A-Za-z$_][0-9A-Za-z$_]*",Tu=["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"],vu=["true","false","null","undefined","NaN","Infinity"],Mu=["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"],Ou=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ru=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Iu=["arguments","this","super","console","window","document","localStorage","module","global"],Lu=[].concat(Ru,Mu,Ou);function o0(n){const e=n.regex,t=(D,{after:k})=>{const w="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(D,k)=>{const w=D[0].length+D.index,I=D.input[w];if(I==="<"||I===","){k.ignoreMatch();return}I===">"&&(t(D,{after:w})||k.ignoreMatch());let W;const le=D.input.substring(w);if(W=le.match(/^\s*=/)){k.ignoreMatch();return}if((W=le.match(/^\s+extends\s+/))&&W.index===0){k.ignoreMatch();return}}},a={$pattern:Ni,keyword:Tu,literal:vu,built_in:Lu,"variable.language":Iu},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\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},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[n.BACKSLASH_ESCAPE,f],subLanguage:"css"}},g={className:"string",begin:"`",end:"`",contains:[n.BACKSLASH_ESCAPE,f]},S={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]},_=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,p,g,{match:/\$\d+/},d];f.contains=_.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(_)});const T=[].concat(S,f.contains),x=T.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(T)}]),L={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},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"}}]},$={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:{_:[...Mu,...Ou]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},oe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ve(D){return e.concat("(?!",D.join("|"),")")}const Le={match:e.concat(/\b/,ve([...Ru,"super","import"]),r,e.lookahead(/\(/)),className:"title.function",relevance:0},ie={begin:e.concat(/\./,e.lookahead(e.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},ae={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},he="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+n.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(he)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[n.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,n.APOS_STRING_MODE,n.QUOTE_STRING_MODE,h,p,g,S,{match:/\$\d+/},d,$,{className:"attr",begin:r+e.lookahead(":"),relevance:0},E,{begin:"("+n.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[S,n.REGEXP_MODE,{className:"function",begin:he,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:n.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+n.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,n.inherit(n.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},ie,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},Le,oe,P,ae,{match:/\$[(.]/}]}}function a0(n){const e=o0(n),t=Ni,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:Ni,keyword:Tu.concat(a),literal:vu,built_in:Lu.concat(r),"variable.language":Iu},c={className:"meta",begin:"@"+t},u=(f,h,p)=>{const g=f.contains.findIndex(b=>b.label===h);if(g===-1)throw new Error("can not find mode to replace");f.contains.splice(g,1,p)};Object.assign(e.keywords,l),e.exports.PARAMS_CONTAINS.push(c),e.contains=e.contains.concat([c,i,s]),u(e,"shebang",n.SHEBANG()),u(e,"use_strict",o);const d=e.contains.find(f=>f.label==="func.def");return d.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx"]}),e}function l0(n){const e=n.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:e.concat(/# */,e.either(s,i),/ *#/)},{begin:e.concat(/# */,a,/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,e.either(s,i),/ +/,e.either(o,a),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=n.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=n.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,r,l,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function c0(n){n.regex;const e=n.COMMENT(/\(;/,/;\)/);e.contains.push("self");const t=n.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[t,e,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,n.QUOTE_STRING_MODE,l,c,a]}}function Bu(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,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=n.inherit(s,{begin:/\(/,end:/\)/}),a=n.inherit(n.APOS_STRING_MODE,{className:"string"}),l=n.inherit(n.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,l,a]}]}]},n.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:e.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:c}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function u0(n){const e="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[n.BACKSLASH_ESCAPE,i]},o=n.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),a="[0-9]{4}(-[0-9][0-9]){0,2}",l="([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?",c="(\\.[0-9]*)?",u="([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?",d={className:"number",begin:"\\b"+a+l+c+u+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},h={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},p={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},g=[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}},d,{className:"number",begin:n.C_NUMBER_RE+"\\b",relevance:0},h,p,s],b=[...g];return b.pop(),b.push(o),f.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var wo={exports:{}};function xo(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach(function(e){var t=n[e];typeof t=="object"&&!Object.isFrozen(t)&&xo(t)}),n}wo.exports=xo;wo.exports.default=xo;class nl{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Fu(n){return n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Mt(n,...e){const t=Object.create(null);for(const r in n)t[r]=n[r];return e.forEach(function(r){for(const i in r)t[i]=r[i]}),t}const d0="",rl=n=>!!n.scope||n.sublanguage&&n.language,f0=(n,{prefix:e})=>{if(n.includes(".")){const t=n.split(".");return[`${e}${t.shift()}`,...t.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${e}${n}`};class h0{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=Fu(e)}openNode(e){if(!rl(e))return;let t="";e.sublanguage?t=`language-${e.language}`:t=f0(e.scope,{prefix:this.classPrefix}),this.span(t)}closeNode(e){!rl(e)||(this.buffer+=d0)}value(){return this.buffer}span(e){this.buffer+=``}}const il=(n={})=>{const e={children:[]};return Object.assign(e,n),e};class To{constructor(){this.rootNode=il(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=il({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(r=>this._walk(e,r)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&(!e.children||(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{To._collapse(t)})))}}class p0 extends To{constructor(e){super(),this.options=e}addKeyword(e,t){e!==""&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){e!==""&&this.add(e)}addSublanguage(e,t){const r=e.root;r.sublanguage=!0,r.language=t,this.add(r)}toHTML(){return new h0(this,this.options).value()}finalize(){return!0}}function mr(n){return n?typeof n=="string"?n:n.source:null}function Pu(n){return un("(?=",n,")")}function g0(n){return un("(?:",n,")*")}function m0(n){return un("(?:",n,")?")}function un(...n){return n.map(t=>mr(t)).join("")}function b0(n){const e=n[n.length-1];return typeof e=="object"&&e.constructor===Object?(n.splice(n.length-1,1),e):{}}function vo(...n){return"("+(b0(n).capture?"":"?:")+n.map(r=>mr(r)).join("|")+")"}function zu(n){return new RegExp(n.toString()+"|").exec("").length-1}function E0(n,e){const t=n&&n.exec(e);return t&&t.index===0}const y0=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Mo(n,{joinWith:e}){let t=0;return n.map(r=>{t+=1;const i=t;let s=mr(r),o="";for(;s.length>0;){const a=y0.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&t++)}return o}).map(r=>`(${r})`).join(e)}const S0=/\b\B/,Uu="[a-zA-Z]\\w*",Oo="[a-zA-Z_]\\w*",$u="\\b\\d+(\\.\\d+)?",Hu="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Ku="\\b(0b[01]+)",D0="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_0=(n={})=>{const e=/^#![ ]*\//;return n.binary&&(n.begin=un(e,/.*\b/,n.binary,/\b.*/)),Mt({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,r)=>{t.index!==0&&r.ignoreMatch()}},n)},br={begin:"\\\\[\\s\\S]",relevance:0},N0={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[br]},k0={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[br]},A0={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/},Hi=function(n,e,t={}){const r=Mt({scope:"comment",begin:n,end:e,contains:[]},t);r.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 i=vo("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 r.contains.push({begin:un(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},C0=Hi("//","$"),w0=Hi("/\\*","\\*/"),x0=Hi("#","$"),T0={scope:"number",begin:$u,relevance:0},v0={scope:"number",begin:Hu,relevance:0},M0={scope:"number",begin:Ku,relevance:0},O0={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[br,{begin:/\[/,end:/\]/,relevance:0,contains:[br]}]}]},R0={scope:"title",begin:Uu,relevance:0},I0={scope:"title",begin:Oo,relevance:0},L0={begin:"\\.\\s*"+Oo,relevance:0},B0=function(n){return Object.assign(n,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var Mr=Object.freeze({__proto__:null,MATCH_NOTHING_RE:S0,IDENT_RE:Uu,UNDERSCORE_IDENT_RE:Oo,NUMBER_RE:$u,C_NUMBER_RE:Hu,BINARY_NUMBER_RE:Ku,RE_STARTERS_RE:D0,SHEBANG:_0,BACKSLASH_ESCAPE:br,APOS_STRING_MODE:N0,QUOTE_STRING_MODE:k0,PHRASAL_WORDS_MODE:A0,COMMENT:Hi,C_LINE_COMMENT_MODE:C0,C_BLOCK_COMMENT_MODE:w0,HASH_COMMENT_MODE:x0,NUMBER_MODE:T0,C_NUMBER_MODE:v0,BINARY_NUMBER_MODE:M0,REGEXP_MODE:O0,TITLE_MODE:R0,UNDERSCORE_TITLE_MODE:I0,METHOD_GUARD:L0,END_SAME_AS_BEGIN:B0});function F0(n,e){n.input[n.index-1]==="."&&e.ignoreMatch()}function P0(n,e){n.className!==void 0&&(n.scope=n.className,delete n.className)}function z0(n,e){!e||!n.beginKeywords||(n.begin="\\b("+n.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",n.__beforeBegin=F0,n.keywords=n.keywords||n.beginKeywords,delete n.beginKeywords,n.relevance===void 0&&(n.relevance=0))}function U0(n,e){!Array.isArray(n.illegal)||(n.illegal=vo(...n.illegal))}function $0(n,e){if(!!n.match){if(n.begin||n.end)throw new Error("begin & end are not supported with match");n.begin=n.match,delete n.match}}function H0(n,e){n.relevance===void 0&&(n.relevance=1)}const K0=(n,e)=>{if(!n.beforeMatch)return;if(n.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},n);Object.keys(n).forEach(r=>{delete n[r]}),n.keywords=t.keywords,n.begin=un(t.beforeMatch,Pu(t.begin)),n.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},n.relevance=0,delete t.beforeMatch},V0=["of","and","for","in","not","or","if","then","parent","list","value"],W0="keyword";function Vu(n,e,t=W0){const r=Object.create(null);return typeof n=="string"?i(t,n.split(" ")):Array.isArray(n)?i(t,n):Object.keys(n).forEach(function(s){Object.assign(r,Vu(n[s],e,s))}),r;function i(s,o){e&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){const l=a.split("|");r[l[0]]=[s,G0(l[0],l[1])]})}}function G0(n,e){return e?Number(e):q0(n)?0:1}function q0(n){return V0.includes(n.toLowerCase())}const sl={},tn=n=>{console.error(n)},ol=(n,...e)=>{console.log(`WARN: ${n}`,...e)},gn=(n,e)=>{sl[`${n}/${e}`]||(console.log(`Deprecated as of ${n}. ${e}`),sl[`${n}/${e}`]=!0)},ki=new Error;function Wu(n,e,{key:t}){let r=0;const i=n[t],s={},o={};for(let a=1;a<=e.length;a++)o[a+r]=i[a],s[a+r]=!0,r+=zu(e[a-1]);n[t]=o,n[t]._emit=s,n[t]._multi=!0}function Y0(n){if(!!Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw tn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ki;if(typeof n.beginScope!="object"||n.beginScope===null)throw tn("beginScope must be object"),ki;Wu(n,n.begin,{key:"beginScope"}),n.begin=Mo(n.begin,{joinWith:""})}}function J0(n){if(!!Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw tn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ki;if(typeof n.endScope!="object"||n.endScope===null)throw tn("endScope must be object"),ki;Wu(n,n.end,{key:"endScope"}),n.end=Mo(n.end,{joinWith:""})}}function Z0(n){n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)}function j0(n){Z0(n),typeof n.beginScope=="string"&&(n.beginScope={_wrap:n.beginScope}),typeof n.endScope=="string"&&(n.endScope={_wrap:n.endScope}),Y0(n),J0(n)}function X0(n){function e(o,a){return new RegExp(mr(o),"m"+(n.case_insensitive?"i":"")+(n.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=zu(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(l=>l[1]);this.matcherRe=e(Mo(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(a);if(!l)return null;const c=l.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const l=new t;return this.rules.slice(a).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(a);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(a)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(o){const a=new r;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){const l=o;if(o.isCompiled)return l;[P0,$0,j0,K0].forEach(u=>u(o,a)),n.compilerExtensions.forEach(u=>u(o,a)),o.__beforeBegin=null,[z0,U0,H0].forEach(u=>u(o,a)),o.isCompiled=!0;let c=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),c=o.keywords.$pattern,delete o.keywords.$pattern),c=c||/\w+/,o.keywords&&(o.keywords=Vu(o.keywords,n.case_insensitive)),l.keywordPatternRe=e(c,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=mr(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(u){return Q0(u==="self"?o:u)})),o.contains.forEach(function(u){s(u,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(n.compilerExtensions||(n.compilerExtensions=[]),n.contains&&n.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return n.classNameAliases=Mt(n.classNameAliases||{}),s(n)}function Gu(n){return n?n.endsWithParent||Gu(n.starts):!1}function Q0(n){return n.variants&&!n.cachedVariants&&(n.cachedVariants=n.variants.map(function(e){return Mt(n,{variants:null},e)})),n.cachedVariants?n.cachedVariants:Gu(n)?Mt(n,{starts:n.starts?Mt(n.starts):null}):Object.isFrozen(n)?Mt(n):n}var eS="11.7.0";class tS extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const Ds=Fu,al=Mt,ll=Symbol("nomatch"),nS=7,rS=function(n){const e=Object.create(null),t=Object.create(null),r=[];let i=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p0};function l(E){return a.noHighlightRe.test(E)}function c(E){let D=E.className+" ";D+=E.parentNode?E.parentNode.className:"";const k=a.languageDetectRe.exec(D);if(k){const w=K(k[1]);return w||(ol(s.replace("{}",k[1])),ol("Falling back to no-highlight mode for this block.",E)),w?k[1]:"no-highlight"}return D.split(/\s+/).find(w=>l(w)||K(w))}function u(E,D,k){let w="",I="";typeof D=="object"?(w=E,k=D.ignoreIllegals,I=D.language):(gn("10.7.0","highlight(lang, code, ...args) has been deprecated."),gn("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),I=E,w=D),k===void 0&&(k=!0);const W={code:w,language:I};ae("before:highlight",W);const le=W.result?W.result:d(W.language,W.code,k);return le.code=W.code,ae("after:highlight",le),le}function d(E,D,k,w){const I=Object.create(null);function W(y,N){return y.keywords[N]}function le(){if(!C.keywords){Z.addText(z);return}let y=0;C.keywordPatternRe.lastIndex=0;let N=C.keywordPatternRe.exec(z),M="";for(;N;){M+=z.substring(y,N.index);const F=ke.case_insensitive?N[0].toLowerCase():N[0],Q=W(C,F);if(Q){const[me,Vi]=Q;if(Z.addText(M),M="",I[F]=(I[F]||0)+1,I[F]<=nS&&(pt+=Vi),me.startsWith("_"))M+=N[0];else{const Wi=ke.classNameAliases[me]||me;Z.addKeyword(N[0],Wi)}}else M+=N[0];y=C.keywordPatternRe.lastIndex,N=C.keywordPatternRe.exec(z)}M+=z.substring(y),Z.addText(M)}function Xe(){if(z==="")return;let y=null;if(typeof C.subLanguage=="string"){if(!e[C.subLanguage]){Z.addText(z);return}y=d(C.subLanguage,z,!0,Gn[C.subLanguage]),Gn[C.subLanguage]=y._top}else y=h(z,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(pt+=y.relevance),Z.addSublanguage(y._emitter,y.language)}function ee(){C.subLanguage!=null?Xe():le(),z=""}function ge(y,N){let M=1;const F=N.length-1;for(;M<=F;){if(!y._emit[M]){M++;continue}const Q=ke.classNameAliases[y[M]]||y[M],me=N[M];Q?Z.addKeyword(me,Q):(z=me,le(),z=""),M++}}function zt(y,N){return y.scope&&typeof y.scope=="string"&&Z.openNode(ke.classNameAliases[y.scope]||y.scope),y.beginScope&&(y.beginScope._wrap?(Z.addKeyword(z,ke.classNameAliases[y.beginScope._wrap]||y.beginScope._wrap),z=""):y.beginScope._multi&&(ge(y.beginScope,N),z="")),C=Object.create(y,{parent:{value:C}}),C}function Ut(y,N,M){let F=E0(y.endRe,M);if(F){if(y["on:end"]){const Q=new nl(y);y["on:end"](N,Q),Q.isMatchIgnored&&(F=!1)}if(F){for(;y.endsParent&&y.parent;)y=y.parent;return y}}if(y.endsWithParent)return Ut(y.parent,N,M)}function Vn(y){return C.matcher.regexIndex===0?(z+=y[0],1):(Kt=!0,0)}function se(y){const N=y[0],M=y.rule,F=new nl(M),Q=[M.__beforeBegin,M["on:begin"]];for(const me of Q)if(!!me&&(me(y,F),F.isMatchIgnored))return Vn(N);return M.skip?z+=N:(M.excludeBegin&&(z+=N),ee(),!M.returnBegin&&!M.excludeBegin&&(z=N)),zt(M,y),M.returnBegin?0:N.length}function dn(y){const N=y[0],M=D.substring(y.index),F=Ut(C,y,M);if(!F)return ll;const Q=C;C.endScope&&C.endScope._wrap?(ee(),Z.addKeyword(N,C.endScope._wrap)):C.endScope&&C.endScope._multi?(ee(),ge(C.endScope,y)):Q.skip?z+=N:(Q.returnEnd||Q.excludeEnd||(z+=N),ee(),Q.excludeEnd&&(z=N));do C.scope&&Z.closeNode(),!C.skip&&!C.subLanguage&&(pt+=C.relevance),C=C.parent;while(C!==F.parent);return F.starts&&zt(F.starts,y),Q.returnEnd?0:N.length}function fn(){const y=[];for(let N=C;N!==ke;N=N.parent)N.scope&&y.unshift(N.scope);y.forEach(N=>Z.openNode(N))}let Qe={};function Wn(y,N){const M=N&&N[0];if(z+=y,M==null)return ee(),0;if(Qe.type==="begin"&&N.type==="end"&&Qe.index===N.index&&M===""){if(z+=D.slice(N.index,N.index+1),!i){const F=new Error(`0 width match regex (${E})`);throw F.languageName=E,F.badRule=Qe.rule,F}return 1}if(Qe=N,N.type==="begin")return se(N);if(N.type==="illegal"&&!k){const F=new Error('Illegal lexeme "'+M+'" for mode "'+(C.scope||"")+'"');throw F.mode=C,F}else if(N.type==="end"){const F=dn(N);if(F!==ll)return F}if(N.type==="illegal"&&M==="")return 1;if(Ht>1e5&&Ht>N.index*3)throw new Error("potential infinite loop, way more iterations than matches");return z+=M,M.length}const ke=K(E);if(!ke)throw tn(s.replace("{}",E)),new Error('Unknown language: "'+E+'"');const Ki=X0(ke);let $t="",C=w||Ki;const Gn={},Z=new a.__emitter(a);fn();let z="",pt=0,Be=0,Ht=0,Kt=!1;try{for(C.matcher.considerAll();;){Ht++,Kt?Kt=!1:C.matcher.considerAll(),C.matcher.lastIndex=Be;const y=C.matcher.exec(D);if(!y)break;const N=D.substring(Be,y.index),M=Wn(N,y);Be=y.index+M}return Wn(D.substring(Be)),Z.closeAllNodes(),Z.finalize(),$t=Z.toHTML(),{language:E,value:$t,relevance:pt,illegal:!1,_emitter:Z,_top:C}}catch(y){if(y.message&&y.message.includes("Illegal"))return{language:E,value:Ds(D),illegal:!0,relevance:0,_illegalBy:{message:y.message,index:Be,context:D.slice(Be-100,Be+100),mode:y.mode,resultSoFar:$t},_emitter:Z};if(i)return{language:E,value:Ds(D),illegal:!1,relevance:0,errorRaised:y,_emitter:Z,_top:C};throw y}}function f(E){const D={value:Ds(E),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return D._emitter.addText(E),D}function h(E,D){D=D||a.languages||Object.keys(e);const k=f(E),w=D.filter(K).filter(ve).map(ee=>d(ee,E,!1));w.unshift(k);const I=w.sort((ee,ge)=>{if(ee.relevance!==ge.relevance)return ge.relevance-ee.relevance;if(ee.language&&ge.language){if(K(ee.language).supersetOf===ge.language)return 1;if(K(ge.language).supersetOf===ee.language)return-1}return 0}),[W,le]=I,Xe=W;return Xe.secondBest=le,Xe}function p(E,D,k){const w=D&&t[D]||k;E.classList.add("hljs"),E.classList.add(`language-${w}`)}function g(E){let D=null;const k=c(E);if(l(k))return;if(ae("before:highlightElement",{el:E,language:k}),E.children.length>0&&(a.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(E)),a.throwUnescapedHTML))throw new tS("One of your code blocks includes unescaped HTML.",E.innerHTML);D=E;const w=D.textContent,I=k?u(w,{language:k,ignoreIllegals:!0}):h(w);E.innerHTML=I.value,p(E,k,I.language),E.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(E.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),ae("after:highlightElement",{el:E,result:I,text:w})}function b(E){a=al(a,E)}const S=()=>{x(),gn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _(){x(),gn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let T=!1;function x(){if(document.readyState==="loading"){T=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function L(){T&&x()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",L,!1);function P(E,D){let k=null;try{k=D(n)}catch(w){if(tn("Language definition for '{}' could not be registered.".replace("{}",E)),i)tn(w);else throw w;k=o}k.name||(k.name=E),e[E]=k,k.rawDefinition=D.bind(null,n),k.aliases&&oe(k.aliases,{languageName:E})}function $(E){delete e[E];for(const D of Object.keys(t))t[D]===E&&delete t[D]}function O(){return Object.keys(e)}function K(E){return E=(E||"").toLowerCase(),e[E]||e[t[E]]}function oe(E,{languageName:D}){typeof E=="string"&&(E=[E]),E.forEach(k=>{t[k.toLowerCase()]=D})}function ve(E){const D=K(E);return D&&!D.disableAutodetect}function Le(E){E["before:highlightBlock"]&&!E["before:highlightElement"]&&(E["before:highlightElement"]=D=>{E["before:highlightBlock"](Object.assign({block:D.el},D))}),E["after:highlightBlock"]&&!E["after:highlightElement"]&&(E["after:highlightElement"]=D=>{E["after:highlightBlock"](Object.assign({block:D.el},D))})}function ie(E){Le(E),r.push(E)}function ae(E,D){const k=E;r.forEach(function(w){w[k]&&w[k](D)})}function he(E){return gn("10.7.0","highlightBlock will be removed entirely in v12.0"),gn("10.7.0","Please use highlightElement now."),g(E)}Object.assign(n,{highlight:u,highlightAuto:h,highlightAll:x,highlightElement:g,highlightBlock:he,configure:b,initHighlighting:S,initHighlightingOnLoad:_,registerLanguage:P,unregisterLanguage:$,listLanguages:O,getLanguage:K,registerAliases:oe,autoDetection:ve,inherit:al,addPlugin:ie}),n.debugMode=function(){i=!1},n.safeMode=function(){i=!0},n.versionString=eS,n.regex={concat:un,lookahead:Pu,either:vo,optional:m0,anyNumberOfTimes:g0};for(const E in Mr)typeof Mr[E]=="object"&&wo.exports(Mr[E]);return Object.assign(n,Mr),n};var Er=rS({}),iS=Er;Er.HighlightJS=Er;Er.default=Er;const nt=iS,Fr=Object.assign(Wt(Error),{eval:Wt(EvalError),range:Wt(RangeError),reference:Wt(ReferenceError),syntax:Wt(SyntaxError),type:Wt(TypeError),uri:Wt(URIError)});function Wt(n){return e.displayName=n.displayName||n.name,e;function e(t,...r){const i=t&&bd(t,...r);return new n(i)}}const sS={}.hasOwnProperty,oS="hljs-";function qu(n,e,t={}){let r=t.prefix;if(typeof n!="string")throw Fr("Expected `string` for name, got `%s`",n);if(!nt.getLanguage(n))throw Fr("Unknown language: `%s` is not registered",n);if(typeof e!="string")throw Fr("Expected `string` for value, got `%s`",e);r==null&&(r=oS),nt.configure({__emitter:fS,classPrefix:r});const i=nt.highlight(e,{language:n,ignoreIllegals:!0});if(nt.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}function aS(n,e={}){const t=e.subset||nt.listLanguages();e.prefix;let r=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if(typeof n!="string")throw Fr("Expected `string` for value, got `%s`",n);for(;++ri.data.relevance&&(i=o)}return i}function lS(n,e){nt.registerLanguage(n,e)}const cS=function(n,e){if(typeof n=="string")nt.registerAliases(e,{languageName:n});else{let t;for(t in n)sS.call(n,t)&&nt.registerAliases(n[t],{languageName:t})}};function uS(n){return Boolean(nt.getLanguage(n))}function dS(){return nt.listLanguages()}class fS{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(e==="")return;const t=this.stack[this.stack.length-1],r=t.children[t.children.length-1];r&&r.type==="text"?r.value+=e:t.children.push({type:"text",value:e})}addKeyword(e,t){this.openNode(t),this.addText(e),this.closeNode()}addSublanguage(e,t){const r=this.stack[this.stack.length-1],i=e.root.children;t?r.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):r.children.push(...i)}openNode(e){const t=e.split(".").map((s,o)=>o?s+"_".repeat(o):this.options.classPrefix+s),r=this.stack[this.stack.length-1],i={type:"element",tagName:"span",properties:{className:t},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const H={highlight:qu,highlightAuto:aS,registerLanguage:lS,registered:uS,listLanguages:dS,registerAlias:cS};H.registerLanguage("arduino",ly);H.registerLanguage("bash",uu);H.registerLanguage("c",du);H.registerLanguage("cpp",cy);H.registerLanguage("csharp",uy);H.registerLanguage("css",fu);H.registerLanguage("diff",by);H.registerLanguage("go",Ey);H.registerLanguage("graphql",yy);H.registerLanguage("ini",Sy);H.registerLanguage("java",pu);H.registerLanguage("javascript",Eu);H.registerLanguage("json",Ay);H.registerLanguage("kotlin",wy);H.registerLanguage("less",Ry);H.registerLanguage("lua",Iy);H.registerLanguage("makefile",Ly);H.registerLanguage("markdown",By);H.registerLanguage("objectivec",Fy);H.registerLanguage("perl",Py);H.registerLanguage("php",Du);H.registerLanguage("php-template",zy);H.registerLanguage("plaintext",Uy);H.registerLanguage("python",_u);H.registerLanguage("python-repl",$y);H.registerLanguage("r",Hy);H.registerLanguage("ruby",Nu);H.registerLanguage("rust",Ky);H.registerLanguage("scss",Zy);H.registerLanguage("shell",ku);H.registerLanguage("sql",jy);H.registerLanguage("swift",s0);H.registerLanguage("typescript",a0);H.registerLanguage("vbnet",l0);H.registerLanguage("wasm",c0);H.registerLanguage("xml",Bu);H.registerLanguage("yaml",u0);H.registerLanguage("javascript",Eu);H.registerLanguage("html",Bu);H.registerLanguage("css",fu);H.registerLanguage("php",Du);H.registerLanguage("shell",ku);H.registerLanguage("bash",uu);H.registerLanguage("ruby",Nu);H.registerLanguage("python",_u);H.registerLanguage("java",pu);H.registerLanguage("c",du);const hS=Te.create({name:"be-info-block",group:"block",content:"inline*",defining:!0,addAttributes(){return{type:{default:"success",renderHTML:n=>({class:n.type})}}},parseHTML(){return[{tag:"div",getAttrs:n=>n.classList.contains("info-block")&&null}]},renderHTML({HTMLAttributes:n}){return["div",ue(n,{class:"info-block"}),["div",{class:"title"},"Important:"],["p",0]]},addCommands(){return{addInfo:n=>({commands:e})=>e.setNode(this.name,n)}}});var Yu={exports:{}};(function(n,e){(function(t,r,i){n.exports=i(),n.exports.default=i()})("slugify",ju,function(){var t=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`),r=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function i(s,o){if(typeof s!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var a=r[o.locale]||{},l=o.replacement===void 0?"-":o.replacement,c=o.trim===void 0?!0:o.trim,u=s.normalize().split("").reduce(function(d,f){var h=a[f]||t[f]||f;return h===l&&(h=" "),d+h.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(u=u.replace(/[^A-Za-z0-9\s]/g,"")),c&&(u=u.trim()),u=u.replace(/\s+/g,l),o.lower&&(u=u.toLowerCase()),u}return i.extend=function(s){Object.assign(t,s)},i})})(Yu);const pS=Yu.exports;function gS(n,e="-",t=!1){if(!n)return n;let r=pS(n,{lower:!0,replacement:e,strict:t,remove:/[*+~.()'"!:@?\|/\\]/g});return r||(r=n.replace(/\s+/g,"-").toLowerCase()),r}function mS({host:n,value:e="",placeholder:t,onChange:r,className:i,inputRef:s,onInputBlur:o,showLinkIcon:a=!0,pattern:l,minLength:c,maxLength:u,hideButton:d,...f}){const{base_url:h}=Xu(),p=f.prefix?`/${f.prefix}`:"",g=f.suffix?`/${f.suffix}`:"",[b,S]=fe.exports.useState(!1),[_,T]=fe.exports.useState(e);n=n||h,fe.exports.useEffect(()=>{T(e)},[e]);const x=()=>{b?(S(!1),_&&(r==null||r(_))):S(!0)};let L="";return _?L=_:t&&(L=gS(t)),J("div",{className:Se("flex items-center",i),children:[a&&m(Sl,{className:"icon-md text-muted"}),J("div",{className:"text-primary ml-6 mr-14",children:[n,p,!b&&L&&J(fe.exports.Fragment,{children:[m("span",{children:"/"}),m("span",{className:"font-medium",children:L})]}),b?null:g]}),b&&m(Qu,{pattern:l,minLength:c,maxLength:u,onKeyDown:P=>{P.key==="Enter"&&x()},ref:s,"aria-label":"slug",autoFocus:!0,className:"mr-14",size:"2xs",value:_,onBlur:o,onChange:P=>{T(P.target.value)}}),!d&&m(St,{type:"button",color:"chip",variant:"outline",size:"2xs",onClick:()=>{x()},children:b?m(X,{message:"Save"}):m(X,{message:"Edit"})})]})}function bS(n){const e=n||"custom-pages";return ed(t=>ES(t,e),{onError:t=>td(t),onSuccess:()=>{dl.invalidateQueries(Sd(e))}})}function ES({pageId:n,payload:e},t){return n?Ro.put(`${t}/${n}`,e).then(r=>r.data):Ro.post(`${t}`,e).then(r=>r.data)}function yS({editor:n}){return J("span",{children:[m(De,{size:"md",radius:"rounded",disabled:!n.can().undo(),onClick:()=>{n.commands.focus(),n.commands.undo()},children:m(Ad,{})}),m(De,{size:"md",radius:"rounded",disabled:!n.can().redo(),onClick:()=>{n.commands.focus(),n.commands.redo()},children:m(Cd,{})})]})}function SS({editor:n}){return J(Ci,{type:"modal",onClose:e=>{e!=null&&(n==null||n.commands.setContent(e))},children:[m(St,{variant:"text",startIcon:m(Dl,{}),children:m(X,{message:"Source code"})}),m(Dd,{title:m(X,{message:"Source code"}),defaultValue:n.getHTML()})]})}function Rn(){return m("div",{className:"self-stretch mx-4 w-1 bg-divider flex-shrink-0"})}function DS({editor:n,size:e}){return J("span",{className:Se("flex-shrink-0 whitespace-nowrap"),children:[m(De,{size:e,radius:"rounded",color:n.isActive("bold")?"primary":null,onClick:()=>{n.commands.focus(),n.commands.toggleBold()},children:m(wd,{})}),m(De,{size:e,radius:"rounded",color:n.isActive("italic")?"primary":null,onClick:()=>{n.commands.focus(),n.commands.toggleItalic()},children:m(xd,{})}),m(De,{size:e,radius:"rounded",color:n.isActive("underline")?"primary":null,onClick:()=>{n.commands.focus(),n.commands.toggleUnderline()},children:m(Td,{})})]})}function _S({editor:n,size:e}){const t=n.isActive("bulletList"),r=n.isActive("orderedList");return J("span",{className:Se("flex-shrink-0","whitespace-nowrap"),children:[m(De,{size:e,radius:"rounded",color:t?"primary":null,onClick:()=>{n.commands.focus(),n.commands.toggleBulletList()},children:m(vd,{})}),m(De,{size:e,radius:"rounded",color:r?"primary":null,onClick:()=>{n.commands.focus(),n.commands.toggleOrderedList()},children:m(Md,{})})]})}function NS({editor:n,size:e}){return J(Ci,{type:"modal",children:[m(De,{size:e,radius:"rounded",className:Se("flex-shrink-0"),children:m(Sl,{})}),m(kS,{editor:n})]})}function kS({editor:n}){const e=n.getAttributes("link").href,t=n.state.doc.textBetween(n.state.selection.from,n.state.selection.to,""),r=Ks({defaultValues:{href:e,text:t}}),{formId:i,close:s}=fl();return J(hl,{children:[m(pl,{children:m(X,{message:"Insert link"})}),m(gl,{children:J(ml,{form:r,id:i,onSubmit:o=>{n.state.selection.empty&&o.text?n.commands.insertContent(`${o.text}`):n.state.selection.empty||(o.href?n.chain().focus().extendMarkRange("link").setLink({href:o.href,target:o.target}).run():n.chain().focus().extendMarkRange("link").unsetLink().run()),s()},children:[m(zr,{name:"href",label:m(X,{message:"URL"}),autoFocus:!0,type:"url",className:"mb-20"}),m(zr,{name:"text",label:m(X,{message:"Text to display"}),className:"mb-20"}),J(nd,{selectionMode:"single",name:"target",label:m(X,{message:"Open link in..."}),children:[m(re,{value:"_self",children:m(X,{message:"Current window"})}),m(re,{value:"_blank",children:m(X,{message:"New window"})})]})]})}),J(bl,{children:[m(St,{onClick:s,variant:"text",children:m(X,{message:"Cancel"})}),m(St,{type:"submit",form:i,variant:"flat",color:"primary",children:m(X,{message:"Save"})})]})]})}const AS=2097152;function CS({editor:n,size:e}){const{selectAndUploadFile:t}=rd();return m(De,{size:e,radius:"rounded",onClick:()=>{t({showToastOnRestrictionFail:!0,restrictions:{allowedFileTypes:[id.image],maxFileSize:AS},metadata:{diskPrefix:"page_media",disk:sd.public},onSuccess:i=>{n.commands.focus(),n.commands.setImage({src:i.url})}})},className:Se("flex-shrink-0"),children:m(Od,{})})}function wS({editor:n,size:e}){return m(De,{className:Se("flex-shrink-0"),size:e,radius:"rounded",onClick:()=>{n.chain().focus().clearNodes().unsetAllMarks().run()},children:m(Rd,{})})}function xS({editor:n,size:e}){const[t,r]=fe.exports.useState(!1);return J(Ai,{children:[J(wi,{onItemSelected:i=>{i==="hr"?(n.commands.focus(),n.commands.setHorizontalRule()):i==="embed"?r("embed"):(n.commands.focus(),n.commands.addInfo({type:i}))},children:[m(De,{variant:"text",size:e,radius:"rounded",className:Se("flex-shrink-0"),children:m(yd,{})}),J(xi,{children:[m(re,{value:"hr",startIcon:m(Id,{}),children:m(X,{message:"Horizontal rule"})}),m(re,{value:"embed",startIcon:m(Ld,{}),children:m(X,{message:"Embed"})}),m(re,{value:"important",startIcon:m(Bd,{}),children:m(X,{message:"Important"})}),m(re,{value:"warning",startIcon:m(od,{}),children:m(X,{message:"Warning"})}),m(re,{value:"success",startIcon:m(Fd,{}),children:m(X,{message:"Note"})})]})]}),m(Ci,{type:"modal",isOpen:!!t,onClose:()=>{r(!1)},children:m(TS,{editor:n})})]})}function TS({editor:n}){const e=n.getAttributes("embed").src,t=Ks({defaultValues:{src:e}}),{formId:r,close:i}=fl();return J(hl,{children:[m(pl,{children:m(X,{message:"Insert link"})}),m(gl,{children:m(ml,{form:t,id:r,onSubmit:s=>{n.commands.setEmbed(s),i()},children:m(zr,{name:"src",label:m(X,{message:"Embed URL"}),autoFocus:!0,type:"url",required:!0})})}),J(bl,{children:[m(St,{onClick:i,variant:"text",children:m(X,{message:"Cancel"})}),m(St,{type:"submit",form:r,disabled:!t.formState.isValid,variant:"flat",color:"primary",children:m(X,{message:"Add"})})]})]})}function st({children:n,modifier:e,separator:t="+"}){const r=ad()?m("span",{className:"text-base align-middle",children:"\u2318"}):"Ctrl";return J("kbd",{className:"text-xs text-muted",children:[e&&J(Ai,{children:[r,t]}),n]})}function vS({editor:n,size:e}){return J(wi,{floatingMinWidth:"w-256",onItemSelected:t=>{n.commands.focus(),typeof t=="string"&&t.startsWith("h")?n.commands.toggleHeading({level:parseInt(t.replace("h",""))}):t==="code"?n.commands.toggleCode():t==="strike"?n.commands.toggleStrike():t==="super"?n.commands.toggleSuperscript():t==="sub"?n.commands.toggleSubscript():t==="blockquote"?n.commands.toggleBlockquote():t==="paragraph"&&n.commands.setParagraph()},children:[m(St,{className:Se("flex-shrink-0"),variant:"text",size:e,endIcon:m(ld,{}),children:m(X,{message:"Format"})}),J(xi,{children:[m(re,{value:"h1",endSection:m(st,{modifier:!0,children:"Alt+1"}),children:m(X,{message:"Heading :number",values:{number:1}})}),m(re,{value:"h2",endSection:m(st,{modifier:!0,children:"Alt+2"}),children:m(X,{message:"Heading :number",values:{number:2}})}),m(re,{value:"h3",endSection:m(st,{modifier:!0,children:"Alt+3"}),children:m(X,{message:"Heading :number",values:{number:3}})}),m(re,{value:"h4",endSection:m(st,{modifier:!0,children:"Alt+4"}),children:m(X,{message:"Heading :number",values:{number:4}})}),m(re,{value:"code",endSection:m(st,{modifier:!0,children:"E"}),children:m(X,{message:"Code"})}),m(re,{value:"strike",endSection:m(st,{modifier:!0,children:"Shift+X"}),children:m(X,{message:"Strikethrough"})}),m(re,{value:"super",endSection:m(st,{modifier:!0,separator:" ",children:"."}),children:m(X,{message:"Superscript"})}),m(re,{value:"sub",endSection:m(st,{modifier:!0,separator:" ",children:","}),children:m(X,{message:"Subscript"})}),m(re,{value:"blockquote",endSection:m(st,{modifier:!0,children:"Shift+B"}),children:m(X,{message:"Blockquote"})}),m(re,{value:"paragraph",endSection:m(st,{modifier:!0,children:"Alt+0"}),children:m(X,{message:"Paragraph"})})]})]})}function MS({editor:n,size:e}){const[t,r]=fe.exports.useState(!1),i=n.getAttributes("textStyle").color,s=n.getAttributes("textStyle").backgroundColor;return J(fe.exports.Fragment,{children:[J("span",{className:Se("flex-shrink-0 whitespace-nowrap"),children:[m(De,{size:e,radius:"rounded",color:i?"primary":null,onClick:()=>{r("text")},children:m(Pd,{})}),m(De,{size:e,radius:"rounded",color:s?"primary":null,onClick:()=>{r("bg")},children:m(zd,{})})]}),m(Ci,{currentValue:t==="text"?"#000000":"#FFFFFF",type:"modal",isOpen:!!t,onClose:o=>{o&&(t==="text"?n.commands.setColor(o):n.commands.setBackgroundColor(o)),r(!1)},children:m(_d,{defaultValue:t==="text"?"#000000":"#FFFFFF"})})]})}const Or={left:{icon:Ud,label:Sr("Align left")},center:{icon:$d,label:Sr("Align center")},right:{icon:Hd,label:Sr("Align right")},justify:{icon:Kd,label:Sr("Justify")}};function OS({editor:n,size:e}){const t=Object.keys(Or).find(i=>n.isActive({textAlign:i}))||"left",r=t?Or[t].icon:Or.left.icon;return J(wi,{floatingWidth:"auto",selectionMode:"single",selectedValue:t,onSelectionChange:i=>{n.commands.focus(),n.commands.setTextAlign(i)},children:[m(De,{size:e,color:t?"primary":null,radius:"rounded",className:Se("flex-shrink-0"),children:m(r,{})}),m(xi,{children:Object.entries(Or).map(([i,s])=>{const o=s.icon;return m(re,{value:i,startIcon:m(o,{size:"md"}),capitalizeFirst:!0,children:m(X,{message:s.label.message})},i)})})]})}function RS({editor:n,size:e}){return J("span",{className:Se("flex-shrink-0","whitespace-nowrap"),children:[m(De,{size:e,radius:"rounded",onClick:()=>{n.commands.focus(),n.commands.outdent()},children:m(Vd,{})}),m(De,{size:e,radius:"rounded",onClick:()=>{n.commands.focus(),n.commands.indent()},children:m(Wd,{})})]})}function IS({editor:n,size:e}){const t=n.getAttributes("codeBlock").language||"";return J(wi,{selectionMode:"single",selectedValue:t,onSelectionChange:r=>{n.commands.toggleCodeBlock({language:r})},children:[m(De,{className:Se("flex-shrink-0"),size:e,color:t?"primary":null,radius:"rounded",children:m(Dl,{})}),J(xi,{children:[m(re,{value:"html",children:"HTML"}),m(re,{value:"javascript",children:"JavaScript"}),m(re,{value:"css",children:"CSS"}),m(re,{value:"php",children:"PHP"}),m(re,{value:"shell",children:"Shell"}),m(re,{value:"bash",children:"Bash"}),m(re,{value:"ruby",children:"Ruby"}),m(re,{value:"python",children:"Python"}),m(re,{value:"java",children:"Java"}),m(re,{value:"c++",children:"C++"})]})]})}const cl="flex items-center justify-center px-4 h-42 text-muted border-b overflow-hidden";function LS({editor:n,size:e="md"}){const t=El(),[r,i]=fe.exports.useState(!1);return J("div",{className:Se(r?"h-84":"h-42"),children:[J("div",{className:Se(cl,"relative z-20"),children:[m(vS,{editor:n,size:e}),m(Rn,{}),m(DS,{editor:n,size:e}),m(Rn,{}),m(OS,{editor:n,size:e}),m(RS,{editor:n,size:e}),m(Rn,{}),t?m(De,{className:"flex-shrink-0",color:r?"primary":null,size:e,radius:"rounded",onClick:()=>{i(!r)},children:r?m(Gd,{}):m(qd,{})}):m(ul,{editor:n,size:e})]}),m(cd,{children:r&&m(ud.div,{className:Se(cl,"absolute w-full h-full flex"),initial:{y:"-100%"},animate:{y:0},exit:{y:"-100%"},children:m(ul,{editor:n,size:e})})})]})}function ul({editor:n,size:e="md"}){return J(fe.exports.Fragment,{children:[m(_S,{editor:n,size:e}),m(Rn,{}),m(NS,{editor:n,size:e}),m(CS,{editor:n,size:e}),m(xS,{editor:n,size:e}),m(Rn,{}),m(MS,{editor:n,size:e}),m(Rn,{}),m(IS,{editor:n,size:e}),m(wS,{editor:n,size:e})]})}function BS({editor:n,page:e,allowSlugEditing:t=!0,endpoint:r}){const{isSticky:i,sentinelRef:s}=Nd(),o=El();return J(fe.exports.Fragment,{children:[m("div",{ref:s}),J("div",{className:Se("sticky top-0 relative z-10 mb-20 bg-paper",i&&"shadow"),children:[J("div",{className:"px-20 py-10 flex items-center justify-between sm:justify-start gap-20 border-b text-muted",children:[!o&&J(fe.exports.Fragment,{children:[m(St,{variant:"text",size:"sm",elementType:dd,to:e?"../..":"..",relative:"path",startIcon:m(kd,{}),"data-testid":"text-editor-back-button",children:m(X,{message:"Back"})}),m(PS,{name:"slug",showLinkIcon:!1,prefix:"pages",hideButton:!t})]}),n&&m(yS,{editor:n}),!o&&m(SS,{editor:n}),m(FS,{page:e,editor:n,endpoint:r})]}),m(LS,{editor:n,size:"sm"})]})]})}function FS({page:n,editor:e,endpoint:t}){const r=bS(t),i=fd(),{trans:s}=yl(),o=Vs(),a=o.watch("title");return m(St,{variant:"flat",size:"sm",color:"primary",className:"min-w-90",disabled:r.isLoading||!a,"data-testid":"text-editor-save-button",onClick:()=>{r.mutate({pageId:n==null?void 0:n.id,payload:{...o.getValues(),body:e==null?void 0:e.getHTML()}},{onSuccess:()=>{const l=n!=null&&n.id?s({message:"Updated page"}):s({message:"Created page"});hd(l),dl.invalidateQueries(["custom-pages"]),i(n?"../..":"..",{relative:"path"})}})},children:m(X,{message:"Save"})})}function PS({name:n,...e}){const{field:{onChange:t,onBlur:r,value:i="",ref:s}}=pd({name:n}),o=fe.exports.useRef(!1),{watch:a,setValue:l}=Vs();return fe.exports.useEffect(()=>{const c=a((u,{name:d})=>{d==="title"&&!o.current&&l("slug",u.title)});return()=>c.unsubscribe()},[a,l]),m(mS,{className:Se("mr-auto",!i&&"invisible"),onChange:c=>{o.current=!0,t(c)},onInputBlur:r,value:i,inputRef:s,...e})}function JS({page:n,allowSlugEditing:e=!0,endpoint:t}){const r=Ks(),i=Im({extensions:[Ob.configure({codeBlock:!1}),Rb,jb,Qb,eE,tE,nE,rE,iy,sy,ry.configure({lowlight:H}),iE.configure({types:["heading","paragraph"]}),hS,oy],onFocus:()=>{},content:n==null?void 0:n.body});return fe.exports.useEffect(()=>{if(i)return()=>{i.destroy()}},[i]),fe.exports.useEffect(()=>{r.reset(n)},[n,r]),i?m(gd,{children:J(md,{...r,children:[m(BS,{editor:i,page:n,allowSlugEditing:e,endpoint:t}),m("div",{className:"mx-20","data-testid":"text-editor",children:J("div",{className:"prose dark:prose-invert mx-auto flex-auto",children:[m(zS,{}),m(vm,{editor:i})]})})]})}):null}function zS(){const[n,e]=fe.exports.useState(!1),{trans:t}=yl(),i=Vs().watch("title"),s=t({message:"Title"});return n?m(zr,{placeholder:s,autoFocus:!0,className:"mb-30",onBlur:()=>{e(!1)},name:"title",required:!0}):J("h1",{tabIndex:0,onClick:()=>{e(!0)},onFocus:()=>{e(!0)},className:Se("hover:bg-primary/focus rounded cursor-pointer",!i&&"text-muted"),children:[i||s,m(Ed,{className:"icon-sm mx-8 mt-8 align-top text-muted"})]})}export{JS as default}; //# sourceMappingURL=text-editor.ee7a4592.js.map