@netnodeag/kraftwerk 0.57.3 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +85 -2
  2. package/dist/acp.js +2 -1
  3. package/dist/cli/journal.d.ts +10 -0
  4. package/dist/cli/journal.js +36 -0
  5. package/dist/cli/knowledge.js +17 -0
  6. package/dist/cli/kraftwerk.js +6 -0
  7. package/dist/cli/projects.js +3 -3
  8. package/dist/cli/repos.js +1 -1
  9. package/dist/cli/trash.d.ts +2 -0
  10. package/dist/cli/trash.js +70 -0
  11. package/dist/cli/vibeables.js +3 -3
  12. package/dist/inspector/agent-status.d.ts +21 -0
  13. package/dist/inspector/agent-status.js +25 -0
  14. package/dist/inspector/agents.d.ts +5 -0
  15. package/dist/inspector/agents.js +10 -1
  16. package/dist/inspector/attention.d.ts +48 -0
  17. package/dist/inspector/attention.js +66 -0
  18. package/dist/inspector/channels.js +2 -1
  19. package/dist/inspector/chat/sessions.d.ts +52 -1
  20. package/dist/inspector/chat/sessions.js +160 -27
  21. package/dist/inspector/chat/store.d.ts +2 -0
  22. package/dist/inspector/chat/store.js +5 -1
  23. package/dist/inspector/files.d.ts +87 -0
  24. package/dist/inspector/files.js +316 -0
  25. package/dist/inspector/git.js +3 -1
  26. package/dist/inspector/journal.d.ts +31 -0
  27. package/dist/inspector/journal.js +72 -0
  28. package/dist/inspector/knowledge.d.ts +2 -0
  29. package/dist/inspector/knowledge.js +7 -0
  30. package/dist/inspector/projects.d.ts +1 -1
  31. package/dist/inspector/projects.js +5 -2
  32. package/dist/inspector/repos.js +2 -1
  33. package/dist/inspector/runs.d.ts +1 -1
  34. package/dist/inspector/runs.js +3 -2
  35. package/dist/inspector/server.js +111 -1
  36. package/dist/inspector/skills.d.ts +1 -1
  37. package/dist/inspector/skills.js +3 -2
  38. package/dist/inspector/status-line.d.ts +14 -0
  39. package/dist/inspector/status-line.js +44 -0
  40. package/dist/inspector/trash.d.ts +37 -0
  41. package/dist/inspector/trash.js +148 -0
  42. package/dist/inspector/vibeables.d.ts +1 -1
  43. package/dist/inspector/vibeables.js +3 -2
  44. package/inspector/dist/assets/dist-B2o7tVdJ.js +23 -0
  45. package/inspector/dist/assets/{dist-Ceimhh7q.js → dist-BA7UaMHM.js} +1 -1
  46. package/inspector/dist/assets/dist-BXQtebmM.js +1 -0
  47. package/inspector/dist/assets/dist-BYDYk38f.js +1 -0
  48. package/inspector/dist/assets/{dist-CPlSMtdY.js → dist-BdZ5cNRp.js} +1 -1
  49. package/inspector/dist/assets/{dist-DGoW6poO.js → dist-BgakrfmB.js} +1 -1
  50. package/inspector/dist/assets/{dist-CprubYd5.js → dist-BpUghI2_.js} +1 -1
  51. package/inspector/dist/assets/{dist-BdimISeT.js → dist-BpYRdsio.js} +1 -1
  52. package/inspector/dist/assets/{dist-C9wdXHwY.js → dist-CHSqB1rM.js} +1 -1
  53. package/inspector/dist/assets/{dist-B1xH7Mxz.js → dist-CVpPKkOb.js} +1 -1
  54. package/inspector/dist/assets/{dist-H3rerbMg.js → dist-CYzOYk_e.js} +9 -9
  55. package/inspector/dist/assets/dist-CzkTIkYD.js +1 -0
  56. package/inspector/dist/assets/{dist-rE2oRtJp.js → dist-D7O3CloR.js} +1 -1
  57. package/inspector/dist/assets/dist-DJzkq2t-.js +1 -0
  58. package/inspector/dist/assets/dist-Dctj7Mr3.js +1 -0
  59. package/inspector/dist/assets/{dist-BA9oX2Qo.js → dist-DtEBn0Pj.js} +1 -1
  60. package/inspector/dist/assets/{dist-CmUexHfa.js → dist-DwpQHmP7.js} +1 -1
  61. package/inspector/dist/assets/{dist-CF7An11X.js → dist-KG4lrraG.js} +1 -1
  62. package/inspector/dist/assets/{dist-5wk4daHl.js → dist-Ko3fuaif.js} +1 -1
  63. package/inspector/dist/assets/{dist-ZMc9InB9.js → dist-f7v359XP.js} +1 -1
  64. package/inspector/dist/assets/{dist-yFKhRrHN.js → dist-itDgDZqI.js} +1 -1
  65. package/inspector/dist/assets/{dist-CXS6W3P9.js → dist-p_qW90fR.js} +1 -1
  66. package/inspector/dist/assets/{dist-DNBDudvB.js → dist-xi1nJU9x.js} +1 -1
  67. package/inspector/dist/assets/editor-BkGiMzB_.js +120 -0
  68. package/inspector/dist/assets/editor-CZMrhTTL.css +1 -0
  69. package/inspector/dist/assets/index-Bb27CwDb.css +2 -0
  70. package/inspector/dist/assets/index-D4h-VE-4.js +229 -0
  71. package/inspector/dist/assets/material-symbols-rounded-Dni8jOUD.woff2 +0 -0
  72. package/inspector/dist/index.html +2 -2
  73. package/package.json +1 -1
  74. package/inspector/dist/assets/dist-9zOw_mLO.js +0 -1
  75. package/inspector/dist/assets/dist-D3a-4Le2.js +0 -1
  76. package/inspector/dist/assets/dist-D8nmL5S9.js +0 -1
  77. package/inspector/dist/assets/dist-DN5yqrtf.js +0 -1
  78. package/inspector/dist/assets/dist-DaG9QYNU.js +0 -1
  79. package/inspector/dist/assets/dist-_9tJHb24.js +0 -23
  80. package/inspector/dist/assets/editor-B1Jq9YIq.css +0 -1
  81. package/inspector/dist/assets/editor-DtVtHids.js +0 -117
  82. package/inspector/dist/assets/index-B-sri0As.js +0 -225
  83. package/inspector/dist/assets/index-Da4dQf-y.css +0 -1
  84. package/inspector/dist/assets/material-symbols-rounded-DzDTtRam.woff2 +0 -0
@@ -0,0 +1,120 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-itDgDZqI.js","assets/dist-CYzOYk_e.js","assets/dist-BdZ5cNRp.js","assets/dist-KG4lrraG.js","assets/dist-BXQtebmM.js","assets/index-D4h-VE-4.js","assets/index-Bb27CwDb.css","assets/dist-D7O3CloR.js","assets/dist-CHSqB1rM.js","assets/dist-B2o7tVdJ.js","assets/dist-CzkTIkYD.js","assets/dist-DwpQHmP7.js","assets/dist-Ko3fuaif.js","assets/dist-BpYRdsio.js","assets/dist-BYDYk38f.js","assets/dist-CVpPKkOb.js","assets/dist-p_qW90fR.js","assets/dist-Dctj7Mr3.js","assets/dist-BgakrfmB.js","assets/dist-BA7UaMHM.js","assets/dist-f7v359XP.js","assets/dist-xi1nJU9x.js","assets/dockerfile-DJkHQgkl.js","assets/simple-mode-DXiLM1-G.js","assets/factor-LKH5gN8L.js","assets/nsis-viPvXFiq.js","assets/pug-3K-JMW4g.js","assets/javascript-Bu8mWwtz.js","assets/dist-DtEBn0Pj.js","assets/dist-BpUghI2_.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./index-D4h-VE-4.js";import{$ as s,A as c,At as l,B as u,C as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,Ft as v,G as y,H as b,Ht as x,I as S,J as C,K as w,L as T,Lt as E,M as D,Mt as O,Nt as k,O as ee,Ot as te,P as A,Pt as j,Q as ne,R as M,Rt as re,S as ie,St as ae,T as oe,U as se,Ut as ce,V as le,Vt as ue,W as de,X as fe,Y as pe,_ as me,_t as he,a as ge,b as _e,bt as ve,c as ye,ct as be,d as xe,dt as Se,et as Ce,f as we,ft as Te,g as Ee,gt as De,ht as Oe,it as ke,j as Ae,jt as je,k as Me,kt as Ne,l as N,lt as Pe,mt as Fe,nt as Ie,o as Le,ot as Re,p as ze,pt as Be,q as Ve,rt as He,st as Ue,tt as We,u as Ge,vt as P,w as Ke,wt as qe,yt as Je,z as Ye,zt as Xe}from"./dist-CYzOYk_e.js";import{n as Ze,r as Qe}from"./dist-CHSqB1rM.js";import{i as $e,n as et,o as tt,r as nt,t as rt}from"./dist-BdZ5cNRp.js";var it=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[E.contextHash,r]]}addChild(e,t){e.prop(E.contextHash)!=this.hash&&(e=new x(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new x(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new x(Xe.none,e,t,n,this.hashProp)})}},F;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(F||={});var at=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},ot=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ut(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function st(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==F.OrderedList?_t:gt)(n,t,!1);return r>0&&(e.type!=F.BulletList||mt(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ct={[F.Blockquote](e,t,n){return n.next==62&&(n.markers.push(Gt(F.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(lt(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[F.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[F.OrderedList]:st,[F.BulletList]:st,[F.Document](){return!0}};function lt(e){return e==32||e==9||e==10||e==13}function ut(e,t=0){for(;t<e.length&&lt(e.charCodeAt(t));)t++;return t}function dt(e,t,n){for(;t>n&&lt(e.charCodeAt(t-1));)t--;return t}function ft(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function pt(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function mt(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!lt(n))return-1}return n&&e.next==45&&yt(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(jt.SetextHeading)>-1||r<3?-1:1}function ht(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function gt(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||lt(e.text.charCodeAt(e.pos+1)))&&(!n||ht(t,F.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function _t(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!lt(e.text.charCodeAt(r+1))||n&&!ht(t,F.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function vt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function yt(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&lt(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var bt=/^[ \t]*$/,xt=/-->/,St=/\?>/,Ct=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,xt],[/^\s*<\?/,St],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,bt],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,bt]];function wt(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=Ct.length-+!!n;e<t;e++)if(Ct[e][0].test(r))return e;return-1}function Tt(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function Et(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==F.CodeText?e[r].to=n:e.push(Gt(F.CodeText,t,n))}var Dt={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(Et(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){Et(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==F.CodeText?Et(o,e.from,e.to):o.push(e);s=[]}Et(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&Et(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=F.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(F.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ft(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=dt(t.text,t.text.length,o),c=[Gt(F.CodeMark,r,r+a)];o<s&&c.push(Gt(F.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&Et(c,e.lineStart-1,e.lineStart),c.push(Gt(F.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(Et(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(Et(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(F.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=pt(t);return n<0?!1:(e.startContext(F.Blockquote,t.pos),e.addNode(F.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(mt(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(F.HorizontalRule,n),!0},BulletList(e,t){let n=gt(t,e,!1);if(n<0)return!1;e.block.type!=F.BulletList&&e.startContext(F.BulletList,t.basePos,t.next);let r=Tt(t,t.pos+1);return e.startContext(F.ListItem,t.basePos,r-t.baseIndent),e.addNode(F.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=_t(t,e,!1);if(n<0)return!1;e.block.type!=F.OrderedList&&e.startContext(F.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Tt(t,t.pos+n);return e.startContext(F.ListItem,t.basePos,r-t.baseIndent),e.addNode(F.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=vt(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=dt(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!lt(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(F.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(F.HeaderMark,o-r,a-r);let c=s.finish(F.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=wt(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=Ct[n][1],a=[],o=i!=bt;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==xt?F.CommentBlock:i==St?F.ProcessingInstructionBlock:F.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ot=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
3
+ `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&ut(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,Gt(F.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(rn(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Gt(F.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(tn(e,ut(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=ut(e,this.pos),n=0;if(t>this.pos){let r=nn(e,t,this.start);if(r){let t=kt(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=kt(e,this.pos),n>0&&n<e.length?n:-1}else return kt(e,this.pos)}};function kt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!lt(n))return-1}return t}var At=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:yt(t),i=t.next;if(r<0)return!1;let a=Gt(F.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,Gt(i==61?F.SetextHeading1:F.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},jt={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Ot(t):null},SetextHeading(){return new At}},Mt=[(e,t)=>vt(t)>=0,(e,t)=>ft(t)>=0,(e,t)=>pt(t)>=0,(e,t)=>gt(t,e,!0)>=0,(e,t)=>_t(t,e,!0)>=0,(e,t)=>mt(t,e,!0)>=0,(e,t)=>wt(t,e,!0)>=0],Nt={text:``,end:0},Pt=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new ot,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=it.create(F.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new cn(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new at(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
4
+ `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=ln(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Nt;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+F[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
5
+ `?``:t;else{let e=t.indexOf(`
6
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=it.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new x(this.parser.nodeSet.types[e],Vt,Vt,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(on(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Ft(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=on(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(F.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?Gt(this.parser.getNodeType(e),t,n,r):new Wt(e,t)}get buffer(){return new Ht(this.parser.nodeSet)}};function Ft(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=Ft(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new x(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var It=class e extends ue{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new Pt(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=Rt(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(Lt(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=F.ATXHeading1&&c<=F.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(Xe.define({id:c,name:n,props:l&&[[E.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof S?t[n]=s:Object.assign(t,s))}r=new re(e),t&&(r=r.extend(T(t)))}if(Lt(n.props)&&(r=r.extend(...n.props)),Lt(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(Lt(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?zt(s,e.before):e.after?zt(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(Lt(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?zt(l,e.before):e.after?zt(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new an(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function Lt(e){return e!=null&&e.length>0}function Rt(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=Rt(e[0]);if(e.length==1)return t;let n=Rt(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||Vt).concat(t||Vt),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function zt(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Bt=[Xe.none];for(let e=1,t;t=F[e];e++)Bt[e]=Xe.define({id:e,name:t,props:e>=F.Escape?[]:[[E.group,e in ct?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var Vt=[],Ht=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return x.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},Ut=class{constructor(e,t,n,r=Vt){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Ht(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Wt=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Vt}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function Gt(e,t,n,r){return new Ut(e,t,n,r)}var Kt={resolve:`Emphasis`,mark:`EmphasisMark`},qt={resolve:`Emphasis`,mark:`EmphasisMark`},Jt={},Yt={},Xt=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Zt=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,Qt=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Qt=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var $t={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Zt.charCodeAt(t)==r)return e.append(Gt(F.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(Gt(F.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(Gt(F.InlineCode,n,r+1,[Gt(F.CodeMark,n,n+i),Gt(F.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(Gt(F.Autolink,n,n+1+i[0].length,[Gt(F.LinkMark,n,n+1),Gt(F.URL,n+1,n+i[0].length),Gt(F.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(Gt(F.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(Gt(F.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(Gt(F.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=Qt.test(i),s=Qt.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new Xt(t==95?Kt:qt,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(Gt(F.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(Gt(F.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new Xt(Jt,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new Xt(Yt,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof Xt&&(r.type==Jt||r.type==Yt)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=en(e,i,r.type==Jt?F.Link:F.Image,r.from,n+1);if(r.type==Jt)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof Xt&&t.type==Jt&&(t.side=0)}return a.to}}return-1}};function en(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(Gt(F.LinkMark,r,r+(n==F.Image?2:1))),t.push(Gt(F.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=tn(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=nn(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(Gt(F.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(Gt(F.LinkMark,n,s)))}else if(o==91){let n=rn(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return Gt(n,r,s,t)}function tn(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return Gt(F.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(lt(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?Gt(F.URL,t+n,i+n):i==e.length&&null}}function nn(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return Gt(F.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function rn(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return!r&&Gt(F.LinkLabel,t+n,a+1+n);else{if(r&&!lt(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var an=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new Xt(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Xt&&(t.type==Jt||t.type==Yt))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof Xt&&n.type.resolve&&n.side&2))continue;let r=n.type==Kt||n.type==qt,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof Xt&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof Ut&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new Xt(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new Xt(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof Ut&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof Xt&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Xt?t:null}skipSpace(e){return ut(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?Gt(this.parser.getNodeType(e),t,n,r):new Wt(e,t)}};an.linkStart=Jt,an.imageStart=Yt;function on(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof Ut&&(n[r]=new Ut(t.type,t.from,t.to,on(t.children,[e])))}else n.splice(r++,0,e)}return n}var sn=[F.CodeBlock,F.ListItem,F.OrderedList,F.BulletList],cn=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
7
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(E.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ln(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new x(e.parser.nodeSet.types[F.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(sn.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function ln(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var un=T({"Blockquote/...":M.quote,HorizontalRule:M.contentSeparator,"ATXHeading1/... SetextHeading1/...":M.heading1,"ATXHeading2/... SetextHeading2/...":M.heading2,"ATXHeading3/...":M.heading3,"ATXHeading4/...":M.heading4,"ATXHeading5/...":M.heading5,"ATXHeading6/...":M.heading6,"Comment CommentBlock":M.comment,Escape:M.escape,Entity:M.character,"Emphasis/...":M.emphasis,"StrongEmphasis/...":M.strong,"Link/... Image/...":M.link,"OrderedList/... BulletList/...":M.list,"BlockQuote/...":M.quote,"InlineCode CodeText":M.monospace,"URL Autolink":M.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":M.processingInstruction,"CodeInfo LinkLabel":M.labelName,LinkTitle:M.string,Paragraph:M.content}),dn=new It(new re(Bt).extend(un),Object.keys(Dt).map(e=>Dt[e]),Object.keys(Dt).map(e=>jt[e]),Object.keys(Dt),Mt,ct,Object.keys($t).map(e=>$t[e]),Object.keys($t),[]);function fn(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function pn(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ce((e,r)=>{let i=e.type.id;if(t&&(i==F.CodeBlock||i==F.FencedCode)){let n=``;if(i==F.FencedCode){let t=e.node.getChild(F.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==F.CodeText,bracketed:i==F.FencedCode}}else if(n&&(i==F.HTMLBlock||i==F.HTMLTag||i==F.CommentBlock))return{parser:n,overlay:fn(e.node,e.from,e.to)};return null})}}var mn={resolve:`Strikethrough`,mark:`StrikethroughMark`},hn={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":M.strikethrough}},{name:`StrikethroughMark`,style:M.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=Qt.test(r),c=Qt.test(i);return e.addDelimiter(mn,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function gn(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function _n(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var vn=/^[>\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,yn=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&vn.test(r=t.text.slice(t.pos))){let i=[];gn(e,n.content,0,i,n.start)==gn(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];gn(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},bn={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":M.heading}},`TableRow`,{name:`TableCell`,style:M.content},{name:`TableDelimiter`,style:M.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return _n(t.content,0)?new yn:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof yn)||!_n(t.text,t.basePos))return!1;let r=e.peekLine();return vn.test(r)&&gn(e,t.text,t.basePos)==gn(e,r,t.basePos)},before:`SetextHeading`}]},xn=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},Sn={defineNodes:[{name:`Task`,block:!0,style:M.list},{name:`TaskMarker`,style:M.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new xn:null},after:`SetextHeading`}]},Cn=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,wn=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,Tn=/[\w-]+\.[\w-]+($|[/:])/,En=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Dn=/\/[a-zA-Z\d@.]+/gy;function On(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function kn(e,t){wn.lastIndex=t;let n=wn.exec(e);if(!n||Tn.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&On(e,t,r,`)`)>On(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function An(e,t){En.lastIndex=t;let n=En.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var jn=[bn,Sn,hn,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;Cn.lastIndex=r;let i=Cn.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=kn(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=An(e.text,r):(a=An(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(Dn.lastIndex=a,i=Dn.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function Mn(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),lt(s))break}return-1}}var Nn={defineNodes:[{name:`Superscript`,style:M.special(M.content)},{name:`SuperscriptMark`,style:M.processingInstruction}],parseInline:[{name:`Superscript`,parse:Mn(94,`Superscript`,`SuperscriptMark`)}]},Pn={defineNodes:[{name:`Subscript`,style:M.special(M.content)},{name:`SubscriptMark`,style:M.processingInstruction}],parseInline:[{name:`Subscript`,parse:Mn(126,`Subscript`,`SubscriptMark`)}]},Fn={defineNodes:[{name:`Emoji`,style:M.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},In=me({commentTokens:{block:{open:`<!--`,close:`-->`}}}),Ln=new E,Rn=dn.configure({props:[d.add(e=>!e.is(`Block`)||e.is(`Document`)||zn(e)!=null||Bn(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Ln.add(zn),p.add({Document:()=>null}),Ae.add({Document:In})]});function zn(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Bn(e){return e.name==`OrderedList`||e.name==`BulletList`}function Vn(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=zn(e.type))!=null&&r<=t)break;n=e}return n.to}var Hn=Ke.of((e,t,n)=>{for(let r=_(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(Ln);if(e==null)continue;let t=Vn(r,e);if(t>n)return{from:n,to:t}}return null});function Un(e){return new ye(In,e,[],`markdown`)}var Wn=Un(Rn),Gn=Un(Rn.configure([jn,Pn,Nn,Fn,{props:[d.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Kn(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):N.matchLanguageName(e,n,!0),t instanceof N)return t.support?t.support.language.parser:xe.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var qn=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}marker(e,t){let n=this.node.name==`OrderedList`?String(+Yn(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Jn(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new qn(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new qn(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new qn(i.parent,s,s+t,a[1],e,n,i))}}return r}function Yn(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function Xn(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=Yn(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Zn(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(c)!=` `)return e;let r=k(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Qn=(e={})=>({state:t,dispatch:n})=>{let r=_(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!Gn.isActiveAt(t,n.from,-1)&&!Gn.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=Jn(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){if(l.item.from<s.from&&!/^[\s>]*$/.test(s.text.slice(0,l.to)))return a={range:n};let r=l.node.firstChild,u=l.node.getChild(`ListItem`,`ListItem`);if(r.to>=o||u&&u.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&Xn(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&Xn(e.item,i,r),{range:P.cursor(t+n.length),changes:r}}{let e=nr(c,t,s);return{range:P.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&Xn(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?k(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=Zn(p,t),tr(l.node,t.doc)&&(p=nr(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:P.cursor(m+p.length+1),changes:d}});return!a&&(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},$n=Qn();function er(e){return e.name==`QuoteMark`||e.name==`ListMark`}function tr(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function nr(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?k(n.text,4,e[t+1].from)-r.length:null,t<i);return Zn(r,t)}function rr(e,t){let n=e.resolveInner(t,-1),r=t;er(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(er(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var ir=({state:e,dispatch:t})=>{let n=_(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&Gn.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Jn(rr(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:P.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(n.item&&t.from<=n.item.from||/^[\s>]*$/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(k(t.text,4,n.to)-k(t.text,4,n.from));return r==t.from&&(i=Zn(i,e)),{range:P.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:P.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return!r&&(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},ar=[{key:`Enter`,run:$n},{key:`Backspace`,run:ir}],or=Ze({matchClosingTags:!1});function sr(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Wn,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=or}=e;if(!(i instanceof It))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,Hn],u;o&&l.push(fr),n instanceof Ge?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?Kn(t,u):void 0;c.push(pn({codeParser:d,htmlParser:s.language.parser})),r&&l.push(ae.high(He.of(ar)));let f=Un(i.configure(c));return a&&l.push(f.data.of({autocomplete:cr})),new Ge(f,l)}function cr(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=_(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:ur(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var lr=null;function ur(){if(lr)return lr;let e=Qe(new rt(Je.create({extensions:or}),0,!0));return lr=e?e.options:[]}var dr=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,fr=le.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!Gn.isActiveAt(t.state,n.from,1)))return!1;let i=_(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||dr.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),!a&&(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),I=a(t(),1),L=n(),pr=Object.defineProperty,mr=(e,t,n)=>t in e?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t,n)=>mr(e,typeof t==`symbol`?t:t+``,n),gr=class e{constructor(e=new Map){this.map=e}clone(){return new e(new Map(this.map))}increment(e){let t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let n=this.map.get(e);n!==void 0&&(--n,this.map.set(e,n),n===0&&t())}},_r=class{constructor(){hr(this,`map`,new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){let n=this.get(e);n!==void 0&&t(n)}delete(e){return this.map.delete(e)}};function vr(e,t){return t(e),e}function yr(){}var br=`cell`;function xr(e,t){return e===t}var Sr=new Map,Cr,wr=class{constructor(e={}){hr(this,`subscriptions`,new _r),hr(this,`singletonSubscriptions`,new Map),hr(this,`graph`,new _r),hr(this,`state`,new Map),hr(this,`distinctNodes`,new Map),hr(this,`executionMaps`,new Map),hr(this,`definitionRegistry`,new Set),hr(this,`combinedCells`,[]);for(let t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,n=Symbol()){return this.state.has(n)||this.state.set(n,e),t!==!1&&!this.distinctNodes.has(n)&&this.distinctNodes.set(n,t===!0?xr:t),n}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?xr:e),t}sub(e,t){this.register(e);let n=this.subscriptions.getOrCreate(e);return n.add(t),()=>n.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){let n=this.signalInstance();return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.sub(n,t)}pubIn(e){var t;let n=Reflect.ownKeys(e),r=this.getExecutionMap(n),i=r.refCount.clone(),a=r.participatingNodes.slice(),o=new Map(this.state),s=e=>{this.graph.use(e,t=>{for(let{sources:n,sink:r}of t)n.has(e)&&i.decrement(r,()=>{a.splice(a.indexOf(r),1),s(r)})})};for(;;){let n=a.shift();if(n===void 0)break;let i=n,c=!1,l=e=>{let t=this.distinctNodes.get(i);if(t!=null&&t(o.get(i),e)){c=!1;return}c=!0,o.set(i,e),this.state.has(i)&&this.state.set(i,e)};if(Object.prototype.hasOwnProperty.call(e,i)?l(e[i]):r.projections.use(i,e=>{for(let t of e){let e=[...Array.from(t.sources),...Array.from(t.pulls)].map(e=>o.get(e));t.map(l)(...e)}}),c){let e=o.get(i);this.inContext(()=>{this.subscriptions.use(i,t=>{for(let n of t)n(e)})}),(t=this.singletonSubscriptions.get(i))==null||t(e)}else s(i)}}connect({sources:e,pulls:t=[],map:n,sink:r}){let i={map:n,pulls:new Set(t),sink:this.register(r),sources:new Set(e)};for(let n of[...e,...t])this.register(n),this.graph.getOrCreate(n).add(i);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>vr(this.signalInstance(),n=>(this.link(this.pipe(n,...e),t),n))}link(e,t){this.connect({map:e=>t=>{e(t)},sink:t,sources:[e]})}combine(...e){return vr(this.signalInstance(),t=>{this.connect({map:e=>(...t)=>{e(t)},sink:t,sources:e})})}combineCells(...e){let t=this.combinedCells.find(t=>e.length===t.sources.length&&e.every((e,n)=>e===t.sources[n]));if(t)return t.cell;let n=this.cellInstance(e.map(e=>this.getValue(e)),!0);return this.connect({map:e=>(...t)=>{e(t)},sink:n,sources:e}),this.combinedCells.push({sources:e,cell:n}),n}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(e=>this.getValue(e))}register(e){let t=Sr.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),vr(t.type===br?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),e=>{this.inContext(()=>{t.init(this,e)})}))}inContext(e){let t=Cr;Cr=this;let n=e();return Cr=t,n}changeWith(e,t,n){this.connect({sources:[t],pulls:[e],sink:e,map:e=>(t,r)=>{e(n(r,t))}})}calculateExecutionMap(e){let t=[],n=new Set,r=new _r,i=new gr,a=new _r,o=(e,s=0)=>{i.increment(e),!n.has(e)&&(this.register(e),r.use(e,e=>{s=Math.max(...Array.from(e).map(e=>t.indexOf(e)))+1}),this.graph.use(e,t=>{for(let n of t)n.sources.has(e)?(a.getOrCreate(n.sink).add(n),o(n.sink,s)):r.getOrCreate(n.sink).add(e)}),n.add(e),t.splice(s,0,e))};return e.forEach(o),{participatingNodes:t,pendingPulls:r,projections:a,refCount:i}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];let n=this.executionMaps.get(t);if(n!==void 0)return n}else for(let[t,n]of this.executionMaps.entries())if(Array.isArray(t)&&t.length===e.length&&t.every(t=>e.includes(t)))return n;let n=this.calculateExecutionMap(e);return this.executionMaps.set(t,n),n}combineOperators(...e){return t=>{for(let n of e)t=n(t,this);return t}}};function R(e,t=yr,n=!0){return vr(Symbol(),r=>{Sr.set(r,{type:br,distinct:n,initial:e,init:t})})}function Tr(e=yr,t=!1){return vr(Symbol(),n=>{Sr.set(n,{type:`signal`,distinct:t,init:e})})}function Er(e=yr){return vr(Symbol(),t=>{Sr.set(t,{type:`signal`,distinct:!1,init:e})})}var Dr=I.createContext(null);function Or(){let e=I.useContext(Dr);if(e===null)throw Error(`useRealm must be used within a RealmContextProvider`);return e}function kr(e){let t=Or();t.register(e);let n=I.useCallback(n=>t.sub(e,n),[t,e]);return I.useSyncExternalStore(n,()=>t.getValue(e),()=>t.getValue(e))}function Ar(...e){let t=Or();return kr(I.useMemo(()=>t.combineCells.apply(t,e),[t,...e]))}function jr(e){let t=Or();return t.register(e),I.useCallback(n=>{t.pub(e,n)},[t,e])}function Mr(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{t(e(n))},sink:r,sources:[t]}),r}}function Nr(...e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:e=>(...t)=>{e(t)},pulls:e,sink:r,sources:[t]}),r}}function Pr(e){return(t,n)=>{let r=n.signalInstance();return n.connect({map:t=>n=>{e(n)&&t(n)},sink:r,sources:[t]}),r}}function Fr(e,t){return(n,r)=>{let i=r.signalInstance();return r.connect({map:n=>r=>{n(t=e(t,r))},sink:i,sources:[n]}),i}}var Ir=new WeakMap;function Lr(e,t){let n=Ir.get(e);return n||(n=new Set,Ir.set(e,n)),n.add(t),()=>{n.delete(t)}}function Rr(e){let t=Ir.get(e);if(Ir.delete(e),!t)return;let n=!1,r;for(let e of[...t].reverse())try{e()}catch(e){n||(n=!0,r=e)}if(n)throw r instanceof Error?r:Error(`Realm cleanup failed with a non-Error value`)}function zr(e){return function(t){return{init:n=>e.init?.call(e,n,t),postInit:n=>e.postInit?.call(e,n,t),update:n=>e.update?.call(e,n,t)}}}function Br({children:e,plugins:t}){let[n,r]=I.useState(null);return I.useEffect(()=>{var e,n;let i=new wr;try{for(let n of t)(e=n.init)==null||e.call(n,i);for(let e of t)(n=e.postInit)==null||n.call(e,i)}catch(e){try{Rr(i)}catch(t){throw AggregateError([e,t],`Realm plugin initialization and cleanup both failed`)}throw e}return r(i),()=>{Rr(i)}},[]),I.useEffect(()=>{var e;if(n)for(let r of t)(e=r.update)==null||e.call(r,n)}),n?I.createElement(Dr.Provider,{value:n},e):null}function z(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Vr(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ur=Hr&&`documentMode`in document?document.documentMode:null,Wr=Hr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Gr=Hr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Kr=!(!Hr||!(`InputEvent`in window)||Ur)&&`getTargetRanges`in new window.InputEvent(`input`),qr=Hr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Jr=Hr&&/Android/.test(navigator.userAgent),Yr=Hr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Jr,Xr=Hr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Zr=Hr&&Jr&&Xr,Qr=Hr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Wr&&!Xr,$r=0,ei=1,ti=2,ni=1,ri=2,ii=3,ai=4,oi=5,si=6,ci=Yr||qr||Qr?`\xA0`:`​`,li=`
8
+
9
+ `,ui=Gr?`\xA0`:ci,di=`֑-߿יִ-﷽ﹰ-ﻼ`,fi=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;RegExp(`^[^`+fi+`]*[`+di+`]`),RegExp(`^[^`+di+`]*[`+fi+`]`);var pi={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},mi={directionless:1,unmergeable:2},hi={center:2,end:6,justify:4,left:1,right:3,start:5},gi={[ri]:`center`,[si]:`end`,[ai]:`justify`,[ni]:`left`,[ii]:`right`,[oi]:`start`},_i={normal:0,segmented:2,token:1},vi={[$r]:`normal`,[ti]:`segmented`,[ei]:`token`},yi=`$config`;function bi(){return cf()._blockCursorElement}function xi(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Si=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&z(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&z(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&z(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=Ci(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=Ci(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function Ci(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var wi=class e extends Si{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;xi(t);)e=t,t=t.nextSibling;let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===bi()?n:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(this.element.__lexicalLastChildKind=e,e===null)this.removeManagedLineBreak();else{let t=e===`decorator`&&(Qr||qr||Yr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before,i=Ud().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),n.insertBefore(i,r),e){let e=Ud().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=bi(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Ti(t,n);i.push(r);let a=Ti(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Ti(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&z(225),n.reverse()}var Ei;try{Ei=`0.48.0+prod.esm`}catch{}var Di=Ei??`"<unknown>+source"`,Oi=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},ki=null;function Ai(e,t=1e3){return e instanceof ji?e.clone():e.size<t?new Map(e):new ji().init(new Map(e),void 0,e.size)}var ji=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===ki?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===ki?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==ki&&n!==void 0||(this._size++,n===ki&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,ki),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(t)for(let n of t){let t=n[0],r=e?e.get(t):void 0;r!==ki&&(r!==void 0&&(n[1]=r),yield n)}if(e)for(let n of e)n[1]===ki||t&&t.has(n[0])||(yield n)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}};function Mi(e,t,n,r,i,a){if(W(e)){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&((W(o)||Pf(o)&&o.__slots!==null)&&Mi(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of Pf(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Ff(e)&&e.__slotHost===t&&((W(e)||Pf(e)&&e.__slots!==null)&&Mi(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var Ni=!1,Pi=0;function Fi(e){Pi=e.timeStamp}function Ii(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Gu(e,n)!==void 0}function Li(e,t,n){let r=Id(Td(n)),i=r&&Kd(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&id(t,s,a,o,!1)}function Ri(e,t,n){if(H(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Mu(t)&&n.isAttached()}function zi(e,t,n){for(let r=e;r&&!Sf(r);r=yd(r)){let e=Gu(r,t);if(e!==void 0){let t=Hu(e,n);if(t)return Gl(t)||!K(r)?void 0:[r,t]}}}function Bi(e,t,n){Ni=!0;let r=performance.now()-Pi>100;try{Bl(e,()=>{let i=U()||function(e){return e.read(`latest`,()=>{let e=U();return e===null?null:e.clone()})}(e),a=new Map,o=e._editorState,s=e._blockCursorElement,c=!1,l=``;for(let n=0;n<t.length;n++){let u=t[n],d=u.type,f=u.target,p=zi(f,e,o);if(!p)continue;let[m,h]=p;if(d===`characterData`)r&&V(h)&&Mu(f)&&Ri(i,f,h)&&Li(f,h,e);else if(d===`childList`){c=!0;let t=u.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Uu(r),a=r.parentNode;if(!(a==null||r===s||i!==null||Ii(r,a,e)||e._slotsUsed&&K(r)&&r.hasAttribute(`data-lexical-slot`)||Sf(r))){if(Gr){let e=(K(r)?r.innerText:null)||r.nodeValue;e&&(l+=e)}a.removeChild(r)}}let n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Ii(r,f,e)||s===r)&&(f.appendChild(r),t++)}r!==t&&a.set(m,h)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){let n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Ii(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(c&&Xu(i),Gr&&_d(e)&&i.insertRawText(l))})}finally{Ni=!1}}function Vi(e){let t=e._observer;t!==null&&Bi(e,t.takeRecords(),t)}function Hi(e){(function(e){Pi===0&&Td(e).addEventListener(`textInput`,Fi,!0)})(e),e._observer=new MutationObserver((t,n)=>{Bi(e,t,n)})}var Ui=`latest`,Wi=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||ea).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Gi(e,t){return new Wi(e,t)}function Ki(e,t,n=Ui){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function qi(e,t,n){let r;if(bl(),typeof n==`function`){let i=e.getLatest(),a=Ki(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return Zi(i).updateFromKnown(t,r),i}function Ji(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Of(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var Yi=new Set([`__proto__`,`constructor`,`prototype`]),Xi=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return $i(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(Yi.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=$i(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(Yi.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Zi(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Xi(t,Qi(t));return t.__state=n,n}function Qi(e){return e.__state?e.__state.sharedNodeState:Su(cf(),e.getType()).sharedNodeState}function $i(e){if(e)for(let t in e)return e}function ea(e){return e}function ta(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function na(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function ra(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function ia(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&ta(n,e,t)||t&&ta(n,t,e)||e&&na(n,e,t)||t&&na(n,t,e))}(c,l))}function aa(e,t){let n=e.mergeWithSibling(t),r=wl()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function oa(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&V(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(ia(t,r)){r=aa(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&V(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(ia(r,n)){r=aa(r,n);break}break}n.remove()}}else r.remove()}function sa(e){return ca(e.anchor),ca(e.focus),e}function ca(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),V(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!W(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var la=Symbol.for(`@lexical/CachedTextSize`);function ua(e,t){return Da.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=Ea.get(r);if(i===void 0&&z(345,r),W(i)){let a=Oa.get(r);if(a!==void 0&&W(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=ka.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&z(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{let e=i[la];e===void 0&&z(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:ma})}function da(e){W(e)||e[la]===void 0&&(e[la]=V(e)?e.__text.length:e.getTextContentSize())}var fa=4,pa,ma,ha,ga=``,_a=null,va=null,ya=null;function ba(){return{firstTextKey:ya,format:_a,style:va}}function xa(e){e.firstTextKey!==null&&(_a=e.format,va=e.style,ya=e.firstTextKey)}function Sa(e){if(ya!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&z(348),t===null)return;let n=Oa.get(t);V(n)&&(_a=n.getFormat(),va=n.getStyle(),ya=t)}var Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na=!1,Pa=!1;function Fa(e,t){let n=Ea.get(e),r=Oa.has(e);if(t!==null){let n=ao(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(ma._keyToDOMMap.delete(e),W(n)){let e=jf(n,Ea);Ia(e,0,e.length-1,null)}if(n!==void 0){for(let e of Ga(n).values()){let t=qa(e);Fa(e,null),t!==null&&t.remove()}md(ja,ha,Ca,n,`destroyed`)}}}function Ia(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Fa(t,r)}}function La(e,t){e.setProperty(`text-align`,t)}var Ra=`40px`;function za(e,t){let n=pa.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${Ra}))`)}function Ba(e,t){let n=e.style;t===0?La(n,``):t===1?La(n,`left`):t===2?La(n,`center`):t===3?La(n,`right`):t===4?La(n,`justify`):t===5?La(n,`start`):t===6&&La(n,`end`)}function Va(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(ql(e))return null;let n=e.getParent();return n===null||kd(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Ha(e){let t=Ud().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function Ua(e,t,n){t||e.contentEditable===`false`?Cf(n,ma):n.removeAttribute(`contenteditable`)}function Wa(e,t,n){let r=ga,i=ba();ga=``;let a=``,o=Gl(e);for(let[r,i]of n){let n=Ha(r);Ua(t,o,n),t.appendChild(n),ga=``;let s=ba();Ya(i,uf(e,n,ma)),xa(s),Ka(e,r,t,n),a+=ga}return xa(i),ga=r,a}function Ga(e){return Pf(e)&&e.__slots!==null?e.__slots:Nf}function Ka(e,t,n,r){let i=Ma.$getSlotTargetElement(e,t,n,ma);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function qa(e){let t=ka.get(e);return t===void 0?null:t.parentElement}function Ja(e,t,n){let r=Ga(e),i=Ga(t);for(let[e,t]of r)if(!i.has(e)){let e=qa(t);Fa(t,null),e!==null&&e.remove()}let a=ga,o=ba(),s=``,c=null,l=Gl(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:qa(i);ga=``;let u=ba();if(o===null){o=Ha(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),Ya(a,uf(t,o,ma))}else i===a?eo(a,o):(i!==void 0&&Fa(i,o),Ya(a,uf(t,o,ma)));if(xa(u),Ua(n,l,o),Ka(t,e,n,o),s+=ga,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return xa(o),ga=a,s}function Ya(e,t){let n=Oa.get(e);if(n===void 0&&z(60),t!==null){let r=Ea.get(e);if(r!==void 0){let i=ka.get(e);if(i!==void 0){let a=Ff(r)?r.__slotHost:null,o=Ff(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),eo(e,t.element)}}}let r=Ma.$createDOM(n,ma);if(function(e,t,n){let r=n._keyToDOMMap;Wu(t,n,e),r.set(e,t)}(e,r,ma),V(n)?r.setAttribute(`data-lexical-text`,`true`):Gl(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),xf(r,{captureSelection:!0})),W(n)){let e=n.__indent,t=n.__size;Va(r,n),e!==0&&za(r,e);let i=Ga(n),a=i.size>0?Wa(n,r,i):``;if(t===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,ga+=a,i.size>0&&(r.__lexicalSlotTextLength=a.length);else{let e=ga,o=t-1;if(Xa(jf(n,Oa),n,0,o,uf(n,r,ma)),a!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=a+t,ga=e+a+t}i.size>0&&(r.__lexicalSlotTextLength=a.length)}let o=n.__format;o!==0&&Ba(r,o),n.isInline()||Za(null,n,r)}else{let t=n.getTextContent();if(Gl(n)){let t=n.decorate(ma,pa);t!==null&&to(e,t),r.contentEditable=`false`;let i=Ga(n);i.size>0&&Wa(n,r,i)}ga+=t}return t!==null&&t.insertChild(r),Ma.$decorateDOM(n,null,r,ma),da(n),md(ja,ha,Ca,n,`created`),r}function Xa(e,t,n,r,i){let a=ga,o=ba();ga=``,_a=null,va=null,ya=null;let s=n;for(;s<=r;++s){let t=ba();Ya(e[s],i);let n=Oa.get(e[s]);n!==null&&V(n)?_a===null&&(_a=n.getFormat(),va=n.getStyle(),ya=n.__key):W(n)&&s<r&&!n.isInline()&&(ga+=li),xa(t)}let c=ma._keyToDOMMap.get(t.__key);c===void 0&&z(349,t.__key),c.__lexicalTextContent=ga,c.__lexicalFirstTextKey=ya,ga=a+ga,xa(o)}function Za(e,t,n){let r=uf(t,n,ma),i=r.element.__lexicalLastChildKind??null,a=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return ru(e)?`line-break`:Gl(e)&&e.isInline()?`decorator`:null}return Ga(e).size>0?null:`empty`}return null}(t,Oa);i!==a&&r.setManagedLineBreak(a)}function Qa(e,t,n){var r;_a=null,va=null,ya=null,function(e,t,n){let r=ga,i=e.__size,a=t.__size;ga=``;let o=n.element,s=ma._keyToDOMMap.get(t.__key);s===void 0&&z(351,t.__key);let c=a-i;if(!Na&&Math.abs(c)<=1&&i>=fa&&e.__first===t.__first&&(c!==0||!ma._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=Aa.get(e.__key);if(!Na&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=Oa.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=ua(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=Oa.get(n);if(e===void 0)break;let t=ba();eo(n,o),V(e)&&_a===null&&(_a=e.getFormat(),va=e.getStyle(),ya=e.__key),xa(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=Oa.get(n);if(e===void 0)break;let t;if(W(e)){let r=ma._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&W(e)&&!e.isInline()&&(d+=li),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,ga=r+m,$a(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=Ea.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=Oa.get(a),d=Ea.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=Oa.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=Ea.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=ua(l,c);for(let e of _){let t=ba();if(e.kind===`reconcile`)eo(e.key,n.element);else if(e.kind===`destroy`)Fa(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=ma._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}Ya(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=Oa.get(e.key);t&&V(t)&&_a===null&&(_a=t.getFormat(),va=t.getStyle(),ya=t.__key)}xa(t)}let x=``;for(let e=0;e<o;e++){let t=Oa.get(f[e]);if(t===void 0)return!1;let n;if(W(t)){let r=ma._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&W(t)&&!t.isInline()&&(x+=li)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&z(353),ga=r+e,$a(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=Oa.get(t);if(e===void 0)break;let r=Na||Ta.has(t)||wa.has(t),i=ba();if(r)eo(t,o);else{let n,r;if(W(e)){r=ka.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&z(354,e.getType()),n=i}else n=e.getTextContent();ga+=n,r!==void 0&&Sa(r)}V(e)?_a===null&&(_a=e.getFormat(),va=e.getStyle(),ya=e.__key):W(e)&&n<a-1&&!e.isInline()&&(ga+=li),xa(i),t=e.__next,n++}s.__lexicalTextContent=ga,s.__lexicalFirstTextKey=ya,ga=r+ga;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)eo(r,o);else{let e=ao(r),t=Ya(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}Fa(r,null)}let a=Oa.get(i);V(a)&&_a===null&&(_a=a.getFormat(),va=a.getStyle(),ya=a.__key)}else{let r=jf(e,Ea),s=jf(t,Oa);if(r.length!==i&&z(227),s.length!==a&&z(228),i===0)a!==0&&Xa(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&Ga(t).size===0&&n.element.__lexicalLineBreak==null;Ia(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=ba();if(e===r)u=no(eo(r,a.element)),d++,f++;else{if(l===void 0&&(l=ro(n,f)),c===void 0)c=ro(t,d);else if(!c.has(e)){d++,xa(i);continue}if(!l.has(e)){u=no(ao(e)),Fa(e,a.element),d++,c.delete(e),xa(i);continue}if(c.has(r)){let e=vd(ma,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=no(eo(r,a.element)),d++,f++}else Ya(r,a.withBefore(u??a.before)),f++}let o=Oa.get(r);o!==null&&V(o)?_a===null&&(_a=o.getFormat(),va=o.getStyle(),ya=o.__key):W(o)&&f<=s&&!o.isInline()&&(ga+=li),xa(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:ma.getElementByKey(t);Xa(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&Ia(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=ga,s.__lexicalFirstTextKey=ya,ga=r+ga}(e,t,uf(t,n,ma)),kd(t)||(r=t,_a==null||_a===r.__textFormat||Pa||r.setTextFormat(_a),function(e){va==null||va===e.__textStyle||Pa||e.setTextStyle(va)}(t))}function $a(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=Oa.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=Oa.get(r);if(V(e))return _a=e.getFormat(),void(va=e.getStyle())}}t.__lexicalFirstTextKey=ya}function eo(e,t){let n=Ea.get(e),r=Oa.get(e);n!==void 0&&r!==void 0||z(61);let i=Na||Ta.has(e)||wa.has(e),a=vd(ma,e);if(n===r&&!i){let e;if(W(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&z(355,n.getType()),e=t,Sa(a)}else e=n.getTextContent();return ga+=e,a}if(n!==r&&i&&md(ja,ha,Ca,r,`updated`),Ma.$updateDOM(r,n,a,ma)){let n=Ya(e,null);return t===null&&z(62),t.replaceChild(n,a),Fa(e,null),n}if(W(n)){W(r)||z(334,e);let t=r.__indent;(Na||t!==n.__indent)&&za(a,t);let o=r.__format;(Na||o!==n.__format)&&Ba(a,o);let s=i&&(Ga(r).size>0||Ga(n).size>0)?Ja(n,r,a):``;if(i){let e=ga;if(Qa(n,r,a),ql(r)||r.isInline()||Za(0,r,a),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,ga=e+s+t,a.__lexicalSlotTextLength=s.length}else(Ga(r).size>0||Ga(n).size>0)&&(a.__lexicalSlotTextLength=0)}else{let e=a.__lexicalTextContent;typeof e!=`string`&&z(356,n.getType()),ga+=e,Sa(a)}if((Na||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(Va(a,r),ql(r)&&!Na))for(let e of r.getChildren())W(e)&&Va(vd(ma,e.getKey()),e)}else{let t=r.getTextContent();if(Gl(r)){let t=r.decorate(ma,pa);t!==null&&to(e,t),i&&(Ga(r).size>0||Ga(n).size>0)&&Ja(n,r,a)}ga+=t}if(!Pa&&ql(r)){let e=r.getLatest();if(e.__cachedText!==ga){let t=e.getWritable();t.__cachedText=ga,r=t}}return Ma.$decorateDOM(r,n,a,ma),da(r),a}function to(e,t){let n=ma._pendingDecorators,r=ma._decorators;if(n===null){if(r[e]===t)return;n=qu(ma)}n[e]=t}function no(e){let t=e.nextSibling;return t!==null&&t===ma._blockCursorElement&&(t=t.nextSibling),t}function ro(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function io(e,t,n,r,i,a){ga=``,_a=null,va=null,ya=null,Na=r===2,ma=n,pa=n._config,Ma=n._config.dom||mu,ha=n._nodes,Ca=ma._listeners.mutation,wa=i,Ta=a,Ea=e._nodeMap,Da=e,Oa=t._nodeMap,Pa=t._readOnly,ka=Ai(n._keyToDOMMap),Aa=function(){let e=new Map,t=t=>{for(let n of t){let t=Oa.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(wa.keys()),t(Ta),e}();let o=new Map;return ja=o,eo(`root`,null),ma=void 0,ha=void 0,wa=void 0,Ta=void 0,Ea=void 0,Da=void 0,Oa=void 0,pa=void 0,ka=void 0,Aa=void 0,ja=void 0,Ma=mu,o}function ao(e){let t=ka.get(e);return t===void 0&&z(75,e),t}function B(e){return{type:e}}var oo=B(`SELECTION_CHANGE_COMMAND`),so=B(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),co=B(`CLICK_COMMAND`),lo=B(`BEFORE_INPUT_COMMAND`),uo=B(`INPUT_COMMAND`),fo=B(`COMPOSITION_START_COMMAND`),po=B(`COMPOSITION_END_COMMAND`),mo=B(`DELETE_CHARACTER_COMMAND`),ho=B(`INSERT_LINE_BREAK_COMMAND`),go=B(`INSERT_PARAGRAPH_COMMAND`),_o=B(`CONTROLLED_TEXT_INSERTION_COMMAND`),vo=B(`PASTE_COMMAND`),yo=B(`REMOVE_TEXT_COMMAND`),bo=B(`DELETE_WORD_COMMAND`),xo=B(`DELETE_LINE_COMMAND`),So=B(`FORMAT_TEXT_COMMAND`),Co=B(`SET_TEXT_FORMAT_COMMAND`),wo=B(`UNDO_COMMAND`),To=B(`REDO_COMMAND`),Eo=B(`KEYDOWN_COMMAND`),Do=B(`KEY_ARROW_RIGHT_COMMAND`),Oo=B(`MOVE_TO_END`),ko=B(`KEY_ARROW_LEFT_COMMAND`),Ao=B(`MOVE_TO_START`),jo=B(`KEY_ARROW_UP_COMMAND`),Mo=B(`KEY_ARROW_DOWN_COMMAND`),No=B(`KEY_ENTER_COMMAND`),Po=B(`KEY_SPACE_COMMAND`),Fo=B(`KEY_BACKSPACE_COMMAND`),Io=B(`KEY_ESCAPE_COMMAND`),Lo=B(`KEY_DELETE_COMMAND`),Ro=B(`KEY_TAB_COMMAND`),zo=B(`INSERT_TAB_COMMAND`),Bo=B(`INDENT_CONTENT_COMMAND`),Vo=B(`OUTDENT_CONTENT_COMMAND`),Ho=B(`DROP_COMMAND`),Uo=B(`FORMAT_ELEMENT_COMMAND`),Wo=B(`DRAGSTART_COMMAND`),Go=B(`DRAGOVER_COMMAND`),Ko=B(`DRAGEND_COMMAND`),qo=B(`COPY_COMMAND`),Jo=B(`CUT_COMMAND`),Yo=B(`SELECT_ALL_COMMAND`),Xo=B(`CLEAR_EDITOR_COMMAND`),Zo=B(`CLEAR_HISTORY_COMMAND`),Qo=B(`CAN_REDO_COMMAND`),$o=B(`CAN_UNDO_COMMAND`),es=B(`FOCUS_COMMAND`),ts=B(`BLUR_COMMAND`),ns=B(`KEY_MODIFIER_COMMAND`);function rs(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function is(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}var as=Object.freeze({}),os=[[`keydown`,function(e,t){let n=t._inputState;n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&_s(n),!t.isComposing()&&G(t,Eo,e)}],[`pointerdown`,function(e,t){let n=Qd(e),r=e.pointerType;ef(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Bl(t,()=>{wf(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}],[`compositionstart`,function(e,t){G(t,fo,e)}],[`compositionend`,function(e,t){let n=t._inputState;Gr?n.compositionPhase=`ending-firefox`:qr||!Yr&&!Qr?G(t,po,e):(n.compositionPhase=`ending-safari`,n.compositionEndData=e.data)}],[`input`,function(e,t){e.stopPropagation();let n=t._inputState;_s(n),Bl(t,()=>{ys(e,t)||t.dispatchCommand(uo,e)},{event:e}),n.unprocessedBeforeInputData=null}],[`click`,function(e,t){Bl(t,()=>{let n=U(),r=Id(Td(t)),i=Jc();if(r){if(H(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!ql(t)&&Yu().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=Kd(r,t._rootElement).anchorNode;(K(n)||Mu(n))&&Xu(qc(i,r,t,e))}}G(t,co,e)})}],[`cut`,as],[`copy`,as],[`dragstart`,as],[`dragover`,as],[`dragend`,as],[`paste`,as],[`focus`,as],[`blur`,as],[`drop`,as]];Kr&&os.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||Gr&&_d(t)||n!==`insertCompositionText`&&Bl(t,()=>{ys(e,t)||G(t,lo,e)},{event:e})}(e,t)]);var ss=new WeakMap,cs=new WeakMap,ls=rs(e=>(e.addEventListener(`selectionchange`,ks),()=>e.removeEventListener(`selectionchange`,ks)));function us(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=wl(),u;if(a!==void 0)u=a;else{let e=Id(Td(l));u=e===null?null:Kd(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!V(c)||(!i&&(!Kr||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||$u(n))&&o.offset!==s.offset&&!c.isComposing()||ju(c)||c.isDirty()&&m>1||(i||!Kr)&&p!==null&&!c.isComposing()&&d!==ff(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Au(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(V(t)||W(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function ds(e,t){return Mu(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fs(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=Kd(e,t._rootElement),s=t._inputState;s.isSelectionChangeFromDOMUpdate&&(s.isSelectionChangeFromDOMUpdate=!1,ds(r,i)&&ds(a,o)&&!s.postDeleteSelectionToRestore)||Bl(t,()=>{if(!n)return void Xu(null);if(!Eu(t,r,a))return;let c=U();if(s.postDeleteSelectionToRestore&&H(c)&&c.isCollapsed()){let e=c.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(c=s.postDeleteSelectionToRestore.clone(),Xu(c))}if(s.postDeleteSelectionToRestore=null,H(c)){let n=c.anchor,l=n.getNode();if(c.isCollapsed()){e.type===`Range`&&r===a&&(c.dirty=!0);let i=Td(t).event,o=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:p,timeStamp:m}=s.collapsedSelectionFormat,h=Yu(),g=!1===t.isComposing()&&h.getTextContent()===``;if(o<m+200&&n.offset===f&&n.key===p)ps(c,u,d);else if(n.type===`text`)V(l)||z(141),ms(c,l);else if(n.type===`element`&&!g){W(l)||z(259);let e=n.getNode();e.isEmpty()?function(e,t){ps(e,t.getTextFormat(),t.getTextStyle())}(c,e):ps(c,c.format,``)}}else{let e=n.key,t=c.focus.key,r=c.getNodes(),a=r.length,s=c.isBackward(),l=s?o:i,u=s?i:o,d=s?t:e,f=s?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(V(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}c.format=m?p:0}}G(t,oo,void 0)})}function ps(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function ms(e,t){ps(e,t.getFormat(),t.getStyle())}function hs(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function gs(e){let{lastKeyCode:t}=wl()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
10
+ `:t===`Tab`?` `:null;if(!n)return;let r=U();if(!H(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!V(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
11
+ `){if(ru(e))e.selectEnd();else if(!e){let e=Af(i,Uc),t=e&&e.getNextSibling();W(t)&&t.selectStart()}}else n===` `?hc(e)&&e.selectEnd():V(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function _s(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function vs(e){_s(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>_s(e),0)}function ys(e,t){let n=Qd(e);if(K(n)&&wf(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=Zd(r.ownerDocument);return i!==null&&r.contains(i)&&wf(i,t)}function bs(e){let t=e.inputType,n=hs(e),r=wl(),i=r._inputState,a=U();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(_s(i),e.preventDefault(),H(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=Jc();if(!H(e))return!0;Xu(e.clone())}if(H(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(Bu(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Bl(r,()=>{Bu(null)})},30),H(a)){let e=a.anchor.getNode();e.markDirty(),V(e)||z(142),ms(a,e)}}else{if(Bu(null),qr&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=Zr&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!Gl(gd(a.anchor,!0))),!u){G(r,mo,!0);let e=U();Zr&&H(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!H(a))return!0;let o=e.data;i.unprocessedBeforeInputData!==null&&rd(!1,r,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||ql(a.anchor.getNode())||n===null||a.applyDOMRange(n),i.unprocessedBeforeInputData=null;let s=a.anchor,c=a.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
12
+ `)e.preventDefault(),G(r,ho,!1);else if(o===li)e.preventDefault(),G(r,go,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&us(a,n,o,e.timeStamp,!0)?(e.preventDefault(),G(r,_o,o),gs(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:G(r,_o,e),gs((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;Bu(null),t||G(r,_o,e),ws(n);break}case`insertLineBreak`:Bu(null),G(r,ho,!1);break;case`insertParagraph`:Bu(null),i.isInsertLineBreak&&!qr?(i.isInsertLineBreak=!1,G(r,ho,!1)):G(r,go,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:G(r,vo,e);break;case`deleteByComposition`:(function(e,t){return e!==t||W(e)||W(t)||!Au(e)||!Au(t)})(l,u)&&G(r,yo,e);break;case`deleteByDrag`:xd(Us),G(r,yo,e);break;case`deleteByCut`:G(r,yo,e);break;case`deleteContent`:G(r,mo,!1);break;case`deleteWordBackward`:G(r,bo,!0);break;case`deleteWordForward`:G(r,bo,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:G(r,xo,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:G(r,xo,!1);break;case`formatStrikeThrough`:G(r,So,`strikethrough`);break;case`formatBold`:G(r,So,`bold`);break;case`formatItalic`:G(r,So,`italic`);break;case`formatUnderline`:G(r,So,`underline`);break;case`historyUndo`:G(r,wo,void 0);break;case`historyRedo`:G(r,To,void 0)}return!0}function xs(e){let t=wl(),n=t._inputState,r=U(),i=e.data,a=hs(e),o=!1;if(i!=null&&H(r)){let s=Id(Td(t)),c=s===null?null:Kd(s,t._rootElement),l=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();l&&(n.hadOrphanedCompositionEvents=!0);let u=r.anchor.getNode(),d=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&V(u)&&ju(u);if(!l&&!d&&us(r,a,i,e.timeStamp,!1,c)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Ts(t,i);if(n.compositionPhase=`idle`,e)return xd(Ws),Zu(),!0}let a=r.anchor.getNode();if(s===null||c===null)return!0;let l=r.isBackward(),u=l?r.anchor.offset:r.focus.offset,d=l?r.focus.offset:r.anchor.offset;Kr&&!r.isCollapsed()&&V(a)&&c.anchorNode!==null&&a.getTextContent().slice(0,u)+i+a.getTextContent().slice(u+d)===nd(c.anchorNode)||G(t,_o,i);let f=i.length;Gr&&f>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),Zr&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,Bu(null))}}return o||(rd(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Ts(t,i||void 0),xd(`composition-end`),n.compositionPhase=`idle`)),Zu(),!0}function Ss(e){let t=wl(),n=t._inputState,r=U();if(H(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(Bu(i.key),xd(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+30||i.type===`element`||!r.isCollapsed()||!Zr&&(a.getFormat()!==r.format||V(a)&&a.getStyle()!==r.style)||V(a)&&(ju(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){G(t,_o,ui);let e=U();H(e)&&Bu(e.anchor.key)}}return!0}function Cs(e){let t=wl();return t._inputState.compositionPhase=`idle`,Ts(t,e.data),xd(Ws),!0}function ws(e){if(e===null)return;let t=Hu(e);if(!V(t)||t.getType()===`text`||ju(t)||!t.isAttached())return;let n=U(),r=H(n)&&n.anchor.key===e?n.anchor.offset:null,i=dc(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),r!==null){let e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function Ts(e,t){let n=e._compositionKey;if(Bu(null),n!==null&&t!=null){if(t===``){let t=Hu(n),r=e.getElementByKey(n),i=r!==null&&V(t)?ff(t,r,e):null;if(i!==null&&i.nodeValue!==null&&V(t)){let n=Id(Td(e)),r=n&&Kd(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),id(t,i.nodeValue,a,o,!0)}return ws(n),!1}if(t[t.length-1]===`
13
+ `){let t=U();if(H(t)||Cc(t)){if(H(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return G(e,No,null),ws(n),!1}}let r=Hu(n);if(r!==null&&V(r)&&ju(r)){r.markDirty();let e=U(),i=r.getTextContentSize(),a=H(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return rd(!0,e,t),ws(n),!1}function Es(e){let t=wl(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase===`ending-safari`){let r=dd(e);if(r&&Bl(t,()=>{Ts(t,n.compositionEndData)}),n.compositionPhase=`idle`,n.compositionEndData=``,r)return!0}if(function(e){return cd(e,`ArrowRight`,{shiftKey:`any`})}(e))G(t,Do,e);else if(function(e){return cd(e,`ArrowRight`,{...ld,shiftKey:`any`})}(e))G(t,Oo,e);else if(function(e){return cd(e,`ArrowLeft`,{shiftKey:`any`})}(e))G(t,ko,e);else if(function(e){return cd(e,`ArrowLeft`,{...ld,shiftKey:`any`})}(e))G(t,Ao,e);else if(function(e){return cd(e,`ArrowUp`,{altKey:`any`,shiftKey:`any`})}(e))G(t,jo,e);else if(function(e){return cd(e,`ArrowDown`,{altKey:`any`,shiftKey:`any`})}(e))G(t,Mo,e);else if(function(e){return cd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:!0})}(e))n.isInsertLineBreak=!0,G(t,No,e);else if(function(e){return e.key===` `}(e))G(t,Po,e);else if(function(e){return Wr&&cd(e,`o`,{ctrlKey:!0})}(e))e.preventDefault(),n.isInsertLineBreak=!0,G(t,ho,!0);else if(function(e){return cd(e,`Enter`,{altKey:`any`,ctrlKey:`any`,metaKey:`any`})}(e))n.isInsertLineBreak=!1,G(t,No,e);else if(function(e){return cd(e,`Backspace`,{shiftKey:`any`})||Wr&&cd(e,`h`,{ctrlKey:!0})}(e))dd(e)?G(t,Fo,e)&&vs(n):(e.preventDefault(),G(t,mo,!0));else if(function(e){return e.key===`Escape`}(e))G(t,Io,e);else if(function(e){return cd(e,`Delete`,{})||Wr&&cd(e,`d`,{ctrlKey:!0})}(e))(function(e){return e.key===`Delete`})(e)?G(t,Lo,e):(e.preventDefault(),G(t,mo,!1));else if(function(e){return cd(e,`Backspace`,ud)}(e))e.preventDefault(),G(t,bo,!0);else if(function(e){return cd(e,`Delete`,ud)}(e))e.preventDefault(),G(t,bo,!1);else if(function(e){return Wr&&cd(e,`Backspace`,{metaKey:!0})}(e))e.preventDefault(),G(t,xo,!0);else if(function(e){return Wr&&(cd(e,`Delete`,{metaKey:!0})||cd(e,`k`,{ctrlKey:!0}))}(e))e.preventDefault(),G(t,xo,!1);else if(function(e){return cd(e,`b`,ld)}(e))e.preventDefault(),G(t,So,`bold`);else if(function(e){return cd(e,`u`,ld)}(e))e.preventDefault(),G(t,So,`underline`);else if(function(e){return cd(e,`i`,ld)}(e))e.preventDefault(),G(t,So,`italic`);else if(function(e){return cd(e,`Tab`,{shiftKey:`any`})}(e))G(t,Ro,e);else if(function(e){return cd(e,`z`,ld)}(e))e.preventDefault(),G(t,wo,void 0);else if(function(e){return Wr?cd(e,`z`,{metaKey:!0,shiftKey:!0}):cd(e,`y`,{ctrlKey:!0})||cd(e,`z`,{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),G(t,To,void 0);else{let r=t._editorState._selection;(function(e){return cd(e,`a`,ld)})(e)?(e.preventDefault(),G(t,Yo,e)&&vs(n)):r===null||H(r)||(function(e){return cd(e,`c`,ld)}(e)?(e.preventDefault(),G(t,qo,e)):function(e){return cd(e,`x`,ld)}(e)&&(e.preventDefault(),G(t,Jo,e)))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(ns,e),!0}function Ds(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Os=new Map;function ks(e){let t=Ld(e.target);if(t===null)return;let n=bd(e.target),r=null,i=null,a=n===null?void 0:cs.get(n);if(n!==null){if(a!==void 0){let e=a.editors,n=a.hasShadowEditor;if(n===void 0){n=!1;for(let t of e)if(t._rootElement!==null&&Rd(t._rootElement.getRootNode())){n=!0;break}a.hasShadowEditor=n}if(n){let n=null,a=null;for(let o of e){let e=o._rootElement;if(e===null)continue;let s=Kd(t,e).anchorNode;if(s!==null&&Ou(s)===o){if(Rd(e.getRootNode())){r=o,i=s;break}n===null&&(n=o,a=s)}}r===null&&n!==null&&(r=n,i=a)}else{let e=t.anchorNode;e===null||K(e)&&e.shadowRoot!==null||(r=Ou(e),r!==null&&(i=e))}}if(r===null){let e=Zd(n);r=e===null?null:Ou(e)}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let e of a.editors)e._inputState.isSelectionChangeFromMouseDown=!1;Bl(r,()=>{let n=Jc(),a=i??Kd(t,r._rootElement).anchorNode;(K(a)||Mu(a))&&Xu(qc(n,t,r,e))})}let o=ed(r),s=o[o.length-1],c=s._key,l=Os.get(c),u=l||s;u!==r&&fs(t,u,!1),fs(t,r,!0),r===s?l&&Os.delete(c):Os.set(c,r)}function As(e){e._lexicalHandled=!0}function js(e){return!0===e._lexicalHandled}function Ms(e){let t=ss.get(e);if(t===void 0)return;let n=cs.get(t);if(n===void 0)return;ss.delete(e);let r=ku(e);Du(r)?(function(e){if(e._parentEditor!==null){let t=ed(e),n=t[t.length-1]._key;Os.get(n)===e&&Os.delete(n)}else Os.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&z(198);let i=Ds(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}function Ns(e,t,n){bl();let r=e.__key,i=e.getParent();if(i===null)return void(If(e)!==null&&z(367,r,String(If(e))));let a=function(e){let t=U();if(!H(t)||!W(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Cd(i,e)&&n.set(e.__key,0,`element`),Cd(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(H(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(Zc(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(Zc(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Cc(a)&&t&&e.isSelected()&&e.selectPrevious();if(H(a)&&t&&!o){let t=e.getIndexWithinParent();Ru(e),Yc(a,i,t,-1)}else Ru(e);n||kd(i)||i.canBeEmpty()||!i.isEmpty()||Ns(i,t),t&&a&&ql(i)&&i.isEmpty()&&i.selectEnd()}function Ps(e){return e}var Fs=Symbol.for(`ephemeral`);function Is(e){return e[Fs]||!1}var Ls={configurable:!0,enumerable:!1,value:void 0,writable:!0},Rs=class{__type;__key;__parent;__prev;__next;__state;[la];static getType(){let{ownNodeType:e}=Df(this);return e===void 0&&z(64,this.name),e}static clone(e){z(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Mf(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",Ls),Object.defineProperty(this,la,Ls),Lu(this,e)}getType(){return this.__type}isInline(){z(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=Hu(e);if(t===null)break;e=t.__parent===null?If(t):t.__parent}return!1}isSelected(e){let t=e||U();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(V(this))return n;if(H(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(Gl(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:Hu(e)}getParentOrThrow(){let e=this.getParent();return e===null&&z(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(kd(t)||If(e)!==null)return W(e)||e===this&&Gl(e)||z(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&z(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:Hu(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:Hu(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){let t=W(this)?this:this.getParent(),n=W(e)?e:e.getParent(),r=t&&n?Mp(t,n):null;return r?r.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Mp(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?kp(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&z(279),!1)))}isParentOf(e){return Cd(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=W(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&z(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=wl()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Is(this))return this;let e=Hu(this.__key);return e===null&&z(113),e}getWritable(){if(Is(this))return this;bl();let e=Sl(),t=wl(),n=e._nodeMap,r=this.__key,i=this.getLatest(),a=t._cloneNotNeeded,o=U();if(o!==null&&o.setCachedNodes(null),a.has(r))return zu(i),i;let s=gf(i);return a.add(r),zu(s),n.set(r,s),s}getTextContent(){return Yf(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){z(70)}updateDOM(e,t,n){z(71)}getDOMSlot(e){return new Si(e)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){let e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){z(18,this.name)}updateFromJSON(e){return function(e,t){let n=e.getWritable(),r=t.$,i=r;for(let e of Qi(n).flatKeys)e in t&&(i!==void 0&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&Zi(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Ns(this,!0,e)}replace(e,t){bl();let n=U();n!==null&&(n=n.clone()),Md(this,e);let r=this.getLatest(),i=this.__key,a=e.__key,o=e.getWritable(),s=this.getParentOrThrow().getWritable(),c=s.__size,l=o.getParent(),u=l===null?-1:o.getIndexWithinParent();Ru(o),l!==null&&H(n)&&Yc(n,l,u,-1);let d=r.getPreviousSibling(),f=r.getNextSibling(),p=r.__prev,m=r.__next,h=r.__parent;Ns(r,!1,!0),d===null?s.__first=a:d.getWritable().__next=a,o.__prev=p,f===null?s.__last=a:f.getWritable().__prev=a,o.__next=m,o.__parent=h,s.__size=c;let g=0;t&&(W(this)&&W(o)||z(139),g=o.getChildrenSize(),o.splice(g,0,this.getChildren()));let _=Vf(this);if(_.length>0){Pf(this)&&Pf(o)||z(368,this.__key,o.__key);for(let e of _){let t=Hf(this,e);t!==null&&($f(this,e),Qf(o,e,t))}}if(H(n)){Xu(n);let e=n.anchor,r=n.focus;e.key===i&&(t&&e.type===`element`?e.set(o.__key,g+e.offset,`element`):yc(e,o)),r.key===i&&(t&&r.type===`element`?r.set(o.__key,g+r.offset,`element`):yc(r,o))}return Vu()===i&&Bu(a),o}insertAfter(e,t=!0){bl(),Md(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.getParent(),a=U(),o=!1,s=!1;if(i!==null){let n=e.getIndexWithinParent();if(H(a)){let e=i.__key,t=a.anchor,r=a.focus;o=t.type===`element`&&t.key===e&&t.offset===n+1,s=r.type===`element`&&r.key===e&&r.offset===n+1}Ru(r),t&&H(a)&&Yc(a,i,n,-1)}else Ru(r);let c=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(c===null?l.__last=u:c.getWritable().__prev=u,l.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&H(a)){let e=this.getIndexWithinParent();Yc(a,l,e+1);let t=l.__key;o&&a.anchor.set(t,e+2,`element`),s&&a.focus.set(t,e+2,`element`)}return e}insertBefore(e,t=!0){bl(),Md(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.__key,a=U(),o=r.getParent(),s=o===null?-1:r.getIndexWithinParent();Ru(r),o!==null&&t&&H(a)&&Yc(a,o,s,-1);let c=this.getPreviousSibling(),l=this.getParentOrThrow().getWritable(),u=n.__prev,d=this.getIndexWithinParent();return c===null?l.__first=i:c.getWritable().__next=i,l.__size++,n.__prev=i,r.__prev=u,r.__next=n.__key,r.__parent=n.__parent,t&&H(a)&&Yc(a,this.getParentOrThrow(),d),e}isParentRequired(){return!1}createParentElementNode(){return lu()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){bl();let n=Lf(this);if(n!==null)return n.selectPrevious(e,t);let r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(W(r))return r.select();if(!V(r)){let e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){bl();let n=Lf(this);if(n!==null)return n.selectNext(e,t);let r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(W(r))return r.select(0,0);if(!V(r)){let e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function zs(e){return e instanceof Rs}var Bs=`historic`,Vs=`history-push`,Hs=`history-merge`,Us=`skip-selection-focus`,Ws=`composition-end`,Gs=`!important`;function Ks(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function qs(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===Gs?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function Js(e,t,n=``){if(t===n)return;let r=Ks(n),i=Ks(t);for(let t in i)delete r[t],qs(e,t,i[t]);for(let t in r)e.removeProperty(t)}function Ys(e,t){return 16&t?`code`:t&128?`mark`:32&t?`sub`:64&t?`sup`:null}function Xs(e,t){return 1&t?`strong`:2&t?`em`:`span`}function Zs(e,t,n,r,i){let a=r.classList,o=pd(i,`base`);o!==void 0&&a.add(...o),o=pd(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in pi){let r=pi[e];if(o=pd(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}}function Qs(e,t,n){let r=n.isComposing(),i=e+(r?ci:``),a=cf(),o=lf(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(Ud().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||Gr){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);t!==0&&c.deleteData(e,t),c.insertData(e,n)}else c.nodeValue=i}}function $s(e,t,n,r,i,a){Qs(i,e,t);let o=a.theme.text;o!==void 0&&Zs(0,0,r,e,o)}function ec(e,t){let n=Ud().createElement(t);return n.appendChild(e),n}function tc(e){return e!=null&&!0===e.__isInlineFormattable}var nc=class e extends Rs{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}static getType(){return`text`}static clone(t){return new e(t.__text,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return vi[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Vu()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=pi[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type===`text`&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Fu(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=Ys(0,n),i=Xs(0,n),a=r===null?i:r,o=Ud().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=Ud().createElement(i),o.appendChild(s)),$s(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&Js(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=Ys(0,i),s=Ys(0,a),c=Xs(0,i),l=Xs(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??z(48);let i=Ud().createElement(l);return $s(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??z(49)),Qs(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&Zs(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&Js(t.style,p,f),!1}static importDOM(){return{"#text":()=>({conversion:sc,priority:0}),b:()=>({conversion:ic,priority:0}),code:()=>({conversion:uc,priority:0}),em:()=>({conversion:uc,priority:0}),i:()=>({conversion:uc,priority:0}),mark:()=>({conversion:uc,priority:0}),s:()=>({conversion:uc,priority:0}),span:()=>({conversion:rc,priority:0}),strong:()=>({conversion:uc,priority:0}),sub:()=>({conversion:uc,priority:0}),sup:()=>({conversion:uc,priority:0}),u:()=>({conversion:uc,priority:0})}}static importJSON(e){return dc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return K(t)||z(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=ec(t,`b`)),this.hasFormat(`italic`)&&(t=ec(t,`i`)),this.hasFormat(`strikethrough`)&&(t=ec(t,`s`)),this.hasFormat(`underline`)&&(t=ec(t,`u`)),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?pi[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?mi[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Fu(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=_i[e];if(this.__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){bl();let n=e,r=t,i=U(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!H(i))return Wc(o,n,o,r,`text`,`text`);{let e=Vu();e!==i.anchor.key&&e!==i.focus.key||Bu(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=U();if(r&&H(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){bl();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=Vu(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=U();if(H(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=dc(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=ra(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=dc(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=ra(t,n);let a=n.__key;i===r&&Bu(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&zu(t),n!==null&&zu(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),H(v)&&Yc(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||z(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;Vu()===r&&Bu(n);let o=U();if(H(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&Qc(i,t,n,e,a),s!==null&&s.key===r&&Qc(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function rc(e){return{forChild:fc(e.style),node:null}}function ic(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:fc(t.style,n?void 0:`bold`),node:null}}var ac=new WeakMap;function oc(e){if(!K(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function sc(e){let t=e;e.parentElement===null&&z(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=ac.get(n))===void 0&&!oc(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)ac.set(r[e],i);return i}(t)!==null)return{node:il(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=cc(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=cc(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:dc(n)}}function cc(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,K(n)){let e=n.style.display;if(e===``&&!rf(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(Mu(n))return n;if(n.nodeName===`BR`)return null}}var lc={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function uc(e){let t=lc[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:fc(e.style,t),node:null}}function dc(e=``){return jd(new nc(e))}function V(e){return e instanceof nc}function fc(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign;return e=>V(e)||tc(e)?(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}var pc=class e extends nc{static getType(){return`tab`}static clone(t){return new e(t.__key)}constructor(e){super(` `,e),this.__detail=2}static importDOM(){return null}createDOM(e){let t=super.createDOM(e),n=pd(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}static importJSON(e){return mc().updateFromJSON(e)}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||z(286),this}setDetail(e){return e!==2&&z(127),this}setMode(e){return e!==`normal`&&z(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function mc(){return jd(new pc)}function hc(e){return e instanceof pc}var gc=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Op(Hp(Np(this,`next`)),Hp(Np(e,`next`)))<0}getNode(){let e=Hu(this.key);return e===null&&z(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,yl()||(Vu()===a&&Bu(e),i!==null&&(i.setCachedNodes(null),H(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function _c(e,t,n){return new gc(e,t,n)}function vc(e,t){let n=t.__key,r=e.offset,i=`element`;if(V(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!W(t)){let e=t.getNextSibling();if(V(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function yc(e,t){if(W(t)){let n=t.getLastDescendant();W(n)||V(n)?vc(e,n):vc(e,t)}else vc(e,t)}var bc=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Cc(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>If(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(V(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=Hu(e);t!==null&&n.push(t)}return yl()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>If(e)===null);if((U()||Jc())===this&&e[0]){let t=hp(e[0],`next`);Fp(Ep(t,t))}for(let t of e)t.remove();xc()}};function xc(){let e=Yu();if(e.isEmpty()){let t=lu();e.append(t),t.select()}}function H(e){return e instanceof Sc}var Sc=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!H(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(dp(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;W(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),up(e.focus)&&W(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=yp(e.focus.origin,`previous`);dp(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=xp(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!W(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=Hp(e.anchor),r=Hp(e.anchor.getFlipped()),i=e=>lp(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(Gp(Lp(this),`next`));return yl()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Oc(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if(W(d)&&!d.isInline()){l||(c+=`
14
+ `);let e=``;for(let t of Vf(d)){let n=Hf(d,t);n!==null&&(e+=n.getTextContent())}e===``?l=!d.isEmpty():(c+=e,l=!1)}else if(l=!1,V(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else!Gl(d)&&!ru(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=wl(),n=t.getEditorState()._selection,r=Hc(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),sa(this)}clone(){let t=this.anchor,n=this.focus;return new e(_c(t.key,t.offset,t.type),_c(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Fu(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=pi[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(il(e))}insertText(e){let t=this.anchor,n=this.focus,r=this.format,i=this.style,a=t,o=n;!this.isCollapsed()&&n.isBefore(t)&&(a=n,o=t),a.type===`element`&&function(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=dc();if(o.setFormat(n),o.setStyle(r),uu(a))a.splice(0,0,[o]);else if(a!==null){let e=kd(i)?lu().append(o):o;a.insertBefore(e)}else if(kd(i)){let e=i.getLastChild();W(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(lu().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}(a,o,r,i),o.type===`element`&&Pp(o,Hp(Np(o,`next`)));let s=a.offset,c=o.offset,l=this.getNodes(),u=l.length,d=l[0];V(d)||z(26);let f=d.getTextContent().length,p=d.getParentOrThrow(),m=l[u-1];if(u===1&&o.type===`element`&&(c=f,o.set(a.key,c,`text`)),this.isCollapsed()&&s===f&&(ju(d)||!d.canInsertTextAfter()||!p.canInsertTextAfter()&&d.getNextSibling()===null)){let t=d.getNextSibling(),n;if(V(t)&&t.canInsertTextBefore()&&!ju(t)?n=t:(n=dc(),n.setFormat(r),n.setStyle(i),p.canInsertTextAfter()?d.insertAfter(n):p.insertAfter(n)),n.select(0,0),d=n,e!==``)return void this.insertText(e)}else if(this.isCollapsed()&&s===0&&(ju(d)||!d.canInsertTextBefore()||!p.canInsertTextBefore()&&d.getPreviousSibling()===null)){let t=d.getPreviousSibling(),n;if(!V(t)||ju(t)?(n=dc(),n.setFormat(r),p.canInsertTextBefore()?d.insertBefore(n):p.insertBefore(n)):n=t,n.select(),d=n,e!==``)return void this.insertText(e)}else if(d.isSegmented()&&s!==f){if(Vu()!==null)d=d.setMode(`normal`).setFormat(r).setStyle(i);else{let e=dc(d.getTextContent());e.setFormat(r),d.replace(e),d=e}}else if(!this.isCollapsed()&&e!==``){let t=m.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||W(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(``),Rc(this.anchor,this.focus),void this.insertText(e)}if(u===1){if(Au(d)){let t=dc(e);t.select(),d.replace(t);return}let t=d.getFormat(),n=d.getStyle();if(s!==c||t===r&&n===i){if(hc(d)){let t=dc(e);t.setFormat(r),t.setStyle(i),t.select(),d.replace(t);return}}else{if(d.getTextContent()!==``){let t=dc(e);if(t.setFormat(r),t.setStyle(i),t.select(),s===0)d.insertBefore(t,!1);else{let[e]=d.splitText(s);e.insertAfter(t,!1)}t.isComposing()&&this.anchor.type===`text`&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null);return}d.setFormat(r),d.setStyle(i)}let a=c-s;d=d.spliceText(s,a,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=t,this.style=n,d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null))}else{let t=new Set([...d.getParentKeys(),...m.getParentKeys()]),n=W(d)?d:d.getParentOrThrow(),r=W(m)?m:m.getParentOrThrow(),i=m;if(!n.is(r)&&r.isInline())do i=r,r=r.getParentOrThrow();while(r.isInline());if(o.type===`text`&&(c!==0||m.getTextContent()===``)||o.type===`element`&&m.getIndexWithinParent()<c){if(V(m)&&!Au(m)&&c!==m.getTextContentSize()){if(m.isSegmented()){let e=dc(m.getTextContent());m.replace(e),m=e}ql(o.getNode())||o.type!==`text`||(V(m)||z(395),m=m.spliceText(0,c,``)),t.add(m.__key)}else{let e=m.getParentOrThrow();e.canBeEmpty()||e.getChildrenSize()!==1?m.remove():e.remove()}}else t.add(m.__key);let a=r.getChildren(),p=new Set(l),h=n.is(r),g=n.isInline()&&d.getNextSibling()===null?n:d;for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.is(d)||W(t)&&t.isParentOf(d))break;t.isAttached()&&(!p.has(t)||t.is(i)?h||g.insertAfter(t,!1):t.remove())}if(!h){let e=r,n=null;for(;e!==null;){let r=e.getChildren(),i=r.length;(i===0||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Au(d)){if(s===f)d.select();else{let t=dc(e);t.select(),d.replace(t)}}else d=d.spliceText(s,f-s,e,!0),d.getTextContent()===``?d.remove():this.anchor.type===`text`&&(this.format=d.getFormat(),this.style=d.getStyle(),d.isComposing()&&(this.anchor.offset-=e.length,this._cachedNodes=null,this._cachedIsBackward=null));for(let e=1;e<u;e++){let n=l[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){let e=U()===this;Ip(this,Vp(Lp(this))),e&&U()!==this&&Xu(this)}formatText(e,t=null){Ec(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&W(t)&&If(t)!==null){let n=t.isShadowRoot()?t.getFirstChild()??t.append(lu()).getFirstChild():t.getFirstChild();if(t.isShadowRoot()&&n!==null&&!W(n)){let e=lu();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=U();return H(t)||z(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&kd(t)){let n=ll(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=(this.isBackward()?this.focus:this.anchor).getNode(),r=Af(n,sf),i=e[e.length-1];if(W(r)&&`__language`in r){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let t=ol(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some(e=>(W(e)||Gl(e))&&!e.isInline())){W(r)||z(211,n.constructor.name,n.getType());let t=ol(this);r.splice(t,0,e),i.selectEnd();return}if(W(r)&&If(r)!==null){let t=ol(this),n=al(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}if(r===null){let t=ll(e),n=t.getLastDescendant(),r=Np(this.anchor,`next`);for(let e of t.getChildren())r=Xp(e,r);n!==null&&n.selectEnd();return}if(W(r)&&!r.isParentRequired()&&!kd(r.getParentOrThrow())){let t=ol(this),n=al(e);r.splice(t,0,n);let i=n[n.length-1];i===void 0?r.select(t,t):i.selectEnd();return}let a=ll(e),o=a.getLastDescendant(),s=a.getChildren(),c=!W(r)||!r.isEmpty()?this.insertParagraph():null;c&&!r.isAttached()&&(n=this.anchor.getNode(),r=Af(n,sf));let l=s[s.length-1],u=s[0];var d;W(d=u)&&sf(d)&&!d.isEmpty()&&W(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(W(r)||z(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=s[1]),u&&(r===null&&z(212,n.constructor.name,n.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||z(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(r,u));let f=Af(o,sf);c&&W(f)&&(c.canMergeWhenEmpty()||sf(l))&&(f.append(...c.getChildren()),c.remove()),W(r)&&r.isEmpty()&&r.remove(),o.selectEnd();let p=W(r)?r.getLastChild():null;ru(p)&&f!==r&&p.remove()}insertParagraph(){let e=this.anchor.getNode();if(this.anchor.type===`element`&&kd(e)){let t=lu();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let t=ol(this),n=Af(this.anchor.getNode(),sf);if(n!==null&&If(n)!==null)return null;W(n)||z(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=nu();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Oc(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(V(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(V(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),V(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(ul(this,e,t,n))return;let r=e===`move`,i=wl(),a=Id(Td(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!W(c)||c.isInline()||c.canBeEmpty()||Fd(o,i,s);let l=vd(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=V(c)?ff(c,l,i):null),this.dirty){let e=vd(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=V(n)?ff(n,e,i):null}t&&u&&$c(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&V(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=hp(c,t?`previous`:`next`).getNodeAtCaret();if(V(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?ff(e,n,i):null;if(r){let e=t?r.length:0;$c(a,r,e,r,e)}}}}if(jc(a,e,t?`backward`:`forward`,n),a.rangeCount>0){let e=Wd(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=ql(o)?o:Dd(o);this.applyDOMRange(n),this.dirty=!0,!r&&(Mc(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||Ac(this))}n===`lineboundary`&&ul(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&W(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if(W(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;let r=wp(Np(t,e?`previous`:`next`));if(r.getTextSlices().every(e=>e===null||e.distance===0)){let e={type:`initial`};for(let t of r.iterNodeCarets(`shadowRoot`))if(dp(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if(W(r.anchor.origin)&&r.anchor.origin.isEmpty()){let e=Hp(t);Ip(this,Ep(e,e)),r.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(up(t)){if(W(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(Gl(t.origin)){if(!t.origin.isIsolated()){if(Vf(t.origin).length>0){if(W(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Kc();e.add(t.origin.getKey()),Xu(e)}}else if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&W(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();let e=Kc();e.add(t.origin.getKey()),Xu(e)}else t.origin.remove()}return}break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return Vf(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(Ip(this,Ep(!t.origin.isEmpty()&&n.isEmpty()?Rp(hp(n,t.direction)):r.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(If(e)!==null)return;if(W(e)&&e.isShadowRoot())break;e=e.getParent()}}let i=this.focus;if(Nc(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&kc(this,t.getNode()))return}else{let r=i.type===`text`?i.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=i.offset,a=r.getTextContentSize();if(r.is(n)||e&&t!==a||!e&&t!==0)return void Fc(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void Fc(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,a=r.offset,o=e<a,s=o?e:a,c=o?a:e,l=c-1;s!==l&&(function(e){return!($u(e)||Pc(e))})(i.getTextContent().slice(s,c))&&(t?r.set(r.key,l,r.type):n.set(n.key,l,n.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0){let e=this.anchor.getNode();e.isEmpty()&&ql(e.getParent())&&e.getPreviousSibling()===null&&kc(this,e),xc()}}deleteLine(e){let t=zc(this.anchor);if(t!==null&&Gl(Lf(t)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&Nc(this,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):Af(this.anchor.getNode(),sf)===Af(this.focus.getNode(),sf)?this.removeText():(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e))}deleteWord(e){if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;Nc(this,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return yl()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function Cc(e){return e instanceof bc}function wc(e,t){if(Cc(e)){for(let n of e.getNodes())tc(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void Bu(null);let n=[];for(let r of e.getNodes())V(r)?n.push(r):W(r)?r.setTextFormat(t(r.getTextFormat())):tc(r)&&r.setFormat(t(r.getFormat()));let r=n.length;if(r===0)return e.setFormat(t(e.format)),void Bu(null);let i=e.anchor,a=e.focus,o=e.isBackward(),s=o?a:i,c=o?i:a,l=0,u=n[0],d=s.type===`element`?0:s.offset;if(s.type===`text`&&d===u.getTextContentSize()&&(l=1,u=n[1],d=0),u==null)return;let f=r-1,p=n[f],m=c.type===`text`?c.offset:p.getTextContentSize();if(u.is(p)){if(d===m)return;let n=t(u.getFormat());if(ju(u)||d===0&&m===u.getTextContentSize())u.setFormat(n);else{let e=u.splitText(d,m),t=d===0?e[0]:e[1];t.setFormat(n),s.type===`text`&&s.set(t.__key,0,`text`),c.type===`text`&&c.set(t.__key,m-d,`text`)}e.format=n;return}d===0||ju(u)||([,u]=u.splitText(d),d=0);let h=t(u.getFormat());u.setFormat(h);let g=t(p.getFormat());m>0&&(m===p.getTextContentSize()||ju(p)||([p]=p.splitText(m)),p.setFormat(g));for(let e=l+1;e<f;e++){let r=n[e];r.setFormat(t(r.getFormat()))}s.type===`text`&&s.set(u.__key,d,`text`),c.type===`text`&&c.set(p.__key,m,`text`),e.format=h|g}function Tc(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&wc(e,e=>{for(let[t,r]of n)e=Fu(e,t,r?pi[t]:0);return e})}function Ec(e,t,n=null){let r=n===null&&H(e)?Fu(e.format,t,null):n;wc(e,e=>Fu(e,t,r))}function Dc(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Oc(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Dc(n),Dc(r)]}function kc(e,t){for(let n=t;n;n=n.getParent()){if(W(n)){if(n.collapseAtStart(e))return!0;if(kd(n))break}if(n.getPreviousSibling())break}return!1}function Ac(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function jc(e,t,n,r){e.modify(t,n,r)}function Mc(e,t,n){let r=e.getNodes(),i=r.filter(e=>Cd(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=W(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function Nc(e,t,n){if(ul(e,`extend`,t,n))return;let r=wl(),i=Id(Td(r));if(!i||typeof i.modify!=`function`)return;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!W(c)||c.isInline()||c.canBeEmpty()||Fd(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&V(t)?ff(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return;let g=m.offset;if($c(i,h,g,h,g),jc(i,`move`,t?`backward`:`forward`,n),i.rangeCount===0)return;let _=Wd(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(p&&n===`character`&&s.type===`text`&&V(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=hp(u,t?`previous`:`next`).getNodeAtCaret();if(V(n)){let r=t?n.getTextContentSize()-1:1;e.focus.set(n.__key,r,`text`),e.dirty=!0;return}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return void(r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0))}let[b,x,S,C]=t?[v,y,d,f]:[d,f,v,y],w=ql(u)?u:Dd(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:C,startContainer:b,startOffset:x}),e.dirty=!0,!Mc(e,t,w)&&t&&Ac(e),n===`lineboundary`&&ul(e,`extend`,t,n,`decorators`)}var Pc=(()=>{try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1})();function Fc(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Ic(e,t,n,r){let i,a=t,o=!1;if(K(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),Gu(e,r)!==void 0||wf(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=Qu(d),V(i))a=_p(i,s?`next`:`previous`);else{let c=Qu(e);if(c===null)return null;if(W(c)){let o=r.getElementByKey(c.getKey());o===null&&z(214);let l=uf(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),W(c)||z(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if(W(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=W(u)?u:u.getParentOrThrow()),a=0}V(u)?(i=u,c=null,a=_p(u,s?`next`:`previous`)):u!==c&&s&&!f&&(W(c)||z(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=Lf(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&Qu(e)===c){let n=uf(c,s,r);n.element===s?t===0&&Gl(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if(W(c))return[_c(c.__key,a,`element`),o]}}else i=Qu(e);return V(i)?[_c(i.__key,_p(i,a,`clamp`),`text`),o]:null}function Lc(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&W(a)&&a.isInline()){let t=a.getPreviousSibling();V(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else W(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):V(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&W(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&W(a)&&a.isInline()&&!a.canInsertTextAfter()&&a.getTextContentSize()>1){let t=a.getNextSibling();V(t)&&e.set(t.__key,0,`text`)}}}function Rc(e,t,n){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Lc(e,n,r),Lc(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function zc(e){let t=Hu(e.key);return t===null?null:zf(t)}function Bc(e,t,n){let r=zc(e),i=zc(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;let a=n(r,i);if(r!==null)return W(r)?t.set(r.getKey(),a?r.getChildrenSize():0,`element`):t.set(r.getKey(),a?r.getTextContentSize():0,`text`),!0;let o=Lf(i);if(o===null)return!1;let s=o.getParent();if(s===null)return!1;let c=o.getIndexWithinParent();return t.set(s.getKey(),a?c+1:c,`element`),!0}function Vc(e){let t=Bc(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(n!==null&&r!==null){let e=Lf(n),t=Lf(r);if(e!==null&&e.is(t)){for(let t of Bf(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return e===null||t===null||e.isBefore(t)}if(n!==null){let e=Lf(n),r=Hu(t.key);return e===null||r===null||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=Lf(r),a=Hu(e.key);return i!==null&&a!==null&&!i.is(a)&&!i.isParentOf(a)&&a.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function Hc(e,t,n,r,i,a){if(e===null||n===null||!Eu(i,e,n))return null;let o=Ic(e,t,H(a)?a.anchor:null,i);if(o===null)return null;let s=Ic(n,r,H(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=Qu(e),r=Qu(n);if(Gl(t)&&Gl(r))return null}let f=i._slotsUsed&&Bc(c,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return Rc(c,u),[c,u,l||d||f]}function Uc(e){return W(e)&&!e.isInline()}function Wc(e,t,n,r,i,a){let o=Sl(),s=new Sc(_c(e,t,i),_c(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function Gc(){return new Sc(_c(`root`,0,`element`),_c(`root`,0,`element`),0,``)}function Kc(){return new bc(new Set)}function qc(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Ni&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(H(e)&&!c)return e.clone();{if(t===null)return null;let r=Kd(t,n._rootElement);if(l=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(s||o===void 0)&&H(e)&&!Eu(n,l,u))return e.clone()}let p=Hc(l,d,u,f,n,e);if(p===null)return null;let[m,h,g]=p,_=0,v=``;if(H(e)){let t=e.anchor;if(m.key===t.key)_=e.format,v=e.style;else{let e=m.getNode();V(e)?(_=e.getFormat(),v=e.getStyle()):W(e)&&(_=e.getTextFormat(),v=e.getTextStyle())}}let y=new Sc(m,h,_,v);return g&&(y.dirty=!0),y}function U(){return Sl()._selection}function Jc(){return wl()._editorState._selection}function Yc(e,t,n,r=1){let i=e.anchor,a=e.focus,o=i.getNode(),s=a.getNode();if(!t.is(o)&&!t.is(s))return;let c=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(c,n,`element`),a.set(c,n,`element`),Xc(e)}}else{let o=e.isBackward(),s=o?a:i,l=s.getNode(),u=o?i:a,d=u.getNode();if(t.is(l)){let e=s.offset;(n<=e&&r>0||n<e&&r<0)&&s.set(c,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(c,Math.max(0,e+r),`element`)}}Xc(e)}function Xc(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!W(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}return}if(W(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(V(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if(W(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(V(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}function Zc(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,V(i)?s=`text`:W(i)&&(s=`element`)):(a=r.__key,V(r)?(o=r.getTextContentSize(),s=`text`):W(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function Qc(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function $c(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function el(e,t,n){let r=vd(e,t.getKey());if(W(t)){let i=uf(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function tl(e,t,n,r,i,a){let o=a.getRootNode(),s=Nu(o)||Rd(o)?Zd(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&Tu(s,s))return;let c=Kd(r,a),l;if(!H(t))return void(e!==null&&Eu(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=el(n,f,u.offset),[g,_]=el(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=V(f)?ff(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):H(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=V(p)?ff(p,g,n):null),x!==null&&S!==null){if(b&&(e===null||C||H(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,h,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===_&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:Ou(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if($c(r,x,h,S,_),Gr&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=Xd(a);if(e===null||!a.contains(e)){let e=Zd(a.ownerDocument),t=e===null?null:Ou(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===Xd(a)){let e=H(t)&&t.anchor.type===`element`?x.childNodes[h]||null:(l===void 0&&(l=Gd(r,a)),l);if(e!==null){let t;if(Mu(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();(function(e,t,n){let r=bd(n),i=wd(r);if(r===null||i===null)return;let a=n.getBoundingClientRect();if(t.bottom<a.top)return;let{top:o,bottom:s}=t,c=0,l=0,u=n;for(;u!==null;){let t=u===r.body;if(t){let t=i.visualViewport;if(t){let e=t.offsetTop;c=e,l=e+t.height}else c=0,l=Td(e).innerHeight;let n=i.getComputedStyle(r.documentElement),a=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(a)&&(c+=a),isFinite(o)&&(l-=o)}else{let e=u===n?a:u.getBoundingClientRect();c=e.top,l=e.bottom}let d=0;if(o<c?d=-(c-o):s>l&&(d=s-l),d!==0){if(t)i.scrollBy(0,d);else{let e=u.scrollTop;u.scrollTop+=d;let t=u.scrollTop-e;o-=t,s-=t}}if(t)break;u=yd(u)}})(n,t,a)}}(function(e){e._inputState.isSelectionChangeFromDOMUpdate=!0})(n)}}function nl(e){let t=U()||Jc();t===null&&(t=Yu().selectEnd()),t.insertNodes(e)}function rl(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
15
+ `||n===`\r
16
+ `?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function il(e){let t=[];return rl(e,{linebreak:()=>t.push(nu()),tab:()=>t.push(mc()),text:e=>t.push(dc(e))}),t}function al(e){let t=[];for(let n of e)ru(n)||(!W(n)&&!Gl(n)||n.isInline()?t.push(n):W(n)&&t.push(...al(n.getChildren())));return t}function ol(e){let t=e;e.isCollapsed()||t.removeText();let n=U();H(n)&&(t=n),H(t)||z(161);let r=t.anchor,i=r.getNode(),a=r.offset;for(;!sf(i)&&If(i)===null;){let e=i;if([i,a]=sl(i,a),e.is(i))break}return a}function sl(e,t){let n=e.getParent();if(!n){let e=lu();return Yu().append(e),e.select(),[Yu(),0]}if(V(e)){let r=e.splitText(t);if(r.length===0)return[n,e.getIndexWithinParent()];let i=t===0?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!W(e)||t===0)return[n,e.getIndexWithinParent()];let r=e.getChildAtIndex(t);if(r){let n=new Sc(_c(e.__key,t,`element`),_c(e.__key,t,`element`),0,``),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function cl(e){return ru(e)||Ed(e)||V(e)||e.isParentRequired()}function ll(e){let t=lu(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(cl(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(ru(i)&&(a===void 0||!cl(a)))continue}n.append(i)}else t.append(i),n=null}return t}function ul(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=Np(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`;if(!Up(c)){for(let e of c){l=!1;let{origin:t}=e;if(!Gl(t)||t.isIsolated()||(c=e,!o||!t.isInline()))break}if(l)for(let e of wp(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(dp(e))e.origin.isInline()||(c=e);else{if(W(e.origin))continue;Gl(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&Gl(c.origin)&&c.origin.isKeyboardSelectable()){let e=Kc();return e.add(c.origin.getKey()),Xu(e),!0}return c=Hp(c),s&&Pp(e.anchor,c),Pp(e.focus,c),l||!o}var dl=null,fl=null,pl=!1,ml=!1,hl=!1,gl=new Set,_l=0,vl={characterData:!0,childList:!0,subtree:!0};function yl(){return pl||dl!==null&&dl._readOnly}function bl(){pl&&z(13)}function xl(){_l>99&&z(14)}function Sl(){return dl===null&&z(195,El()),dl}function Cl(e){Sl()!==null&&fl===null&&(fl=e),fl!==e&&Vr(378)}function wl(){return fl===null&&z(337,El()),fl}function Tl(){wl()._dirtyType=2}function El(){let e=0,t=new Set,n=vu.version;if(typeof window<`u`)for(let r of Vd(document)){let i=ku(r);if(Du(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Dl(){return fl}function Ol(e,t,n){let r=t.__type,i=Su(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function kl(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Al(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function jl(e){return Ml(e,wl()._nodes)}function Ml(e,t){let n=e.type,r=t.get(n);r===void 0&&z(17,n);let i=r.klass;e.type!==i.getType()&&z(18,i.name);let a=i.importJSON(e),o=e.children;if(W(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Ml(o[e],t);a.append(n)}let s=e.$slots;if(s){Pf(a)||z(379,i.name);for(let e in s)Qf(a,e,Ml(s[e],t))}return a}function Nl(e,t,n){let r=dl,i=pl,a=fl;dl=t,pl=!0,fl=e;try{return n()}finally{dl=r,pl=i,fl=a}}function Pl(e,t){let n=hl;hl=!0;try{(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&Ll(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=dl,u=pl,d=fl,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){fl=e,dl=n,pl=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=io(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),ml)throw t;fu(e,null,r,n),Hi(e),e._dirtyType=2,ml=!0,Pl(e,a),ml=!1;return}finally{p.observe(r,vl),e._updating=f,dl=l,pl=u,fl=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set,function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=qu(e)),delete r[a])}(e,n);let y=i?null:Id(Td(e));if(e._editable&&y!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){fl=e,dl=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Fd(t,e,r),tl(o,s,e,y,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(H(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(Xd(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Pd(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);if(t!==null&&Pd(t)){let n=t.getPreviousSibling();(n===null||Pd(n))&&(s=!0,c=e.getElementByKey(t.__key))}}if(s){let n=uf(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=Ud().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=nm(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Fd(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,vl),fl=d,dl=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a),H(s)||s===null||o!==null&&o.is(s)||e.dispatchCommand(oo,void 0);let b=e._pendingDecorators;b!==null&&(e._decorators=b,e._pendingDecorators=null,Fl(`decorator`,e,!0,b)),function(e,t,n){let r=Ju(t),i=Ju(n);r!==i&&Fl(`textcontent`,e,!0,i)}(e,t||a,n),Fl(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),!f&&Ll(e,e._deferred),(function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){gl.has(e)||(gl.add(e),setTimeout(()=>{gl.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Error(`One or more update listeners are endlessly enqueueing more updates. May have encountered infinite recursion caused by update listeners that trigger additional updates without a stop condition. Editor namespace: ${e._config.namespace}`));let n=t.shift();if(n){let[t,r]=n;zl(e,t,r)}})(e)})(e,t)}finally{hl=n}}function Fl(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function Il(e,t,n,r){let i=ed(e),a;if(!hl)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Bl(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Il(a,t,n,r)}),!1}function Ll(e,t){if(e._deferred=[],t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Rl(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&z(191),a._flushSync=!0),o&&e._deferred.push(o),Al(e,i.tag)),a==null?zl(e,n,i):n()}}return r}function zl(e,t,n){let r=e._updateTags,i,a=!1,o=!1;n!==void 0&&(i=n.onUpdate,Al(e,n.tag),a=n.skipTransforms||!1,o=n.discrete||!1),i&&e._deferred.push(i);let s=e._editorState,c=e._pendingEditorState,l=!1;(c===null||c._readOnly)&&(c=e._pendingEditorState=Jl(c||s),l=!0),c._flushSync=o;let u=dl,d=pl,f=fl,p=e._updating;dl=c,pl=!1,e._updating=!0,fl=e;let m=e._headless||e.getRootElement()===null;bu(null);try{l&&(m?s._selection!==null&&(c._selection=s._selection.clone()):c._selection=function(e,t){let n=e.getEditorState()._selection,r=Id(Td(e));return H(n)||n==null?qc(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),a=Rl(e,a),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(H(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),e._dirtyType!==0&&(a?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);V(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&oa(t)}}(c,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=Vu(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);V(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&oa(r),r!==void 0&&kl(r,a)&&Ol(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){_l++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&kl(c,a)&&Ol(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,_l++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Rl(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||(W(t)&&Mi(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Pf(t)&&t.__slots!==null&&Mi(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}for(let e of o)a.delete(e);let s=wl(),c=s._compositionKey;c===null||a.has(c)||(s._compositionKey=null)}(s,c,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(c._flushSync=!0);let i=c._selection;if(H(i)){e._slotsUsed&&Vc(i);let t=c._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||z(19)}else Cc(i)&&i._nodes.size===0&&(c._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=s,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Pl(e);return}finally{dl=u,pl=d,fl=f,e._updating=p,_l=0}e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(c,e)?c._flushSync?(c._flushSync=!1,Pl(e)):l&&wu(()=>{Pl(e)}):(c._flushSync=!1,l&&(r.clear(),e._deferred=[],e._pendingEditorState=null))}function Bl(e,t,n){fl===e&&n===void 0?t():zl(e,t,n)}function Vl(e){if(kd(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var Hl=class extends Rs{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:Vl,extends:Rs})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&z(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){return gi[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&Vf(this).length===0}isDirty(){let e=wl()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of Vf(this)){let n=Hf(this,t);W(n)&&e.push(...n.getAllTextNodes())}let t=this.getFirstChild();for(;t!==null;){if(V(t)&&e.push(t),W(t)){let n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;W(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;W(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return W(e)&&e.getLastDescendant()||e||null}let r=t[e];return W(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:Hu(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&z(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:Hu(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&z(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=Yf(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),W(i)&&r!==n-1&&!i.isInline()&&(e+=li)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of Vf(e)){let r=Hf(e,n);r!==null&&(t+=r.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),W(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=hi[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=pi[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Fu(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){bl();let n=U(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(V(e)||W(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(V(e)||W(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return H(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):Wc(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==``&&hi[e]||0,this}setStyle(e){return this.getWritable().__style=e||``,this}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,n){Is(this)&&z(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||z(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&z(100);let t=e.getNextSibling(),n=e.__key;Ru(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling());let t=e.getWritable();t.__parent===a&&u--,Ru(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&z(76),t.__parent=a,o.push(n),d=e}if(e+t===r)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else if(c!==null){let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=U();if(H(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;Ul(r,t,n)&&Zc(r,r.getNode(),this,l,c),Ul(i,t,n)&&Zc(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||kd(this)||this.remove()}}return i}getDOMSlot(e){return new wi(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){let e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return t===0&&n===``||kd(this)||this.getChildren().some(V)||(t!==0&&(e.textFormat=t),n!==``&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||``)}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=uf(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function W(e){return e instanceof Hl}function Ul(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var Wl=class extends Rs{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&z(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function Gl(e){return e instanceof Wl}var Kl=class e extends Hl{__cachedText;static getType(){return`root`}static clone(){return new e}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){z(51)}getTextContent(){let e=this.__cachedText;return e===null||!yl()&&wl()._dirtyType!==0?super.getTextContent():e}remove(){z(52)}replace(e){z(53)}insertBefore(e){z(54)}insertAfter(e){z(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)W(e)||Gl(e)||z(282);return super.splice(e,t,n)}static importJSON(e){return Yu().updateFromJSON(e)}collapseAtStart(){return!0}};function ql(e){return e instanceof Kl}function Jl(e){return new Ql(Ai(e._nodeMap),null,e._slotsUsed)}function Yl(){return new Ql(new Map([[`root`,new Kl]]),null,!1)}function Xl(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&z(130,n.name),W(e)){let r=t.children;Array.isArray(r)||z(59,n.name);let i=e.getChildren();for(let e=0;e<i.length;e++){let t=Xl(i[e]);r.push(t)}}let r=Vf(e);if(r.length>0){let i={};for(let t of r){let r=Hf(e,t);r===null&&z(366,n.name,t),i[t]=Xl(r)}t.$slots=i}return t}function Zl(e){return e instanceof Ql}var Ql=class e{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Nl(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n}toJSON(){return Nl(null,this,()=>({root:Xl(Yu())}))}},$l=class extends Hl{static getType(){return`artificial`}createDOM(e){return Ud().createElement(`div`)}},eu=class e extends Rs{static getType(){return`linebreak`}static clone(t){return new e(t.__key)}constructor(e){super(e)}getTextContent(){return`
17
+ `}createDOM(){return Ud().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>iu(e)||au(e)?null:{conversion:tu,priority:0}}}static importJSON(e){return nu().updateFromJSON(e)}};function tu(e){return{node:nu()}}function nu(){return jd(new eu)}function ru(e){return e instanceof eu}function iu(e){let t=e.parentElement;if(t!==null&&of(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ou(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&ou(n))return!0}}return!1}function au(e){let t=e.parentElement;if(t!==null&&of(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&ou(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&ou(r))return!0}return!1}function ou(e){return Mu(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}var su=class e extends Hl{static getType(){return`paragraph`}static clone(t){return new e(t.__key)}createDOM(e){let t=Ud().createElement(`p`),n=pd(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:e=>({conversion:cu,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return lu().updateFromJSON(e)}exportJSON(){let e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){let t=this.getChildren().find(V);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){let n=lu();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){let e=this.getChildren();if(e.length===0||V(e[0])&&e[0].getTextContent().trim()===``){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function cu(e){let t=lu();if(bf(t,e),vf(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in hi&&t.setFormat(n)}return yf(t,e),{node:t}}function lu(){return jd(new su)}function uu(e){return e instanceof su}function du(e){console.warn(e)}function fu(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=Yl(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){let n=`__lexicalKey_${t._key}`;delete e[n]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),Wu(n,e,`root`))}function pu(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Of(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var mu={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=Cu(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>W(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>W(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function hu(e){let t=e||{},n=Dl(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=Yl(),s=t.namespace||(i===null?td():i._config.namespace),c=t.editorState,l=[Kl,nc,eu,pc,su,$l,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===Rs||n.prototype instanceof Rs)){let r=`<unknown>`;try{r=JSON.parse(Di)}catch{}z(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Df(n);let a=n.getType(),o=pu(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Ji(l[e]),transforms:o})}}let h=new vu(o,i,m,{disableEvents:a,dom:{...mu,...e&&e.dom},namespace:s,theme:r},u||console.error,d||du,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(lo,bs,0),e.registerCommand(uo,xs,0),e.registerCommand(fo,Ss,0),e.registerCommand(po,Cs,0),e.registerCommand(Eo,Es,0)}(h),h}function gu(e,t){let n=e.get(t);e.delete(t),n&&n()}function _u(e,t,n){return e.set(t,n),gu.bind(null,e,t)}var vu=class{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_inputState;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new ji,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=td(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,unprocessedBeforeInputData:null}}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return _u(this._listeners.update,e)}registerEditableListener(e){return _u(this._listeners.editable,e)}registerDecoratorListener(e){return _u(this._listeners.decorator,e)}registerTextContentListener(e){return _u(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return am(_u(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&z(35);let r=this._commands;r.has(e)||r.set(e,[new Oi,new Oi,new Oi,new Oi,new Oi]);let i=r.get(e);i===void 0&&z(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&z(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=hf(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=hf(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=Hu(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:Hs}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return G(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=pd(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,fu(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||Ms(t),n!=null&&t.classList.remove(...n)),e!==null){let t=wd(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,Hi(this),this._updateTags.add(Hs),Pl(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;ss.set(e,n);let r=cs.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},cs.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Ds(e);i.push(ls.register(n));for(let n=0;n<os.length;n++){let[r,a]=os[n],o=typeof a==`function`?e=>{js(e)||(As(e),(t.isEditable()||r===`click`)&&a(e,t))}:e=>{if(js(e))return;As(e);let n=t.isEditable();switch(r){case`cut`:return n&&G(t,Jo,e);case`copy`:return G(t,qo,e);case`paste`:return n&&G(t,vo,e);case`dragstart`:return n&&G(t,Wo,e);case`dragover`:return n&&G(t,Go,e);case`dragend`:return n&&G(t,Ko,e);case`focus`:return n&&G(t,es,e);case`blur`:return n&&G(t,ts,e);case`drop`:return n&&G(t,Ho,e)}};i.push(is(e,r,o))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Hs),Pl(this);Fl(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&z(38);let n=e;n._readOnly&&(n=Jl(e),n._selection=e._selection?e._selection.clone():null),Vi(this);let r=this._pendingEditorState,i=t===void 0?null:t.tag;r===null||r.isEmpty()||(i!=null&&this._updateTags.add(i),Pl(this)),this._pendingEditorState=n,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Bl(this,()=>{if(i&&this._updateTags.add(i),e._parsed)for(let[e,t]of n._nodeMap.entries())W(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=Yl(),i=dl,a=pl,o=fl,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,dl=r,pl=!1,fl=t,bu(null);try{let i=t._nodes;Ml(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,dl=i,pl=a,fl=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&Pl(this),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):zl(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Bl(this,()=>{let r=U(),i=Yu();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||Xu(r.clone()),xd(`focus`),Sd(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Id(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Fl(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Tl()))}toJSON(){return{editorState:this._editorState.toJSON()}}};vu.version=Di;var yu=null;function bu(e){yu=e}var xu=1;function Su(e,t){let n=Cu(e,t);return n===void 0&&z(30,t),n}function Cu(e,t){return e._nodes.get(t)}var wu=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function Tu(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return Nu(t)||Rd(t)?Zd(t):null})():t;if(!K(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=Ku(n),i=n.nodeName;return zs(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&ku(n)==null)}function Eu(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return Ou(t)===e&&e.read(`latest`,()=>!Tu(t))}function Du(e){return e instanceof vu}function Ou(e){let t=e;for(;t!=null;){let e=ku(t);if(Du(e))return e;t=yd(t)}return null}function ku(e){return e?e.__lexicalEditor:null}function Au(e){return hc(e)||e.isToken()}function ju(e){return Au(e)||e.isSegmented()}function Mu(e){return ef(e)&&e.nodeType===3}function Nu(e){return ef(e)&&e.nodeType===9}function Pu(e){let t=e;for(;t!=null;){if(Mu(t))return t;t=t.firstChild}return null}function Fu(e,t,n){let r=pi[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~pi.superscript:t===`superscript`?i&=~pi.subscript:t===`lowercase`?(i&=~pi.uppercase,i&=~pi.capitalize):t===`uppercase`?(i&=~pi.lowercase,i&=~pi.capitalize):t===`capitalize`&&(i&=~pi.lowercase,i&=~pi.uppercase),i}function Iu(e){return V(e)||ru(e)||Gl(e)}function Lu(e,t){let n=function(){let e=yu;return yu=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);bl(),xl();let r=wl(),i=Sl(),a=``+xu++;i._nodeMap.set(a,e),W(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.add(a),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function Ru(e){If(e)!==null&&z(380,e.__key,String(If(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function zu(e){xl(),Is(e)&&z(323,e.__key,e.__type);let t=e.getLatest(),n=t.__parent===null?Ff(t)?t.__slotHost:null:t.__parent,r=Sl(),i=wl(),a=r._nodeMap,o=i._dirtyElements;n!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Ff(e)?e.__slotHost:null:e.__parent}}(n,a,o);let s=t.__key;i._dirtyType===0&&(i._dirtyType=1),W(e)?o.set(s,!0):i._dirtyLeaves.add(s)}function Bu(e){bl();let t=wl(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=Hu(n);e!==null&&e.getWritable()}if(e!==null){let t=Hu(e);t!==null&&t.getWritable()}}}function Vu(){return yl()?null:wl()._compositionKey}function Hu(e,t){let n=(t||Sl())._nodeMap.get(e);return n===void 0?null:n}function Uu(e,t){let n=Gu(e,wl());return n===void 0?null:Hu(n,t)}function Wu(e,t,n){e[`__lexicalKey_${t._key}`]=n}function Gu(e,t){return e[`__lexicalKey_${t._key}`]}function Ku(e,t){let n=e;for(;n!=null;){let e=Uu(n,t);if(e!==null)return e;n=yd(n)}return null}function qu(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Ju(e){return e.read(()=>Yu().getTextContent())}function Yu(){return Sl()._nodeMap.get(`root`)}function Xu(e){bl();let t=Sl();e!==null&&(e.dirty=!0,e.setCachedNodes(null),H(e)&&wl()._slotsUsed&&Vc(e)),t._selection=e}function Zu(){bl(),Vi(wl())}function Qu(e){let t=function(e,t){let n=e;for(;n!=null;){let e=Gu(n,t);if(e!==void 0)return e;n=yd(n)}return null}(e,wl());return t===null?null:Hu(t)}function $u(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function ed(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function td(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function nd(e){return Mu(e)?e.nodeValue:null}function rd(e,t,n){let r=Id(Td(t));if(r===null)return;let i=Kd(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=nd(a),r=Ku(a);if(t!==null&&V(r)){if((t===ci||t===ui)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&id(r,t,o,s,e)}}}function id(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing();if(a.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(ci)&&(s=t.slice(0,-ci.length)),i)){let e=ui,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){let t=U();if(s===``){if(Bu(null),Yr||qr||Qr)a.remove();else{let e=wl();ad(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let i=a.getParent(),c=Jc(),l=a.getTextContentSize(),u=Vu(),d=a.getKey();if(a.isToken()&&!o||u!==null&&d===u&&!o||H(c)&&(i!==null&&!i.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===e.__key&&c.anchor.offset===0&&!a.canInsertTextBefore()&&!o||c.focus.key===e.__key&&c.focus.offset===l&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!H(t)||n===null||r===null)return void ad(a,s,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=dc(a.getTextContent());a.replace(e),a=e}ad(a,s,t)}}}function ad(e,t,n){if(e.setTextContent(t),H(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=_p(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function od(e,t,n){let r=t[n]||!1;return r===`any`||r===e[n]}function sd(e,t){return od(e,t,`altKey`)&&od(e,t,`ctrlKey`)&&od(e,t,`shiftKey`)&&od(e,t,`metaKey`)}function cd(e,t,n){if(!sd(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1||e.key.length===1&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith(`Digit`)&&/^\d$/.test(t))return e.code===`Digit${t}`;let r=`Key`+t.toUpperCase();return e.code===r}var ld={ctrlKey:!Wr,metaKey:Wr},ud={altKey:Wr,ctrlKey:!Wr};function dd(e){return e.key===`Backspace`}function fd(e){let t=Yu();if(H(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(ql(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),sa(e),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();if(a===null)return W(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),sa(e)),e;let o=a;return t.set(o.getKey(),0,`element`),n.set(o.getKey(),o.getChildrenSize(),`element`),sa(e),e}{let e=t.select(0,t.getChildrenSize());return Xu(sa(e)),e}}function pd(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=nm(i);return n[t]=e,e}return i}function md(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&z(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function hd(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function gd(e,t){let n=e.offset;if(e.type===`element`)return hd(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?hd(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function _d(e){let t=Td(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function G(e,t,n){return Il(e,t,n,e)}function vd(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&z(75,t),n}function yd(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Rd(n)?n.host:null}function bd(e){return Nu(e)?e:K(e)?e.ownerDocument:null}function xd(e){bl(),wl()._updateTags.add(e)}function Sd(e){bl(),wl()._deferred.push(e)}function Cd(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function wd(e){let t=bd(e);return t?t.defaultView:null}function Td(e){let t=e._window;return t===null&&z(78),t}function Ed(e){return W(e)&&e.isInline()||Gl(e)&&e.isInline()}function Dd(e){let t=e.getLatest();for(;t!==null;){if(If(t)!==null&&W(t))return t;let e=t.getParentOrThrow();if(kd(e))return e;t=e}return t}function Od(e){return W(e)&&e.isShadowRoot()}function kd(e){return ql(e)||Od(e)}function Ad(e,t=!1){let n=e.constructor.clone(e);return Lu(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function jd(e){let t=wl(),n=e.getType(),r=Cu(t,n);r===void 0&&z(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||z(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||z(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&z(203,e.constructor.name,n,r.name,r.getType()),t}return e}function Md(e,t){!ql(e.getParent())||W(t)||Gl(t)||z(99)}function Nd(e){let t=Hu(e);return t===null&&z(63,e),t}function Pd(e){if(!e||e.isInline())return!1;if(Gl(e))return!0;if(W(e)){if(e.isShadowRoot()){let t=e.getParent();return!(W(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Fd(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Id(e){return Hr?(e||window).getSelection():null}function Ld(e){let t=wd(e);return t?t.getSelection():null}function Rd(e){return tf(e)&&`host`in e}var zd=[];function Bd(e){let t=e.getRootNode();if(t===e||!Rd(t))return zd;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Rd(e))break;n.push(e),r=e.host}return n}function*Vd(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(Nu(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function Hd(e){return e===null?document:e.ownerDocument}function Ud(){let e=Dl();return Hd(e===null?null:e._rootElement)}function Wd(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=Bd(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function Gd(e,t){let n=Wd(e,t);if(n!==null){let e=qd(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function Kd(e,t){let n=Wd(e,t);return n===null?e:Jd(n,Yd(e))}function qd(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Jd(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Yd(e){return e.direction}function Xd(e){let t=e.getRootNode();return Nu(t)||Rd(t)?t.activeElement:null}function Zd(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function Qd(e){let t=e.target;if(t!==null&&K(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function $d(e){return K(e)&&e.tagName===`A`}function K(e){return ef(e)&&e.nodeType===1}function ef(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function tf(e){return ef(e)&&e.nodeType===11}var nf=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function rf(e){return!(!K(e)||!e.style.display.startsWith(`inline`))||nf.test(e.nodeName)}var af=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function of(e){return(!K(e)||!e.style.display.startsWith(`inline`))&&af.test(e.nodeName)}function sf(e){if(Gl(e)&&!e.isInline())return!0;if(!W(e)||kd(e))return!1;let t=e.getFirstChild(),n=t===null||ru(t)||V(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function cf(){return wl()}function lf(e=cf()){return e._config.dom||mu}function uf(e,t,n=cf()){let r=lf(n).$getDOMSlot(e,t,n);return W(e)&&(df(r)||z(344,e.getKey(),e.getType())),r}function df(e){return e instanceof wi}function ff(e,t,n=cf()){return Pu(uf(e,t,n).element)}var pf=new WeakMap,mf=new Map;function hf(e){if(!e._readOnly&&e.isEmpty())return mf;e._readOnly||z(192);let t=pf.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),pf.set(e,t)),t}function gf(e){let t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function _f(e){return(t=gf(e))[Fs]=!0,t;var t}function vf(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function yf(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function bf(e,t){let n=t.style.textAlign;return n&&n in hi?e.setFormat(n):e}function xf(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Sf(e){return!0===e.__lexicalUnmanaged}function Cf(e,t=cf()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function wf(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(K(n)&&n.hasAttribute(`data-lexical-slot`)||Gu(n,t)!==void 0)return!1;n=yd(n)}return!1}function Tf(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Rs[t]}var Ef=new WeakMap;function Df(e){let t=Ef.get(e);if(t)return t;let n=e.prototype!=null&&yi in e.prototype?e.prototype[yi]():void 0,r=function(e){if(!(e===Rs||e.prototype instanceof Rs)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{vu.version&&(n=JSON.parse(vu.version))}catch{}z(290,e.name,t,n)}return e===Wl||e===Hl||e===Rs}(e),i=!r&&Tf(e,`getType`)?e.getType():void 0,a,o=i;if(n){if(i)a=n[i];else{for(let[e,t]of Object.entries(n))o=e,a=t;if(!a)for(let e of Object.getOwnPropertySymbols(n)){let t=n[e];if(t){a=t;break}}}}if(!r&&o&&(Tf(e,`getType`)||(e.getType=()=>o),Tf(e,`clone`)||(e.clone=t=>(bu(t),new e)),Tf(e,`importJSON`)||(e.importJSON=a&&a.$importJSON||(t=>new e().updateFromJSON(t))),!Tf(e,`importDOM`)&&a)){let{importDOM:t}=a;t&&(e.importDOM=()=>t)}let s={klass:e,ownNodeConfig:a,ownNodeType:o};return Ef.set(e,s),s}function*Of(e){for(let t=e;t&&(t===Rs||zs(t.prototype));){let e=Df(t);yield e,t=e.ownNodeConfig&&e.ownNodeConfig.extends||Mf(t)}}function kf(e){let t=cf();return bl(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e))).klass}var Af=(e,t)=>{let n=e;for(;n!=null&&!ql(n);){if(t(n))return n;n=n.getParent()}return null};function jf(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?Hu(r):t.get(r);e??z(174),n.push(r),r=e.__next}return n}function Mf(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var Nf=new Map;function Pf(e){return W(e)||Gl(e)}function Ff(e){return W(e)||Gl(e)}function If(e){let t=e.getLatest();return Ff(t)?t.__slotHost:null}function Lf(e){let t=If(e);if(t===null)return null;let n=Hu(t);return W(n)||Gl(n)||z(370),n}function Rf(e){let t=Lf(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of Bf(t))if(r===n)return e;return null}function zf(e){let t=e.getLatest();for(;t!==null;){if(If(t)!==null)return t;t=t.getParent()}return null}function Bf(e){let t=e.getLatest();return Pf(t)&&t.__slots!==null?t.__slots:Nf}function Vf(e){return Array.from(Bf(e).keys())}function Hf(e,t){let n=Bf(e).get(t);return n===void 0?null:Hu(n)}var Uf=[`__proto__`,`constructor`,`prototype`],Wf=Symbol(`slotMapOwner`);function Gf(e){let t=e.__slots;return t!==null&&t[Wf]===e||(t=new Map(t),t[Wf]=e,e.__slots=t),t}var Kf=new WeakMap,qf=[];function Jf(e){for(let{ownNodeConfig:t}of Of(e)){let e=t&&t.slots;if(e)return e}return qf}function Yf(e){let t=``;for(let n of Vf(e)){let r=Hf(e,n);r!==null&&(t+=r.getTextContent())}return t}function Xf(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Zf(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=Kf.get(e);if(t===void 0){let n=Jf(e),r=new Map;for(let t of n)Uf.includes(t)&&z(371,e.name,t),r.has(t)&&z(372,e.name,t),r.set(t,r.size);t=r,Kf.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&Xf(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>Xf(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}function Qf(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||z(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!W(n)&&!Gl(n)||n.isInline())&&z(374,n.__key);let i=e.getWritable(),a=Gf(i),o=a.get(t);o!==void 0&&ep(o);let s=n.getWritable(),c=Lf(s);if(c!==null){let e=Rf(s);e!==null&&Gf(c.getWritable()).delete(e),s.__slotHost=null}return Ru(s),s.__slotHost=i.__key,a.set(t,s.__key),Zf(i),function(){let e=cf();e._slotsUsed=!0,e._pendingEditorState&&(e._pendingEditorState._slotsUsed=!0)}(),i}function $f(e,t){let n=e.getWritable();if(n.__slots===null)return n;let r=n.__slots.get(t);return r!==void 0&&(ep(r),Gf(n).delete(t)),n}function ep(e){let t=Hu(e);if(t===null)return;let n=t.getWritable();Ff(n)||z(377,e),n.__slotHost=null,n.remove()}var tp={next:`previous`,previous:`next`},np=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Dp({hasNext:up,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return hp(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return hp(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&z(263,Array.from(o).join(` `))}else i.insert(e);i=hp(e,this.direction)}for(let e of o.values())e.remove();return this}},rp=class e extends np{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:yp(e,this.direction)}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ap(this.direction);return hp(this.getNodeAtCaret(),e)||yp(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},ip={root:ql,shadowRoot:kd};function ap(e){return tp[e]}function op(e,t=`root`){return e===null||ip[t](e)?null:If(e)===null?e:null}var sp=class e extends np{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:hp(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return W(this.origin)?yp(this.origin,this.direction):null}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=ap(this.direction);return hp(this.getNodeAtCaret(),e)||yp(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof cp)&&this.direction===t.direction&&this.origin.is(t.origin)}},cp=class e extends np{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:gp(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return hp(op(this.getParentAtCaret(),e),this.direction)}getFlipped(){return gp(this.origin,ap(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof sp||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return hp(this.origin,this.direction)}};function lp(e){return e instanceof cp}function up(e){return e instanceof sp}function dp(e){return e instanceof rp}var fp={next:class extends cp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends cp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},pp={next:class extends sp{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends sp{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},mp={next:class extends rp{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends rp{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function hp(e,t){return e?new pp[t](e):null}function gp(e,t,n){return e?new fp[t](e,_p(e,n)):null}function _p(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&Vr(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function vp(e,t){return new Cp(e,t)}function yp(e,t){return W(e)?new mp[t](e):null}function bp(e){return e&&e.getChildCaret()||e}function xp(e){return e&&bp(e.getAdjacentCaret())}var Sp=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return lp(t)?function(e,t){let{direction:n,origin:r}=e;return vp(e,_p(r,t===`focus`?ap(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[vp(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=lp(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=lp(n),i=t=>t.isSameNodeCaret(n)?null:xp(t)||t.getParentCaret(e);return Dp({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},Cp=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return gp(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function wp(e){return Ep(e,hp(Yu(),e.direction))}function Tp(e){return Ep(e,e)}function Ep(e,t){return e.direction!==t.direction&&z(265),new Sp(e,t,e.direction)}function Dp(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function Op(e,t){let n=Mp(e.origin,t.origin);switch(n===null&&z(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return kp(n)}}function kp(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function Ap(e,t){return t.is(e)}function jp(e){return W(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Mp(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=jp(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=jp(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(Ap(e,r)||z(276),{commonAncestor:r,type:`ancestor`}):i===null?(Ap(t,r)||z(277),{commonAncestor:r,type:`descendant`}):((W(a)||Ap(e,a))&&(W(i)||Ap(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||z(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function Np(e,t){let{type:n,key:r,offset:i}=e,a=Nd(e.key);return n===`text`?(V(a)||z(266,a.getType(),r),gp(a,t,i)):(W(a)||z(267,a.getType(),r),Kp(a,e.offset,t))}function Pp(e,t){let{origin:n,direction:r}=t,i=r===`next`;lp(t)?e.set(n.getKey(),t.offset,`text`):up(t)?V(n)?e.set(n.getKey(),_p(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(dp(t)&&W(n)||z(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function Fp(e){let t=U(),n=H(t)?t:Gc();return Ip(n,e),Xu(n),n}function Ip(e,t){Pp(e.anchor,t.anchor),Pp(e.focus,t.focus)}function Lp(e){let{anchor:t,focus:n}=e,r=Np(t,`next`),i=Np(n,`next`),a=Op(r,i)<=0?`next`:`previous`;return Ep(Wp(r,a),Wp(i,a))}function Rp(e){let{direction:t,origin:n}=e,r=hp(n,ap(t)).getNodeAtCaret();return r?hp(r,t):yp(n.getParentOrThrow(),t)}function zp(e,t=`root`){let n=[e];for(let r=dp(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(Rp(r));return n}function Bp(e){return!!e&&e.origin.isAttached()}function Vp(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=Gp(e,r),o=zp(a.anchor,n),s=zp(a.focus.getFlipped(),n),c=new Set,l=[];for(let e of a.iterNodeCarets(n))if(dp(e))c.add(e.origin.getKey());else if(up(e)){let{origin:t}=e;W(t)&&!c.has(t.getKey())||l.push(t)}for(let e of l)e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=Rp(hp(t,r)),c=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||c===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(c===`segmented`){let e=t.origin,n=dc(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=gp(n,r,t.offset)}n.is(o[0].origin)&&(o[0]=t),n.is(s[0].origin)&&(s[0]=t.getFlipped())}}let u,d;for(let e of o)if(Bp(e)){u=Hp(e);break}for(let e of s)if(Bp(e)){d=Hp(e);break}let f=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c=0;for(;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(kd(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,sf),d=u&&l(o,e=>n.has(e.getKey())&&sf(e));return d&&Vf(d).length>0?null:u&&d?[u,d]:null}(u,d,c);if(f){let[e,t]=f;yp(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(d){let e=function(e){if(dp(e)){let t=e.origin;if(sf(t))return t}else{let t=e.getParentAtCaret();if(t&&sf(t))return t}return null}(d),t=e&&e.getParent(),n=e&&e.getParents().findLast(Od);if(e&&t&&!ql(t)&&e.isEmpty()&&c.has(e.getKey())&&Vf(e).length===0&&(!n||c.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!ql(n)&&n.isEmpty();){let e=n.getParent();if(e&&ql(e)&&e.getChildrenSize()<=1)break;let t=n;n=e,t.remove(!0)}}}let p=[u,d,...o,...s].find(Bp);if(p)return Tp(Wp(Hp(p),e.direction));z(269,JSON.stringify(o.map(e=>e.origin.__key)))}function Hp(e){let t=function(e){let t=e;for(;dp(t);){let e=xp(t);if(!dp(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(V(t.origin))return lp(t)?t:gp(t.origin,n,n);let r=t.getAdjacentCaret();return up(r)&&V(r.origin)?gp(r.origin,n,ap(n)):t}function Up(e){return lp(e)&&e.offset!==_p(e.origin,e.direction)}function Wp(e,t){return e.direction===t?e:e.getFlipped()}function Gp(e,t){return e.direction===t?e:Ep(Wp(e.focus,t),Wp(e.anchor,t))}function Kp(e,t,n){let r=yp(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Wp(r,n)}function qp(e){let{origin:t,offset:n,direction:r}=e;if(n===_p(t,r))return e.getSiblingCaret();if(n===_p(t,ap(r)))return Rp(e.getSiblingCaret());let[i]=t.splitText(n);return V(i)||z(281),Wp(hp(i,`next`),r)}function Jp(e,t){return!0}function Yp(e,{$copyElementNode:t=Ad,$splitTextPointCaretNext:n=qp,rootMode:r=`shadowRoot`,$shouldSplit:i=Jp,removeEmptyDestination:a=!1}={}){if(lp(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(dp(e)){let e=Rp(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}return o}function Xp(e,t,n){let r=Wp(t,`next`);lp(r)&&(r.offset===0?r=hp(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=hp(r.origin,`next`))),r.origin.is(e)&&(up(r)||z(342,e.getKey(),e.getType()),r=Rp(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=Yp(e,n))r=e;return lp(r)&&z(283),r.insert(e.isInline()?lu().append(e):e),Wp(hp(e.getLatest(),`next`),t.direction)}function Zp(e){return e}function Qp(...e){return e}function $p(e,t){return[e,t]}function em(e){return e}function tm(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function nm(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function rm(e,...t){let n=nm(...t);n.length>0&&e.classList.add(...n)}function im(e,...t){let n=nm(...t);n.length>0&&e.classList.remove(...n)}function am(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function om(e,t,n){return am(...Object.entries(t).map(([t,r])=>is(e,t,r,n)))}function sm(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function cm(e){let t=cf().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function lm(e){return cm(ql(e)?e:e.getParentOrThrow())}function um(e){let t=lm(e);return t!==null&&t.direction===`rtl`}function dm(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!ju(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Oc(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=_f(t)),t.__text=p)}}return t}function fm(e){if(e.type===`text`)return e.offset===e.getNode().getTextContentSize();let t=e.getNode();return W(t)||sm(177),e.offset===t.getChildrenSize()}function pm(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function mm(e,t,n){let r=Np(e,n);if(Up(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function hm(e,t,n=pm){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=Af(t.getNode(),sf);a=Af(n.getNode(),sf);let c=e.isBackward()?`previous`:`next`;i=W(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!W(r)||!r.isEmpty())&&mm(e,t,n)}(n,a,ap(c)),W(s)&&o.set(s.getKey(),s),W(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if(W(t)&&sf(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=Af(t,sf);W(e)&&o.set(e.getKey(),e)}for(let e of o.values()){let r=t();n(e,r),e.replace(r,!0)}}function gm(e){let t=_m(e);return t!==null&&t.writingMode===`vertical-rl`}function _m(e){let t=e.anchor.getNode();return W(t)?cm(t):lm(t)}function vm(e,t){let n=gm(e)?!t:t;bm(e)&&(n=!n);let r=Np(e.focus,n?`previous`:`next`);if(Up(r))return!1;if(lp(r)&&!hc(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(V(e)&&!hc(e))return!0}for(let e of wp(r)){if(dp(e))return!e.origin.isInline();if(!W(e.origin)){if(Gl(e.origin))return!0;break}}return!1}function ym(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function bm(e){let t=_m(e);return t!==null&&t.direction===`rtl`}function xm(e,t,n){let r=bm(e),i;i=gm(e)||r?!n:n,ym(e,t,i,`character`)}function Sm(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Cm(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function wm(e){let t=Af(e,e=>W(e)&&!e.isInline());return W(t)||Sm(4,e.__key),t}function Tm(e){let t=U()||Jc(),n;if(H(t))n=Np(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=hp(r,`next`))}n||=yp(Yu(),`previous`).getFlipped().insert(lu())}let r=Xp(e,n),i=xp(r);return Fp(Tp(dp(i)?Hp(i):r)),e.getLatest()}function Em(e,t){let n=t();return e.replace(n),n.append(e),n}function Dm(e,t){return e!==null&&Object.getPrototypeOf(e).constructor.name===t.name}function Om(e){let t=null;if(Dm(e,DragEvent)?t=e.dataTransfer:Dm(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function km(e){let t=U();if(!H(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=Af(i,e=>W(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}var Am=!(Gr||!Hr)&&void 0;function jm(e,t=!1){let n=1;if(function(){if(Am===void 0){let e=document.createElement(`div`);e.style.position=`absolute`,e.style.opacity=`0`,e.style.width=`100px`,e.style.left=`-1000px`,document.body.appendChild(e);let t=e.getBoundingClientRect();e.style.setProperty(`zoom`,`2`),Am=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return Am}()||t){let t=e&&e.ownerDocument.defaultView||window;for(;e;)n*=Number(t.getComputedStyle(e).getPropertyValue(`zoom`)),e=yd(e)}return n}var Mm=Symbol.for(`preact-signals`);function Nm(){if(zm>1)return void zm--;let e,t=!1;for(function(){let e=Rm;for(Rm=void 0;e!==void 0;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();Im!==void 0;){let n=Im;for(Im=void 0,Bm++;n!==void 0;){let r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&qm(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Bm=0,zm--,t)throw e}function Pm(e){if(zm>0)return e();Hm=++Vm,zm++;try{return e()}finally{Nm()}}var Fm,Im;function Lm(e){let t=Fm;Fm=void 0;try{return e()}finally{Fm=t}}var Rm,zm=0,Bm=0,Vm=0,Hm=0,Um=0;function Wm(e){if(Fm===void 0)return;let t=e.n;return t===void 0||t.t!==Fm?(t={i:0,S:e,p:Fm.s,n:void 0,t:Fm,e:void 0,x:void 0,r:t},Fm.s!==void 0&&(Fm.s.n=t),Fm.s=t,e.n=t,32&Fm.f&&e.S(t),t):t.i===-1?(t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Fm.s,t.n=void 0,Fm.s.n=t,Fm.s=t),t):void 0}function Gm(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Km(e,t){return new Gm(e,t)}function qm(e){for(let t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Jm(e){for(let t=e.s;t!==void 0;t=t.n){let n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Ym(e){let t,n=e.s;for(;n!==void 0;){let e=n.p;n.i===-1?(n.S.U(n),e!==void 0&&(e.n=n.n),n.n!==void 0&&(n.n.p=e)):t=n,n.S.n=n.r,n.r!==void 0&&(n.r=void 0),n=e}e.s=t}function Xm(e,t){Gm.call(this,void 0),this.x=e,this.s=void 0,this.g=Um-1,this.f=4,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}function Zm(e){let t=e.m;if(e.m=void 0,typeof t==`function`){zm++;let n=Fm;Fm=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Qm(e),t}finally{Fm=n,Nm()}}}function Qm(e){for(let t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Zm(e)}function $m(e){if(Fm!==this)throw Error(`Out-of-order effect`);Ym(this),Fm=e,this.f&=-2,8&this.f&&Qm(this),Nm()}function eh(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name}function th(e,t){let n=new eh(e,t);try{n.c()}catch(e){throw n.d(),e}let r=n.d.bind(n);return r[Symbol.dispose]=r,r}function nh(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Km(i===void 0?e[r]:i)}return n}Gm.prototype.brand=Mm,Gm.prototype.h=function(){return!0},Gm.prototype.S=function(e){let t=this.t;t!==e&&e.e===void 0&&(e.x=t,this.t=e,t===void 0?Lm(()=>{var e;(e=this.W)==null||e.call(this)}):t.e=e)},Gm.prototype.U=function(e){if(this.t!==void 0){let t=e.e,n=e.x;t!==void 0&&(t.x=n,e.e=void 0),n!==void 0&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,n===void 0&&Lm(()=>{var e;(e=this.Z)==null||e.call(this)}))}},Gm.prototype.subscribe=function(e){return th(()=>{let t=this.value,n=Fm;Fm=void 0;try{e(t)}finally{Fm=n}},{name:`sub`})},Gm.prototype.valueOf=function(){return this.value},Gm.prototype.toString=function(){return this.value+``},Gm.prototype.toJSON=function(){return this.value},Gm.prototype.peek=function(){let e=Fm;Fm=void 0;try{return this.value}finally{Fm=e}},Object.defineProperty(Gm.prototype,"value",{get(){let e=Wm(this);return e!==void 0&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(Bm>100)throw Error(`Cycle detected`);(function(e){zm!==0&&Bm===0&&e.l!==Hm&&(e.l=Hm,Rm={S:e,v:e.v,i:e.i,o:Rm})})(this),this.v=e,this.i++,Um++,zm++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Nm()}}}}),Xm.prototype=new Gm,Xm.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Um))return!0;if(this.g=Um,this.f|=1,this.i>0&&!qm(this))return this.f&=-2,!0;let e=Fm;try{Jm(this),Fm=this;let e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Fm=e,Ym(this),this.f&=-2,!0},Xm.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Gm.prototype.S.call(this,e)},Xm.prototype.U=function(e){if(this.t!==void 0&&(Gm.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Xm.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Xm.prototype,"value",{get(){if(1&this.f)throw Error(`Cycle detected`);let e=Wm(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),eh.prototype.c=function(){let e=this.S();try{if(8&this.f||this.x===void 0)return;let e=this.x();typeof e==`function`&&(this.m=e)}finally{e()}},eh.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,Zm(this),Jm(this),zm++;let e=Fm;return Fm=this,$m.bind(this,e)},eh.prototype.N=function(){2&this.f||(this.f|=2,this.u=Im,Im=this)},eh.prototype.d=function(){this.f|=8,1&this.f||Qm(this)},eh.prototype.dispose=function(){this.d()};function rh(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}function ih(e,t){let n;return Km(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}function ah(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var oh;try{oh=`0.48.0+prod.esm`}catch{}var sh=oh??`"<unknown>+source"`,ch=new Set([`__proto__`,`constructor`,`prototype`]);function lh(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!ch.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=lh(n[e],r[e]));return e}return t}var uh=0,dh=1,fh=2,ph=3,mh=4,hh=5,gh=6,_h=7;function vh(e){return e.id===uh}function yh(e){return e.id===fh}function bh(e){return function(e){return e.id===dh}(e)||ah(305,String(e.id),String(dh)),Object.assign(e,{id:fh})}var xh=new Set,Sh=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:uh}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):tm;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;yh(t)||ah(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:ph,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:mh,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==mh&&ah(307,String(t.id),String(hh)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:hh,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==hh&&ah(308,String(n.id),String(hh));let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:gh})}(n),()=>{let e=this.state;e.id!==_h&&ah(309,String(n.id),String(_h)),this.state=function(e){return Object.assign(e,{id:hh})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==gh&&ah(310,String(t.id),String(gh)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:_h})}(t),n}getSignal(){return this._signal===void 0&&ah(311),this._signal}getInitResult(){this.extension.init===void 0&&ah(312,this.extension.name);let e=this.state;return function(e){return e.id>=mh}(e)||ah(313,String(e.id),String(mh)),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=ph}(e)||ah(314,String(e.id),String(ph)),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ah(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&ah(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=_h}(e)||ah(316,String(e.id),String(_h)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||xh}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=hh})(e)||ah(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},Ch={tag:Hs};function wh(){let e=Yu();e.isEmpty()&&e.append(lu())}var Th=Zp({config:em({setOptions:Ch,updateOptions:Ch}),init:({$initialEditorState:e=wh})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(Zl(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[Kl,nc,eu,pc,su]}),Eh=Symbol.for(`@lexical/extension/LexicalBuilder`);function Dh(...e){return Mh.fromExtensions(e).buildEditor()}function Oh(){}function kh(e){throw e}function Ah(e){return Array.isArray(e)?e:[e]}var jh=sh,Mh=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=jh,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[Ah(Th)];for(let e of t)n.push(Ah(e));return new e(n)}static maybeFromEditor(t){let n=t[Eh];return n&&(n.PACKAGE_VERSION!==jh&&ah(292,n.PACKAGE_VERSION,jh),n instanceof e||ah(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&ah(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(hu({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[Eh]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=Oh;function t(){try{e()}finally{e=Oh}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=am(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&ah(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&ah(296);let[t]=Ah(e);typeof t.name!=`string`&&ah(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&ah(298,t.name),!n){n=new Sh(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&ah(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&ah(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=Ah(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(yh(i))return;let a=n.extension.name;var o;vh(i)||ah(300,a,r||`[unknown]`),vh(o=i)||ah(304,String(o.id),String(uh)),i=Object.assign(o,{id:dh}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=bh(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())vh(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&ah(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return am(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of rh(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&ah(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&lh(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=[...t]);let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=kh,e}};function Nh(e,t){let n=Mh.fromEditor(e).getExtensionRep(t);return n===void 0&&ah(303,t.name),n.getExtensionDependency()}function Ph(e,t){let n=Mh.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function Fh(e){return Ph(cf(),e)}var Ih=B(`INSERT_HORIZONTAL_RULE_COMMAND`),Lh=class e extends Wl{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return zh().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Rh,priority:0})}}exportDOM(){return{element:Ud().createElement(`hr`)}}createDOM(e){let t=Ud().createElement(`hr`);return rm(t,e.theme.hr),t}getTextContent(){return`
18
+ `}isInline(){return!1}updateDOM(){return!1}};function Rh(){return{node:zh()}}function zh(){return kf(Lh)}function Bh(e){return e instanceof Lh}var Vh=Zp({build:(e,t)=>nh({inheritEditableFromParent:t.inheritEditableFromParent}),config:em({$getParentEditor:function(){let e=cf();return Mh.fromEditor(e),e},inheritEditableFromParent:!1}),init:(e,t,n)=>{let r=t.$getParentEditor();e.parentEditor=r,e.theme=e.theme||r._config.theme},name:`@lexical/extension/NestedEditor`,register:(e,t,n)=>th(()=>{let t=e._parentEditor;if(t&&n.getOutput().inheritEditableFromParent.value)return e.setEditable(t.isEditable()),t.registerEditableListener(e.setEditable.bind(e))})});Date.now;function Hh(e){return e.canIndent()}function Uh(e,t,n=Hh){return am(e.registerCommand(Ro,t=>{let n=U();if(!H(n))return!1;t.preventDefault();let r=function(e){if(e.getNodes().filter(e=>Uc(e)&&e.canIndent()).length>0)return!0;let t=e.anchor,n=e.focus,r=n.isBefore(t)?n:t,i=wm(r.getNode());if(i.canIndent()){let e=i.getKey(),t=Gc();if(t.anchor.set(e,0,`element`),t.focus.set(e,0,`element`),t=sa(t),t.anchor.is(r))return!0}return!1}(n)?t.shiftKey?Vo:Bo:zo;return e.dispatchCommand(r,void 0)},0),e.registerCommand(Bo,()=>{let e=typeof t==`number`?t:t?t.peek():null;if(!H(U()))return!1;let r=typeof n==`function`?n:n.peek();return km(t=>{if(r(t)){let n=t.getIndent()+1;(!e||n<e)&&t.setIndent(n)}})},4))}function Wh(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(H(a)&&H(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||ql(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&V(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!V(l)||!V(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}function Gh(e,t,n){let r=n(),i=0,a=r,o=0,s=null;return(c,l,u,d,f,p)=>{let m=n();if(p.has(`composition-start`)&&(a=r,o=i,s=c),p.has(`historic`))return i=0,r=m,2;p.has(`composition-end`)&&s&&(r=a,i=o,c=s);let h=p.has(`paste`)||p.has(`cut`)?0:Wh(c,l,d,f,e.isComposing()),g=(()=>{let n=u===null||u.editor===e,a=p.has(Vs);if(!a&&n&&p.has(`history-merge`))return 0;if(h===1)return 2;if(c===null)return 1;let o=l._selection;if(!(d.size>0||f.size>0))return o===null?2:0;let s=typeof t==`number`?t:t.peek();return!1===a&&h!==0&&h===i&&m<r+s&&n||d.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(H(a)&&H(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!V(r)||!V(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],c,l)?0:1})();return r=m,i=h,g}}function Kh(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function qh(e,t,n,r=Date.now,i,a=null){let o=Gh(e,n,r),s=()=>{i&&i(t)};return s(),am(e.registerCommand(wo,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();a!==null&&(r.push(a),e.dispatchCommand(Qo,!0)),i.length===0&&e.dispatchCommand($o,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(To,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current;a!==null&&(i.push(a),e.dispatchCommand($o,!0));let o=r.pop();r.length===0&&e.dispatchCommand(Qo,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Xo,()=>(Kh(t,i),!1),0),e.registerCommand(Zo,()=>(Kh(t,i),e.dispatchCommand(Qo,!1),e.dispatchCommand($o,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){if(d.length!==0&&(t.redoStack=[],e.dispatchCommand(Qo,!1)),u!==null){f.push({...u});let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand($o,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function Jh(){return{current:null,redoStack:[],undoStack:[]}}var Yh=Zp({build:(e,{delay:t,createInitialHistoryState:n,disabled:r,maxDepth:i,now:a},o)=>({...nh({delay:t,disabled:r,historyState:n(e),maxDepth:i,now:a}),...o.getInitResult()}),config:em({createInitialHistoryState:Jh,delay:300,disabled:typeof window>`u`,maxDepth:null,now:Date.now}),init:()=>({canRedo:Km(!1),canUndo:Km(!1)}),name:`@lexical/history/History`,register:(e,t,n)=>{let{canUndo:r,canRedo:i}=n.getInitResult(),a=n.getOutput(),o=e=>Pm(()=>{r.value=e!=null&&e.undoStack.length>0,i.value=e!=null&&e.redoStack.length>0});return th(()=>{if(!a.disabled.value)return qh(e,a.historyState.value,a.delay,()=>a.now.peek()(),o,a.maxDepth);o(null)})}}),Xh=Zp({build:(e,{disabled:t,parentEditor:n})=>nh({disabled:t,parentEditor:n||e._parentEditor}),config:em({disabled:!1,parentEditor:null}),dependencies:[Qp(Yh,{disabled:!0})],name:`@lexical/history/SharedHistory`,register:(e,t,n)=>th(()=>{let{disabled:e,parentEditor:t}=n.getOutput();if(!e.value){let{output:e}=n.getDependency(Yh),r=function(e){return e?Ph(e,Yh.name):null}(t.value);if(!r)return;let i=r.output;Pm(()=>{e.delay.value=i.delay.value,e.historyState.value=i.historyState.value,e.now.value=i.now.value,e.disabled.value=i.disabled.value})}})});function Zh(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Qh;function $h(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function eg(e){return Qh&&Qh.editor===e?Qh:void 0}function tg(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r($h(e,n))]}return t}function ng(e,t){let n=t;for(let r of e){let[e,i]=tg(n,r),a=e.key;if(n===t&&$h(n,e)===i)continue;let o=n===t||n===void 0?rg(t):n;o[a]=i,n=o}return n}function rg(e){return Object.create(e||null)}function ig(e,t){return[e,t]}function ag(e,t,n,r=cf()){let i=Qh,a=eg(r);try{return Qh={...a,editor:r,[e]:t},n()}finally{Qh=i}}function og(e,t=()=>{}){return(n,r=cf())=>i=>{let a=eg(r),o=a&&a[e],s=ng(n,o||t(r));return s&&s!==o?ag(e,s,i,r):i()}}function sg(e,t,n,r){return Object.assign(Gi(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}function cg(e){if(!Nu(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!Dm(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!K(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var lg=`@lexical/html/DOM`,ug=Symbol.for(`@lexical/html/DOMExportContext`);function dg(e,t,n){return sg(ug,e,t,n)}var fg=dg(`isExport`,Boolean);function pg(e){let t=Ph(e,lg);return t?t.output.defaults:void 0}function mg(e){let t=Ph(e,lg);return t?t.output.runtime:void 0}function hg(e=cf()){let t=mg(e);return t?t.getSessionConfig():lf(e)}var gg=og(ug,pg),_g=Symbol.for(`@lexical/html/SelectorImpl`);function vg(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?K:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>vg(e,[...t,n]);return{[_g]:n,attr:(e,t,n)=>i(xg(e,t,n)),classAll:(...e)=>i(bg(e)),classAny:(...e)=>i(function(e){let t=yg(e);return t.length===0?()=>!1:e=>{if(!K(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>K(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!K(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Zh(362,JSON.stringify(e))}(e,t,n))}}function yg(e){let t=[];for(let n of e)n&&t.push(n);return t}function bg(e){let t=yg(e);return t.length===0?()=>!0:e=>{if(!K(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function xg(e,t,n){if(!0===t)return t=>K(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>K(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!K(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Zh(361,JSON.stringify(e))}var Sg={kind:`text`,predicate:Mu,tags:new Set},Cg={[_g]:Sg},wg={kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set},Tg={[_g]:wg},Eg={any:()=>vg(new Set,[]),comment:()=>Tg,tag(...e){e.length>0||Zh(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return vg(t,[])},text:()=>Cg},Dg=/[A-Za-z0-9_-]/,Og=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&Dg.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||Zh(364,String(this.pos+1),t,this.source)}};function kg(e){let t=new Set,n=[],r=[];if(e.skipWhitespace(),e.peek()===`*`)e.consume();else if(Dg.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(xg(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(xg(t,r))}}}return r.length>0&&n.push(bg(r)),{predicates:n,tags:t}}function Ag(e){let t=new Og(e,0),n=[];for(;;){let e=kg(t);if(n.push(e),t.skipWhitespace(),t.eof())break;t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace()}if(n.length===1)return vg(n[0].tags,n[0].predicates);let r=new Set;for(let e of n)for(let t of e.tags)r.add(t);return vg(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}var jg=Eg;jg.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),jg.text(),jg.tag(`script`,`style`),jg.tag(`br`),jg.tag(`p`),jg.tag(`hr`),jg.any(),Object.freeze([]),Object.freeze({}),Eg.any();var Mg={any:Eg.any,comment:Eg.comment,css:Ag,tag:Eg.tag,text:Eg.text},Ng=new Set([`STYLE`,`SCRIPT`]);function Pg(e,t){cg(t);let n=Nu(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!Ng.has(t.nodeName)){let n=Rg(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof $l&&t.insertAfter(nu());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function Fg(e,t=null,n=cf()){return gg([ig(fg,!0)],n)(()=>{let r=Yu(),i=hg(n),a=H(t)?zf(t.anchor.getNode()):null,o=e.append.bind(e);for(let e of(W(a)?a:r).getChildren())Lg(n,e,o,t,i);return e})}function Ig(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&Zh(338),Cl(e),Fg(Ud().createElement(`div`),t,e).innerHTML}function Lg(e,t,n,r=null,i=lf(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&V(t)&&(s=dm(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=Ud().createDocumentFragment(),p=d?d():W(s)?s.getChildren():[],m=a&&Cc(r)&&W(t)?null:r,h=f.append.bind(f);for(let n of p){let o=Lg(e,n,h,m,i);!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((K(c)||tf(c))&&(u?u(f):c.append(f)),n(c),l){let e=l.call(s,c);e&&(tf(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(f);return a}function Rg(e,t,n,r,i=new Map,a){let o=[];if(Ng.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!kd(s))&&(s!=null&&Uc(s)||r);for(let e=0;e<d.length;e++)f.push(...Rg(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),of(e)&&(f=zg(e,f,p?()=>{let e=new $l;return n.push(e),e}:lu)),s==null){if(f.length>0)for(let e of f)o.push(e);else of(e)&&function(e){return e.nextSibling==null||e.previousSibling==null?!1:rf(e.nextSibling)&&rf(e.previousSibling)}(e)&&o.push(nu())}else W(s)&&s.append(...f);return o}function zg(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(Uc(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&Uc(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}function Bg(e,t,n=null){let r=Hd(n),i=n?Bd(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=yd(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Rd(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function Vg(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var Hg={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function Ug(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var Wg=(e,t)=>{if(!H(t))return t.insertRawText(e),!0;let n=e=>{let t=U();H(t)&&e(t)};return rl(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([mc()])),text:e=>n(t=>t.insertText(e))}),!0},Gg={"application/x-lexical-editor":[(e,t,n)=>{try{let n=cf(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return r_(n,o_(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=cf();return r_(n,Pg(n,new DOMParser().parseFromString(Ug(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[Wg],"text/uri-list":[Wg]};function Kg(e,t,n,r){if(!e)return!1;let i=a=>!!e[a]&&e[a](t,n,i.bind(null,a-1),r);return i(e.length-1)}function qg(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&Kg(e.$importMimeType[i],a,n,t))return!0}return!1}var Jg={$importMimeType:Gg,$insertDataTransfer:(e,t)=>qg({$importMimeType:Gg,priority:Hg},e,t),priority:Hg},Yg=Zp({build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>qg(t,e,n),priority:t.priority}),config:em({$importMimeType:Gg,priority:Hg}),mergeConfig(e,t){let n=tm(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`});function Xg(e,t=U()){return t??Vg(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?``:Ig(e,t)}function Zg(e,t=U()){return t??Vg(166),H(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(a_(e,t))}function Qg(e,t,n){(function(){let e=Fh(Yg.name);return e?e.output:Jg})().$insertDataTransfer(e,t)}var $g=`application/x-lexical-drag`;function e_(e,t){let n={editorKey:t.getKey()};e.setData($g,JSON.stringify(n))}function t_(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData($g);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=Bg(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=Ku(n.node);if(r===null)return null;if(V(r))return gp(r,`next`,n.offset);if(W(r))return Kp(r,n.offset,`next`);let i=r.getParent();return i===null?null:Kp(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=Yp(a);if(o===null)return!1;let s=i.editorKey===t.getKey(),c=U();if(s){if(!H(c)||c.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=Gp(Lp(t),`next`);return Op(n,e)<0&&Op(e,r)<0}(a,c))return e.preventDefault(),!0;c.removeText()}if(!o.origin.isAttached())return e.preventDefault(),!0;if(n(r,Fp(Tp(o)),t),!s){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of Vd(t)){let t=ku(n);if(Du(t)&&t.getKey()===e&&K(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function n_(e,t){return t_(e,t,Qg)}function r_(e,t,n){e.dispatchCommand(so,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(H(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=Np(t,`previous`);if(r){if(lp(r))n=r.origin;else{let e=Ep(r,yp(Yu(),`next`).getFlipped());for(let t of e){if(V(t.origin)){n=t.origin;break}if(W(t.origin)&&!t.origin.isInline())break}}}if(n&&V(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function i_(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=W(n)&&n.excludeFromCopy(`html`),o=n;t!==null&&V(o)&&(o=dm(t,o,`clone`));let s=W(o)?o.getChildren():[],c=function(e){let t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&Vg(58,n.name),W(e)){let e=t.children;Array.isArray(e)||Vg(59,n.name)}return t}(o);V(o)&&o.getTextContentSize()===0&&(i=!1);let l=i&&Cc(t)&&W(n)?null:t;for(let r=0;r<s.length;r++){let a=s[r],o=i_(e,l,a,c.children);!i&&W(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=Vf(o);if(t.length>0){let n={};for(let r of t){let t=Hf(o,r);t===null&&Vg(366,o.constructor.name,r);let i=[];i_(e,null,t,i),i.length===1&&i[0].type===t.getType()||Vg(385,r,o.constructor.name,String(i.length),String(i.length>0?i[0].type:`none`)),n[r]=i[0]}c.$slots=n}}if(i&&!a)r.push(c);else if(Array.isArray(c.children))for(let e=0;e<c.children.length;e++){let t=c.children[e];r.push(t)}return i}function a_(e,t){let n=[],r=Yu(),i=H(t)?t.anchor.getNode():Cc(t)?t.getNodes()[0]??null:null,a=i===null?null:zf(i),o=(W(a)?a:r).getChildren();for(let r=0;r<o.length;r++)i_(e,t,o[r],n);return{namespace:e._config.namespace,nodes:n}}function o_(e){let t=[];for(let n of e)t.push(jl(n));return t}var s_=null;async function c_(e,t,n){if(s_!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(l_(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Id(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(qo,r=>(Dm(r,ClipboardEvent)&&(o(),s_!==null&&(i.clearTimeout(s_),s_=null),t(l_(e,r,n))),!0),4);s_=i.setTimeout(()=>{o(),s_=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function l_(e,t,n){if(n===void 0){let t=Id(e._window),r=U();if(!r||r.isCollapsed()||!t)return!1;let i=Kd(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!Eu(e,a,o))return!1;n=d_(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(f_(r,n),!0)}var u_=[[`text/html`,Xg],[`application/x-lexical-editor`,Zg]];function d_(e=U()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=h_(i,t);e!==null&&(n[r]=e)}return n}(p_(),e)}function f_(e,t){for(let[n]of u_)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function p_(e=cf()){let t=Ph(e,g_.name);return t?t.output:m_}var m_={"application/x-lexical-editor":[(e,t)=>e?Zg(cf(),e):t()],"text/html":[(e,t)=>e?Xg(cf(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function h_(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var g_=Zp({build:(e,t,n)=>t.$exportMimeType,config:em({$exportMimeType:m_}),mergeConfig(e,t){let n=tm(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`}),__={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},v_=Symbol.for(`@lexical/dragon/WindowState`);function y_(e,t,n){let r=function(e){let t=e[v_];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[v_]=t),t}(e);if(r.installs.size===0){let t=C_.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return b_.bind(null,e,r,t,n)}function b_(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[v_])}function x_(e){return e&&e.ownerDocument.defaultView}function S_(e){let t=ih(()=>x_(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=x_(e)}));return th(()=>{let n=t.value;if(n)return y_(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function C_(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[v_];if(t===void 0)return null;let n=ku(Zd(e.document));return Du(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=U();if(H(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(V(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),V(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=__[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}Mg.tag(`h1`,`h2`,`h3`,`h4`,`h5`,`h6`),Mg.tag(`blockquote`),Mg.tag(`blockquote`),Mg.tag(`p`),Mg.tag(`span`);var w_=B(`DRAG_DROP_PASTE_FILE`),T_=Gi(`shadowRoot`,{parse:Boolean}),E_=class e extends Hl{static getType(){return`quote`}static clone(t){return new e(t.__key)}$config(){return this.config(`quote`,{extends:Hl,stateConfigs:[{flat:!0,stateConfig:T_}]})}isShadowRoot(){return Ki(this,T_)}setIsShadowRoot(e){return qi(this,T_,e)}createDOM(e){let t=Ud().createElement(`blockquote`);return rm(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:M_,priority:0})}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return D_().updateFromJSON(e)}exportJSON(){return super.exportJSON()}insertNewAfter(e,t){let n=lu(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=lu();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function D_(e){let t=jd(new E_);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function O_(e){return e instanceof E_}var k_=class e extends Hl{__tag;static getType(){return`heading`}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=Ud().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];rm(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:j_,priority:0}),h2:e=>({conversion:j_,priority:0}),h3:e=>({conversion:j_,priority:0}),h4:e=>({conversion:j_,priority:0}),h5:e=>({conversion:j_,priority:0}),h6:e=>({conversion:j_,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&A_(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>A_(e)?{conversion:e=>({node:N_(`h1`)}),priority:3}:null}}exportDOM(e){let{element:t}=super.exportDOM(e);if(K(t)){this.isEmpty()&&t.append(Ud().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return N_(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?lu():N_(this.getTag()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=lu();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=lu();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function A_(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function j_(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=N_(t),vf(e,n),bf(n,e),yf(n,e)),{node:n}}function M_(e){let t=D_();return bf(t,e),vf(e,t),yf(t,e),{node:t}}function N_(e=`h1`){return jd(new k_(e))}function P_(e){return e instanceof k_}function F_(e){return Gl(Ku(e))}function I_(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(V(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&V(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var L_={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function R_(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=Np(e.focus,t),r=Af(n.origin,Od);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!Cd(i,r))return!1;let a=Ep(n,hp(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=Ep(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!up(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of wp(hp(r,t))){if(!e.origin.is(c.getParent())){if(Pd(e.origin)){let e=hp(c,t);return Fp(Ep(e,e)),!0}break}if(!Od(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=Np(e.anchor,t).getNodeAtCaret();return!(!Od(n)||n.isInline()||(Fp(Tp(Hp(yp(n,t)))),0))}(e,t)}function z_(e){return Gl(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function B_(e){let t=Kc();t.add(e),Xu(t)}function V_(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=Np(n,i);if(n.type===`element`&&W(r)&&(ql(r)||Od(r))){let e=a.getNodeAtCaret();return!(e===null||!z_(e))&&(B_(e.__key),!0)}let o=Af(W(r)?r:r.getParentOrThrow(),e=>W(e)&&!e.isInline()&&kd(e.getParent()));if(o===null)return!1;let s=hp(o,i).getNodeAtCaret();if(s===null||!z_(s))return!1;if(o.getTextContentSize()===0)return B_(s.__key),!0;let c=cf().getRootElement();if(c===null)return!1;let l=Id(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return H_(l,u,d,f,p),!1;let g=Ku(m);return H_(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!Cd(g,o))&&(B_(s.__key),!0)}function H_(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function U_(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=Af(W(n)?n:n.getParentOrThrow(),e=>W(e)&&!e.isInline());if(r===null)return!1;let i=cf(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if(W(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=hp(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!W(c)){if(t){let e=r.getFirstDescendant();V(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(V(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=Id(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=Bg(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(V(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function W_(e,t){let n=hp(e,t),r=n.getAdjacentCaret();r!==null&&W(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?Fp(Tp(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function G_(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>hp(e,`next`)).sort(Op),a=(t?i[0]:i[i.length-1]).origin,o=Af(a,e=>e!==a&&W(e)&&!e.isInline())??Yu(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function K_(e,t=Km(L_)){return am(e.registerCommand(co,()=>{let e=U();return Cc(e)?(e.clear(),!0):(H(e)&&I_(e,`click`,`both`,t.peek()),!1)},0),e.registerCommand(mo,e=>{let t=U();return H(t)?(t.deleteCharacter(e),!0):!!Cc(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(bo,e=>{let t=U();return!!H(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(xo,e=>{let t=U();return!!H(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(_o,t=>{let n=U();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)Qg(r,n,e);else if(H(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(yo,()=>{let e=U();return!!H(e)&&(e.removeText(),!0)},0),e.registerCommand(So,e=>{let t=U();return!(!H(t)&&!Cc(t))&&(Ec(t,e),!0)},0),e.registerCommand(Co,e=>{let t=U();return!(!H(t)&&!Cc(t))&&(Tc(t,e),!0)},0),e.registerCommand(Uo,e=>{let t=U();if(!H(t)&&!Cc(t))return!1;let n=t.getNodes();for(let t of n){let n=Af(t,e=>W(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(ho,e=>{let t=U();return!!H(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(go,()=>{let e=U();return!!H(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(zo,()=>{let e=mc(),t=U();return H(t)&&(e.setFormat(t.format),e.setStyle(t.style)),nl([e]),!0},0),e.registerCommand(Bo,()=>km(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(Vo,()=>km(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(jo,e=>{let t=U();if(Cc(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),W_(n[0],`previous`),!0}else if(H(t)&&(!e.shiftKey&&R_(t,`previous`)||!e.shiftKey&&V_(t,!0)||!e.shiftKey&&U_(t,!0)))return e.preventDefault(),!0;return!1},0),e.registerCommand(Mo,e=>{let t=U();if(Cc(t)){let n=t.getNodes();if(n.length>0)return e.preventDefault(),W_(n[0],`next`),!0}else if(H(t)&&(function(e){let t=e.focus;return t.key===`root`&&t.offset===Yu().getChildrenSize()}(t)||!e.shiftKey&&R_(t,`next`)||!e.shiftKey&&V_(t,!1)||!e.shiftKey&&U_(t,!1)))return e.preventDefault(),!0;return!1},0),e.registerCommand(ko,e=>{let n=U();if(Cc(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),W_(t[0],um(t[0])?`next`:`previous`),!0}if(!H(n))return!1;if(!e.shiftKey&&R_(n,um(n.anchor.getNode())?`next`:`previous`))return e.preventDefault(),!0;if(e.shiftKey||I_(n,`arrow`,`start`,t.peek()),vm(n,!0)){let t=e.shiftKey;return e.preventDefault(),xm(n,t,!0),!0}return!1},0),e.registerCommand(Do,e=>{let n=U();if(Cc(n)){let t=n.getNodes();if(t.length>0)return e.preventDefault(),W_(t[0],um(t[0])?`previous`:`next`),!0}if(!H(n))return!1;if(!e.shiftKey&&R_(n,um(n.anchor.getNode())?`previous`:`next`))return e.preventDefault(),!0;if(e.shiftKey||I_(n,`arrow`,`end`,t.peek()),vm(n,!1)){let t=e.shiftKey;return e.preventDefault(),xm(n,t,!1),!0}return!1},0),e.registerCommand(Fo,t=>{let n=U();if(!Cc(n)&&F_(t.target))return!1;if(H(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(ql(n))return!1;let r=wm(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Vo,void 0);if(qr&&Kr)return!1}else if(!Cc(n))return!1;return t.preventDefault(),e.dispatchCommand(mo,!0)},0),e.registerCommand(Lo,t=>{let n=U();return!(!Cc(n)&&F_(t.target))&&!(!H(n)&&!Cc(n))&&(t.preventDefault(),e.dispatchCommand(mo,!1))},0),e.registerCommand(No,n=>{let r=U();if(Cc(r)){let e=r.getNodes();e.length===1&&Gl(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!H(r))return!1;if(I_(r,`enter`,`both`,t.peek()),n!==null){if((qr||Yr||Qr)&&Kr)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(ho,!1)}return e.dispatchCommand(go,void 0)},0),e.registerCommand(Io,()=>!!H(U())&&(e.blur(),!0),0),e.registerCommand(Ho,t=>{let[,n]=Om(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=Bg(r,i,e.getRootElement());if(a!==null){let{offset:t,node:r}=a,i=Ku(r);if(i!==null){let e=Gc();if(V(i))e.anchor.set(i.getKey(),t,`text`),e.focus.set(i.getKey(),t,`text`);else{let t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,`element`),e.focus.set(t,n,`element`)}Xu(sa(e))}e.dispatchCommand(w_,n)}return t.preventDefault(),!0}return n_(t,e)},0),e.registerCommand(Wo,t=>{let[n]=Om(t),r=U();return!(n&&!H(r))&&(H(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(f_(t.dataTransfer,d_(r)),e_(t.dataTransfer,e)),!0)},0),e.registerCommand(Go,t=>{let[n]=Om(t),r=U();if(n&&!H(r))return!1;let i=t.clientX,a=t.clientY,o=Bg(i,a,e.getRootElement());return o!==null&&Gl(Ku(o.node))&&t.preventDefault(),!0},0),e.registerCommand(Yo,()=>{let e=U();return fd(H(e)&&zf(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(qo,t=>(c_(e,Dm(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(Jo,t=>(async function(e,t){await c_(t,Dm(e,ClipboardEvent)?e:null),t.update(()=>{let e=U();H(e)?e.removeText():Cc(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(vo,t=>{let[,n,r]=Om(t);return n.length>0&&!r?(e.dispatchCommand(w_,n),!0):ef(t.target)&&Tu(t.target)?!1:U()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=U(),r=Dm(e,InputEvent)||Dm(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&Qg(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(Po,()=>{let e=U();return H(e)&&I_(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(Ro,()=>{let e=U();return H(e)&&I_(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand(Oo,e=>{let t=U();if(Cc(t))return G_(t,!1,e);if(!H(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!W(r))return!1;let i=r.getFirstChild();if(!Gl(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(Ao,e=>{let t=U();if(Cc(t))return G_(t,!0,e);if(!H(t))return!1;let{anchor:n,focus:r}=t,i=Af(r.getNode(),e=>W(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!Gl(a)||!a.isInline()||Af(n.getNode(),e=>W(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function q_(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function J_(e){let t=1,n=e.getParent();for(;n!=null;){if(q(n)){let e=n.getParent();if(J(e)){t++,n=e.getParent();continue}q_(40)}return t}return t}function Y_(e){let t=e.getParent();J(t)||q_(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),J(r)&&(n=r);return n}function X_(e){let t=[],n=e.getChildren().filter(q);for(let e=0;e<n.length;e++){let r=n[e],i=r.getFirstChild();J(i)?t=t.concat(X_(i)):t.push(r)}return t}function Z_(e){return q(e)&&J(e.getFirstChild())}function Q_(e,t){return q(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function $_(e){let t=U();if(t!==null){let n=t.getNodes();if(H(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(kd(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=lu();i.append(e),n=e.select().getNodes()}}else if(Q_(i,n)){let t=_v(e);if(kd(a)){i.replace(t);let e=fv();W(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(q(i)){let e=i.getParentOrThrow();ev(t,e.getChildren()),e.replace(t)}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if(W(i)&&i.isEmpty()&&!q(i)&&!r.has(i.getKey())){tv(i,e);continue}let a=Iu(i)?i.getParent():q(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(J(a)){if(!r.has(t)){let n=_v(e);ev(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(kd(n)&&!r.has(t)){r.add(t),tv(a,e);break}a=n}}}}}function ev(e,t){e.splice(e.getChildrenSize(),0,t)}function tv(e,t){if(J(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=fv(),a;if(ev(i,e.getChildren()),J(n)&&t===n.getListType())n.append(i),J(r)&&t===r.getListType()&&(ev(n,r.getChildren()),r.remove()),a=n;else if(J(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=_v(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=U();return H(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function nv(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&Z_(n)&&Z_(r)&&(nv(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function rv(){let e=U();if(H(e)){let t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(Q_(r,n))t.add(Y_(r));else for(let e=0;e<n.length;e++){let r=n[e];if(Iu(r)){let e=Cm(r,cv);e!=null&&t.add(Y_(e))}}for(let n of t){let t=n,r=X_(n);for(let n of r){let r=lu().setTextStyle(e.style).setTextFormat(e.format);ev(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Pp(e.anchor,Hp(yp(r,`next`))),n.__key===e.focus.key&&Pp(e.focus,Hp(yp(r,`next`))),n.remove()}n.remove()}}}function iv(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())q(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),J(r.getFirstChild())||n++)}function av(e){let t=new Set;if(Z_(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Z_(r)&&Z_(i)){let n=i.getFirstChild();if(J(n)){n.append(e);let i=r.getFirstChild();J(i)&&(ev(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Z_(r)){let t=r.getFirstChild();if(J(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(Z_(i)){let t=i.getFirstChild();J(t)&&t.append(e)}else if(J(n)){let t=Ad(e),a=Ad(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ov(e){if(Z_(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(J(n?n.getParent():void 0)&&q(n)&&J(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=Ad(e),i=Ad(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=Ad(e),o=Ad(t);a.append(o),ev(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function sv(e=!1){let t=U();if(!H(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(q(n)&&n.getChildrenSize()===0)r=n;else if(V(n)){let e=n.getParent();q(e)&&e.getChildren().every(e=>V(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=Y_(r),a=r.getParent();J(a)||q_(40);let o=a.getParent(),s;if(kd(o))s=lu(),i.insertAfter(s);else{if(!q(o))return!1;s=Ad(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,r):1,n=Ad(a).setStart(t);if(q(s)){let e=Ad(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!q(e)&&!J(e))break;t=e}t.remove()}(r),!0}var cv=class extends Hl{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(J(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();J(n)||q_(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of hp(e,t)){if(!q(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),kd(t)||(Xp(n,Rp(hp(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:Hl,importDOM:Ps({li:()=>({conversion:lv,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){let t=Ud().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!J(n)||n.getListType()!==`check`||J(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=J(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>J(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...nm(a)),u.length>0&&im(e,...u);let d=[];if(i!==void 0&&d.push(...nm(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...nm(a)),d.length>0&&rm(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&Js(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=Ks(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in Ks(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),Z_(this)?{after(e){if(K(e)){let t=e.previousElementSibling;if(K(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if(W(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(q(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!J(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Ad(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&(W(e)||q_(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&W(e)){let t=U();if(H(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(J(n)||q_(39),q(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=Ad(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Z_(t)&&Z_(n)&&(nv(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Ad(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(Z_(this))return!1;let t=this.getParentOrThrow();if(q(t.getParentOrThrow()))return ov(this),!0;let n=lu().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=Ad(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return J(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;q(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&q_(117),(e=Math.floor(e))>=0||q_(199);let t=this.getIndent();for(;t!==e;)t<e?(av(this),t++):(ov(this),t--);return this}canInsertAfter(e){return q(e)}canReplaceWith(e){return q(e)}canMergeWith(e){return q(e)||uu(e)}extractWithChild(e,t){if(!H(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return _v(`bullet`)}canMergeWhenEmpty(){return!0}};function lv(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return uv(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return uv(t.children[0])}let t=e.getAttribute(`aria-checked`),n=fv(t===`true`||t!==`false`&&void 0);return bf(n,e),{after:dv.bind(null,n),node:yf(n,e)}}function uv(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=fv(e.hasAttribute(`checked`));return{after:dv.bind(null,t),node:t}}function dv(e,t){let n=t[0];return t.length===1&&uu(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function fv(e){return jd(new cv(void 0,e))}function q(e){return e instanceof cv}var pv=class extends Hl{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();J(t)&&e.getListType()===t.getListType()&&nv(e,t)})(e),iv(e)},extends:Hl,importDOM:Ps({ol:()=>({conversion:hv,priority:0}),ul:()=>({conversion:hv,priority:0})})})}constructor(e=`number`,t=1,n){super(n);let r=gv[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=Ud().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,mv(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(mv(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){let t=this.createDOM(e._config,e);return K(t)&&(this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`)),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];q(t)||(r===n&&(r=[...n]),r[e]=this.createListItemNode().append(!W(t)||J(t)||t.isInline()?t:dc(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return q(e)}createListItemNode(){return fv()}};function mv(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=J_(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...nm(s));for(let t=0;t<e.length;t++)t!==o&&i.push(n.__tag+t)}if(l!==void 0){let e=nm(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&im(e,...i),r.length>0&&rm(e,...r)}function hv(e){let t;if(function(e){return K(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=_v(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(K(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?_v(`check`):_v(`bullet`);return yf(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(q(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{J(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}var gv={ol:`number`,ul:`bullet`};function _v(e=`number`,t=1){return jd(new pv(e,t))}function J(e){return e instanceof pv}var vv=B(`INSERT_CHECK_LIST_COMMAND`);function yv(e,t){let n=t&&t.disableTakeFocusOnClick||!1,r=typeof n==`boolean`?()=>n:n.peek.bind(n),i=e=>{let t=e.target;if(!K(t))return!1;let n=t.__lexicalCheckListLastHandled;return n!==void 0&&e.timeStamp-n<500},a=e=>{let t=e.target;K(t)&&(t.__lexicalCheckListLastHandled=e.timeStamp)},o=e=>{i(e)||(a(e),xv(e,r()))},s=e=>{e.pointerType===`touch`&&(i(e)||(a(e),xv(e,r())))},c=e=>{(function(e,t){bv(e,()=>{e.preventDefault(),t&&e.stopPropagation()})})(e,r())};return am(e.registerCommand(vv,()=>($_(`check`),!0),1),e.registerCommand(Mo,t=>Cv(t,e,!1),1),e.registerCommand(jo,t=>Cv(t,e,!0),1),e.registerCommand(Io,()=>Sv(e)!=null&&(e.getRootElement()?.focus(),!0),1),e.registerCommand(Po,t=>{let n=Sv(e);return!(n==null||!e.isEditable())&&(e.update(()=>{let e=Ku(n);q(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},1),e.registerCommand(ko,t=>e.read(`latest`,()=>{let n=U();if(H(n)&&n.isCollapsed()){let{anchor:r}=n,i=r.type===`element`;if(i||r.offset===0){let n=r.getNode(),a=Af(n,e=>W(e)&&!e.isInline());if(q(a)){let r=a.getParent();if(J(r)&&r.getListType()===`check`&&(i||a.getFirstDescendant()===n)){let n=e.getElementByKey(a.__key);if(n!=null&&Xd(n)!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),1),e.registerRootListener(e=>{if(e!==null)return am(om(e,{click:o,pointerup:s}),om(e,{mousedown:c,pointerdown:c},{capture:!0}),is(e,`touchstart`,c,{capture:!0,passive:!1}))}))}function bv(e,t){let n=e.target;if(!K(n))return;let r=n.firstChild;if(K(r)&&(r.tagName===`UL`||r.tagName===`OL`))return;let i=n.parentNode;if(!i||i.__lexicalListType!==`check`)return;let a=null,o=null;if(`clientX`in e)a=e.clientX;else if(`touches`in e){let t=e.touches;t.length>0&&(a=t[0].clientX,o=`touch`)}if(a==null)return;let s=n.getBoundingClientRect(),c=a/jm(n),l=n.ownerDocument.defaultView,u=l?l.getComputedStyle(n,`::before`):{width:`0px`},d=parseFloat(u.width),f=o===`touch`||`pointerType`in e&&e.pointerType===`touch`?32:0;(n.dir===`rtl`?c<s.right+f&&c>s.right-d-f:c>s.left-f&&c<s.left+d+f)&&t()}function xv(e,t){bv(e,()=>{if(K(e.target)){let n=e.target,r=Ou(n);r!=null&&r.isEditable()&&r.update(()=>{let e=Ku(n);q(e)&&(t?(xd(`skip-selection-focus`),xd(`skip-dom-selection`)):n.focus(),e.toggleChecked())})}})}function Sv(e){let t=e.getRootElement(),n=t?Xd(t):null;return K(n)&&n.tagName===`LI`&&n.parentNode!=null&&n.parentNode.__lexicalListType===`check`?n:null}function Cv(e,t,n){let r=Sv(t);return r!=null&&t.update(()=>{let i=Ku(r);if(!q(i))return;let a=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;n==null&&q(r);)r=r.getParentOrThrow().getParent(),r!=null&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;q(n);){let e=t?n.getLastChild():n.getFirstChild();if(!J(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(a!=null){a.selectStart();let n=t.getElementByKey(a.__key);n!=null&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}Mg.tag(`ol`,`ul`),Mg.tag(`li`),Mg.tag(`li`).classAll(`task-list-item`),Mg.tag(`li`).classAll(`joplin-checkbox`);var wv=B(`UPDATE_LIST_START_COMMAND`),Tv=B(`INSERT_UNORDERED_LIST_COMMAND`),Ev=B(`INSERT_ORDERED_LIST_COMMAND`),Dv=B(`REMOVE_LIST_COMMAND`);function Ov(e,t){return am(e.registerCommand(Ev,()=>($_(`number`),!0),1),e.registerCommand(wv,e=>{let{listNodeKey:t,newStart:n}=e,r=Hu(t);return!!J(r)&&(r.getListType()===`number`&&(r.setStart(n),iv(r)),!0)},1),e.registerCommand(Tv,()=>($_(`bullet`),!0),1),e.registerCommand(Dv,()=>(rv(),!0),1),e.registerCommand(go,()=>sv(!!(t&&t.restoreNumbering)),1),e.registerCommand(Fo,e=>{if(function(){let e=U();if(!H(e)||!e.isCollapsed()||e.anchor.offset!==0)return!1;let t=e.anchor.getNode(),n=Af(t,q);if(!q(n))return!1;let r=n.getFirstDescendant();if(r===null||!n.is(t)&&!r.is(t))return!1;let i=n.getParent();if(!J(i)||!n.is(i.getFirstChild()))return!1;let a=i.getPreviousSibling();if(!Gl(a)||a.isIsolated()||!a.isKeyboardSelectable()&&a.isInline())return!1;let o=lu().append(...n.getChildren());return i.insertBefore(o),n.remove(),i.isEmpty()&&i.remove(),o.selectStart(),!0}())return e.preventDefault(),!0;let t=U();if(!H(t)||!t.isCollapsed())return!1;let{anchor:n}=t;if(n.offset!==0)return!1;let r=n.getNode();for(;!q(r);){if(r.getPreviousSibling()!==null)return!1;let e=r.getParent();if(e===null)return!1;r=e}return!(!q(r)||!r.collapseAtStart(t))&&(e.preventDefault(),!0)},-8),e.registerNodeTransform(cv,e=>{let t=e.getFirstChild();if(t){if(V(t)){let n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{let t=U();H(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(nc,e=>{let t=e.getParent();if(q(t)&&e.is(t.getFirstChild())){let n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function kv(e){let t=e=>{let t=e.getParent();if(J(e.getFirstChild())||!J(t))return;let n=Af(e,e=>q(e)&&J(e.getParent())&&q(e.getPreviousSibling()));if(n===null&&e.getIndent()>0)e.setIndent(0);else if(q(n)){let r=n.getPreviousSibling();if(q(r)){let n=function(e){let t=e,n=t.getFirstChild();for(;J(n);){let e=n.getLastChild();if(!q(e))break;t=e,n=t.getFirstChild()}return t}(r).getParent();if(J(n)){let r=J_(n);r+1<J_(t)&&e.setIndent(r)}}}};return e.registerNodeTransform(pv,e=>{let n=[e];for(;n.length>0;){let e=n.shift();if(J(e)){for(let r of e.getChildren())if(q(r)){t(r);let e=r.getFirstChild();J(e)&&n.push(e)}}}})}function Av(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function jv(e,t){return e.length>0?(Av(e,e.length,0,t),e):t}var Mv=Uv(/[A-Za-z]/),Nv=Uv(/[\dA-Za-z]/),Pv=Uv(/[#-'*+\--9=?A-Z^-~]/);function Fv(e){return e!==null&&(e<32||e===127)}var Iv=Uv(/\d/),Lv=Uv(/[\dA-Fa-f]/),Rv=Uv(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function zv(e){return e!==null&&(e<0||e===32)}function Bv(e){return e===-2||e===-1||e===32}var Vv=Uv(/\p{P}|\p{S}/u),Hv=Uv(/\s/);function Uv(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Wv(e){if(e===null||zv(e)||Hv(e))return 1;if(Vv(e))return 2}function Gv(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}function Kv(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Av(o,o.length,0,Gv(s,e.slice(r+1,n),t)),Av(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Av(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Wv(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Wv(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var qv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Qv.attention=$v,Qv.peek=ey;function Jv(){return{canContainEols:[`delete`],enter:{strikethrough:Xv},exit:{strikethrough:Zv}}}function Yv(){return{handlers:{delete:Qv},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:qv}]}}function Xv(e){this.enter({type:`delete`,children:[],position:void 0},e)}function Zv(e){this.exit(e)}function Qv(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function $v(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function ey(){return`~`}oy.peek=sy;var ty=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],ny={canContainEols:[`highlight`],enter:{highlight:ry},exit:{highlight:iy}};function ry(e){this.enter({type:`highlight`,children:[]},e)}function iy(e){this.exit(e)}var ay={unsafe:[{character:`=`,inConstruct:`phrasing`,notInConstruct:ty}],handlers:{highlight:oy}};function oy(e,t,n,r){let i=n.createTracker(r),a=n.enter(`highlight`),o=i.move(`==`);return o+=i.move(n.containerPhrasing(e,{before:o,after:`=`,...i.current()})),o+=i.move(`==`),a(),o}function sy(){return`=`}function cy(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var ly=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),uy={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function dy(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function fy(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function py(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function my(e){return py(e)||dy(e)}var hy=document.createElement(`i`);function gy(e){let t=`&`+e+`;`;hy.innerHTML=t;let n=hy.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var _y=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function vy(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?my:u===`decimal`?dy:fy;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&ly.includes(y)&&(_=y,v=gy(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&gy(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):my(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(yy(e))h(7,S),C=`�`;else if(e in uy)h(6,S),C=uy[e];else{let t=``;by(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,_y[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function yy(e){return e>=55296&&e<=57343||e>1114111}function by(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var xy=/["&'<>`]/g,Sy=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Cy=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,wy=/[|\\{}()[\]^$+*?.]/g,Ty=new WeakMap;function Ey(e,t){return e=e.replace(t.subset?Dy(t.subset):xy,r),t.subset||t.escapeOnly?e:e.replace(Sy,n).replace(Cy,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Dy(e){let t=Ty.get(e);return t||(t=Oy(e),Ty.set(e,t)),t}function Oy(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(wy,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function ky(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Ay(e,t){return Ey(e,Object.assign({format:ky},t))}function jy(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ny(e.position):`start`in e||`end`in e?Ny(e):`line`in e||`column`in e?My(e):``}function My(e){return Py(e&&e.line)+`:`+Py(e&&e.column)}function Ny(e){return My(e&&e.start)+`-`+My(e&&e.end)}function Py(e){return e&&typeof e==`number`?e:1}var Fy=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=jy(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Fy.prototype.file=``,Fy.prototype.name=``,Fy.prototype.reason=``,Fy.prototype.message=``,Fy.prototype.stack=``,Fy.prototype.column=void 0,Fy.prototype.line=void 0,Fy.prototype.ancestors=void 0,Fy.prototype.cause=void 0,Fy.prototype.fatal=void 0,Fy.prototype.place=void 0,Fy.prototype.ruleId=void 0,Fy.prototype.source=void 0;var Iy=` `;function Ly(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Fy("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Fy(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Fy("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=vy(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Fy("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+jy(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Fy("Expected a closing tag for `"+S(r)+"` ("+jy({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Fy("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+jy(t.end)+") or another opening tag after the start of `"+t.type+"` ("+jy(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Ry(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=Hy,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=Vy(By(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null){if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&cy(e,n)>cy(e,o)?o:n;s=t+Ay(e,{subset:[t]})+t}}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+Iy+m[e];b+=y.move(`
19
+ `+m.join(`
20
+ `)+`
21
+ `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
22
+ `),b+=y.move(zy(e,s,y.current())),b+=y.move(`
23
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function zy(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=Vy(By(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
24
+ `,after:`
25
+ `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
26
+
27
+ `))}return r.pop(),s.join(``)}function By(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function Vy(e){return Iy.repeat(e)}function Hy(){return`<`}var Uy=Object.prototype.hasOwnProperty;function Wy(e,t,n){for(n of e.keys())if(Gy(n,t))return n}function Gy(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Gy(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=Wy(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=Wy(t,i),!i)||!Gy(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(Uy.call(e,n)&&++r&&!Uy.call(t,n)||!(n in t)||!Gy(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var Ky,qy,Jy,Yy,Xy=!0;typeof process<`u`&&({FORCE_COLOR:Ky,NODE_DISABLE_COLORS:qy,NO_COLOR:Jy,TERM:Yy}={},Xy=process.stdout&&process.stdout.isTTY);var Zy={enabled:!qy&&Jy==null&&Yy!==`dumb`&&(Ky!=null&&Ky!==`0`||Xy),reset:eb(0,0),bold:eb(1,22),dim:eb(2,22),italic:eb(3,23),underline:eb(4,24),inverse:eb(7,27),hidden:eb(8,28),strikethrough:eb(9,29),black:eb(30,39),red:eb(31,39),green:eb(32,39),yellow:eb(33,39),blue:eb(34,39),magenta:eb(35,39),cyan:eb(36,39),white:eb(37,39),gray:eb(90,39),grey:eb(90,39),bgBlack:eb(40,49),bgRed:eb(41,49),bgGreen:eb(42,49),bgYellow:eb(43,49),bgBlue:eb(44,49),bgMagenta:eb(45,49),bgCyan:eb(46,49),bgWhite:eb(47,49)};function Qy(e,t){let n=0,r,i=``,a=``;for(;n<e.length;n++)r=e[n],i+=r.open,a+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return i+t+a}function $y(e,t){let n={has:e,keys:t};return n.reset=Zy.reset.bind(n),n.bold=Zy.bold.bind(n),n.dim=Zy.dim.bind(n),n.italic=Zy.italic.bind(n),n.underline=Zy.underline.bind(n),n.inverse=Zy.inverse.bind(n),n.hidden=Zy.hidden.bind(n),n.strikethrough=Zy.strikethrough.bind(n),n.black=Zy.black.bind(n),n.red=Zy.red.bind(n),n.green=Zy.green.bind(n),n.yellow=Zy.yellow.bind(n),n.blue=Zy.blue.bind(n),n.magenta=Zy.magenta.bind(n),n.cyan=Zy.cyan.bind(n),n.white=Zy.white.bind(n),n.gray=Zy.gray.bind(n),n.grey=Zy.grey.bind(n),n.bgBlack=Zy.bgBlack.bind(n),n.bgRed=Zy.bgRed.bind(n),n.bgGreen=Zy.bgGreen.bind(n),n.bgYellow=Zy.bgYellow.bind(n),n.bgBlue=Zy.bgBlue.bind(n),n.bgMagenta=Zy.bgMagenta.bind(n),n.bgCyan=Zy.bgCyan.bind(n),n.bgWhite=Zy.bgWhite.bind(n),n}function eb(e,t){let n={open:`\x1b[${e}m`,close:`\x1b[${t}m`,rgx:RegExp(`\\x1b\\[${t}m`,`g`)};return function(t){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),t===void 0?this:Zy.enabled?Qy(this.keys,t+``):t+``):t===void 0?$y([e],[n]):Zy.enabled?Qy([n],t+``):t+``}}function tb(){}tb.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(nb(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function nb(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}new tb;var rb=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ib=/\S/,ab=new tb;ab.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!ib.test(e)&&!ib.test(t)},ab.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&rb.test(t[n])&&rb.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var ob=new tb;ob.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
28
+ `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var sb=new tb;sb.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var cb=new tb;cb.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function lb(e){"@babel/helpers - typeof";return lb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},lb(e)}var ub=Object.prototype.toString,db=new tb;db.useLongestToken=!0,db.tokenize=ob.tokenize,db.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(fb(e,null,null,i),i,` `)},db.equals=function(e,t){return tb.prototype.equals.call(db,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function fb(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));for(var a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ub.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=fb(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),lb(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=fb(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var pb=new tb;pb.tokenize=function(e){return e.slice()},pb.join=pb.removeEmpty=function(e){return e},Zy.red,Zy.grey,Zy.green,Zy.dim().italic,Zy.dim(`→`),Zy.dim(`·`),Zy.dim(`↵`);function mb(e){e=e.replace(/\r?\n/g,`
29
+ `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,i=(t||[]).length;for(;n<i;n++)r=Math.min(r,t[n].length);return i&&r?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e}var hb=class extends Error{constructor(e={}){super(e.message),this.name=`Assertion`,this.code=`ERR_ASSERTION`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}};function gb(e,t,n,r,i,a,o){if(e)return;let s=o||a;throw o instanceof Error?o:new hb({actual:t,expects:n,operator:r,message:s,details:i&&i(t,n),generated:!o})}function _b(e,t){gb(!!e,!1,!0,`ok`,!1,`Expected value to be truthy`,t)}function vb(e,t){gb(!e,!0,!1,`not`,!1,`Expected value to be falsey`,t)}vb.ok=vb,vb.equal=function(e,t,n){gb(!Gy(e,t),e,t,`not.equal`,!1,`Expected values not to be deeply equal`,n)},vb.type=function(e,t,n){let r=typeof e;gb(r!==t,r,t,`not.type`,!1,`Expected "${r}" not to be "${t}"`,n)},vb.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";gb(!(e instanceof t),e,t,`not.instance`,!1,`Expected value not to be an instance of ${r}`,n)},vb.snapshot=function(e,t,n){e=mb(e),t=mb(t),gb(e!==t,e,t,`not.snapshot`,!1,`Expected value not to match snapshot`,n)},vb.fixture=function(e,t,n){e=mb(e),t=mb(t),gb(e!==t,e,t,`not.fixture`,!1,`Expected value not to match fixture`,n)},vb.match=function(e,t,n){typeof t==`string`?gb(!e.includes(t),e,t,`not.match`,!1,`Expected value not to include "${t}" substring`,n):gb(!t.test(e),e,t,`not.match`,!1,`Expected value not to match \`${String(t)}\` pattern`,n)},vb.throws=function(e,t,n){!n&&typeof t==`string`&&(n=t,t=null);try{e()}catch(e){typeof t==`function`?gb(!t(e),!0,!1,`not.throws`,!1,`Expected function not to throw matching exception`,n):t instanceof RegExp?gb(!t.test(e.message),!0,!1,`not.throws`,!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||gb(!1,!0,!1,`not.throws`,!1,`Expected function not to throw`,n)}};var yb={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},bb={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},xb={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Sb=`highlightSequenceTemporary`,Cb=`highlightSequence`,wb=`highlight`,Tb=`highlightText`;function Eb(){let e={name:`highlight`,tokenize:n,resolveAll:t};return{text:{[yb.equalsTo]:e},insideSpan:{null:[e]},attentionMarkers:{null:[yb.equalsTo]}};function t(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===Sb&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===Sb&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=Cb,e[r][1].type=Cb;let i={type:wb,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:Tb,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Av(o,o.length,0,Gv(s,e.slice(r+1,n),t)),Av(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Av(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===Sb&&(e[n][1].type=xb.data);return e}function n(e,t,n){let r=this.previous,i=this.events,a=0;return o;function o(t){return _b(t===yb.equalsTo,"expected `=`"),r===yb.equalsTo&&i[i.length-1][1].type!==xb.characterEscape?n(t):(e.enter(Sb),s(t))}function s(i){let o=Wv(r);if(i===yb.equalsTo)return a>1?n(i):(e.consume(i),a++,s);if(a<2)return n(i);let c=e.exit(Sb),l=Wv(i);return c._open=!l||l===bb.attentionSideAfter&&!!o,c._close=!o||o===bb.attentionSideAfter&&!!l,t(i)}}}var Db=/[$_\p{ID_Start}]/u,Ob=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,kb=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,Ab={};function jb(e){return e?Db.test(String.fromCodePoint(e)):!1}function Mb(e,t){let n=(t||Ab).jsx?kb:Ob;return e?n.test(String.fromCodePoint(e)):!1}function Nb(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Bv(r)?(e.enter(n),s(r)):t(r)}function s(r){return Bv(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Pb(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Bv(t)?(e.enter(r),c(t)):l(t)}function c(t){return Bv(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}function Fb(e){return e}var Ib={}.hasOwnProperty,Lb=Symbol(`continue`),Rb=Symbol(`exit`),zb=Symbol(`skip`);function Bb(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return Hb(e)&&(s.displayName=`node (`+Fb(e.type)+`)`),s;function s(){let s=n?Vb(n(e,t,a,o)):[];if(s[0]===Rb)return s;if(s[0]!==zb){let t;for(t in e)if(Ib.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(Hb(r)){let e=i(r,t,a,n)();if(e[0]===Rb)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(Hb(r)){let e=i(r,t,void 0,n)();if(e[0]===Rb)return e}}}return r?Vb(r(e,t,a,o)):s}}}function Vb(e){return Array.isArray(e)?e:typeof e==`number`?[Lb,e]:[e]}function Hb(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function Ub(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=Gb(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&Wb(m);if(g&&!t.allowEmpty)throw new Fy(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(Wb(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,Bb(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=Kb(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function Wb(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function Gb(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=qb(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function Kb(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function qb(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
30
+ `;break;case-3:a=`\r
31
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function Jb(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=Yb(n.start,r[0]||t.start),a=Yb(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function Yb(e,t){if(e&&typeof e==`object`){let n=`line`in e?Xb(e.line):void 0,r=`column`in e?Xb(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:Xb(t)}}}function Xb(e){return typeof e==`number`&&e>-1?e:void 0}var Zb=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,Qb=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,$b=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,ex=`#unexpected-type-in-code-expected-an-object-spread-spread`,tx=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,nx=`#could-not-parse-expression-with-acorn`;function rx(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Fy("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=Zb+Qb,e}if(Y(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?ix.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||Y(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Fy("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=Zb+$b,e}return Bv(t)?Nb(e,_,`linePrefix`,3)(t):_(t)}}function ix(e,t,n,r,i,a,o){let s=Ub(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=Jb(e),n=new Fy("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Zb+ex,n}if(e.expression.properties[1]){let t=new Fy(`Unexpected extra content in spread: only a single spread is supported`,{place:Jb(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=Zb+tx,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=Jb(e.expression.properties[0]),n=new Fy("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=Zb+ex,n}}if(s.error){let e=new Fy(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=Zb+nx,{type:`nok`,message:e}}return{type:`ok`,estree:c}}var ax=`https://github.com/micromark/micromark-extension-mdx-jsx`;function ox(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,ee,te){let A=this,j,ne;return M;function M(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),re}function re(e){return zv(e)?n(e):(j=ie,De(e))}function ie(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),j=ae,De;if(t===62)return Ee(t);if(t!==null&&t>=0&&jb(t))return e.enter(d),e.enter(f),e.consume(t),oe;Ae(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function ae(t){if(t===62)return Ee(t);if(t!==null&&t>=0&&jb(t))return e.enter(d),e.enter(f),e.consume(t),oe;Ae(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function oe(t){if(t!==null&&t>=0&&Mb(t,{jsx:!0}))return e.consume(t),oe;if(t===46||t===47||t===58||t===62||t===123||zv(t)||Hv(t))return e.exit(f),j=se,De(t);Ae(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function se(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),j=ce,De;if(t===58)return e.enter(h),e.consume(t),e.exit(h),j=de,De;if(t===47||t===62||t===123||t!==null&&t>=0&&jb(t))return e.exit(d),me(t);Ae(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ce(t){if(t!==null&&t>=0&&jb(t))return e.enter(m),e.consume(t),le;Ae(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t!==null&&t>=0&&Mb(t,{jsx:!0}))return e.consume(t),le;if(t===46||t===47||t===62||t===123||zv(t)||Hv(t))return e.exit(m),j=ue,De(t);Ae(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ue(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),j=ce,De;if(t===47||t===62||t===123||t!==null&&t>=0&&jb(t))return e.exit(d),me(t);Ae(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(t){if(t!==null&&t>=0&&jb(t))return e.enter(g),e.consume(t),fe;Ae(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function fe(t){if(t!==null&&t>=0&&Mb(t,{jsx:!0}))return e.consume(t),fe;if(t===47||t===62||t===123||zv(t)||Hv(t))return e.exit(g),j=pe,De(t);Ae(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t===47||t===62||t===123||t!==null&&t>=0&&jb(t))return e.exit(d),me(t);Ae(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function me(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),j=Te,De;if(t===62)return Ee(t);if(t===123)return rx.call(A,e,he,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&jb(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),ge;Ae(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(e){return j=me,De(e)}function ge(t){if(t!==null&&t>=0&&Mb(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===58||t===61||t===62||t===123||zv(t)||Hv(t))return e.exit(S),j=_e,De(t);Ae(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function _e(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),j=ve,De;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),j=xe,De;if(t===47||t===62||t===123||zv(t)||Hv(t)||t!==null&&t>=0&&jb(t))return e.exit(x),e.exit(b),j=me,De(t);Ae(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ve(t){if(t!==null&&t>=0&&jb(t))return e.enter(w),e.consume(t),ye;Ae(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ye(t){if(t!==null&&t>=0&&Mb(t,{jsx:!0}))return e.consume(t),ye;if(t===47||t===61||t===62||t===123||zv(t)||Hv(t))return e.exit(w),e.exit(x),j=be,De(t);Ae(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function be(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),j=xe,De;if(t===47||t===62||t===123||t!==null&&t>=0&&jb(t))return e.exit(b),me(t);Ae(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function xe(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),ne=t,Ce;if(t===123)return rx.call(A,e,Se,k,ee,te,r,i,a,!1,!1,o)(t);Ae(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Se(t){return e.exit(b),j=me,De(t)}function Ce(t){return t===null&&Ae(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ne)+"`"),t===ne?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),ne=void 0,j=me,De):Y(t)?(j=Ce,De(t)):(e.enter(O),we(t))}function we(t){return t===null||t===ne||Y(t)?(e.exit(O),Ce(t)):(e.consume(t),we)}function Te(e){if(e===62)return Ee(e);Ae(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ee(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function De(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ke):Bv(t)||Hv(t)?(e.enter(`esWhitespace`),Oe(t)):j(t)}function Oe(t){return Y(t)?(e.exit(`esWhitespace`),De(t)):Bv(t)||Hv(t)?(e.consume(t),Oe):(e.exit(`esWhitespace`),j(t))}function ke(e){if(!o&&A.parser.lazy[A.now().line]){let e=new Fy("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",A.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=ax+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return De(e)}function Ae(e,t,n){let r=new Fy(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+sx(e)+`)`)+` `+t+`, expected `+n,A.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=ax+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function sx(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function cx(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return ox.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function lx(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return ox.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Bv(e)?Nb(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||Y(e)?r(e):i(e)}}}function ux(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:lx(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:cx(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function dx(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var fx=(function(e){if(e==null)return _x;if(typeof e==`function`)return gx(e);if(typeof e==`object`)return Array.isArray(e)?px(e):mx(e);if(typeof e==`string`)return hx(e);throw Error(`Expected function, string, or object as test`)});function px(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fx(e[n]);return gx(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mx(e){let t=e;return gx(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function hx(e){return gx(t);function t(t){return t&&t.type===e}}function gx(e){return t;function t(t,n,r){return!!(vx(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function _x(){return!0}function vx(e){return typeof e==`object`&&!!e&&`type`in e}var yx=fx([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]),bx={}.hasOwnProperty;function xx(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&bx.call(t,e)){let n=String(t[e]);i=bx.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Sx={}.hasOwnProperty;function Cx(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Cx(e,t.extensions[n]);for(r in t)if(Sx.call(t,r))switch(r){case`extensions`:break;case`unsafe`:wx(e[r],t[r]);break;case`join`:wx(e[r],t[r]);break;case`handlers`:Tx(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function wx(e,t){t&&e.push(...t)}function Tx(e,t){t&&Object.assign(e,t)}function Ex(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Dx);return i(),o}function Dx(e,t,n){return`>`+(n?``:` `)+e}function Ox(e,t){return kx(e,t.inConstruct,!0)&&!kx(e,t.notInConstruct,!1)}function kx(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Ax(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
32
+ `&&!e.before&&!e.after&&Ox(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
33
+ `}function jx(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Mx(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function Nx(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Px(e,t,n,r){let i=Nx(n),a=e.value||``;if(Mx(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Fx);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(jx(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
34
+ `,encode:["`"],...o.current()})),t()}return u+=o.move(`
35
+ `),a&&(u+=o.move(a+`
36
+ `)),u+=o.move(s),c(),u}function Fx(e,t,n){return(n?``:` `)+e}function Ix(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Lx(e,t,n,r){let i=Ix(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
37
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Rx(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}zx.attention=Bx,zx.peek=Vx;function zx(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Bx(e,t){return{construct:`emphasis`,markers:Rx(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Vx(e,t,n){return n.options.emphasis||`*`}function Hx(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Ux(e){return e}var Wx=[];function Gx(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=fx(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Ux(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Wx,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Kx(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Kx(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Wx:[e]}function qx(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Gx(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Jx={};function Yx(e,t){let n=t||Jx;return Xx(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Xx(e,t,n){if(Qx(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Zx(e.children,t,n)}return Array.isArray(e)?Zx(e,t,n):``}function Zx(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Xx(e[i],t,n);return r.join(``)}function Qx(e){return!!(e&&typeof e==`object`)}function $x(e,t){let n=!1;return qx(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Yx(e)&&(t.options.setext||n))}function eS(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if($x(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
38
+ `,after:`
39
+ `});return r(),t(),o+`
40
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
41
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
42
+ `,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Hx(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}tS.peek=nS;function tS(e){return e.value||``}function nS(){return`<`}rS.peek=iS;function rS(e,t,n,r){let i=Ix(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function iS(){return`!`}aS.peek=oS;function aS(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function oS(){return`!`}sS.peek=cS;function sS(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function cS(){return"`"}function lS(e,t){let n=Yx(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}uS.peek=dS;function uS(e,t,n,r){let i=Ix(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(lS(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function dS(e,t,n){return lS(e,n)?`<`:`[`}fS.peek=pS;function fS(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function pS(){return`[`}function mS(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function hS(e){let t=mS(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function gS(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function _S(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function vS(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?gS(n):mS(n),s=e.ordered?o===`.`?`)`:`.`:hS(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),_S(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function yS(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function bS(e,t,n,r){let i=yS(n),a=n.bulletCurrent||mS(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function xS(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function SS(e,t,n,r){if(!e.children.some(function(e){return yx(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function CS(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}wS.attention=TS,wS.peek=ES;function wS(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function TS(e,t){return{construct:`strong`,markers:CS(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function ES(e,t,n){return n.options.strong||`*`}function DS(e,t,n,r){return n.safe(e.value,r)}function OS(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function kS(e,t,n){let r=(_S(n)+(n.options.ruleSpaces?` `:``)).repeat(OS(n));return n.options.ruleSpaces?r.slice(0,-1):r}var AS={blockquote:Ex,break:Ax,code:Px,definition:Lx,emphasis:zx,hardBreak:Ax,heading:eS,html:tS,image:rS,imageReference:aS,inlineCode:sS,link:uS,linkReference:fS,list:vS,listItem:bS,paragraph:xS,root:SS,strong:wS,text:DS,thematicBreak:kS},jS=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),MS=[`pre`,`script`,`style`,`textarea`];function NS(e){if(e.charCodeAt(0)!==60)return;let t=e.charCodeAt(1);if(t===33){let t=e.charCodeAt(2);return t===45?2:t===91?5:Mv(t)?4:void 0}if(t===63)return 3;let n=t===47,r=n?2:1,i=r,a=e.charCodeAt(i);if(!Mv(a))return;for(;a===45||Nv(a);)a=e.charCodeAt(++i);let o=e.slice(r,i).toLowerCase();return!n&&a!==47&&MS.includes(o)?1:jS.includes(o)?6:7}var PS=[FS];function FS(e,t,n,r){if(t.type===`code`&&Mx(t,r)&&(e.type===`list`||e.type===t.type&&Mx(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`){if(e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&$x(t,r)))return;if(e.type===`html`){let t=NS(e.value);if(t===void 0||t===6||t===7)return 1}if(e.type===`paragraph`&&t.type===`html`){let e=NS(t.value);if(e===void 0||e===7)return 1}return+!!n.spread}}for(var IS=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],LS=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
43
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`\r`,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:`\r`,after:`\\r`,inConstruct:`phrasing`},{character:`
44
+ `,before:`\\n`,inConstruct:`phrasing`},{character:`
45
+ `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:IS},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
46
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:IS},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
47
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:IS},{atBreak:!0,character:`+`,after:`(?:[ \r
48
+ ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
49
+ -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
50
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:IS},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:IS},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:IS},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:IS},{atBreak:!0,character:`~`},{character:`<`,inConstruct:`autolink`},{character:`>`,inConstruct:`autolink`},{character:``,inConstruct:`autolink`}],RS=-1;++RS<33;)LS.push({character:String.fromCharCode(RS),inConstruct:`autolink`});function zS(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}var BS=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VS(e){return e.replace(BS,HS)}function HS(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return zS(n.slice(t?2:1),t?16:10)}return gy(n)||e}function US(e){return e.label||!e.identifier?e.label||``:VS(e.identifier)}function WS(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[$()*+\-.?[\\\]^{|}]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function GS(e){let t=e.codePointAt(0);return t===void 0?``:String.fromCodePoint(t)}function KS(e){let t=e.codePointAt(e.length-2);return t!==void 0&&t>65535?e.slice(-2):e.slice(-1)}function qS(e,t,n){let r=Wv(e),i=Wv(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var JS=new Map([[`*`,!1],[`_`,!0]]);function YS(e,t,n){let r=new Set;for(let i of e){let e=n.get(i);if(e&&i.attention&&t.some(e=>e.attention===i.attention))for(let t of e.tokens)r.add(t.attention)}let i=[];for(let t of e)t.attention&&r.delete(t.attention)&&i.push(t.attention);return i.reverse(),i}function XS(e,t,n){let r=[],i=new Map,a=new Map,o=0;for(;o<e.length;){if(!e[o].attention){o++;continue}let s=e[o].value.charAt(0),c=JS.get(s),l=o+1;for(;l<e.length&&e[l].attention&&e[l].value.charAt(0)===s;)l++;let u=o?e[o-1].value:t,d=Wv(u.charCodeAt(u.length-1)),f=Wv((l<e.length?e[l].value:n).charCodeAt(0)),p=!f||f===2&&!!d,m=!d||d===2&&!!f,h={tokens:e.slice(o,l),markers:[],start:0,end:0,open:c?p&&(!!d||!m):p,close:c?m&&(!!f||!p):m,split:c!==void 0};for(let e of h.tokens){i.set(e,[...h.tokens]),a.set(e,h);let t=e.value.length;for(;t--;)h.markers.push(e)}h.end=h.markers.length,r.push(h),o=l}for(eC(r,i),o=-1;++o<e.length;){let t=i.get(e[o]);if(t)return{attention:YS(e,t,a),index:o}}}function ZS(e,t,n){return iC(nC(e,t,n),n.before,n.after)}function QS(e,t){let n=e[t?0:e.length-1];if(!n||n.attention)return;let r=t?GS(n.value):KS(n.value),i=Hx(r.codePointAt(0));n.value=t?i+n.value.slice(r.length):n.value.slice(0,n.value.length-r.length)+i}function $S(e,t,n,r,i){for(let a of n.attention){let o=t.get(a)||a.sequences[0];for(let s of a.sequences){if(s===o)continue;let c=new Map(t);c.set(a,s);let l=rC(e,c,r,i),u=XS(l,r,i);if(!u||u.index>n.index)return{chosen:c,mistake:u,tokens:l}}}}function eC(e,t){let n=0;for(;n<e.length;){let r=e[n],i=r.tokens[0].value.charAt(0),a=r.end-r.start,o=r.close&&a?n:0;for(;o--;){let n=e[o],s=n.end-n.start;if(n.tokens[0].value.charAt(0)===i&&n.open&&s&&(r.split?!((n.close||r.open)&&a%3)||(s+a)%3:s===n.markers.length&&s===a)){let e=r.split?s>1&&a>1?2:1:a,i=n.markers.slice(n.end-e,n.end),o=r.markers.slice(r.start,r.start+e),c=i[0],l=o[0];if(c===i[e-1]&&c.value.length===e&&l===o[e-1]&&l.value.length===e&&c.attention===l.attention)t.delete(c),t.delete(l);else{let e=[...new Set([...i,...o])];for(let n of e){let r=t.get(n);r&&r.push(...e)}}n.end-=e,r.start+=e;break}}(o===-1||r.start===r.end)&&n++}}function tC(e,t,n){if(t.length===0)throw Error("Cannot serialize `"+e+"` as attention without markers, expected one or more markers");if(n.length===0)throw Error("Cannot serialize `"+e+"` as attention without sizes, expected one or more sizes");for(let t of n)if(!Number.isSafeInteger(t)||t<1)throw Error("Cannot serialize `"+e+"` as attention with `"+t+"` as size, expected positive integer");let r=[];for(let i of t){if(i.length!==1)throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected a single ascii character");if(!Rv(i.charCodeAt(0)))throw Error("Cannot serialize `"+e+"` as attention with `"+i+"` as marker, expected ascii punctuation");for(let e of n)r.push(i.repeat(e))}return r}function nC(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before;r.push(-1);let c=t.createTracker(n);for(;++o<i.length;){let l=i[o],u;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),u=n?GS(n(i[o+1],e,t,{before:``,after:``,...c.current()})):``}else u=n.after;let d=a[a.length-1];typeof d==`string`&&(s===`\r`||s===`
51
+ `)&&l.type===`html`&&NS(l.value)!==7&&(a[a.length-1]=d.replace(/(\r?\n|\r)$/,` `),s=` `,c=t.createTracker(n),c.move(iC(a,n.before,n.after)));let f=t.handle.handlers[l.type];if(f&&f.attention){let{construct:e,markers:n,sizes:r}=f.attention(l,t),i=tC(l.type,n,r),o=i[0],u=t.enter(e);c.move(o);let d=nC(l,t,{...c.current(),before:o,after:o});c.move(iC(d,o,o)),c.move(o),u(),a.push({children:d,sequences:i}),s=o.charAt(o.length-1)}else{let n=t.handle(l,e,t,{...c.current(),after:u,before:s});if(!n)continue;c.move(n),a.push(n),s=KS(n)}}return r.pop(),a}function rC(e,t,n,r){let i=[],a,o=KS(n),s=-1;for(;++s<e.length;){let n=e[s];if(typeof n==`string`){let e={value:n,attention:void 0};a&&a===GS(n)&&QS([e],!0),a=void 0,i.push(e),e.value&&(o=KS(e.value));continue}let c=t.get(n)||n.sequences[0],l=c.charAt(0),u=e[s+1],d=o,f=GS(u===void 0?r:typeof u==`string`?u:t.get(u)||u.sequences[0]),p=rC(n.children,t,c,c),m=p.length>0?p[0].value:``,h=qS(d.charCodeAt(d.length-1),m.charCodeAt(0),l);h.inside&&QS(p,!0);let g=p.length>0?KS(p[p.length-1].value):``,_=qS(f.charCodeAt(0),g.charCodeAt(g.length-1),l);_.inside&&QS(p,!1),h.outside&&d!==`
52
+ `&&d!==`\r`&&QS(i,!1),_.outside&&(a=f),i.push({value:c,attention:n},...p,{value:c,attention:n}),o=c.charAt(c.length-1)}return i}function iC(e,t,n){let r=new Map,i=rC(e,r,t,n),a=i,o=XS(a,t,n);for(;o;){let s=$S(e,r,o,t,n);if(!s){a=i;break}r=s.chosen,a=s.tokens,o=s.mistake}let s=``;for(let e of a)s+=e.value;return s}function aC(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
53
+ `,after:`
54
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(oC(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function oC(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
55
+ `.repeat(1+a);if(a===!1)return`
56
+
57
+ <!---->
58
+
59
+ `}return`
60
+
61
+ `}var sC=/\r?\n|\r/g;function cC(e,t){let n=[],r=0,i=0,a;for(;a=sC.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}var lC={}.hasOwnProperty;function uC(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=e.stack.includes(`autolink`),c=-1;for(;++c<e.unsafe.length;){let t=e.unsafe[c];if(!Ox(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);lC.call(o,r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(dC);let l=n.before?n.before.length:0,u=r.length-(n.after?n.after.length:0),d=l;for(c=-1;++c<i.length;){let e=i[c];if(!(e<d||e>=u)){if(r.charAt(e)===`_`&&e>0&&Wv(r.charCodeAt(e-1))===void 0&&!lC.call(o,e-1)&&!(e-1===l&&/[*_]/.test(r.charAt(l-1)))){let t=e+1;for(;t<u&&r.charAt(t)===`_`;)t++;let n=t-e-1;if(i[c+n]===t-1&&t<r.length&&Wv(r.charCodeAt(t))===void 0&&!lC.call(o,t)&&!(t===u-1&&/[*_]/.test(r.charAt(u)))){c+=n;continue}}if(!(e+1<u&&i[c+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[c-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after)){if(d!==e){let t=r.slice(d,e);a.push(s?t:fC(t,`\\`))}d=e,s?(a.push(`%`+r.charCodeAt(e).toString(16).toUpperCase().padStart(2,`0`)),d++):/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Hx(r.charCodeAt(e))),d++)}}}let f=r.slice(d,u);return a.push(s?f:fC(f,n.after)),a.join(``)}function dC(e,t){return e-t}function fC(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function pC(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function mC(e,t){let n=t||{},r={associationId:US,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:vC,containerFlow:yC,createTracker:pC,compilePattern:WS,enter:a,handlers:{...AS},handle:void 0,indentLines:cC,indexStack:[],join:[...PS],options:{},safe:bC,stack:[],unsafe:[...LS]};Cx(r,n),r.options.tightDefinitions&&r.join.push(_C),r.handle=xx(`type`,{invalid:hC,unknown:gC,handlers:r.handlers});let i=r.handle(yx(e)?{type:`root`,children:[e]}:e,void 0,r,{before:`
62
+ `,after:`
63
+ `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
64
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function hC(e){throw Error("Cannot handle value `"+e+"`, expected node")}function gC(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function _C(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function vC(e,t){return ZS(e,this,t)}function yC(e,t){return aC(e,this,t)}function bC(e,t){return uC(this,e,t)}var xC=[`mdxJsxTextElement`,`mdxJsxFlowElement`];function SC(e){return xC.includes(e.type)&&CC.includes(e.name)}var CC=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.input.ins.kbd.label.legend.li.link.main.map.mark.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`);function wC(e,t){let n=TC(e),r=TC(t);return EC({...n,...r})}function TC(e){let t={};return e.split(`;`).filter(e=>e.trim()!==``).forEach(e=>{let[n,r]=e.split(`:`).map(e=>e.trim());t[n]=r}),t}function EC(e){return Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`; `)}function DC(e){return e.children instanceof Array}function OC({root:e,visitors:t,jsxComponentDescriptors:n,jsxIsAvailable:r,addImportStatements:i=!0}){let a=null,o=new Set,s=new Map;t=[...t].sort((e,t)=>(t.priority??0)-(e.priority??0)),d(e,null);function c(e,t){o.add(e),t&&s.set(e,{...t})}function l(e,n){if(a===null)return a=n,a;if(!DC(e))throw Error(`Attempting to append children to a non-parent`);let r=e.children,i=r.at(-1);if(i){let e=t.find(e=>e.shouldJoin?.call(e,i,n));if(e){let t=e.join(i,n);return r.splice(r.length-1,1,t),t}}return r.push(n),n}function u(e,t){e.getChildren().forEach(e=>{d(e,t)})}function d(e,n,r=null){var i;let a=t.find((t,n)=>!r?.has(n)&&t.testLexicalNode?.call(t,e));if(!a)throw Error(`no lexical visitor found for ${e.getType()}`,{cause:e});(i=a.visitLexicalNode)==null||i.call(a,{lexicalNode:e,mdastParent:n,actions:{addAndStepInto(t,r={},i=!0){let a={type:t,...r,...i?{children:[]}:{}};l(n,a),W(e)&&i&&u(e,a)},appendToParent:l,visitChildren:u,visit:d,registerReferredComponent:c,nextVisitor(){d(e,n,(r??new Set).add(t.indexOf(a)))}}})}if(a===null)throw Error(`traversal ended with no root element`);let f=new Map,p=new Map;for(let e of o){let t=n.find(t=>t.name===e)??s.get(e)??n.find(e=>e.name===`*`);if(!t)throw Error(`Component ${e} is used but not imported`);if(t.source){if(t.defaultExport)p.set(e,t.source);else{let{source:n}=t,r=f.get(n);r?r.push(e):f.set(n,[e])}}}if(!i){for(let[e,t]of f.entries()){let n=t.filter(e=>s.has(e));n.length>0?f.set(e,n):f.delete(e)}for(let e of p.keys())s.has(e)||p.delete(e)}let m=Array.from(f).map(([e,t])=>({type:`mdxjsEsm`,value:`import { ${t.join(`, `)} } from '${e}'`}));m.push(...Array.from(p).map(([e,t])=>({type:`mdxjsEsm`,value:`import ${e} from '${t}'`})));let h=a,g=h.children.find(e=>e.type===`yaml`);return g?h.children.splice(h.children.indexOf(g)+1,0,...m):h.children.unshift(...m),MC(h),IC(h,[]),kC(h),r||AC(h),h}function kC(e){if(`children`in e&&e.children.length>0){if(SC(e)&&e.children.length===1){let t=e.children[0];t.type===`mdxJsxTextElement`&&t.name===`span`&&(t.attributes.forEach(t=>{if(t.type===`mdxJsxAttribute`){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t.name);if(n){if(t.name===`className`){let e=new Set([...n.value.split(` `),...t.value.split(` `)]);n.value=Array.from(e).join(` `)}else t.name===`style`&&(n.value=wC(n.value,t.value))}else e.attributes.push(t)}}),e.children=t.children)}e.children.forEach(e=>{kC(e)})}}function AC(e){if(Object.hasOwn(e,`children`)){let t=e,n=[];t.children.forEach(e=>{e.type===`mdxJsxTextElement`&&e.name===`u`?n.push({type:`html`,value:`<u>`},...e.children,{type:`html`,value:`</u>`}):(n.push(e),AC(e))}),t.children=n}}var jC=/\n(?:[^\S\n]*\n)+/;function MC(e){if(!(`children`in e))return;let t=[];for(let n of e.children)n.type===`paragraph`&&n.children.some(e=>e.type===`text`&&jC.test(e.value))?t.push(...NC(n)):(MC(n),t.push(n));e.children=t}function NC(e){let t=[{type:`paragraph`,children:[]}];for(let n of e.children){if(n.type!==`text`){t.at(-1).children.push(n);continue}n.value.split(jC).forEach((e,n)=>{n>0&&t.push({type:`paragraph`,children:[]}),e&&t.at(-1).children.push({type:`text`,value:e})})}let n=t.filter(e=>e.children.length>0);return n.length>0?n:[{type:`paragraph`,children:[]}]}var PC=/\s+$/,FC=/^\s+/;function IC(e,t){if(e.type===`strong`||e.type===`emphasis`){let n=e.children.at(-1);if(n?.type===`text`){let r=PC.exec(n.value);if(r){n.value=n.value.replace(PC,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e)+1,0,{type:`text`,value:r[0]}),IC(i,t.slice(0,-1)))}}let r=e.children.at(0);if(r?.type===`text`){let n=FC.exec(r.value);if(n){r.value=r.value.replace(FC,``);let i=t.at(-1);i&&(i.children.splice(i.children.indexOf(e),0,{type:`text`,value:n[0]}),IC(i,t.slice(0,-1)))}}}if(`children`in e&&e.children.length>0){let n=e;n.children.forEach(e=>{IC(e,[...t,n])})}}function LC({root:e,toMarkdownOptions:t,toMarkdownExtensions:n,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}){return mC(OC({root:e,visitors:r,jsxComponentDescriptors:i,jsxIsAvailable:a}),{extensions:n,...t})+`
65
+ `}var RC={}.hasOwnProperty;function zC(e){let t={},n=-1;for(;++n<e.length;)BC(t,e[n]);return t}function BC(e,t){let n;for(n in t){let r=(RC.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){RC.call(r,a)||(r[a]=[]);let e=i[a];VC(r[a],Array.isArray(e)?e:e?[e]:[])}}}function VC(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Av(e,0,0,r)}function HC(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var UC={tokenize:WC};function WC(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Nb(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var GC=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){KC(this,e,t,n,!1)}addBefore(e,t,n){KC(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function KC(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var qC={tokenize:YC},JC={tokenize:XC};function YC(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new GC;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(JC,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(JC,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new GC;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function XC(e,t,n){return Nb(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var ZC={name:`attention`,resolveAll:QC,tokenize:$C};function QC(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};ew(o,-a),ew(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=jv(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=jv(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=jv(r,Gv(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=jv(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=jv(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Av(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function $C(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wv(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Wv(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function ew(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var tw={name:`autolink`,tokenize:nw};function nw(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Mv(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Nv(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Nv(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Fv(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Pv(t)?(e.consume(t),l):n(t)}function u(e){return Nv(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Nv(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var rw={partial:!0,tokenize:iw};function iw(e,t,n){return r;function r(t){return Bv(t)?Nb(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var aw={continuation:{tokenize:sw},exit:cw,name:`blockQuote`,tokenize:ow};function ow(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Bv(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function sw(e,t,n){let r=this;return i;function i(t){return Bv(t)?Nb(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(aw,t,n)(r)}}function cw(e){e.exit(`blockQuote`)}var lw={name:`characterEscape`,tokenize:uw};function uw(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Rv(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var dw={name:`characterReference`,tokenize:fw};function fw(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Nv,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Lv,u):(e.enter(`characterReferenceValue`),a=7,o=Iv,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Nv&&!gy(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var pw={partial:!0,tokenize:mw};function mw(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var hw={concrete:!0,name:`codeFenced`,tokenize:gw};function gw(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Bv(t)?Nb(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(pw,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Bv(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Nb(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Bv(t)?Nb(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(pw,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Bv(t)?Nb(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Bv(t)?Nb(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var _w={name:`codeIndented`,tokenize:yw},vw={partial:!0,tokenize:bw};function yw(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Pb(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Y(t)?e.attempt(vw,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function bw(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Y(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Pb(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Y(e)?i(e):n(e)}}var xw={name:`codeText`,previous:Cw,resolve:Sw,tokenize:ww};function Sw(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Cw(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ww(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Tw=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Ew(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Ew(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ew(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Ew(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Ew(this.left,t.reverse())}}}};function Ew(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Dw(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Tw(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Ow(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Av(e,0,1/0,u.slice(0)),!l}function Ow(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var kw={resolve:jw,tokenize:Mw},Aw={partial:!0,tokenize:Nw};function jw(e){return Dw(e),e}function Mw(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(Aw,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Nw(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Nb(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Pw(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Fv(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||zv(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Fv(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Fw(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Bv(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Iw(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Nb(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Lw(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Bv(i)?Nb(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Rw={name:`definition`,tokenize:Bw},zw={partial:!0,tokenize:Vw};function Bw(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Fw.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=HC(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return zv(t)?Lw(e,l)(t):l(t)}function l(t){return Pw(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(zw,d,d)(t)}function d(t){return Bv(t)?Nb(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Vw(e,t,n){return r;function r(t){return zv(t)?Lw(e,i)(t):n(t)}function i(t){return Iw(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Bv(t)?Nb(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Hw={name:`hardBreakEscape`,tokenize:Uw};function Uw(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ww={name:`headingAtx`,resolve:Gw,tokenize:Kw};function Gw(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Av(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Kw(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||zv(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Bv(n)?Nb(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||zv(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var qw={concrete:!0,name:`htmlFlow`,resolveTo:Yw,tokenize:Xw},Jw={partial:!0,tokenize:Zw};function Yw(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Xw(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):Mv(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Mv(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Mv(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||zv(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&MS.includes(l)?(i=1,r.interrupt?t(s):O(s)):jS.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Nv(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Bv(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Mv(t)?(e.consume(t),b):Bv(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Nv(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Bv(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Bv(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||zv(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Bv(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Bv(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),M):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Jw,ae,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(pw,ee,ae)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),re):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return MS.includes(n)?(e.consume(t),ie):O(t)}return Mv(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function M(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),re):O(t)}function ie(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function Zw(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(rw,t,n)}}var Qw={name:`htmlText`,tokenize:$w};function $w(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Mv(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Mv(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):Y(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return Mv(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Nv(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,j(t)):Bv(t)?(e.consume(t),C):A(t)}function w(t){return t===45||Nv(t)?(e.consume(t),w):t===47||t===62||zv(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||Mv(t)?(e.consume(t),E):Y(t)?(o=T,j(t)):Bv(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||Nv(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,j(t)):Bv(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,j(t)):Bv(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):Y(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||zv(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||zv(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return Bv(t)?Nb(e,M,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):M(t)}function M(t){return e.enter(`htmlTextData`),o(t)}}var eT={name:`labelEnd`,resolveAll:iT,resolveTo:aT,tokenize:oT},tT={tokenize:sT},nT={tokenize:cT},rT={tokenize:lT};function iT(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Av(e,0,e.length,n),e}function aT(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=jv(o,e.slice(i+1,i+r+3)),o=jv(o,[[`enter`,l,t]]),o=jv(o,Gv(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=jv(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=jv(o,e.slice(a+1)),o=jv(o,[[`exit`,s,t]]),Av(e,i,e.length,o),e}function oT(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(HC(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(tT,u,o?u:d)(t):t===91?e.attempt(nT,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(rT,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function sT(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return zv(t)?Lw(e,a)(t):a(t)}function a(t){return t===41?u(t):Pw(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return zv(t)?Lw(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Iw(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return zv(t)?Lw(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function cT(e,t,n){let r=this;return i;function i(t){return Fw.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(HC(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function lT(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var uT={name:`labelStartImage`,resolveAll:eT.resolveAll,tokenize:dT};function dT(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var fT={name:`labelStartLink`,resolveAll:eT.resolveAll,tokenize:pT};function pT(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var mT={name:`lineEnding`,tokenize:hT};function hT(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Nb(e,t,`linePrefix`)}}var gT={name:`thematicBreak`,tokenize:_T};function _T(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Bv(t)?Nb(e,s,`whitespace`)(t):s(t))}}var vT={continuation:{tokenize:ST},exit:wT,name:`list`,tokenize:xT},yT={partial:!0,tokenize:TT},bT={partial:!0,tokenize:CT};function xT(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Iv(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(gT,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Iv(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(rw,r.interrupt?n:u,e.attempt(yT,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Bv(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ST(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(rw,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Nb(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Bv(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bT,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Nb(e,e.attempt(vT,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function CT(e,t,n){let r=this;return Nb(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function wT(e){e.exit(this.containerState.type)}function TT(e,t,n){let r=this;return Nb(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Bv(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ET={name:`setextUnderline`,resolveTo:DT,tokenize:OT};function DT(e,t){let n=new GC,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function OT(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Bv(t)?Nb(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var kT={tokenize:AT};function AT(e){let t=this,n=e.attempt(rw,r,e.attempt(this.parser.constructs.flowInitial,i,Nb(e,e.attempt(this.parser.constructs.flow,i,e.attempt(kw,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var jT={resolveAll:FT()},MT=PT(`string`),NT=PT(`text`);function PT(e){return{resolveAll:FT(e===`text`?IT:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function FT(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function IT(e,t){let n=new GC,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var LT=r({attentionMarkers:()=>GT,contentInitial:()=>zT,disable:()=>KT,document:()=>RT,flow:()=>VT,flowInitial:()=>BT,insideSpan:()=>WT,string:()=>HT,text:()=>UT}),RT={42:vT,43:vT,45:vT,48:vT,49:vT,50:vT,51:vT,52:vT,53:vT,54:vT,55:vT,56:vT,57:vT,62:aw},zT={91:Rw},BT={[-2]:_w,[-1]:_w,32:_w},VT={35:Ww,42:gT,45:[ET,gT],60:qw,61:ET,95:gT,96:hw,126:hw},HT={38:dw,92:lw},UT={[-5]:mT,[-4]:mT,[-3]:mT,33:uT,38:dw,42:ZC,60:[tw,Qw],91:fT,92:[Hw,lw],93:eT,95:ZC,96:xw},WT={null:[ZC,jT]},GT={null:[42,95]},KT={null:[]};function qT(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=jv(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Gv(a,l.events,l),l.events):[]}function f(e,t){return YT(p(e),t)}function p(e){return JT(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Av(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function JT(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function YT(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
66
+ `;break;case-3:o=`\r
67
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function XT(e){let t={constructs:zC([LT,...(e||{}).extensions||[]]),content:n(UC),defined:[],document:n(qC),flow:n(kT),lazy:{},string:n(MT),text:n(NT)};return t;function n(e){return n;function n(n){return qT(t,e,n)}}}function ZT(e){for(;!Dw(e););return e}var QT=/[\0\t\n\r]/g;function $T(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){QT.lastIndex=c;let n=QT.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var eE={}.hasOwnProperty;function tE(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),nE(n)(ZT(XT(n).document().write($T()(e,t,!0))))}function nE(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(te),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(ee),htmlTextData:E,image:c(j),label:M,labelText:ne,lineEnding:D,link:c(A),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:re,resourceTitleString:ie,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};iE(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];eE.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||oE).call(a,void 0,e[0])}for(r.position={start:rE(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:rE(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:rE(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||oE).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+jy({start:e.start,end:e.end})+`): it’s not open`);n.position.end=rE(e.end)}function u(){return Yx(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=HC(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:rE(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=rE(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=rE(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=VS(t),n.identifier=HC(t).toLowerCase()}function M(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=HC(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=zS(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=gy(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=rE(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function rE(e){return{line:e.line,column:e.column,offset:e.offset}}function iE(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?iE(e,r):aE(e,r)}}function aE(e,t){let n;for(n in t)if(eE.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function oE(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+jy({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jy({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+jy({start:t.start,end:t.end})+`) is still open`)}var sE=class extends Error{constructor(e,t,n,r){let i=e.name??`Fragment`,a=e.type===`mdxJsxFlowElement`?`flow`:`text`,o=r?` ${r}`:``;super(`JSX component "${i}" was parsed as ${a} but is declared as ${t.kind} (kindMismatchPolicy: "${n}").${o}`),this.name=`JsxKindMismatchError`}},cE=new Set([`paragraph`,`heading`,`emphasis`,`strong`,`delete`,`link`,`linkReference`,`tableCell`,`footnote`,`mdxJsxTextElement`,`textDirective`,`leafDirective`]),lE=new Set([`root`,`blockquote`,`listItem`,`footnoteDefinition`,`mdxJsxFlowElement`,`containerDirective`]);function uE(e){return e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`}function dE(e,t){return t.find(t=>t.name===e.name)??t.find(e=>e.name===`*`)}function fE(e,t){return(e.type===`mdxJsxFlowElement`?`flow`:`text`)!==t.kind}function pE(e,t,n){if(uE(e)){let r=dE(e,t);if(r&&n(e)&&fE(e,r))throw new sE(e,r,`error`)}`children`in e&&e.children.forEach(e=>{pE(e,t,n)})}function mE(e,t,n){let r=e=>n(e)?dE(e,t):void 0;function i(e){let t=cE.has(e.type)?`phrasing`:lE.has(e.type)?`flow`:`structural`;return e.children=t===`phrasing`?e.children.flatMap(t=>s(t,e.type)):t===`flow`?e.children.flatMap(e=>l(e)):e.children.map(t=>o(t,e.type)),e}function a(e){return`children`in e&&i(e),e}function o(e,t){if(uE(e)){let n=r(e);if(n&&fE(e,n))throw new sE(e,n,`normalize`,`The ${t} parent does not declare whether its children are flow or phrasing content.`)}return a(e)}function s(e,t){if(!uE(e))return[a(e)];let n=r(e);if(!n||!fE(e,n))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new sE(e,n,`normalize`,`It cannot be lifted from ${t} without changing surrounding phrasing content.`);return[a(u(e,n))]}function c(e){let t=e.children.find(e=>e.type===`mdxJsxTextElement`&&r(e)?.kind===`flow`);if(!t)return[i(e)];let n=r(t);if(e.children.length!==1)throw new sE(t,n,`normalize`,`It has surrounding phrasing content, and normalization would need to split the paragraph.`);return[a({...t,type:`mdxJsxFlowElement`,children:t.children.length===0?[]:[{type:`paragraph`,children:t.children}]})]}function l(e){if(e.type===`paragraph`)return c(e);if(!uE(e))return[a(e)];let t=r(e);if(!t||!fE(e,t))return[a(e)];if(e.type===`mdxJsxTextElement`)throw new sE(e,t,`normalize`,`A text JSX node can be normalized to flow only when it is the sole child of a paragraph.`);return[{type:`paragraph`,children:[a(u(e,t))]}]}function u(e,t){if(e.children.length===0)return{...e,type:`mdxJsxTextElement`,children:[]};if(e.children.length!==1||e.children[0].type!==`paragraph`)throw new sE(e,t,`normalize`,`Its block children cannot be represented as one phrasing-content sequence without data loss.`);return{...e,type:`mdxJsxTextElement`,children:e.children[0].children}}return i(e)}function hE(e,t,n,r=()=>!0){return n===`source`?e:n===`error`?(pE(e,t,r),e):mE(structuredClone(e),t,r)}function gE(e){return e.children instanceof Array}var _E=[`paragraph`,`heading`,`tableCell`],vE=class extends Error{constructor(e,t){super(e),this.name=`MarkdownParseError`,this.cause=t}},yE=class extends Error{constructor(e){super(e),this.name=`UnrecognizedMarkdownConstructError`}};function bE(e){let t=new Map;return e.type===`root`?(e.children.filter(e=>e.type===`mdxjsEsm`).filter(e=>e.value.startsWith(`import `)).forEach(e=>{(e.data?.estree?.body??[]).forEach(e=>{e.type===`ImportDeclaration`&&e.specifiers.forEach(n=>{t.set(n.local.name,{source:`${e.source.value}`,defaultExport:n.type===`ImportDefaultSpecifier`})})})}),{importDeclarations:Object.fromEntries(t.entries())}):{importDeclarations:{}}}function xE({root:e,markdown:t,visitors:n,syntaxExtensions:r,mdastExtensions:i,...a}){let o;try{o=tE(t,{extensions:r,mdastExtensions:i})}catch(e){throw e instanceof Error?new vE(`Error parsing markdown: ${e.message}`,e):new vE(`Error parsing markdown: ${e}`,e)}o.children.length===0&&o.children.push({type:`paragraph`,children:[]}),o.children.at(-1)?.type!==`paragraph`&&o.children.push({type:`paragraph`,children:[]}),SE({root:e,mdastRoot:o,visitors:n,...a})}function SE({root:e,mdastRoot:t,visitors:n,...r}){n=n.sort((e,t)=>(t.priority??0)-(e.priority??0));function i(e,t=null){return n.find((n,i)=>t?.has(i)?!1:typeof n.testNode==`string`?n.testNode===e.type:n.testNode(e,r))}t=hE(t,r.jsxComponentDescriptors,r.jsxKindMismatchPolicy??`source`,e=>i(e)?.jsxKindReconciliationOwner===!0);let a=new WeakMap,o=new WeakMap,s=bE(t);function c(e,t){if(!gE(e))throw Error(`Attempting to visit children of a non-parent`);e.children.forEach(n=>{if(gE(n)&&!_E.includes(n.type)){let t=a.get(e);t!==void 0&&!a.has(n)&&a.set(n,t);let r=o.get(e);r!==void 0&&!o.has(n)&&o.set(n,r)}l(n,t,e)})}function l(e,t,u,d=null){let f=i(e,d);if(!f)try{throw new yE(`Unsupported markdown syntax: ${mC(e)}`)}catch{throw new yE(`Parsing of the following markdown structure failed: ${JSON.stringify({type:e.type,name:`name`in e?e.name:`N/A`})}`)}f.visitNode({mdastNode:e,lexicalParent:t,mdastParent:u,descriptors:r,metaData:s,actions:{visitChildren:c,nextVisitor(){l(e,t,u,(d??new Set).add(n.indexOf(f)))},addAndStepInto(n){t.append(n),gE(e)&&c(e,n)},addFormatting(t,n){n||gE(e)&&(n=e),n&&a.set(n,t|(a.get(u)??0))},removeFormatting(t,n){n||gE(e)&&(n=e),n&&a.set(n,t^(a.get(u)??0))},getParentFormatting(){return a.get(u)??0},addStyle(t,n){n||gE(e)&&(n=e),n&&o.set(n,t)},getParentStyle(){return o.get(u)??``}}})}l(t,e,null)}function CE(){}var wE=Object.defineProperty,TE=(e,t,n)=>t in e?wE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EE=(e,t,n)=>TE(e,typeof t==`symbol`?t:t+``,n),DE=`generic-html`,OE=class e extends Hl{constructor(e,t,n,r){super(r),EE(this,`__tag`),EE(this,`__nodeType`),EE(this,`__attributes`),this.__tag=e,this.__nodeType=t,this.__attributes=n}static getType(){return DE}static clone(t){return new e(t.__tag,t.__nodeType,t.__attributes,t.__key)}getTag(){return this.__tag}getNodeType(){return this.__nodeType}getAttributes(){return this.__attributes}updateAttributes(e){let t=this.getWritable();t.__attributes=e}getStyle(){return this.__attributes.find(e=>e.name===`style`)?.value}createDOM(){let e=this.__tag,t=document.createElement(e);return this.__attributes.forEach(e=>{t.setAttribute(e.name,e.value)}),t}updateDOM(){return!1}static importDOM(){return{}}exportDOM(e){let{element:t}=super.exportDOM(e);return{element:t}}static importJSON(e){let t=kE(e.tag,e.mdxType,e.attributes);return t.setFormat(e.format),t.setIndent(e.indent),t.setDirection(e.direction),t}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),attributes:this.__attributes,mdxType:this.__nodeType,type:DE,version:1}}extractWithChild(){return!0}isInline(){return this.__nodeType===`mdxJsxTextElement`}};function kE(e,t,n){return jd(new OE(e,t,n))}function AE(e){return e instanceof OE}var jE={testLexicalNode:AE,visitLexicalNode({actions:e,lexicalNode:t}){e.addAndStepInto(`mdxJsxTextElement`,{name:t.getTag(),type:t.getNodeType(),attributes:t.getAttributes()})},priority:-100},ME={testLexicalNode:ru,visitLexicalNode:({mdastParent:e,actions:t})=>{t.appendToParent(e,{type:`text`,value:`
68
+ `})}},NE={testLexicalNode:uu,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`paragraph`)}},PE={testLexicalNode:ql,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`root`)}};function FE(e){return e.type===`text`}var IE=[`u`,`span`,`sub`,`sup`];function LE(e,t){return{format:e,isTag:!0,matches:e=>e.type===`mdxJsxTextElement`&&e.name===t&&e.attributes.length===0,create:()=>({type:`mdxJsxTextElement`,name:t,children:[],attributes:[]})}}function RE(e,t){return{format:e,isTag:!1,matches:e=>e.type===t,create:()=>({type:t,children:[]})}}var zE=[LE(8,`u`),LE(64,`sup`),LE(32,`sub`),RE(2,`emphasis`),RE(1,`strong`),RE(4,`delete`),RE(128,`highlight`)];function BE(e,t){let n=e.getStyle(),r=0,i=e.getNextSibling();for(;V(i)&&i.getFormat()&t&&i.getStyle()===n;)r++,i=i.getNextSibling();return r}var VE={shouldJoin:(e,t)=>{if([`text`,`emphasis`,`strong`,`highlight`].includes(e.type))return e.type===t.type;if(e.type===`mdxJsxTextElement`&&t.type===`mdxJsxTextElement`&&IE.includes(t.name)){let n=t;return e.name===n.name&&JSON.stringify(e.attributes)===JSON.stringify(n.attributes)}return!1},join(e,t){return FE(e)&&FE(t)?{type:`text`,value:e.value+t.value}:{...e,children:[...e.children,...t.children]}},testLexicalNode:V,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getTextContent(),i=e.getFormat(),a=e.getStyle(),o=t;a&&(o=n.appendToParent(o,{type:`mdxJsxTextElement`,name:`span`,children:[],attributes:[{type:`mdxJsxAttribute`,name:`style`,value:a}]}));let s=0;for(;;){let e=o.children.at(-1),t=e&&zE.find(t=>i&t.format&&!(s&t.format)&&t.matches(e));if(!t)break;s|=t.format,o=e}let c=zE.filter(e=>i&e.format&&!(s&e.format)).map(t=>({container:t,runLength:BE(e,t.format)})).sort((e,t)=>Number(t.container.isTag)-Number(e.container.isTag)||t.runLength-e.runLength);for(let{container:e}of c)o=n.appendToParent(o,e.create());if(i&16){n.appendToParent(o,{type:`inlineCode`,value:r});return}n.appendToParent(o,{type:`text`,value:r})}},HE={testNode:`break`,visitNode:function({lexicalParent:e}){e.append(nu())}};function UE(e,t){return[{testNode:t=>t.type===`mdxJsxTextElement`&&t.name===e,visitNode({actions:e,mdastNode:n,lexicalParent:r}){e.addFormatting(t),e.visitChildren(n,r)}},{testNode:t=>t.type===`html`&&t.value===`<${e}>`,visitNode({actions:e,mdastParent:n}){e.addFormatting(t,n)}},{testNode:t=>t.type===`html`&&t.value===`</${e}>`,visitNode({actions:e,mdastParent:n}){e.removeFormatting(t,n)}}]}var WE={testNode:`delete`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(4),t.visitChildren(e,n)}},GE={testNode:`highlight`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(128),t.visitChildren(e,n)}},KE={testNode:`inlineCode`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(dc(e.value).setFormat(t.getParentFormatting()|16))}},qE=[{testNode:`emphasis`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(2),t.visitChildren(e,n)}},{testNode:`strong`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){t.addFormatting(1),t.visitChildren(e,n)}},...UE(`u`,8),...UE(`code`,16),KE,WE,GE,...UE(`sup`,64),...UE(`sub`,32)],JE={testNode:SC,visitNode:function({mdastNode:e,actions:t,lexicalParent:n}){e.name===`span`&&e.attributes.length===1&&e.attributes[0].type===`mdxJsxAttribute`&&e.attributes[0].name===`style`?(t.addStyle(e.attributes[0].value,e),t.visitChildren(e,n)):t.addAndStepInto(kE(e.name,e.type,e.attributes))},priority:-100},YE=[`listitem`,`admonition`],XE={testNode:`paragraph`,visitNode:function({mdastNode:e,mdastParent:t,lexicalParent:n,actions:r}){let i=n.getType();if(YE.includes(i)){let a=t?.children.indexOf(e)??-1,o=a>0?t?.children.at(a-1):void 0;i===`listitem`&&o?.type===`paragraph`&&n.append(nu(),nu()),r.visitChildren(e,n)}else r.addAndStepInto(lu())}},ZE={testNode:`root`,visitNode({actions:e,mdastNode:t,lexicalParent:n}){e.visitChildren(t,n)}},QE={testNode:`text`,visitNode({mdastNode:e,actions:t}){let n=dc(e.value);n.setFormat(t.getParentFormatting());let r=t.getParentStyle();r!==``&&n.setStyle(r),t.addAndStepInto(n)}},$E={dash:45,eof:null,exclamationMark:33,greaterThan:62},eD={data:`data`,lineEnding:`lineEnding`,linePrefix:`linePrefix`};function tD(e){return{canContainEols:[`comment`],enter:{comment(e){this.buffer()}},exit:{comment(e){this.resume()}}}}var nD=(e,t,n)=>{return r;function r(t){return e.enter(`comment`),e.consume(t),i}function i(t){return t===$E.exclamationMark?(e.consume(t),a):n(t)}function a(t){return t===$E.dash?(e.consume(t),o):n(t)}function o(t){return t===$E.dash?(e.consume(t),s):n(t)}function s(t){return t===$E.greaterThan?n(t):Y(t)?u(t):(e.enter(eD.data),t===$E.dash?(e.consume(t),c):l(t))}function c(e){return e===$E.greaterThan?n(e):l(e)}function l(t){return t===$E.eof?n(t):t===$E.dash?(e.consume(t),f):Y(t)?(e.exit(eD.data),u(t)):(e.consume(t),l)}function u(t){return e.enter(eD.lineEnding),e.consume(t),e.exit(eD.lineEnding),Nb(e,d,eD.linePrefix)}function d(t){return Y(t)?u(t):(e.enter(eD.data),l(t))}function f(t){return t===$E.dash?(e.consume(t),p):l(t)}function p(n){return n===$E.greaterThan?(e.exit(eD.data),e.enter(`commentEnd`),e.consume(n),e.exit(`commentEnd`),e.exit(`comment`),t(n)):n===$E.dash?(e.consume(n),p):l(n)}},rD={flow:{60:{tokenize:nD,concrete:!0}},text:{60:{tokenize:nD}}},iD={bold:`_bold_6j9u9_10`,italic:`_italic_6j9u9_14`,underline:`_underline_6j9u9_18`,strikethrough:`_strikethrough_6j9u9_34`,underlineStrikethrough:`_underlineStrikethrough_6j9u9_38`,subscript:`_subscript_6j9u9_42`,superscript:`_superscript_6j9u9_47`,code:`_code_6j9u9_52`,quote:`_quote_6j9u9_59`,nestedListItem:`_nestedListItem_6j9u9_66`,listitem:`_listitem_6j9u9_76`,listItemChecked:`_listItemChecked_6j9u9_80`,listItemUnchecked:`_listItemUnchecked_6j9u9_81`,admonitionDanger:`_admonitionDanger_6j9u9_158`,admonitionInfo:`_admonitionInfo_6j9u9_159`,admonitionNote:`_admonitionNote_6j9u9_160`,admonitionTip:`_admonitionTip_6j9u9_161`,admonitionCaution:`_admonitionCaution_6j9u9_162`,mdxExpression:`_mdxExpression_6j9u9_195`},aD={quote:iD.quote,text:{bold:iD.bold,italic:iD.italic,underline:iD.underline,code:iD.code,strikethrough:iD.strikethrough,subscript:iD.subscript,superscript:iD.superscript,underlineStrikethrough:iD.underlineStrikethrough},list:{listitem:iD.listitem,listitemChecked:iD.listItemChecked,listitemUnchecked:iD.listItemUnchecked,nested:{listitem:iD.nestedListItem}},admonition:{danger:iD.admonitionDanger,info:iD.admonitionInfo,note:iD.admonitionNote,tip:iD.admonitionTip,caution:iD.admonitionCaution}},oD=(0,I.createContext)(null);function sD(){let e=(0,I.useContext)(oD);return e??function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(8),e}function cD(){return Yu().getTextContent()}function lD(e,t=!0){if(e)return!1;let n=cD();return t&&(n=n.trim()),n===``}function uD(e){if(!lD(e,!1))return!1;let t=Yu().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){let n=t[e];if(Gl(n))return!1;if(W(n)){if(!uu(n)||n.__indent!==0)return!1;let t=n.getChildren(),r=t.length;for(let n=0;n<r;n++){let n=t[e];if(!V(n))return!1}}}return!0}function dD(e){return()=>uD(e)}var fD=Hr?I.useLayoutEffect:I.useEffect;function pD({editor:e,ariaActiveDescendant:t,ariaAutoComplete:n,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:a,ariaExpanded:o,ariaInvalid:s,ariaLabel:c,ariaLabelledBy:l,ariaMultiline:u,ariaOwns:d,ariaRequired:f,autoCapitalize:p,className:m,id:h,role:g=`textbox`,spellCheck:_=!0,style:v,tabIndex:y,"data-testid":b,...x},S){let[C,w]=(0,I.useState)(e.isEditable()),T=(0,I.useCallback)(t=>{t&&t.ownerDocument&&t.ownerDocument.defaultView?e.setRootElement(t):e.setRootElement(null)},[e]),E=(0,I.useMemo)(()=>function(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n!=null&&(n.current=t)}}(S,T),[T,S]);return fD(()=>(w(e.isEditable()),e.registerEditableListener(e=>{w(e)})),[e]),(0,L.jsx)(`div`,{"aria-activedescendant":C?t:void 0,"aria-autocomplete":C?n:`none`,"aria-controls":C?r:void 0,"aria-describedby":i,...a==null?{}:{"aria-errormessage":a},"aria-expanded":C&&g===`combobox`?!!o:void 0,...s==null?{}:{"aria-invalid":s},"aria-label":c,"aria-labelledby":l,"aria-multiline":u,"aria-owns":C?d:void 0,"aria-readonly":!C||void 0,"aria-required":f,autoCapitalize:p,className:m,contentEditable:C,"data-testid":b,id:h,ref:E,role:g,spellCheck:_,style:v,tabIndex:y??(C?void 0:-1),...x})}var mD=(0,I.forwardRef)(pD);function hD(e){return e.read(`latest`,dD(e.isComposing()))}var gD=(0,I.forwardRef)(_D);function _D(e,t){let{placeholder:n,...r}=e,[i]=sD();return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(mD,{editor:i,...r,ref:t}),n!=null&&(0,L.jsx)(vD,{editor:i,content:n})]})}function vD({content:e,editor:t}){let n=function(e){let[t,n]=(0,I.useState)(()=>hD(e));return fD(()=>{function t(){let t=hD(e);n(t)}return t(),am(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),[r,i]=(0,I.useState)(t.isEditable());if((0,I.useLayoutEffect)(()=>(i(t.isEditable()),t.registerEditableListener(e=>{i(e)})),[t]),!n)return null;let a=null;return typeof e==`function`?a=e(r):e!==null&&(a=e),a===null?null:(0,L.jsx)(`div`,{"aria-hidden":!0,children:a})}var yD=class extends I.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){this.props.onError(e instanceof Error?e:Error(String(e),{cause:e}),t)}render(){return this.state.hasError?this.props.fallback:this.props.children}};function bD({children:e,fallback:t,onError:n}){return(0,L.jsx)(yD,{fallback:t===void 0?(0,L.jsx)(`div`,{style:{border:`1px solid #f00`,color:`#f00`,padding:`8px`},children:`An error was thrown.`}):t,onError:n,children:e})}var xD=Zp({name:`@lexical/react/ReactProvider`}),SD=a(i(),1);function CD(e,t){let[n]=t,r=e.decorators.map(e=>typeof e==`function`?(0,L.jsx)(e,{context:t}):e);return function(i){let{EditorChildrenComponent:a=e.EditorChildrenComponent,ErrorBoundary:o=e.ErrorBoundary,contentEditable:s=e.contentEditable,children:c}=i,l=function(e,t){let[n,r]=(0,I.useMemo)(()=>[t=>e.registerDecoratorListener(t),()=>e.getDecorators()],[e]),i=(0,I.useSyncExternalStore)(n,r,r);return(0,I.useMemo)(()=>{let n=[];for(let r in i){let a=e.getElementByKey(r);if(a!==null){let o=(0,L.jsx)(t,{onError:t=>{e._onError(t)},children:(0,L.jsx)(I.Suspense,{fallback:null,children:i[r]})});n.push((0,SD.createPortal)(o,a,r))}}return n},[t,i,e])}(n,o),u=(0,I.useMemo)(()=>r.map((e,t)=>(0,L.jsx)(o,{onError:e=>{n._onError(e)},children:(0,L.jsx)(I.Suspense,{fallback:null,children:e})},t)),[o]);return(0,L.jsx)(oD.Provider,{value:t,children:(0,L.jsxs)(a,{context:t,contentEditable:s,children:[c,u,l]})})}}function wD({contentEditable:e,children:t}){return(0,L.jsxs)(L.Fragment,{children:[e,t]})}var TD=Zp({build(e,t,n){n.getPeer(xD.name)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(321,[...n.getDirectDependentNames()].join(` `));let r=[e,{getTheme:()=>e._config.theme}];return{Component:CD(t,r),context:r}},config:{EditorChildrenComponent:wD,ErrorBoundary:bD,contentEditable:(0,L.jsx)(gD,{}),decorators:[]},mergeConfig(e,t){let n=tm(e,t);return t.decorators&&(n.decorators=t.decorators.length>0?[...e.decorators,...t.decorators]:e.decorators),n},name:`@lexical/react/React`,peerDependencies:[$p(xD.name)]}),ED=new WeakSet,DD=new WeakMap,OD=new Set([Kl,nc,eu,pc,su]),kD=new WeakMap;function AD(e){return Qp(Yh,{createInitialHistoryState:()=>e,disabled:!1})}function jD({name:e,namespace:t,nodes:n,theme:r,editable:i=!0,parentEditor:a,historyMode:o,historyState:s,initialEditorState:c,onError:l=e=>{throw e}}){let u=[xD,Qp(TD,{contentEditable:null}),Qp(Th,{setOptions:{tag:Bs},updateOptions:{tag:Bs}})];if(a&&u.push(Qp(Vh,{$getParentEditor:()=>a,inheritEditableFromParent:!0})),o===`nested-shared`)u.push(Xh);else if(o===`root-shared`||o===`nested-external`){if(!s)throw Error(`${o} requires a historyState`);u.push(AD(s))}else o===`table-local`&&u.push(Qp(Yh,{disabled:!1}));let d=Dh(Zp({name:e,namespace:t,nodes:n?.filter(e=>!OD.has(e)),theme:r,editable:i,$initialEditorState:c,onError:l,dependencies:u})),f=Ph(d,Yh.name)?.output.historyState.value;f&&DD.set(d,f),f&&(kD.has(f)||kD.set(f,f.current));let p=f?d.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{let r=f.current;if(n.has(`historic`)){kD.set(f,r);return}if(e.size>0||t.size>0){kD.set(f,r);return}let i=kD.get(f);r?.editor===d&&i&&i.editor!==d?(f.undoStack.push({...i}),f.redoStack=[],d.dispatchCommand($o,!0),d.dispatchCommand(Qo,!1),kD.set(f,r)):kD.set(f,r)}):()=>void 0,m=new Set,h=f?d.registerCommand(es,()=>{let e=setTimeout(()=>{m.delete(e),d.dispatchCommand($o,f.undoStack.length>0),d.dispatchCommand(Qo,f.redoStack.length>0)});return m.add(e),!1},1):()=>void 0,g=d.dispose.bind(d),_=!1;return d.dispose=()=>{_||(_=!0,m.forEach(clearTimeout),m.clear(),h(),p(),g())},o===`root-shared`&&ED.add(d),d}var MD=B(`NESTED_EDITOR_UPDATED_COMMAND`),ND=R(null),PD=R(null),FD=R(``),ID=R(!0),LD=R(!1,e=>{e.sub(e.pipe(LD,Nr(ND)),([e,t])=>{t?.setEditable(!e)})}),RD=R(``),zD=R(!1),BD=R(!1),VD=R(0),HD=R(null),UD=Tr(e=>{e.link(e.pipe(HD,Pr(e=>e!==null)),UD)}),WD=Tr(e=>{e.sub(e.pipe(WD,Nr(PD)),([e,t])=>{t?.dispatchCommand(So,e)})}),GD=R(null,e=>{e.sub(e.pipe(GD,Nr(PD)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:Af(r,e=>{let t=e.getParent();return t!==null&&kd(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){let t=P_(i)?i.getTag():i.getType();e.pub(qO,t)}})}),KD=R(``),qD=R(``),JD=R(!1),YD=Tr(e=>{e.link(qD,YD),e.sub(KD,t=>{e.pubIn({[JD]:!0,[qD]:t})})}),XD=Tr(e=>{e.link(e.pipe(YD,Nr(yO),Pr(([,e])=>!e),Mr(([e])=>e)),XD)},!0),ZD=R([]),QD=R([]),$D=R([]),eO=R([]),tO=R([]),nO=R([]),rO=R({}),iO=R(!1),aO=R([]),oO=R(`source`),sO=R([]),cO=R([]),lO=R(``),uO=R(null),dO=R(null),fO=R(null),pO=kO(QD),mO=kO(ZD),hO=kO($D),gO=kO(eO),_O=kO(tO),vO=kO(nO),yO=R(!1),bO=Tr(e=>{e.sub(e.pipe(bO,Nr(qD,ND,BD),Pr(([e,t])=>e.trim()!==t.trim())),([t,,n,r])=>{e.pub(yO,!0),n?.update(()=>{Yu().clear(),NO(e,Yu(),t),r?n.focus():Xu(null)},{onUpdate:()=>{e.pub(yO,!1)}})})}),xO=Tr(e=>{e.sub(e.pipe(xO,Nr(PD,BD)),([t,n,r])=>{n?.update(()=>{let i=U();if(i!==null){let n={children:[],append(e){this.children.push(e)},getType(){return i.getNodes()[0].getType()}};NO(e,n,t),nl(n.children)}r?n.focus():Xu(null)})})});function SO(){return Fr((e,[t,n])=>(e.forEach(e=>{if(!e)throw Error(`You have a subscription that does not return a teardown`);e()}),n?t.map(e=>e(n)):[]),[])}var CO=R(null),wO=R([],e=>{e.pipe(e.combine(wO,PD),SO())}),TO=R([],e=>{e.pipe(e.combine(TO,ND),SO())}),EO=R(null,CE,(e,t)=>!!(e&&t&&e.editorRef===t.editorRef)),DO=Tr(),OO=R(e=>{throw Error(`No icon component for ${e}`)});function kO(e,t){return Tr((n,r)=>{n.changeWith(e,r,(e,t)=>{Array.isArray(t)||(t=[t]);let n=e;for(let r of t)e.includes(r)||(n=[...n,r]);return n}),t?.(n,r)})}function AO(e){let t=U();H(t)&&e.pubIn({[GD]:t,[VD]:t.format})}var jO=kO(TO,(e,t)=>{e.pub(t,[t=>t.registerCommand(oo,(t,n)=>(e.pubIn({[PD]:n,[BD]:!0}),n._parentEditor===null&&n.getEditorState().read(()=>{e.pub(EO,{rootNode:Yu(),editorType:`lexical`,editorRef:n})}),AO(e),!1),4),t=>t.registerUpdateListener(({dirtyElements:n,dirtyLeaves:r,editorState:i})=>{if(e.getValue(HD)!==null||n.size===0&&r.size===0)return;let a;i.read(()=>{Yu().getLastChild()instanceof Wl&&t.update(()=>{Yu().append(lu())},{discrete:!0}),a=LC({root:Yu(),visitors:e.getValue(tO),jsxComponentDescriptors:e.getValue(aO),toMarkdownExtensions:e.getValue(nO),toMarkdownOptions:e.getValue(rO),jsxIsAvailable:e.getValue(iO)})}),e.pub(qD,a.trim()),e.pub(JD,!1)}),t=>t.registerCommand(es,()=>(e.pub(BD,!0),!1),4)])}),MO=kO(wO,(e,t)=>{e.pub(t,[t=>t.registerUpdateListener(({editorState:t})=>{t.read(()=>{AO(e)})}),t=>t.registerCommand(ts,t=>{let n=e.getValue(ND);return n&&(n.getRootElement()?.contains(t.relatedTarget)||e.pubIn({[BD]:!1,[DO]:t})),!1},4)])});function NO(e,t,n){try{xE({root:t,visitors:e.getValue(ZD),mdastExtensions:e.getValue(eO),markdown:n,syntaxExtensions:e.getValue($D),jsxComponentDescriptors:e.getValue(aO),jsxKindMismatchPolicy:e.getValue(oO),directiveDescriptors:e.getValue(sO),codeBlockEditorDescriptors:e.getValue(cO),defaultCodeBlockLanguage:e.getValue(lO)}),e.pub(HD,null)}catch(t){if(t instanceof vE||t instanceof yE||t instanceof sE)e.pubIn({[qD]:n,[HD]:{error:t.message,source:n}});else throw t}}var PO=R([]),FO=kO(PO),IO=R([]),LO=kO(IO),RO=R([]),zO=kO(RO),BO=R([]),VO=kO(BO),HO=kO(R([])),UO=R([]),WO=kO(UO),GO=R(!1,e=>{e.link(e.pipe(PD,Mr(e=>[`td`,`th`].includes((e?.getRootElement()?.parentNode)?.nodeName.toLowerCase()??``))),GO)}),KO=R(Jh()),qO=R(``);Tr();var JO=Tr(e=>{e.sub(e.pipe(JO,Nr(PD)),([e,t])=>{t?.update(()=>{let n=U();H(n)&&(hm(n,e),setTimeout(()=>{t.focus()}))})})});function YO(e){if(e.isInline()){nl([e]),kd(e.getParentOrThrow())&&Em(e,lu).selectEnd();return}let t=U();if(H(t)){let n=Af(t.focus.getNode(),q);if(q(n)){let r=Np(t.focus,`next`);for(;r!==null&&(lp(r)||!n.is(r.getParentAtCaret()));)r=Yp(r);if(r!==null){r.insert(e);return}}}Tm(e)}var XO=Tr(e=>{e.sub(e.pipe(XO,Nr(PD)),([e,t])=>{t?.focus(()=>{t.getEditorState().read(()=>{H(U())&&(t.update(()=>{let t=e();YO(t),setTimeout(()=>{`select`in t&&typeof t.select==`function`&&t.select()})}),setTimeout(()=>{t.dispatchCommand(MD,void 0)}))})},{defaultSelection:`rootEnd`})})}),ZO=R(`rich-text`,e=>{function t(){return Fr((e,t)=>({current:e.next,next:t}),{current:`rich-text`,next:`rich-text`})}e.sub(e.pipe(ZO,t(),Nr(QO)),([{current:t},n])=>{(t===`source`||t===`diff`)&&e.pub(bO,n)}),e.sub(e.pipe(ZO,t(),Pr(e=>e.current===`rich-text`),Nr(PD)),([,e])=>{e?.dispatchCommand(MD,void 0)})}),QO=R(``,e=>{e.link(qD,QO),e.link(QO,YD)},!0),$O=R([]),ek=kO($O),tk=R(()=>{throw Error(`No translation function provided`)}),nk=R(aD),rk=zr({init(e,t){let n=t?.initialMarkdown??``;e.register(jO),e.register(MO),e.register(YD),e.register(QO),e.pubIn({[KD]:t?.trim?n.trim():n,[OO]:t?.iconComponentFor,[mO]:[ZE,XE,QE,HE,...qE],[pO]:[su,nc,OE],[_O]:[PE,NE,VE,ME,jE],[FD]:t?.contentEditableClassName,[ID]:t?.spellCheck,[rO]:t?.toMarkdownOptions,[zD]:t?.autoFocus,[RD]:t?.placeholder,[LD]:t?.readOnly,[tk]:t?.translation,[KO]:Jh(),[gO]:[Jv(),ny],[hO]:[Kv(),Eb()],[vO]:[Ry(),Yv(),ay],[nk]:t?.lexicalTheme??aD}),e.singletonSub(UD,t?.onError),e.singletonSub(XD,n=>{t?.onChange(n,e.getValue(JD))}),e.singletonSub(DO,t?.onBlur),t?.suppressHtmlProcessing||e.pubIn({[gO]:[Ly(),tD()],[hO]:[ux(),dx(),rD],[mO]:JE})},postInit(e,t){let n=jD({name:`@mdxeditor/root`,editable:t?.readOnly!==!0,namespace:t?.lexicalEditorNamespace??`MDXEditor`,nodes:[...e.getValue(QD),...t?.additionalLexicalNodes??[]],theme:e.getValue(nk),historyMode:t?.suppressSharedHistory?`none`:`root-shared`,historyState:e.getValue(KO),initialEditorState:t?.editorState===null?null:()=>{let n=t?.initialMarkdown.trim()??``;NO(e,Yu(),n)}});Lr(e,()=>{n.dispose()});let r=t?.autoFocus;if(t?.editorState!==null&&r){let t=setTimeout(()=>{n.focus(CE,{defaultSelection:r===!0?`rootStart`:r.defaultSelection??`rootStart`})});Lr(e,()=>{clearTimeout(t)})}e.pub(ND,n),e.pub(PD,n)},update(e,t){e.pubIn({[FD]:t?.contentEditableClassName,[ID]:t?.spellCheck,[rO]:t?.toMarkdownOptions,[zD]:t?.autoFocus,[RD]:t?.placeholder,[LD]:t?.readOnly}),e.singletonSub(XD,n=>{t?.onChange(n,e.getValue(JD))}),e.singletonSub(DO,t?.onBlur),e.singletonSub(UD,t?.onError)}});function ik(){return kr(tk)}function ak({initialEditor:e,children:t}){let{Component:n}=Nh(e,TD).output;return(0,L.jsx)(n,{children:t})}var ok=Hr?I.useLayoutEffect:I.useEffect;function sk(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function ck(){return function(e){let[t]=sD(),n=(0,I.useMemo)(()=>e(t),[t,e]),[r,i]=(0,I.useState)(()=>n.initialValueFn()),a=(0,I.useRef)(r);return ok(()=>{let{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,i(r)),t(e=>{a.current=e,i(e)})},[n,e]),r}(sk)}function lk(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var uk=Hr?I.useLayoutEffect:I.useEffect;function dk({editor:e,ErrorBoundary:t}){return function(e,t){let[n,r]=(0,I.useState)(()=>e.getDecorators());return uk(()=>e.registerDecoratorListener(e=>{(0,SD.flushSync)(()=>{r(e)})}),[e]),(0,I.useEffect)(()=>{r(e.getDecorators())},[e]),(0,I.useMemo)(()=>{let r=[],i=Object.keys(n);for(let a=0;a<i.length;a++){let o=i[a],s=(0,L.jsx)(t,{onError:t=>e._onError(t),children:(0,L.jsx)(I.Suspense,{fallback:null,children:n[o]})}),c=e.getElementByKey(o);c!==null&&r.push((0,SD.createPortal)(s,c,o))}return r},[t,n,e])}(e,t)}function fk({editor:e,ErrorBoundary:t}){return function(e){let t=Mh.maybeFromEditor(e);if(t&&t.hasExtensionByName(xD.name)){for(let e of[`@lexical/plain-text`,`@lexical/rich-text`])t.hasExtensionByName(e)&&lk(320,e);return!0}return!1}(e)?null:(0,L.jsx)(dk,{editor:e,ErrorBoundary:t})}function pk(e){return e.read(`latest`,dD(e.isComposing()))}function mk({contentEditable:e,placeholder:t=null,ErrorBoundary:n}){let[r]=sD();return function(e){uk(()=>am(K_(e),S_(e)),[e])}(r),(0,L.jsxs)(L.Fragment,{children:[e,(0,L.jsx)(hk,{content:t}),(0,L.jsx)(fk,{editor:r,ErrorBoundary:n})]})}function hk({content:e}){let[t]=sD(),n=function(e){let[t,n]=(0,I.useState)(()=>pk(e));return uk(()=>{function t(){let t=pk(e);n(t)}return t(),am(e.registerUpdateListener(()=>{t()}),e.registerEditableListener(()=>{t()}))},[e]),t}(t),r=ck();return n?typeof e==`function`?e(r):e:null}var gk=e(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),_k={undo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.202 18.5V17H14.3788C15.4224 17 16.3205 16.6554 17.073 15.9663C17.8257 15.2773 18.202 14.4263 18.202 13.4135C18.202 12.4007 17.8257 11.5512 17.073 10.8652C16.3205 10.1794 15.4224 9.8365 14.3788 9.8365H7.35775L10.1402 12.6193L9.0865 13.673L4.5 9.0865L9.0865 4.5L10.1402 5.55375L7.35775 8.3365H14.3788C15.8416 8.3365 17.0945 8.82467 18.1375 9.801C19.1805 10.7773 19.702 11.9815 19.702 13.4135C19.702 14.8455 19.1805 16.0513 18.1375 17.0308C17.0945 18.0103 15.8416 18.5 14.3788 18.5H7.202Z`,fill:`currentColor`})),redo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.6211 18.5C8.15827 18.5 6.90535 18.0103 5.86235 17.0308C4.81935 16.0513 4.29785 14.8455 4.29785 13.4135C4.29785 11.9815 4.81935 10.7773 5.86235 9.801C6.90535 8.82467 8.15827 8.3365 9.6211 8.3365H16.6421L13.8596 5.55375L14.9134 4.5L19.4999 9.0865L14.9134 13.673L13.8596 12.6193L16.6421 9.8365H9.6211C8.57744 9.8365 7.67935 10.1794 6.92685 10.8652C6.17418 11.5512 5.79785 12.4007 5.79785 13.4135C5.79785 14.4263 6.17418 15.2773 6.92685 15.9663C7.67935 16.6554 8.57744 17 9.6211 17H16.7979V18.5H9.6211Z`,fill:`currentColor`})),format_bold:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.33838 18.625V5.375H12.1999C13.219 5.375 14.1405 5.69233 14.9644 6.327C15.788 6.9615 16.1999 7.816 16.1999 8.8905C16.1999 9.63783 16.0194 10.2471 15.6584 10.7182C15.2975 11.1894 14.9088 11.5314 14.4921 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3158 16.6614 14.0193 16.6614 14.9038C16.6614 16.1819 16.1902 17.1217 15.2479 17.723C14.3055 18.3243 13.3562 18.625 12.3999 18.625H7.33838ZM9.48838 16.6328H12.3191C13.1063 16.6328 13.6627 16.4142 13.9884 15.977C14.314 15.5398 14.4769 15.1206 14.4769 14.7192C14.4769 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8058 12.2729 12.8058H9.48838V16.6328ZM9.48838 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5279 10.3538C13.8835 10.0064 14.0614 9.59042 14.0614 9.10575C14.0614 8.59042 13.8733 8.16925 13.4971 7.84225C13.1208 7.51542 12.6595 7.352 12.1134 7.352H9.48838V10.875Z`,fill:`currentColor`})),format_italic:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.39404 18.625V16.8173H9.21129L12.4518 7.18275H8.63454V5.375H17.7883V7.18275H14.2785L11.0383 16.8173H14.5478V18.625H5.39404Z`,fill:`currentColor`})),format_underlined:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.34619 22.125V20.625H18.6537V22.125H5.34619ZM11.9999 18.5287C10.4448 18.5287 9.23102 18.0566 8.35869 17.1125C7.48619 16.1683 7.04994 14.9032 7.04994 13.3172V5.41345H8.90369V13.4095C8.90369 14.4198 9.17228 15.2295 9.70944 15.8385C10.2466 16.4475 11.0101 16.752 11.9999 16.752C12.9898 16.752 13.7533 16.4475 14.2904 15.8385C14.8276 15.2295 15.0962 14.4198 15.0962 13.4095V5.41345H16.9499V13.3172C16.9499 14.9032 16.5137 16.1683 15.6412 17.1125C14.7689 18.0566 13.5551 18.5287 11.9999 18.5287Z`,fill:`currentColor`})),format_highlight:I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.75`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`path`,{d:`m9 11-6 6v3h9l3-3`}),I.createElement(`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`})),code:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.99994 17.6537L2.34619 11.9999L7.99994 6.34619L9.06919 7.41544L4.46919 12.0154L9.05369 16.5999L7.99994 17.6537ZM15.9999 17.6537L14.9307 16.5844L19.5307 11.9844L14.9462 7.39994L15.9999 6.34619L21.6537 11.9999L15.9999 17.6537Z`,fill:`currentColor`})),strikeThrough:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.15 19.6923C10.9732 19.6923 9.9315 19.359 9.025 18.6923C8.11867 18.0256 7.45525 17.1128 7.03475 15.9538L8.6385 15.2635C8.91667 16.0444 9.3545 16.6867 9.952 17.1905C10.5493 17.6944 11.2923 17.9463 12.1808 17.9463C12.9578 17.9463 13.6744 17.7508 14.3307 17.3598C14.9872 16.9686 15.3155 16.3487 15.3155 15.5C15.3155 15.123 15.2555 14.7968 15.1355 14.5213C15.0157 14.2456 14.8462 13.9885 14.627 13.75H16.677C16.7987 13.9705 16.8932 14.2256 16.9605 14.5153C17.0278 14.8051 17.0615 15.1334 17.0615 15.5C17.0615 16.8372 16.5747 17.8702 15.601 18.599C14.6272 19.3279 13.4768 19.6923 12.15 19.6923ZM2.25 11.75V10.25H21.75V11.75H2.25ZM12.05 4.19629C13.0475 4.19629 13.9123 4.42704 14.6443 4.88854C15.3763 5.35004 15.9673 6.05896 16.4173 7.01529L14.823 7.73079C14.6218 7.26029 14.2978 6.84462 13.851 6.48379C13.4042 6.12279 12.8141 5.94229 12.0808 5.94229C11.2244 5.94229 10.5392 6.16221 10.025 6.60204C9.51083 7.04171 9.264 7.59104 9.2845 8.25004H7.5385C7.50133 7.16421 7.89783 6.21712 8.728 5.40879C9.558 4.60046 10.6653 4.19629 12.05 4.19629Z`,fill:`currentColor`})),superscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 8V6.2115C16.6924 5.95383 16.7786 5.73875 16.9511 5.56625C17.1235 5.39392 17.3385 5.30775 17.5961 5.30775H19.5001V4.38475H16.6924V3.5H19.4809C19.7385 3.5 19.9536 3.58625 20.1261 3.75875C20.2985 3.93108 20.3846 4.14617 20.3846 4.404V5.2885C20.3846 5.54617 20.2985 5.76125 20.1261 5.93375C19.9536 6.10608 19.7385 6.19225 19.4809 6.19225H17.5771V7.1155H20.3846V8H16.6924ZM4.44238 18.5L8.84638 11.6287L4.77713 5.30775H6.74438L9.95963 10.404H10.0214L13.2501 5.30775H15.2329L11.1194 11.6287L15.5579 18.5H13.5751L10.0214 12.9308H9.95963L6.42513 18.5H4.44238Z`,fill:`currentColor`})),subscript:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M16.6924 20.5V18.7115C16.6924 18.4538 16.7786 18.2387 16.9511 18.0662C17.1235 17.8939 17.3385 17.8077 17.5961 17.8077H19.5001V16.8845H16.6924V16H19.4809C19.7385 16 19.9536 16.0863 20.1261 16.2587C20.2985 16.4311 20.3846 16.6461 20.3846 16.9038V17.7885C20.3846 18.0462 20.2985 18.2612 20.1261 18.4337C19.9536 18.6061 19.7385 18.6923 19.4809 18.6923H17.5771V19.6152H20.3846V20.5H16.6924ZM4.44238 18.6923L8.84638 11.8212L4.77713 5.5H6.74438L9.95963 10.5962H10.0214L13.2501 5.5H15.2329L11.1194 11.8212L15.5579 18.6923H13.5751L10.0214 13.123H9.95963L6.42513 18.6923H4.44238Z`,fill:`currentColor`})),format_list_bulleted:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75005V5.25005H20.5V6.75005H9.30775ZM5.1635 19.6635C4.706 19.6635 4.31442 19.5006 3.98875 19.1748C3.66292 18.8491 3.5 18.4575 3.5 18C3.5 17.5425 3.66292 17.151 3.98875 16.8253C4.31442 16.4995 4.706 16.3365 5.1635 16.3365C5.621 16.3365 6.01258 16.4995 6.33825 16.8253C6.66408 17.151 6.827 17.5425 6.827 18C6.827 18.4575 6.66408 18.8491 6.33825 19.1748C6.01258 19.5006 5.621 19.6635 5.1635 19.6635ZM5.1635 13.6635C4.706 13.6635 4.31442 13.5006 3.98875 13.1748C3.66292 12.8491 3.5 12.4575 3.5 12C3.5 11.5425 3.66292 11.151 3.98875 10.8253C4.31442 10.4995 4.706 10.3365 5.1635 10.3365C5.621 10.3365 6.01258 10.4995 6.33825 10.8253C6.66408 11.151 6.827 11.5425 6.827 12C6.827 12.4575 6.66408 12.8491 6.33825 13.1748C6.01258 13.5006 5.621 13.6635 5.1635 13.6635ZM5.1635 7.66355C4.706 7.66355 4.31442 7.50063 3.98875 7.1748C3.66292 6.84913 3.5 6.45755 3.5 6.00005C3.5 5.54255 3.66292 5.15096 3.98875 4.8253C4.31442 4.49946 4.706 4.33655 5.1635 4.33655C5.621 4.33655 6.01258 4.49946 6.33825 4.8253C6.66408 5.15096 6.827 5.54255 6.827 6.00005C6.827 6.45755 6.66408 6.84913 6.33825 7.1748C6.01258 7.50063 5.621 7.66355 5.1635 7.66355Z`,fill:`currentColor`})),format_list_numbered:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 21.5V20.3078H6V19.25H4.5V18.0577H6V17H3.5V15.8077H6.34625C6.58592 15.8077 6.78683 15.8888 6.949 16.051C7.11117 16.2132 7.19225 16.4141 7.19225 16.6538V17.8462C7.19225 18.0859 7.11117 18.2868 6.949 18.449C6.78683 18.6112 6.58592 18.6923 6.34625 18.6923C6.58592 18.6923 6.78683 18.7733 6.949 18.9355C7.11117 19.0977 7.19225 19.2987 7.19225 19.5385V20.6538C7.19225 20.8936 7.11117 21.0946 6.949 21.2568C6.78683 21.4189 6.58592 21.5 6.34625 21.5H3.5ZM3.5 14.8463V12.25C3.5 12.0103 3.58108 11.8093 3.74325 11.647C3.90542 11.4848 4.10642 11.4038 4.34625 11.4038H6V10.3462H3.5V9.15375H6.34625C6.58592 9.15375 6.78683 9.23483 6.949 9.397C7.11117 9.55933 7.19225 9.76033 7.19225 10V11.75C7.19225 11.9897 7.11117 12.1907 6.949 12.353C6.78683 12.5152 6.58592 12.5963 6.34625 12.5963H4.69225V13.6538H7.19225V14.8463H3.5ZM5 8.19225V3.69225H3.5V2.5H6.19225V8.19225H5ZM9.30775 18.75V17.25H20.5V18.75H9.30775ZM9.30775 12.75V11.25H20.5V12.75H9.30775ZM9.30775 6.75V5.25H20.5V6.75H9.30775Z`,fill:`currentColor`})),format_list_checked:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.69425 18.452L2.5 15.2578L3.54425 14.2135L5.66925 16.3385L9.91925 12.0885L10.9635 13.1578L5.69425 18.452ZM5.69425 10.8365L2.5 7.64227L3.54425 6.59802L5.66925 8.72302L9.91925 4.47302L10.9635 5.54227L5.69425 10.8365ZM13.0095 16.5578V15.0578H21.5095V16.5578H13.0095ZM13.0095 8.94227V7.44227H21.5095V8.94227H13.0095Z`,fill:`currentColor`})),link:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8077 16.5385H7.0385C5.78283 16.5385 4.7125 16.096 3.8275 15.211C2.9425 14.3262 2.5 13.256 2.5 12.0005C2.5 10.745 2.9425 9.67471 3.8275 8.78955C4.7125 7.90421 5.78283 7.46155 7.0385 7.46155H10.8077V8.96155H7.0385C6.19867 8.96155 5.48233 9.25805 4.8895 9.85105C4.2965 10.444 4 11.1604 4 12C4 12.8397 4.2965 13.556 4.8895 14.149C5.48233 14.742 6.19867 15.0385 7.0385 15.0385H10.8077V16.5385ZM8.25 12.75V11.25H15.75V12.75H8.25ZM13.1923 16.5385V15.0385H16.9615C17.8013 15.0385 18.5177 14.742 19.1105 14.149C19.7035 13.556 20 12.8397 20 12C20 11.1604 19.7035 10.444 19.1105 9.85105C18.5177 9.25805 17.8013 8.96155 16.9615 8.96155H13.1923V7.46155H16.9615C18.2172 7.46155 19.2875 7.90405 20.1725 8.78905C21.0575 9.67388 21.5 10.744 21.5 11.9995C21.5 13.255 21.0575 14.3254 20.1725 15.2105C19.2875 16.0959 18.2172 16.5385 16.9615 16.5385H13.1923Z`,fill:`currentColor`})),add_photo:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.11537 20.5C4.6182 20.5 4.19262 20.323 3.83862 19.969C3.48462 19.615 3.30762 19.1894 3.30762 18.6922V5.30773C3.30762 4.81056 3.48462 4.38498 3.83862 4.03098C4.19262 3.67698 4.6182 3.49998 5.11537 3.49998H13.8076V4.99998H5.11537C5.02553 4.99998 4.95178 5.02881 4.89412 5.08648C4.83645 5.14415 4.80762 5.2179 4.80762 5.30773V18.6922C4.80762 18.7821 4.83645 18.8558 4.89412 18.9135C4.95178 18.9711 5.02553 19 5.11537 19H18.4999C18.5895 19 18.6633 18.9711 18.7211 18.9135C18.7788 18.8558 18.8076 18.7821 18.8076 18.6922V9.99998H20.3076V18.6922C20.3076 19.1894 20.1306 19.615 19.7766 19.969C19.4226 20.323 18.997 20.5 18.4999 20.5H5.11537ZM17.1921 8.61523V6.61523H15.1921V5.11548H17.1921V3.11548H18.6921V5.11548H20.6921V6.61523H18.6921V8.61523H17.1921ZM6.55762 16.75H17.1344L13.8459 12.3655L11.0384 16.0192L9.03837 13.4615L6.55762 16.75Z`,fill:`currentColor`})),table:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 18.6923V5.30775C3.5 4.81058 3.677 4.385 4.031 4.031C4.385 3.677 4.81058 3.5 5.30775 3.5H18.6923C19.1894 3.5 19.615 3.677 19.969 4.031C20.323 4.385 20.5 4.81058 20.5 5.30775V18.6923C20.5 19.1894 20.323 19.615 19.969 19.969C19.615 20.323 19.1894 20.5 18.6923 20.5H5.30775C4.81058 20.5 4.385 20.323 4.031 19.969C3.677 19.615 3.5 19.1894 3.5 18.6923ZM5 9.077H19V5.30775C19 5.21792 18.9712 5.14417 18.9135 5.0865C18.8558 5.02883 18.7821 5 18.6923 5H5.30775C5.21792 5 5.14417 5.02883 5.0865 5.0865C5.02883 5.14417 5 5.21792 5 5.30775V9.077ZM10.1615 14.0385H13.8385V10.577H10.1615V14.0385ZM10.1615 19H13.8385V15.5385H10.1615V19ZM5 14.0385H8.6615V10.577H5V14.0385ZM15.3385 14.0385H19V10.577H15.3385V14.0385ZM5.30775 19H8.6615V15.5385H5V18.6923C5 18.7821 5.02883 18.8558 5.0865 18.9135C5.14417 18.9712 5.21792 19 5.30775 19ZM15.3385 19H18.6923C18.7821 19 18.8558 18.9712 18.9135 18.9135C18.9712 18.8558 19 18.7821 19 18.6923V15.5385H15.3385V19Z`,fill:`currentColor`})),horizontal_rule:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 12.75V11.25H19.5V12.75H4.5Z`,fill:`currentColor`})),frontmatter:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M4.5 8.75V7.25H8.5V8.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M4.5 14.75V13.25H8.5V14.75H4.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 8.75V7.25H13.5V8.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.5 14.75V13.25H13.5V14.75H9.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 8.75V7.25H18.5V8.75H14.5Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M14.5 14.75V13.25H18.5V14.75H14.5Z`,fill:`currentColor`})),frame_source:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M8.6 15.2443L5.35575 12L8.6 8.75575L9.64425 9.825L7.46925 12L9.64425 14.175L8.6 15.2443ZM15.4 15.2443L14.3558 14.175L16.5307 12L14.3558 9.825L15.4 8.75575L18.6443 12L15.4 15.2443ZM5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V15H5V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H9V20.5H5.30775ZM15 20.5V19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V15H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H15ZM3.5 9V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H9V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V9H3.5ZM19 9V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H15V3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V9H19Z`,fill:`currentColor`})),arrow_drop_down:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M11.9999 14.6537L7.59619 10.25H16.4037L11.9999 14.6537Z`,fill:`currentColor`})),admonition:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12.0001 21.4C11.7654 21.4 11.5385 21.3548 11.3193 21.2645C11.1002 21.174 10.9002 21.0435 10.7193 20.873L3.1271 13.2807C2.9566 13.0999 2.8261 12.8999 2.7356 12.6807C2.64526 12.4616 2.6001 12.2346 2.6001 12C2.6001 11.7653 2.64526 11.5358 2.7356 11.3115C2.8261 11.0871 2.9566 10.8897 3.1271 10.7192L10.7193 3.12698C10.9002 2.94614 11.1002 2.81314 11.3193 2.72798C11.5385 2.64264 11.7654 2.59998 12.0001 2.59998C12.2348 2.59998 12.4643 2.64264 12.6886 2.72798C12.9129 2.81314 13.1103 2.94614 13.2808 3.12698L20.8731 10.7192C21.0539 10.8897 21.1869 11.0871 21.2721 11.3115C21.3574 11.5358 21.4001 11.7653 21.4001 12C21.4001 12.2346 21.3574 12.4616 21.2721 12.6807C21.1869 12.8999 21.0539 13.0999 20.8731 13.2807L13.2808 20.873C13.1103 21.0435 12.9129 21.174 12.6886 21.2645C12.4643 21.3548 12.2348 21.4 12.0001 21.4ZM12.2213 19.8037L19.8039 12.2212C19.8552 12.1699 19.8808 12.0961 19.8808 12C19.8808 11.9038 19.8552 11.8301 19.8039 11.7787L12.2213 4.19623C12.17 4.14489 12.0963 4.11923 12.0001 4.11923C11.9039 4.11923 11.8302 4.14489 11.7788 4.19623L4.19635 11.7787C4.14501 11.8301 4.11935 11.9038 4.11935 12C4.11935 12.0961 4.14501 12.1699 4.19635 12.2212L11.7788 19.8037C11.8302 19.8551 11.9039 19.8807 12.0001 19.8807C12.0963 19.8807 12.17 19.8551 12.2213 19.8037ZM11.2501 13.0865H12.7501V7.47123H11.2501V13.0865ZM12.0001 15.702C12.2258 15.702 12.4168 15.6237 12.5731 15.4672C12.7296 15.3109 12.8078 15.1199 12.8078 14.8942C12.8078 14.6686 12.7296 14.4776 12.5731 14.3212C12.4168 14.1647 12.2258 14.0865 12.0001 14.0865C11.7744 14.0865 11.5834 14.1647 11.4271 14.3212C11.2706 14.4776 11.1923 14.6686 11.1923 14.8942C11.1923 15.1199 11.2706 15.3109 11.4271 15.4672C11.5834 15.6237 11.7744 15.702 12.0001 15.702Z`,fill:`currentColor`})),rich_text:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V5.30775C19 5.23075 18.9679 5.16025 18.9038 5.09625C18.8398 5.03208 18.7692 5 18.6923 5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19ZM6.75 17H17.3268L14 12.3655L11.2308 16.0192L9 13.4615L6.75 17Z`,fill:`currentColor`}),I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M6 12V6.5H9.1925C9.5925 6.5 9.9425 6.65 10.2425 6.95C10.5425 7.25 10.6925 7.6 10.6925 8V8.6925C10.6925 9.03733 10.605 9.32675 10.43 9.56075C10.255 9.79458 10.0168 9.97817 9.7155 10.1115L10.6155 12H9.404L8.504 10.1925H7.1925V12H6ZM9.1925 9H7.1925V7.6925H9.1925C9.26933 7.6925 9.33983 7.7245 9.404 7.7885C9.468 7.85267 9.5 7.92317 9.5 8V8.6925C9.5 8.76933 9.468 8.83983 9.404 8.904C9.33983 8.968 9.26933 9 9.1925 9Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 7H17.5V8.25H12.5V7Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M12.5 9.25H17.5V10.5H12.5V9.25Z`,fill:`currentColor`})),difference:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`10`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`9`,y:`15`,width:`5.5`,height:`1.5`,fill:`currentColor`}),I.createElement(`rect`,{x:`11`,y:`8`,width:`1.5`,height:`5.5`,fill:`currentColor`})),markdown:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H18.6923C19.1974 3.5 19.625 3.675 19.975 4.025C20.325 4.375 20.5 4.80258 20.5 5.30775V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM18.6923 19H5.30775C5.23075 19 5.16025 18.9679 5.09625 18.9038C5.03208 18.8398 5 18.7692 5 18.6923V5.30775C5 5.23075 5.03208 5.16025 5.09625 5.09625C5.16025 5.03208 5.23075 5 5.30775 5H18.6923C18.7692 5 18.8398 5.03208 18.9038 5.09625C18.9679 5.16025 19 5.23075 19 5.30775V18.6923C19 18.7692 18.9679 18.8398 18.9038 18.9038C18.8398 18.9679 18.7692 19 18.6923 19Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M13 15H11.5V11L9.5 14L7.5 11V15H6V8H7.5L9.5 11L11.5 8H13V15Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M15.9921 15.5833L13.2886 12.8797L14.0546 12.1137L15.4504 13.5016V7.99597L16.5336 7.99993V13.5016L17.9296 12.1137L18.6954 12.8797L15.9921 15.5833Z`,fill:`currentColor`})),open_in_new:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5.30775 20.5C4.80258 20.5 4.375 20.325 4.025 19.975C3.675 19.625 3.5 19.1974 3.5 18.6923V5.30775C3.5 4.80258 3.675 4.375 4.025 4.025C4.375 3.675 4.80258 3.5 5.30775 3.5H11.6152V5H5.30775C5.23075 5 5.16025 5.03208 5.09625 5.09625C5.03208 5.16025 5 5.23075 5 5.30775V18.6923C5 18.7692 5.03208 18.8398 5.09625 18.9038C5.16025 18.9679 5.23075 19 5.30775 19H18.6923C18.7692 19 18.8398 18.9679 18.9038 18.9038C18.9679 18.8398 19 18.7692 19 18.6923V12.3848H20.5V18.6923C20.5 19.1974 20.325 19.625 19.975 19.975C19.625 20.325 19.1974 20.5 18.6923 20.5H5.30775ZM9.71925 15.3345L8.6655 14.2808L17.9462 5H14V3.5H20.5V10H19V6.05375L9.71925 15.3345Z`,fill:`currentColor`})),link_off:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M18.8843 16.1038L17.7498 14.9385C18.4228 14.7552 18.9661 14.3946 19.3796 13.8568C19.7931 13.319 19.9998 12.7 19.9998 12C19.9998 11.1604 19.705 10.444 19.1153 9.85105C18.5255 9.25805 17.8139 8.96155 16.9806 8.96155H13.1728V7.46155H16.9806C18.2293 7.46155 19.2947 7.90422 20.1768 8.78955C21.0588 9.67472 21.4998 10.7449 21.4998 12C21.4998 12.8859 21.262 13.6951 20.7863 14.4278C20.3107 15.1606 19.6767 15.7193 18.8843 16.1038ZM15.5806 12.75L14.0806 11.25H15.7306V12.75H15.5806ZM20.1461 22.2538L1.74609 3.8538L2.79984 2.80005L21.1998 21.2L20.1461 22.2538ZM10.8268 16.5386H7.03834C5.78318 16.5386 4.71301 16.0959 3.82784 15.2105C2.94251 14.3254 2.49984 13.2552 2.49984 12C2.49984 10.8885 2.85784 9.91322 3.57384 9.07405C4.28984 8.23505 5.18826 7.72838 6.26909 7.55405H6.49984L7.90759 8.96155H7.03834C6.19851 8.96155 5.48218 9.25805 4.88934 9.85105C4.29634 10.444 3.99984 11.1604 3.99984 12C3.99984 12.8397 4.29634 13.556 4.88934 14.149C5.48218 14.742 6.19851 15.0385 7.03834 15.0385H10.8268V16.5386ZM8.26909 12.75V11.25H10.2113L11.6863 12.75H8.26909Z`,fill:`currentColor`})),edit:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M5 19H6.2615L16.498 8.7635L15.2365 7.502L5 17.7385V19ZM3.5 20.5V17.1155L16.6905 3.93075C16.8417 3.79342 17.0086 3.68733 17.1913 3.6125C17.3741 3.5375 17.5658 3.5 17.7663 3.5C17.9668 3.5 18.1609 3.53558 18.3488 3.60675C18.5367 3.67792 18.7032 3.79108 18.848 3.94625L20.0693 5.18275C20.2244 5.32758 20.335 5.49425 20.401 5.68275C20.467 5.87125 20.5 6.05975 20.5 6.24825C20.5 6.44942 20.4657 6.64133 20.397 6.824C20.3283 7.00683 20.2191 7.17383 20.0693 7.325L6.8845 20.5H3.5ZM15.8562 8.14375L15.2365 7.502L16.498 8.7635L15.8562 8.14375Z`,fill:`currentColor`})),content_copy:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.05775 17.5C8.55258 17.5 8.125 17.325 7.775 16.975C7.425 16.625 7.25 16.1974 7.25 15.6923V4.30775C7.25 3.80258 7.425 3.375 7.775 3.025C8.125 2.675 8.55258 2.5 9.05775 2.5H17.4423C17.9474 2.5 18.375 2.675 18.725 3.025C19.075 3.375 19.25 3.80258 19.25 4.30775V15.6923C19.25 16.1974 19.075 16.625 18.725 16.975C18.375 17.325 17.9474 17.5 17.4423 17.5H9.05775ZM9.05775 16H17.4423C17.5192 16 17.5898 15.9679 17.6538 15.9038C17.7179 15.8398 17.75 15.7692 17.75 15.6923V4.30775C17.75 4.23075 17.7179 4.16025 17.6538 4.09625C17.5898 4.03208 17.5192 4 17.4423 4H9.05775C8.98075 4 8.91025 4.03208 8.84625 4.09625C8.78208 4.16025 8.75 4.23075 8.75 4.30775V15.6923C8.75 15.7692 8.78208 15.8398 8.84625 15.9038C8.91025 15.9679 8.98075 16 9.05775 16ZM5.55775 21C5.05258 21 4.625 20.825 4.275 20.475C3.925 20.125 3.75 19.6974 3.75 19.1923V6.30775H5.25V19.1923C5.25 19.2693 5.28208 19.3398 5.34625 19.4038C5.41025 19.4679 5.48075 19.5 5.55775 19.5H15.4423V21H5.55775Z`,fill:`currentColor`})),more_horiz:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.23096 13.5C5.81846 13.5 5.46537 13.3531 5.17171 13.0592C4.87787 12.7656 4.73096 12.4125 4.73096 12C4.73096 11.5875 4.87787 11.2344 5.17171 10.9408C5.46537 10.6469 5.81846 10.5 6.23096 10.5C6.64346 10.5 6.99662 10.6469 7.29046 10.9408C7.58412 11.2344 7.73096 11.5875 7.73096 12C7.73096 12.4125 7.58412 12.7656 7.29046 13.0592C6.99662 13.3531 6.64346 13.5 6.23096 13.5ZM12.0002 13.5C11.5877 13.5 11.2346 13.3531 10.941 13.0592C10.6471 12.7656 10.5002 12.4125 10.5002 12C10.5002 11.5875 10.6471 11.2344 10.941 10.9408C11.2346 10.6469 11.5877 10.5 12.0002 10.5C12.4127 10.5 12.7658 10.6469 13.0595 10.9408C13.3533 11.2344 13.5002 11.5875 13.5002 12C13.5002 12.4125 13.3533 12.7656 13.0595 13.0592C12.7658 13.3531 12.4127 13.5 12.0002 13.5ZM17.7695 13.5C17.357 13.5 17.0038 13.3531 16.71 13.0592C16.4163 12.7656 16.2695 12.4125 16.2695 12C16.2695 11.5875 16.4163 11.2344 16.71 10.9408C17.0038 10.6469 17.357 10.5 17.7695 10.5C18.182 10.5 18.535 10.6469 18.8287 10.9408C19.1225 11.2344 19.2695 11.5875 19.2695 12C19.2695 12.4125 19.1225 12.7656 18.8287 13.0592C18.535 13.3531 18.182 13.5 17.7695 13.5Z`,fill:`currentColor`})),more_vert:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M12 19.2692C11.5875 19.2692 11.2344 19.1223 10.9408 18.8285C10.6469 18.5348 10.5 18.1817 10.5 17.7692C10.5 17.3567 10.6469 17.0035 10.9408 16.7097C11.2344 16.416 11.5875 16.2692 12 16.2692C12.4125 16.2692 12.7656 16.416 13.0592 16.7097C13.3531 17.0035 13.5 17.3567 13.5 17.7692C13.5 18.1817 13.3531 18.5348 13.0592 18.8285C12.7656 19.1223 12.4125 19.2692 12 19.2692ZM12 13.5C11.5875 13.5 11.2344 13.353 10.9408 13.0592C10.6469 12.7655 10.5 12.4125 10.5 12C10.5 11.5875 10.6469 11.2344 10.9408 10.9407C11.2344 10.6469 11.5875 10.5 12 10.5C12.4125 10.5 12.7656 10.6469 13.0592 10.9407C13.3531 11.2344 13.5 11.5875 13.5 12C13.5 12.4125 13.3531 12.7655 13.0592 13.0592C12.7656 13.353 12.4125 13.5 12 13.5ZM12 7.73071C11.5875 7.73071 11.2344 7.58388 10.9408 7.29021C10.6469 6.99638 10.5 6.64321 10.5 6.23071C10.5 5.81821 10.6469 5.46513 10.9408 5.17146C11.2344 4.87763 11.5875 4.73071 12 4.73071C12.4125 4.73071 12.7656 4.87763 13.0592 5.17146C13.3531 5.46513 13.5 5.81821 13.5 6.23071C13.5 6.64321 13.3531 6.99638 13.0592 7.29021C12.7656 7.58388 12.4125 7.73071 12 7.73071Z`,fill:`currentColor`})),close:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M6.39994 18.6538L5.34619 17.6L10.9462 12L5.34619 6.4L6.39994 5.34625L11.9999 10.9463L17.5999 5.34625L18.6537 6.4L13.0537 12L18.6537 17.6L17.5999 18.6538L11.9999 13.0538L6.39994 18.6538Z`,fill:`currentColor`})),settings:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.69225 21.5L9.3115 18.4538C9.04367 18.3641 8.769 18.2385 8.4875 18.077C8.20617 17.9153 7.95459 17.7422 7.73275 17.5577L4.9115 18.75L2.604 14.75L5.04425 12.9058C5.02125 12.7571 5.00492 12.6077 4.99525 12.4578C4.98559 12.3078 4.98075 12.1583 4.98075 12.0095C4.98075 11.8673 4.98559 11.7228 4.99525 11.576C5.00492 11.4292 5.02125 11.2686 5.04425 11.0943L2.604 9.25L4.9115 5.26925L7.723 6.452C7.96417 6.261 8.22159 6.08633 8.49525 5.928C8.76892 5.76967 9.03784 5.64242 9.302 5.54625L9.69225 2.5H14.3078L14.6885 5.55575C14.9885 5.66475 15.2599 5.792 15.5028 5.9375C15.7458 6.083 15.991 6.2545 16.2385 6.452L19.0885 5.26925L21.396 9.25L18.9173 11.123C18.9531 11.2845 18.9727 11.4355 18.976 11.576C18.9792 11.7163 18.9808 11.8577 18.9808 12C18.9808 12.1358 18.9775 12.274 18.971 12.4145C18.9647 12.5548 18.9417 12.7154 18.902 12.8963L21.3615 14.75L19.0538 18.75L16.2385 17.548C15.991 17.7455 15.7384 17.9202 15.4808 18.072C15.2231 18.224 14.959 18.3481 14.6885 18.4443L14.3078 21.5H9.69225ZM11 20H12.9655L13.325 17.3212C13.8353 17.1879 14.3017 16.9985 14.724 16.753C15.1465 16.5073 15.5539 16.1916 15.9463 15.8057L18.4308 16.85L19.4155 15.15L17.2463 13.5155C17.3296 13.2565 17.3863 13.0026 17.4163 12.7537C17.4464 12.5051 17.4615 12.2538 17.4615 12C17.4615 11.7397 17.4464 11.4884 17.4163 11.2463C17.3863 11.0039 17.3296 10.7564 17.2463 10.5038L19.4345 8.85L18.45 7.15L15.9365 8.2095C15.6018 7.85183 15.2009 7.53583 14.7338 7.2615C14.2664 6.98717 13.7937 6.79292 13.3155 6.67875L13 4H11.0155L10.6845 6.66925C10.1743 6.78975 9.70325 6.97433 9.27125 7.223C8.83909 7.47183 8.42684 7.79233 8.0345 8.1845L5.55 7.15L4.5655 8.85L6.725 10.4595C6.64167 10.6968 6.58334 10.9437 6.55 11.2C6.51667 11.4563 6.5 11.7262 6.5 12.0095C6.5 12.2698 6.51667 12.525 6.55 12.775C6.58334 13.025 6.6385 13.2718 6.7155 13.5155L4.5655 15.15L5.55 16.85L8.025 15.8C8.4045 16.1897 8.81025 16.5089 9.24225 16.7578C9.67442 17.0064 10.152 17.1974 10.675 17.3307L11 20ZM12.0115 15C12.8435 15 13.5515 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.168 14.7195 10.46 14.1355 9.876C13.5515 9.292 12.8435 9 12.0115 9C11.1692 9 10.4586 9.292 9.87975 9.876C9.30092 10.46 9.0115 11.168 9.0115 12C9.0115 12.832 9.30092 13.54 9.87975 14.124C10.4586 14.708 11.1692 15 12.0115 15Z`,fill:`currentColor`})),delete_big:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),delete_small:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M7.30775 20.5C6.80908 20.5 6.38308 20.3234 6.02975 19.9702C5.67658 19.6169 5.5 19.1909 5.5 18.6922V5.99998H4.5V4.49998H9V3.61548H15V4.49998H19.5V5.99998H18.5V18.6922C18.5 19.1974 18.325 19.625 17.975 19.975C17.625 20.325 17.1974 20.5 16.6923 20.5H7.30775ZM17 5.99998H7V18.6922C7 18.7821 7.02883 18.8558 7.0865 18.9135C7.14417 18.9711 7.21792 19 7.30775 19H16.6923C16.7692 19 16.8398 18.9679 16.9038 18.9037C16.9679 18.8397 17 18.7692 17 18.6922V5.99998ZM9.404 17H10.9037V7.99998H9.404V17ZM13.0962 17H14.596V7.99998H13.0962V17Z`,fill:`currentColor`})),format_align_center:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM7.5 16.625V15.125H16.5V16.625H7.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM7.5 8.875V7.375H16.5V8.875H7.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 20.5V19H20.5V20.5H3.5ZM3.5 16.625V15.125H14.5V16.625H3.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM3.5 8.875V7.375H14.5V8.875H3.5ZM3.5 5V3.5H20.5V5H3.5Z`,fill:`currentColor`})),format_align_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M3.5 5V3.5H20.5V5H3.5ZM9.5 8.875V7.375H20.5V8.875H9.5ZM3.5 12.75V11.25H20.5V12.75H3.5ZM9.5 16.625V15.125H20.5V16.625H9.5ZM3.5 20.5V19H20.5V20.5H3.5Z`,fill:`currentColor`})),add_row:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M4.025 10.2077C4.375 9.85775 4.80258 9.68275 5.30775 9.68275H6.5V11.1827H5.30775C5.21792 11.1827 5.14417 11.2116 5.0865 11.2693C5.02883 11.3269 5 11.4007 5 11.4905V16.1923C5 16.2821 5.02883 16.3558 5.0865 16.4135C5.14417 16.4712 5.21792 16.5 5.30775 16.5H18.6923C18.7821 16.5 18.8558 16.4712 18.9135 16.4135C18.9712 16.3558 19 16.2821 19 16.1923V11.4905C19 11.4007 18.9712 11.3269 18.9135 11.2693C18.8558 11.2116 18.7821 11.1827 18.6923 11.1827H17.6923V9.68275H18.6923C19.1974 9.68275 19.625 9.85775 19.975 10.2077C20.325 10.5577 20.5 10.9853 20.5 11.4905V16.1923C20.5 16.6974 20.325 17.125 19.975 17.475C19.625 17.825 19.1974 18 18.6923 18H5.30775C4.80258 18 4.375 17.825 4.025 17.475C3.675 17.125 3.5 16.6974 3.5 16.1923V11.4905C3.5 10.9853 3.675 10.5577 4.025 10.2077Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M11.3848 9.68275V7.5H12.8848V9.68275H15V11.1827H12.8848V13.2307H11.3848V11.1827H9.26925V9.68275H11.3848Z`,fill:`currentColor`})),add_column:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M9.70775 4.025C9.35775 4.375 9.18275 4.80258 9.18275 5.30775V6.5H10.6827V5.30775C10.6827 5.21792 10.7116 5.14417 10.7693 5.0865C10.8269 5.02883 10.9007 5 10.9905 5H15.6923C15.7821 5 15.8558 5.02883 15.9135 5.0865C15.9712 5.14417 16 5.21792 16 5.30775V18.6923C16 18.7821 15.9712 18.8558 15.9135 18.9135C15.8558 18.9712 15.7821 19 15.6923 19H10.9905C10.9007 19 10.8269 18.9712 10.7693 18.9135C10.7116 18.8558 10.6827 18.7821 10.6827 18.6923V17.6923H9.18275V18.6923C9.18275 19.1974 9.35775 19.625 9.70775 19.975C10.0577 20.325 10.4853 20.5 10.9905 20.5H15.6923C16.1974 20.5 16.625 20.325 16.975 19.975C17.325 19.625 17.5 19.1974 17.5 18.6923V5.30775C17.5 4.80258 17.325 4.375 16.975 4.025C16.625 3.675 16.1974 3.5 15.6923 3.5H10.9905C10.4853 3.5 10.0577 3.675 9.70775 4.025Z`,fill:`currentColor`}),I.createElement(`path`,{d:`M9.18275 11.3848H7V12.8848H9.18275V15H10.6827V12.8848H12.7307V11.3848H10.6827V9.26925H9.18275V11.3848Z`,fill:`currentColor`})),insert_col_left:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M13.0001 20.1152H8.67713H8.75388H8.69238H13.0001ZM7.19238 19.8075C7.19238 20.3127 7.36738 20.7402 7.71738 21.0902C8.06738 21.4402 8.49497 21.6152 9.00013 21.6152H12.6924C13.1975 21.6152 13.6251 21.4402 13.9751 21.0902C14.3251 20.7402 14.5001 20.3127 14.5001 19.8075V10.423H13.0001V19.8075C13.0001 19.8973 12.9713 19.9711 12.9136 20.0287C12.856 20.0864 12.7822 20.1152 12.6924 20.1152H9.00013C8.9103 20.1152 8.83655 20.0864 8.77888 20.0287C8.72122 19.9711 8.69238 19.8973 8.69238 19.8075V4.69223C8.26422 4.74357 7.90722 4.93299 7.62138 5.26048C7.33538 5.58798 7.19238 5.97548 7.19238 6.42298V19.8075ZM13.0001 2.49998V4.61523H10.8846V6.11523H13.0001V8.23073H14.5001V6.11523H16.6154V4.61523H14.5001V2.49998H13.0001Z`,fill:`currentColor`})),insert_row_above:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 9.99987V14.3229V14.2461V14.3076V9.99987ZM19.8075 15.8076C20.3127 15.8076 20.7402 15.6326 21.0902 15.2826C21.4402 14.9326 21.6152 14.505 21.6152 13.9999V10.3076C21.6152 9.80245 21.4402 9.37487 21.0902 9.02487C20.7402 8.67487 20.3127 8.49987 19.8075 8.49987H10.423V9.99987H19.8075C19.8973 9.99987 19.9711 10.0287 20.0287 10.0864C20.0864 10.144 20.1152 10.2178 20.1152 10.3076V13.9999C20.1152 14.0897 20.0864 14.1635 20.0287 14.2211C19.9711 14.2788 19.8973 14.3076 19.8075 14.3076H4.69223C4.74357 14.7358 4.93299 15.0928 5.26048 15.3786C5.58798 15.6646 5.97548 15.8076 6.42298 15.8076H19.8075ZM2.49998 9.99987H4.61523V12.1154H6.11523V9.99987H8.23073V8.49987H6.11523V6.38462H4.61523V8.49987H2.49998V9.99987Z`,fill:`currentColor`})),insert_row_below:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M20.1152 14.1924V9.86939V9.94614V9.88464V14.1924ZM19.8075 8.38464C20.3127 8.38464 20.7402 8.55964 21.0902 8.90964C21.4402 9.25964 21.6152 9.68723 21.6152 10.1924V13.8846C21.6152 14.3898 21.4402 14.8174 21.0902 15.1674C20.7402 15.5174 20.3127 15.6924 19.8075 15.6924H10.423V14.1924H19.8075C19.8973 14.1924 19.9711 14.1636 20.0287 14.1059C20.0864 14.0482 20.1152 13.9745 20.1152 13.8846V10.1924C20.1152 10.1026 20.0864 10.0288 20.0287 9.97114C19.9711 9.91348 19.8973 9.88464 19.8075 9.88464H4.69223C4.74357 9.45648 4.93299 9.09948 5.26048 8.81364C5.58798 8.52764 5.97548 8.38464 6.42298 8.38464H19.8075ZM2.49998 14.1924H4.61523V12.0769H6.11523V14.1924H8.23073V15.6924H6.11523V17.8076H4.61523V15.6924H2.49998V14.1924Z`,fill:`currentColor`})),insert_col_right:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M10.8075 20.1152H15.1305H15.0537H15.1152H10.8075ZM16.6152 19.8075C16.6152 20.3127 16.4402 20.7402 16.0902 21.0902C15.7402 21.4402 15.3127 21.6152 14.8075 21.6152H11.1152C10.6101 21.6152 10.1825 21.4402 9.83248 21.0902C9.48248 20.7402 9.30748 20.3127 9.30748 19.8075V10.423H10.8075V19.8075C10.8075 19.8973 10.8363 19.9711 10.894 20.0287C10.9517 20.0864 11.0254 20.1152 11.1152 20.1152H14.8075C14.8973 20.1152 14.9711 20.0864 15.0287 20.0287C15.0864 19.9711 15.1152 19.8973 15.1152 19.8075V4.69223C15.5434 4.74357 15.9004 4.93299 16.1862 5.26048C16.4722 5.58798 16.6152 5.97548 16.6152 6.42298V19.8075ZM10.8075 2.49998V4.61523H12.923V6.11523H10.8075V8.23073H9.30748V6.11523H7.19223V4.61523H9.30748V2.49998H10.8075Z`,fill:`currentColor`})),check:I.createElement(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},I.createElement(`path`,{d:`M9.54983 17.6537L4.21533 12.3192L5.28433 11.25L9.54983 15.5155L18.7153 6.34998L19.7843 7.41923L9.54983 17.6537Z`,fill:`currentColor`}))},X={editorRoot:`_editorRoot_eoiyl_53`,editorWrapper:`_editorWrapper_eoiyl_155`,toolbarRoot:`_toolbarRoot_eoiyl_162`,readOnlyToolbarRoot:`_readOnlyToolbarRoot_eoiyl_189`,toolbarToggleItem:`_toolbarToggleItem_eoiyl_208`,toolbarGroupOfGroups:`_toolbarGroupOfGroups_eoiyl_219`,toolbarToggleSingleGroup:`_toolbarToggleSingleGroup_eoiyl_224`,toolbarButton:`_toolbarButton_eoiyl_239`,activeToolbarButton:`_activeToolbarButton_eoiyl_275`,toolbarButtonDropdownContainer:`_toolbarButtonDropdownContainer_eoiyl_286`,selectContainer:`_selectContainer_eoiyl_288`,selectItem:`_selectItem_eoiyl_301`,toolbarButtonSelectTrigger:`_toolbarButtonSelectTrigger_eoiyl_307`,selectTrigger:`_selectTrigger_eoiyl_308`,selectDropdownArrow:`_selectDropdownArrow_eoiyl_373`,contentEditable:`_contentEditable_eoiyl_379`,codeMirrorWrapper:`_codeMirrorWrapper_eoiyl_391`,codeMirrorToolbar:`_codeMirrorToolbar_eoiyl_408`,propertyPanelTitle:`_propertyPanelTitle_eoiyl_430`,propertyEditorTable:`_propertyEditorTable_eoiyl_438`,iconButton:`_iconButton_eoiyl_456`,readOnlyColumnCell:`_readOnlyColumnCell_eoiyl_461`,buttonsFooter:`_buttonsFooter_eoiyl_474`,propertyEditorInput:`_propertyEditorInput_eoiyl_480`,primaryButton:`_primaryButton_eoiyl_506`,secondaryButton:`_secondaryButton_eoiyl_507`,smallButton:`_smallButton_eoiyl_522`,dialogForm:`_dialogForm_eoiyl_534`,linkDialogEditForm:`_linkDialogEditForm_eoiyl_540`,linkDialogInputContainer:`_linkDialogInputContainer_eoiyl_548`,linkDialogInputWrapper:`_linkDialogInputWrapper_eoiyl_554`,linkDialogInput:`_linkDialogInput_eoiyl_548`,linkDialogAnchor:`_linkDialogAnchor_eoiyl_586`,linkDialogPopoverContent:`_linkDialogPopoverContent_eoiyl_600`,tableColumnEditorPopoverContent:`_tableColumnEditorPopoverContent_eoiyl_601`,dialogContent:`_dialogContent_eoiyl_602`,largeDialogContent:`_largeDialogContent_eoiyl_614`,dialogTitle:`_dialogTitle_eoiyl_624`,visuallyHidden:`_visuallyHidden_eoiyl_631`,dialogCloseButton:`_dialogCloseButton_eoiyl_644`,popoverContent:`_popoverContent_eoiyl_651`,popoverArrow:`_popoverArrow_eoiyl_663`,linkDialogPreviewAnchor:`_linkDialogPreviewAnchor_eoiyl_667`,tooltipTrigger:`_tooltipTrigger_eoiyl_690`,tooltipContent:`_tooltipContent_eoiyl_694`,actionButton:`_actionButton_eoiyl_708`,primaryActionButton:`_primaryActionButton_eoiyl_715`,tableEditor:`_tableEditor_eoiyl_727`,toolCell:`_toolCell_eoiyl_738`,tableColumnEditorTrigger:`_tableColumnEditorTrigger_eoiyl_757`,addRowButton:`_addRowButton_eoiyl_759`,addColumnButton:`_addColumnButton_eoiyl_760`,tableColumnEditorToolbar:`_tableColumnEditorToolbar_eoiyl_802`,toggleGroupRoot:`_toggleGroupRoot_eoiyl_815`,tableToolsColumn:`_tableToolsColumn_eoiyl_833`,leftAlignedCell:`_leftAlignedCell_eoiyl_842`,rightAlignedCell:`_rightAlignedCell_eoiyl_846`,centeredCell:`_centeredCell_eoiyl_850`,dialogOverlay:`_dialogOverlay_eoiyl_883`,focusedImage:`_focusedImage_eoiyl_929`,imageWrapper:`_imageWrapper_eoiyl_933`,editImageToolbar:`_editImageToolbar_eoiyl_946`,editImageButton:`_editImageButton_eoiyl_950`,inlineEditor:`_inlineEditor_eoiyl_956`,blockEditor:`_blockEditor_eoiyl_965`,nestedEditor:`_nestedEditor_eoiyl_974`,genericComponentName:`_genericComponentName_eoiyl_993`,diffSourceToggleWrapper:`_diffSourceToggleWrapper_eoiyl_999`,ggDiffSourceToggle:`_ggDiffSourceToggle_eoiyl_1007`,diffSourceToggle:`_diffSourceToggle_eoiyl_999`,selectWithLabel:`_selectWithLabel_eoiyl_1025`,toolbarTitleMode:`_toolbarTitleMode_eoiyl_1040`,imageControlWrapperResizing:`_imageControlWrapperResizing_eoiyl_1045`,imageResizer:`_imageResizer_eoiyl_1049`,imageResizerN:`_imageResizerN_eoiyl_1058`,imageResizerNe:`_imageResizerNe_eoiyl_1064`,imageResizerE:`_imageResizerE_eoiyl_1070`,imageResizerSe:`_imageResizerSe_eoiyl_1076`,imageResizerS:`_imageResizerS_eoiyl_1076`,imageResizerSw:`_imageResizerSw_eoiyl_1088`,imageResizerW:`_imageResizerW_eoiyl_1094`,imageResizerNw:`_imageResizerNw_eoiyl_1100`,imagePlaceholder:`_imagePlaceholder_eoiyl_1106`,imageDimensionsContainer:`_imageDimensionsContainer_eoiyl_1114`,placeholder:`_placeholder_eoiyl_1119`,rootContentEditableWrapper:`_rootContentEditableWrapper_eoiyl_1132`,downshiftInputWrapper:`_downshiftInputWrapper_eoiyl_1142`,downshiftInput:`_downshiftInput_eoiyl_1142`,downshiftAutocompleteContainer:`_downshiftAutocompleteContainer_eoiyl_1173`,textInput:`_textInput_eoiyl_1219`,multiFieldForm:`_multiFieldForm_eoiyl_1227`,formField:`_formField_eoiyl_1233`,markdownParseError:`_markdownParseError_eoiyl_1244`,popupContainer:`_popupContainer_eoiyl_1253`,inputSizer:`_inputSizer_eoiyl_1258`};function vk(e){try{let t=e.anchor,n=e.focus,r=e.anchor.getNode(),i=e.focus.getNode();return r===i?r:e.isBackward()?fm(n)?r:i:fm(t)?r:i}catch{return null}}var yk=[`transform`,`perspective`,`filter`,`backdrop-filter`,`contain`,`container-type`],bk=[`layout`,`paint`,`strict`,`content`];function xk(e){let t=e?.parentElement;for(;t;){let e=window.getComputedStyle(t),n=e.willChange.split(`,`).map(e=>e.trim()).some(e=>yk.includes(e));if(e.transform!==`none`||e.perspective!==`none`||e.filter!==`none`||e.backdropFilter!==`none`||bk.includes(e.contain)||e.containerType!==`normal`||e.contentVisibility===`auto`||n)return t;t=t.parentElement}return null}function Sk(e,t){let n=xk(t);if(n){let t=n.getBoundingClientRect();return{top:Math.round(e.top-t.top),left:Math.round(e.left-t.left),width:Math.round(e.width),height:Math.round(e.height)}}return{top:Math.round(e.top),left:Math.round(e.left),width:Math.round(e.width),height:Math.round(e.height)}}function Ck(e,t){let n=e.getRootElement(),r=e.getElementByKey(t);return n===null||r===null?null:Sk(r.getBoundingClientRect(),n)}function wk(e){let t=U(),n=window.getSelection(),r=document.activeElement,i=e.getRootElement();if(t!==null&&n!==null&&i!==null&&i.contains(n.anchorNode)&&e.isEditable()){let e=n.getRangeAt(0),t;if(n.isCollapsed){let e=n.anchorNode;e?.nodeType==3&&(e=e.parentNode),t=e.getBoundingClientRect(),t.width=0}else if(n.anchorNode===i){let e=i;for(;e.firstElementChild!=null;)e=e.firstElementChild;t=e.getBoundingClientRect()}else t=e.getBoundingClientRect();return Sk(t,i)}return r?.className,null}function Tk(e,t){let n=null,r=[],i=``;e.getEditorState().read(()=>{let t=U();!t||H(t)&&t.isCollapsed()||t.getNodes().length===0||(r=a_(e,t).nodes,r.length>0&&(n=hu()))},{editor:e});let a=n;if(!a||r.length===0)return``;let o={error:void 0,failed:!1};if(a.update(()=>{try{let e=Yu(),n=o_(r),a=lu(),o=()=>{a.isEmpty()||(e.append(a),a=lu())};for(let t of n)t.isInline()?a.append(t):(o(),e.append(t));o(),i=LC({root:e,...t})}catch(e){o.failed=!0,o.error=e}},{discrete:!0,skipTransforms:!0}),o.failed)throw o.error;return i.replace(/\n+$/u,``)}var Ek=a(gk(),1),Dk=({children:e})=>{let t=kr(ND);return I.createElement(ak,{initialEditor:t},e)},Ok=()=>{let e=ik(),t=jr(fO),n=jr(CO),r=e=>{n(e),t(e?{current:e}:null)},[i,a,o,s,c,l,u]=Ar(FD,ID,PO,IO,BO,RD,RO);return I.createElement(I.Fragment,null,s.map((e,t)=>I.createElement(e,{key:t})),I.createElement(Mk,{wrappers:c},I.createElement(`div`,{className:(0,Ek.default)(X.rootContentEditableWrapper,`mdxeditor-root-contenteditable`)},I.createElement(mk,{contentEditable:I.createElement(`div`,{ref:r,className:`mdxeditor-contenteditable-wrapper`},I.createElement(gD,{className:(0,Ek.default)(X.contentEditable,i),ariaLabel:e(`contentArea.editableMarkdown`,`editable markdown`),spellCheck:a})),placeholder:I.createElement(`div`,{className:(0,Ek.default)(X.contentEditable,X.placeholder,i)},I.createElement(`p`,null,l)),ErrorBoundary:bD}))),o.map((e,t)=>I.createElement(e,{key:t})),u.map((e,t)=>I.createElement(e,{key:t})))},kk={listItemIndent:`one`},Ak=e=>_k[e];function jk(e,t,n={}){let r=t;for(let[e,t]of Object.entries(n))r=r.replaceAll(`{{${e}}}`,String(t));return r}var Mk=({wrappers:e,children:t})=>{if(e.length===0)return I.createElement(I.Fragment,null,t);let n=e[0];return I.createElement(n,null,I.createElement(Mk,{wrappers:e.slice(1)},t))},Nk=({children:e,className:t,overlayContainer:n})=>{let r=I.useRef(null),i=I.useRef(null),a=jr(uO),o=jr(dO);return I.useEffect(()=>{let e=document.createElement(`div`);return e.classList.add(`mdxeditor-popup-container`,X.editorRoot,X.popupContainer,...(t??``).trim().split(` `).filter(Boolean)),(n??document.body).appendChild(e),r.current=e,a(r),o(i),()=>{e.remove()}},[t,r,n,a,o]),I.createElement(`div`,{className:(0,Ek.default)(`mdxeditor`,X.editorRoot,X.editorWrapper,t),ref:i},e)};function Pk(e){return{getMarkdown:()=>{let t=e.getValue(ZO);return t===`source`||t===`diff`?e.getValue(QO):e.getValue(qD)},setMarkdown:t=>{e.pub(bO,t)},insertMarkdown:t=>{e.pub(xO,t)},focus:(t,n)=>{var r;(r=e.getValue(ND))==null||r.focus(t,n)},getContentEditableHTML:()=>e.getValue(fO)?.current.innerHTML??``,getSelectionMarkdown:()=>{let t=e.getValue(ZO);if(t===`source`||t===`diff`)return``;let n=e.getValue(PD);return n?Tk(n,{visitors:e.getValue(tO),toMarkdownExtensions:e.getValue(nO),toMarkdownOptions:e.getValue(rO),jsxComponentDescriptors:e.getValue(aO),jsxIsAvailable:e.getValue(iO)}):``}}}var Fk=({onReady:e,onDispose:t})=>{let n=Or(),r=I.useMemo(()=>Pk(n),[n]);return I.useLayoutEffect(()=>(e(r),()=>{t(r)}),[r,t,e]),null},Ik=I.forwardRef((e,t)=>{let n=I.useRef(null),r=I.useRef(null),i=I.useRef([]),a=I.useRef(e.trim===!1?e.markdown:e.markdown.trim()),o=I.useCallback(e=>{let t=n.current;t&&r.current===null?e(t):i.current.push(e)},[]),s=I.useMemo(()=>({getMarkdown:()=>n.current?.getMarkdown()??a.current,setMarkdown:e=>{a.current=e,o(t=>{t.setMarkdown(e)})},insertMarkdown:e=>{o(t=>{t.insertMarkdown(e)})},focus:(e,t)=>{o(n=>{n.focus(e,t)})},getContentEditableHTML:()=>n.current?.getContentEditableHTML()??``,getSelectionMarkdown:()=>n.current?.getSelectionMarkdown()??``}),[o]),c=I.useCallback(e=>{if(n.current=e,r.current===e)return;if(i.current.length===0){a.current=e.getMarkdown();return}r.current=e;let t=()=>{if(n.current!==e){r.current===e&&(r.current=null);return}let o=i.current.shift();if(!o){r.current=null,a.current=e.getMarkdown();return}o(e),queueMicrotask(t)};t()},[]),l=I.useCallback(e=>{n.current===e&&(a.current=e.getMarkdown(),n.current=null)},[]);return I.useImperativeHandle(t,()=>s,[s]),I.createElement(Br,{plugins:[rk({contentEditableClassName:e.contentEditableClassName??``,spellCheck:e.spellCheck??!0,initialMarkdown:e.markdown,onChange:e.onChange??CE,onBlur:e.onBlur??CE,toMarkdownOptions:e.toMarkdownOptions??kk,autoFocus:e.autoFocus??!1,placeholder:e.placeholder??``,readOnly:!!e.readOnly,iconComponentFor:e.iconComponentFor??Ak,suppressHtmlProcessing:e.suppressHtmlProcessing??!1,onError:e.onError??CE,translation:e.translation??jk,trim:e.trim??!0,lexicalTheme:e.lexicalTheme,...`editorState`in e?{editorState:e.editorState}:{},suppressSharedHistory:e.suppressSharedHistory??!1,additionalLexicalNodes:e.additionalLexicalNodes??[],lexicalEditorNamespace:e.lexicalEditorNamespace??`MDXEditor`}),...e.plugins??[]]},I.createElement(Nk,{className:e.className,overlayContainer:e.overlayContainer},I.createElement(Dk,null,I.createElement(Ok,null))),I.createElement(Fk,{onReady:c,onDispose:l}))}),Lk=typeof window<`u`&&window.document.createElement!==void 0&&(()=>{let e=navigator.userAgentData?.platform;return e?/mac/i.test(e):/Mac|iPod|iPhone|iPad/.test(navigator.userAgent)})();function Rk(e,t){return Lk?e:t}var zk={testLexicalNode:P_,visitLexicalNode:({lexicalNode:e,actions:t})=>{let n=parseInt(e.getTag()[1],10);t.addAndStepInto(`heading`,{depth:n})}},Bk={testNode:`heading`,visitNode:function({mdastNode:e,actions:t}){t.addAndStepInto(N_(`h${e.depth}`))}},Vk=[`Digit0`,`Digit1`,`Digit2`,`Digit3`,`Digit4`,`Digit5`,`Digit6`],Hk=[1,2,3,4,5,6],Uk={Digit1:1,Digit2:2,Digit3:3,Digit4:4,Digit5:5,Digit6:6},Wk=R(Hk,e=>{e.pub(jO,t=>t.registerCommand(Eo,n=>{let{code:r,ctrlKey:i,metaKey:a,altKey:o}=n;return Vk.includes(r)&&Rk(a,i)&&o?(n.preventDefault(),t.update(()=>{if(r===`Digit0`)e.pub(JO,()=>lu());else{let t=e.getValue(Wk),n=Uk[r];t.includes(n)&&e.pub(JO,()=>N_(`h${n}`))}}),!0):!1},1))}),Gk=zr({init(e,t){e.pubIn({[ek]:`headings`,[mO]:Bk,[pO]:k_,[_O]:zk}),e.pub(Wk,t?.allowedHeadingLevels??Hk)},update(e,t){e.pub(Wk,t?.allowedHeadingLevels??Hk)}});function Kk(e,t){return e.read(`latest`,()=>{let e=Hu(t);return e!==null&&e.isSelected()})}function qk(e){let[t]=sD(),[n,r]=(0,I.useState)(()=>Kk(t,e));return(0,I.useEffect)(()=>{let n=!0,i=t.registerUpdateListener(()=>{n&&r(Kk(t,e))});return()=>{n=!1,i()}},[t,e]),[n,(0,I.useCallback)(n=>{t.update(()=>{let t=U();Cc(t)||(t=Kc(),Xu(t)),Cc(t)&&(n?t.add(e):t.delete(e))})},[t,e]),(0,I.useCallback)(()=>{t.update(()=>{let e=U();Cc(e)&&e.clear()})},[t])]}function Jk({nodeKey:e}){let[t]=sD(),[n,r,i]=qk(e);return(0,I.useEffect)(()=>am(t.registerCommand(co,a=>{let o=t.getElementByKey(e);return Qd(a)===o&&(a.shiftKey||i(),r(!n),!0)},1)),[i,t,n,e,r]),(0,I.useEffect)(()=>{let r=t.getElementByKey(e),i=t._config.theme.hrSelected??`selected`;r!==null&&(n?rm(r,i):im(r,i))},[t,n,e]),null}var Yk=class e extends Lh{static getType(){return`horizontalrule`}static clone(t){return new e(t.__key)}static importJSON(e){return Zk().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Xk,priority:0})}}decorate(){return(0,L.jsx)(Jk,{nodeKey:this.__key})}};function Xk(){return{node:Zk()}}function Zk(){return jd(new Yk)}function Qk(){let[e]=sD();return(0,I.useEffect)(()=>e.registerCommand(Ih,e=>{let t=U();return H(t)?(t.focus.getNode()!==null&&Tm(Zk()),!0):!1},0),[e]),null}var $k={testLexicalNode:e=>e instanceof Yk,visitLexicalNode({actions:e}){e.addAndStepInto(`thematicBreak`)}},eA={testNode:`thematicBreak`,visitNode({actions:e}){e.addAndStepInto(Zk())}},tA=Er(e=>{e.sub(e.pipe(tA,Nr(PD)),([,e])=>{e?.dispatchCommand(Ih,void 0)})}),nA=zr({init(e){e.pubIn({[ek]:`thematicBreak`,[mO]:eA,[pO]:Yk,[_O]:$k,[FO]:Qk})}}),rA={testNode:`list`,visitNode:function({mdastNode:e,lexicalParent:t,actions:n}){let r=_v(e.children.some(e=>typeof e.checked==`boolean`)?`check`:e.ordered?`number`:`bullet`);if(q(t)){let e=fv();e.append(r),t.insertAfter(e)}else t.append(r);n.visitChildren(e,r)}},iA={testNode:`listItem`,visitNode({mdastNode:e,actions:t,lexicalParent:n}){let r=n.getListType()===`check`?e.checked??!1:void 0;t.addAndStepInto(fv(r))}},aA={testLexicalNode:J,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`list`,{ordered:e.getListType()===`number`,spread:!1})}},oA={testLexicalNode:q,visitLexicalNode:({lexicalNode:e,mdastParent:t,actions:n})=>{let r=e.getChildren(),i=r[0];if(r.length===1&&J(i)){let r=t.children.at(-1);r?n.visitChildren(e,r):n.visitChildren(i,t)}else{let r=e.getParent(),i=n.appendToParent(t,{type:`listItem`,checked:r.getListType()===`check`?!!e.getChecked():void 0,spread:!1,children:[]}),a=null;for(let t of e.getChildren())V(t)||ru(t)||t.isInline()&&(W(t)||Gl(t))?(a??=n.appendToParent(i,{type:`paragraph`,children:[]}),n.visit(t,a)):(a=null,n.visit(t,i))}}};function sA({maxIndent:e,$canIndent:t}){let[n]=sD();return(0,I.useEffect)(()=>Uh(n,e,t),[n,e,t]),null}function cA({disableTakeFocusOnClick:e=!1}){let[t]=sD();return(0,I.useEffect)(()=>yv(t,{disableTakeFocusOnClick:e}),[t,e]),null}function lA({hasStrictIndent:e=!1,shouldPreserveNumbering:t=!1}){let[n]=sD();return(0,I.useEffect)(()=>{if(!n.hasNodes([pv,cv]))throw Error(`ListPlugin: ListNode and/or ListItemNode not registered on editor`)},[n]),(0,I.useEffect)(()=>am(Ov(n,{restoreNumbering:t}),e?kv(n):()=>{}),[n,e,t]),function(e){(0,I.useEffect)(()=>Ov(e),[e])}(n),null}var uA={name:`tasklistCheck`,tokenize:fA};function dA(){return{text:{91:uA}}}function fA(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return zv(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Bv(r)?e.check({tokenize:pA},t,n)(r):n(r)}}function pA(e,t,n){return Nb(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function mA(){return{exit:{taskListCheckValueChecked:gA,taskListCheckValueUnchecked:gA,paragraph:_A}}}function hA(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:vA}}}function gA(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function _A(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function vA(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=AS.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}var yA=new Map([[`number`,Ev],[`bullet`,Tv],[`check`,vv],[``,Dv]]),bA=R(``,e=>{e.sub(e.pipe(GD,Nr(PD)),([t,n])=>{if(!t||!n)return;let r=t.anchor.getNode(),i=r.getKey()===`root`?r:Af(r,e=>{let t=e.getParent();return t!==null&&kd(t)});i??=r.getTopLevelElementOrThrow();let a=i.getKey();if(n.getElementByKey(a)!==null){if(J(i)){let t=Cm(r,pv),n=t?t.getListType():i.getListType();e.pub(bA,n)}else e.pub(bA,``)}})}),xA=Tr(e=>{e.sub(e.pipe(xA,Nr(PD)),([e,t])=>{t?.dispatchCommand(yA.get(e),void 0)})}),SA=zr({init(e){var t;(t=e.getValue(ND))==null||t.registerCommand(Bo,()=>!wA(7),4),e.pubIn({[ek]:`lists`,[gO]:mA(),[hO]:dA(),[mO]:[rA,iA],[pO]:[cv,pv],[_O]:[aA,oA],[vO]:hA(),[FO]:[sA,lA,cA],[HO]:[sA,lA,cA]})}});function CA(e){let t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(e=>W(e)?e:e.getParentOrThrow()))}function wA(e){let t=U();if(!H(t))return!1;let n=CA(t),r=0;for(let e of n)if(J(e))r=Math.max(J_(e)+1,r);else if(q(e)){let t=e.getParent();if(t?.getChildren().length===1){let e=t.getParent();if(q(e)&&e.getChildren().length===1)return!1}if(!J(t))throw Error(`ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.`);r=Math.max(J_(t)+1,r)}return r<=e}function TA(e){return e.length}function EA(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||TA,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=DA(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=OA(r[d]);else{let e=OA(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
69
+ `)}function DA(e){return e==null?``:String(e)}function OA(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function kA(){return{enter:{table:AA,tableData:PA,tableHeader:PA,tableRow:MA},exit:{codeText:FA,table:jA,tableData:NA,tableHeader:NA,tableRow:NA}}}function AA(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function jA(e){this.exit(e),this.data.inTable=void 0}function MA(e){this.enter({type:`tableRow`,children:[]},e)}function NA(e){this.exit(e)}function PA(e){this.enter({type:`tableCell`,children:[]},e)}function FA(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,IA));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function IA(e,t){return t===`|`?t:e}function LA(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
70
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
71
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return EA(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=AS.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}var RA=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){zA(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function zA(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function BA(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function VA(){return{flow:{null:{name:`table`,tokenize:HA,resolveAll:UA}}}}function HA(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Bv(t)?Nb(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||zv(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Bv(t)?Nb(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Bv(t)?Nb(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Bv(t)?Nb(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Bv(n)?Nb(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||zv(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function UA(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new RA;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(GA(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=WA(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=WA(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=WA(f,t,o,i,n,d)):(o[0]=o[1],d=WA(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&GA(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=BA(t.events,n))}return e}function WA(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},KA(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=KA(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=KA(t.events,n[2]),a=KA(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},KA(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function GA(e,t,n,r,i){let a=[],o=KA(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function KA(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var qA=Object.defineProperty,JA=(e,t)=>qA(e,`name`,{value:t,configurable:!0}),YA=!!(typeof window<`u`&&window.document&&window.document.createElement);function XA(e,t,{checkForDefaultPrevented:n=!0}={}){return JA(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}JA(XA,`composeEventHandlers`);function ZA(e){if(!YA)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}JA(ZA,`getOwnerWindow`);function QA(e){if(!YA)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}JA(QA,`getOwnerDocument`);function $A(e,t=!1){let{activeElement:n}=QA(e);if(!n?.nodeName)return null;if(ej(n)&&n.contentDocument)return $A(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=QA(n).getElementById(e);if(t)return t}}return n}JA($A,`getActiveElement`);function ej(e){return e.tagName===`IFRAME`}JA(ej,`isFrame`);var tj=Object.defineProperty,nj=(e,t)=>tj(e,`name`,{value:t,configurable:!0});function rj(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}nj(rj,`setRef`);function ij(...e){return t=>{let n=!1,r=e.map(e=>{let r=rj(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rj(e[t],null)}}}}nj(ij,`composeRefs`);function aj(...e){return I.useCallback(ij(...e),e)}nj(aj,`useComposedRefs`);var oj=Object.defineProperty,sj=(e,t)=>oj(e,`name`,{value:t,configurable:!0});function cj(e,t){let n=I.createContext(t);n.displayName=e+`Context`;let r=sj(e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=I.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return sj(i,`useContext`),[r,i]}sj(cj,`createContext`);function lj(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=sj(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=I.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return sj(s,`useContext`),[o,s]}sj(r,`createContext`);let i=sj(()=>{let t=n.map(e=>I.createContext(e));return sj(function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,uj(i,...t)]}sj(lj,`createContextScope`);function uj(...e){let t=e[0];if(e.length===1)return t;let n=sj(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return sj(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}sj(uj,`composeContextScopes`);var dj=Object.defineProperty,fj=(e,t)=>dj(e,`name`,{value:t,configurable:!0});function pj(e){let t=I.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];xj(r)&&typeof Tj==`function`&&(r=Tj(r._payload)),I.Children.forEach(r,e=>{if(yj(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;xj(n)&&typeof Tj==`function`&&(n=Tj(n._payload)),a=gj(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=I.cloneElement(a,void 0,s):!o&&I.Children.count(r)===1&&I.isValidElement(r)&&(a=r);let c=a?vj(a):void 0,l=aj(n,c);if(!a){if(r||r===0)throw Error(o?wj(e):Cj(e));return r}let u=_j(i,a.props??{});return a.type!==I.Fragment&&(u.ref=n?l:c),I.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}fj(pj,`createSlot`);var mj=Symbol.for(`radix.slottable`);function hj(e){let t=fj(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=mj,t}fj(hj,`createSlottable`);var gj=fj((e,t)=>{if(`child`in e.props){let t=e.props.child;return I.isValidElement(t)?I.cloneElement(t,void 0,e.props.children(t.props.children)):null}return I.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function _j(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}fj(_j,`mergeProps`);function vj(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fj(vj,`getElementRef`);function yj(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===mj}fj(yj,`isSlottable`);var bj=Symbol.for(`react.lazy`);function xj(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===bj&&`_payload`in e&&Sj(e._payload)}fj(xj,`isLazyComponent`);function Sj(e){return typeof e==`object`&&!!e&&`then`in e}fj(Sj,`isPromiseLike`);var Cj=fj(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),wj=fj(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Tj=I.use,Ej=Object.defineProperty,Dj=(e,t)=>Ej(e,`name`,{value:t,configurable:!0}),Oj=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=pj(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function kj(e,t){e&&SD.flushSync(()=>e.dispatchEvent(t))}Dj(kj,`dispatchDiscreteCustomEvent`);var Aj=Object.defineProperty,jj=(e,t)=>Aj(e,`name`,{value:t,configurable:!0});function Mj(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}jj(Mj,`useCallbackRef`);var Nj=Object.defineProperty,Pj=(e,t)=>Nj(e,`name`,{value:t,configurable:!0}),Fj=`dismissableLayer.update`,Ij=`dismissableLayer.pointerDownOutside`,Lj=`dismissableLayer.focusOutside`,Rj,zj=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Bj=I.forwardRef(Pj(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=I.useContext(zj),[d,f]=I.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=I.useState({}),h=aj(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=I.useRef(!1),C=Uj(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:I.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Wj(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=Mj(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return I.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),I.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Rj=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Gj(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Rj))}},[d,p,n,u]),I.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Gj())},[d,u]),I.useEffect(()=>{let e=Pj(()=>m({}),`handleUpdate`);return document.addEventListener(Fj,e),()=>document.removeEventListener(Fj,e)},[]),(0,L.jsx)(Oj.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:XA(e.onFocusCapture,w.onFocusCapture),onBlurCapture:XA(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:XA(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Vj(){let e=I.useContext(zj),[t,n]=I.useState(null);return I.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Pj(Vj,`useDismissableLayerSurface`);var Hj=Pj(()=>!0,`IS_TRUE`);function Uj(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Hj}=t,s=Mj(e),c=I.useRef(!1),l=I.useRef(!1),u=I.useRef(new Map),d=I.useRef(()=>{});return I.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Pj(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Pj(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Pj(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Pj(p,`handleInteractionBubble`);let m=Pj(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Kj(Ij,s,p,{discrete:!0})};if(Pj(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Pj(()=>c.current=!0,`onPointerDownCapture`)}}Pj(Uj,`usePointerDownOutside`);function Wj(e,t=globalThis?.document){let n=Mj(e),r=I.useRef(!1);return I.useEffect(()=>{let e=Pj(e=>{e.target&&!r.current&&Kj(Lj,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Pj(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Pj(()=>r.current=!1,`onBlurCapture`)}}Pj(Wj,`useFocusOutside`);function Gj(){let e=new CustomEvent(Fj);document.dispatchEvent(e)}Pj(Gj,`dispatchUpdate`);function Kj(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?kj(i,a):i.dispatchEvent(a)}Pj(Kj,`handleAndDispatchCustomEvent`);var qj=Object.defineProperty,Jj=(e,t)=>qj(e,`name`,{value:t,configurable:!0}),Yj=0,Xj=null;function Zj(e){return Qj(),e.children}Jj(Zj,`FocusGuards`);function Qj(){I.useEffect(()=>{Xj||={start:$j(),end:$j()};let{start:e,end:t}=Xj;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Yj++,()=>{Yj===1&&(Xj?.start.remove(),Xj?.end.remove(),Xj=null),Yj=Math.max(0,Yj-1)}},[])}Jj(Qj,`useFocusGuards`);function $j(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Jj($j,`createFocusGuard`);var eM=Object.defineProperty,tM=(e,t)=>eM(e,`name`,{value:t,configurable:!0}),nM=`focusScope.autoFocusOnMount`,rM=`focusScope.autoFocusOnUnmount`,iM={bubbles:!1,cancelable:!0},aM=I.forwardRef(tM(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=Mj(i),u=Mj(a),d=I.useRef(null),f=aj(t,c),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:fM(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||fM(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&fM(s)};tM(e,`handleFocusIn`),tM(t,`handleFocusOut`),tM(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){pM.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(nM,iM);s.addEventListener(nM,l),s.dispatchEvent(t),t.defaultPrevented||(oM(gM(cM(s)),{select:!0}),document.activeElement===e&&fM(s))}return()=>{s.removeEventListener(nM,l),setTimeout(()=>{let t=new CustomEvent(rM,iM);s.addEventListener(rM,u),s.dispatchEvent(t),t.defaultPrevented||fM(e??document.body,{select:!0}),s.removeEventListener(rM,u),pM.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=sM(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&fM(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&fM(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Oj.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function oM(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(fM(r,{select:t}),document.activeElement!==n)return}tM(oM,`focusFirst`);function sM(e){let t=cM(e);return[lM(t,e),lM(t.reverse(),e)]}tM(sM,`getTabbableEdges`);function cM(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:tM(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}tM(cM,`getTabbableCandidates`);function lM(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):uM(r,{upTo:t})))return r}tM(lM,`findVisible`);function uM(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}tM(uM,`isHidden`);function dM(e){return e instanceof HTMLInputElement&&`select`in e}tM(dM,`isSelectableInput`);function fM(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dM(e)&&t&&e.select()}}tM(fM,`focus`);var pM=mM();function mM(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=hM(e,t),e.unshift(t)},remove(t){e=hM(e,t),e[0]?.resume()}}}tM(mM,`createFocusScopesStack`);function hM(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}tM(hM,`arrayRemove`);function gM(e){return e.filter(e=>e.tagName!==`A`)}tM(gM,`removeLinks`);var _M=globalThis?.document?I.useLayoutEffect:()=>{},vM=Object.defineProperty,yM=(e,t)=>vM(e,`name`,{value:t,configurable:!0}),bM=I.useId||(()=>void 0),xM=0;function SM(e){let[t,n]=I.useState(bM());return _M(()=>{e||n(e=>e??String(xM++))},[e]),e||(t?`radix-${t}`:``)}yM(SM,`useId`);var CM=[`top`,`right`,`bottom`,`left`],wM=Math.min,TM=Math.max,EM=Math.round,DM=Math.floor,OM=e=>({x:e,y:e}),kM={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function AM(e,t,n){return TM(e,wM(t,n))}function jM(e,t){return typeof e==`function`?e(t):e}function MM(e){return e.split(`-`)[0]}function NM(e){return e.split(`-`)[1]}function PM(e){return e===`x`?`y`:`x`}function FM(e){return e===`y`?`height`:`width`}function IM(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function LM(e){return PM(IM(e))}function RM(e,t,n){n===void 0&&(n=!1);let r=NM(e),i=LM(e),a=FM(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qM(o)),[o,qM(o)]}function zM(e){let t=qM(e);return[BM(e),t,BM(t)]}function BM(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var VM=[`left`,`right`],HM=[`right`,`left`],UM=[`top`,`bottom`],WM=[`bottom`,`top`];function GM(e,t,n){switch(e){case`top`:case`bottom`:return n?t?HM:VM:t?VM:HM;case`left`:case`right`:return t?UM:WM;default:return[]}}function KM(e,t,n,r){let i=NM(e),a=GM(MM(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(BM)))),a}function qM(e){let t=MM(e);return kM[t]+e.slice(t.length)}function JM(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function YM(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:JM(e)}function XM(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ZM(e,t,n){let{reference:r,floating:i}=e,a=IM(t),o=LM(t),s=FM(o),c=MM(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=NM(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function QM(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=jM(t,e),p=YM(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=XM(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=XM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var $M=50,eN=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:QM},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ZM(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<$M&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ZM(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},tN=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=jM(e,t)||{};if(l==null)return{};let d=YM(u),f={x:n,y:r},p=LM(i),m=FM(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=wM(d[_],T),D=wM(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=AM(E,k,O),te=!c.arrow&&NM(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,A=te?k<E?k-E:k-O:0;return{[p]:f[p]+A,data:{[p]:ee,centerOffset:k-ee-A,...te&&{alignmentOffset:A}},reset:te}}}),nN=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=jM(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=MM(r),_=IM(o),v=MM(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qM(o)]:zM(o)),x=p!==`none`;!d&&x&&b.push(...KM(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=RM(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===IM(t)||T.every(e=>IM(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=IM(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function rN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iN(e){return CM.some(t=>e[t]>=0)}var aN=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=jM(e,t);switch(i){case`referenceHidden`:{let e=rN(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:iN(e)}}}case`escaped`:{let e=rN(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:iN(e)}}}default:return{}}}}},oN=new Set([`left`,`top`]);async function sN(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=MM(n),s=NM(n),c=IM(n)===`y`,l=oN.has(o)?-1:1,u=a&&c?-1:1,d=jM(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var cN=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await sN(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},lN=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=jM(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=IM(i),p=PM(f),m=u[p],h=u[f],g=(e,t)=>AM(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},uN=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=jM(e,t),u={x:n,y:r},d=IM(i),f=PM(d),p=u[f],m=u[d],h=jM(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=oN.has(MM(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},dN=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=jM(e,t),c=await i.detectOverflow(t,s),l=MM(n),u=NM(n),d=IM(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=wM(p-c[m],g),y=wM(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*TM(c.left,c.right):S=p-2*TM(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function fN(){return typeof window<`u`}function pN(e){return gN(e)?(e.nodeName||``).toLowerCase():`#document`}function mN(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hN(e){return((gN(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function gN(e){return fN()?e instanceof Node||e instanceof mN(e).Node:!1}function _N(e){return fN()?e instanceof Element||e instanceof mN(e).Element:!1}function vN(e){return fN()?e instanceof HTMLElement||e instanceof mN(e).HTMLElement:!1}function yN(e){return!fN()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof mN(e).ShadowRoot}function bN(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=jN(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function xN(e){return/^(table|td|th)$/.test(pN(e))}function SN(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var CN=/transform|translate|scale|rotate|perspective|filter/,wN=/paint|layout|strict|content/,TN=e=>!!e&&e!==`none`,EN;function DN(e){let t=_N(e)?jN(e):e;return TN(t.transform)||TN(t.translate)||TN(t.scale)||TN(t.rotate)||TN(t.perspective)||!kN()&&(TN(t.backdropFilter)||TN(t.filter))||CN.test(t.willChange||``)||wN.test(t.contain||``)}function ON(e){let t=NN(e);for(;vN(t)&&!AN(t);){if(DN(t))return t;if(SN(t))return null;t=NN(t)}return null}function kN(){return EN??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),EN}function AN(e){return/^(html|body|#document)$/.test(pN(e))}function jN(e){return mN(e).getComputedStyle(e)}function MN(e){return _N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function NN(e){if(pN(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||yN(e)&&e.host||hN(e);return yN(t)?t.host:t}function PN(e){let t=NN(e);return AN(t)?(e.ownerDocument||e).body:vN(t)&&bN(t)?t:PN(t)}function FN(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=PN(e),i=r===e.ownerDocument?.body,a=mN(r);if(i){let e=IN(a);return t.concat(a,a.visualViewport||[],bN(r)?r:[],e&&n?FN(e):[])}return t.concat(r,FN(r,[],n))}function IN(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function LN(e){let t=jN(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=vN(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=EM(n)!==a||EM(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function RN(e){return _N(e)?e:e.contextElement}function zN(e){let t=RN(e);if(!vN(t))return OM(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=LN(t),o=(a?EM(n.width):n.width)/r,s=(a?EM(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var BN=OM(0);function VN(e){let t=mN(e);return!kN()||!t.visualViewport?BN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HN(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===mN(e)}function UN(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=RN(e),o=OM(1);t&&(r?_N(r)&&(o=zN(r)):o=zN(e));let s=HN(a,n,r)?VN(a):OM(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=mN(a),t=_N(r)?mN(r):r,n=e,i=IN(n);for(;i&&t!==n;){let e=zN(i),t=i.getBoundingClientRect(),r=jN(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=mN(i),i=IN(n)}}return XM({width:u,height:d,x:c,y:l})}function WN(e,t){let n=MN(e).scrollLeft;return t?t.left+n:UN(hN(e)).left+n}function GN(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-WN(e,n),y:n.top+t.scrollTop}}function KN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=hN(r),s=t?SN(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=OM(1),u=OM(0),d=vN(r);if((d||!a)&&((pN(r)!==`body`||bN(o))&&(c=MN(r)),d)){let e=UN(r);l=zN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?GN(o,c):OM(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function qN(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function JN(e){let t=MN(e),n=e.ownerDocument.body,r=TM(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=TM(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+WN(e),o=-t.scrollTop;return jN(n).direction===`rtl`&&(a+=TM(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var YN=25;function XN(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=mN(e),a=hN(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!kN()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(WN(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=YN&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ZN(e,t){let n=UN(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=zN(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function QN(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=XN(e,n,t);else if(t===`document`)r=JN(hN(e));else if(_N(t))r=ZN(t,n);else{let n=VN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return XM(r)}function $N(e,t){let n=t.get(e);if(n)return n;let r=FN(e,[],!1).filter(e=>_N(e)&&pN(e)!==`body`),i=null,a=jN(e).position===`fixed`,o=a?NN(e):e;for(;_N(o)&&!AN(o);){let e=jN(o),t=DN(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=NN(o)}return t.set(e,r),r}function eP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?SN(t)?[]:$N(t,this._c):[].concat(n),r],o=QN(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=QN(t,a[e],i);s=TM(n.top,s),c=wM(n.right,c),l=wM(n.bottom,l),u=TM(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tP(e){let{width:t,height:n}=LN(e);return{width:t,height:n}}function nP(e,t,n){let r=vN(t),i=hN(t),a=n===`fixed`,o=UN(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=OM(0);if((r||!a)&&((pN(t)!==`body`||bN(i))&&(s=MN(t)),r)){let e=UN(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=WN(i));let l=i&&!r&&!a?GN(i,s):OM(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function rP(e){return jN(e).position===`static`}function iP(e,t){if(!vN(e)||jN(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return hN(e)===n&&(n=n.ownerDocument.body),n}function aP(e,t){let n=mN(e);if(SN(e))return n;if(!vN(e)){let t=NN(e);for(;t&&!AN(t);){if(_N(t)&&!rP(t))return t;t=NN(t)}return n}let r=iP(e,t);for(;r&&xN(r)&&rP(r);)r=iP(r,t);return r&&AN(r)&&rP(r)&&!DN(r)?n:r||ON(e)||n}var oP=async function(e){let t=this.getOffsetParent||aP,n=this.getDimensions,r=await n(e.floating);return{reference:nP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sP(e){return jN(e).direction===`rtl`}var cP={convertOffsetParentRelativeRectToViewportRelativeRect:KN,getDocumentElement:hN,getClippingRect:eP,getOffsetParent:aP,getElementRects:oP,getClientRects:qN,getDimensions:tP,getScale:zN,isElement:_N,isRTL:sP};function lP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uP(e,t,n){let r=null,i,a=hN(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=DM(d),h=DM(a.clientWidth-(u+f)),g=DM(a.clientHeight-(d+p)),_=DM(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:TM(0,wM(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!lP(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=mN(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function dP(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=RN(e),u=i||a?[...l?FN(l):[],...t?FN(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?uP(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?UN(e):null;c&&g();function g(){let t=UN(e);h&&!lP(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var fP=cN,pP=lN,mP=nN,hP=dN,gP=aN,_P=tN,vP=uN,yP=(e,t,n)=>{let r=new Map,i=n??{},a={...cP,...i.platform,_c:r};return eN(e,t,{...i,platform:a})},bP=typeof document<`u`?I.useLayoutEffect:function(){};function xP(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xP(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xP(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function SP(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CP(e,t){let n=SP(e);return Math.round(t*n)/n}function wP(e){let t=I.useRef(e);return bP(()=>{t.current=e}),t}function TP(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);xP(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=wP(c),D=wP(i),O=wP(l),k=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yP(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};ee.current&&!xP(w.current,t)&&(w.current=t,SD.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bP(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=I.useRef(!1);bP(()=>(ee.current=!0,()=>{ee.current=!1}),[]),bP(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let te=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=I.useMemo(()=>({reference:b,floating:x}),[b,x]),j=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=CP(A.floating,u.x),r=CP(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...SP(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:k,refs:te,elements:A,floatingStyles:j}),[u,k,te,A,j])}var EP=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:_P({element:r.current,padding:i}).fn(n):r?_P({element:r,padding:i}).fn(n):{}}}},DP=(e,t)=>{let n=fP(e);return{name:n.name,fn:n.fn,options:[e,t]}},OP=(e,t)=>{let n=pP(e);return{name:n.name,fn:n.fn,options:[e,t]}},kP=(e,t)=>({fn:vP(e).fn,options:[e,t]}),AP=(e,t)=>{let n=mP(e);return{name:n.name,fn:n.fn,options:[e,t]}},jP=(e,t)=>{let n=hP(e);return{name:n.name,fn:n.fn,options:[e,t]}},MP=(e,t)=>{let n=gP(e);return{name:n.name,fn:n.fn,options:[e,t]}},NP=(e,t)=>{let n=EP(e);return{name:n.name,fn:n.fn,options:[e,t]}},PP=Object.defineProperty,FP=I.forwardRef(((e,t)=>PP(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(Oj.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),IP=Object.defineProperty,LP=(e,t)=>IP(e,`name`,{value:t,configurable:!0});function RP(e){let[t,n]=I.useState(void 0);return _M(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}LP(RP,`useSize`);var zP=Object.defineProperty,BP=(e,t)=>zP(e,`name`,{value:t,configurable:!0}),VP=`Popper`,[HP,UP]=lj(VP),[WP,GP]=HP(VP),KP=BP(e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null),[a,o]=I.useState(void 0);return(0,L.jsx)(WP,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),qP=`PopperAnchor`,JP=I.forwardRef(BP(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=GP(qP,n),o=I.useRef(null),s=a.onAnchorChange,c=aj(t,I.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=I.useRef(null);I.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&iF(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Oj.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),YP=`PopperContent`,[XP,ZP]=HP(YP),QP=I.forwardRef(BP(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=GP(YP,n),[_,v]=I.useState(null),y=aj(t,v),[b,x]=I.useState(null),S=RP(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(nF),altBoundary:O},{refs:ee,floatingStyles:te,placement:A,isPositioned:j,middlewareData:ne}=TP({strategy:`fixed`,placement:T,whileElementsMounted:BP((...e)=>dP(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[DP({mainAxis:i+w,alignmentAxis:o}),c&&OP({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?kP():void 0,...k}),c&&AP({...k}),jP({...k,apply:BP(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&NP({element:b,padding:s}),rF({arrowWidth:C,arrowHeight:w}),f&&MP({strategy:`referenceHidden`,...k,boundary:O?k.boundary:void 0})]}),M=g.setPlacementState;_M(()=>(M(A),()=>{M(void 0)}),[A,M]);let[re,ie]=iF(A),ae=Mj(m);_M(()=>{j&&ae?.()},[j,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=I.useState();return _M(()=>{_&&ue(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:j?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(XP,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:x,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,L.jsx)(Oj.div,{"data-side":re,"data-align":ie,...h,ref:y,style:{...h.style,animation:j?h.style?.animation:`none`}})})})},`PopperContent`)),$P=`PopperArrow`,eF={top:`bottom`,right:`left`,bottom:`top`,left:`right`},tF=I.forwardRef(BP(function(e,t){let{__scopePopper:n,...r}=e,i=ZP($P,n),a=eF[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(FP,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function nF(e){return e!==null}BP(nF,`isNotNull`);var rF=BP(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=iF(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function iF(e){let[t,n=`center`]=e.split(`-`);return[t,n]}BP(iF,`getSideAndAlignFromPlacement`);var aF=KP,oF=JP,sF=QP,cF=tF,lF=Object.defineProperty,uF=I.forwardRef(((e,t)=>lF(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=I.useState(!1);_M(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?SD.createPortal((0,L.jsx)(Oj.div,{...r,ref:t}),o):null},`Portal`)),dF=Object.defineProperty,fF=(e,t)=>dF(e,`name`,{value:t,configurable:!0});function pF(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}fF(pF,`useStateMachine`);var mF=fF(e=>{let{present:t,children:n}=e,r=hF(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=_F(r.ref,yF(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null},`Presence`);function hF(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),o=I.useRef(void 0),[s,c]=pF(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{s===`mounted`?(a.current=o.current??vF(r.current),o.current=void 0):a.current=`none`},[s]),_M(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=vF(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),_M(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=fF(a=>{let o=vF(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=fF(e=>{e.target===t&&(a.current=vF(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:I.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=vF(t)}else r.current=null;n(e)},[])}}fF(hF,`usePresence`);function gF(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}fF(gF,`setRef`);function _F(...e){let t=I.useRef(e);return t.current=e,I.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=gF(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():gF(n[e],null)}}},[])}fF(_F,`useStableComposedRefs`);function vF(e){return e?.animationName||`none`}fF(vF,`getAnimationName`);function yF(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}fF(yF,`getElementRef`);var bF=Object.defineProperty,xF=(e,t)=>bF(e,`name`,{value:t,configurable:!0}),SF=I.useEffectEvent,CF=I.useInsertionEffect;function wF(e){if(typeof SF==`function`)return SF(e);let t=I.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof CF==`function`?CF(()=>{t.current=e}):_M(()=>{t.current=e}),I.useMemo(()=>((...e)=>t.current?.(...e)),[])}xF(wF,`useEffectEvent`);var TF=Object.defineProperty,EF=(e,t)=>TF(e,`name`,{value:t,configurable:!0}),DF=I.useInsertionEffect||_M;function OF({prop:e,defaultProp:t,onChange:n=EF(()=>{},`onChange`),caller:r}){let[i,a,o]=kF({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,I.useCallback(t=>{if(s){let n=AF(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}EF(OF,`useControllableState`);function kF({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return DF(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}EF(kF,`useUncontrolledState`);function AF(e){return typeof e==`function`}EF(AF,`isFunction`);var jF=Symbol(`RADIX:SYNC_STATE`);function MF(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=wF(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=I.useReducer((t,n)=>{if(n.type===jF)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=I.useRef(p);I.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=I.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return I.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:jF,state:i})},[i,d.state,c]),[h,f]}EF(MF,`useControllableStateReducer`);var NF=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},PF=new WeakMap,FF=new WeakMap,IF={},LF=0,RF=function(e){return e&&(e.host||RF(e.parentNode))},zF=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=RF(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},BF=function(e,t,n,r){var i=zF(t,Array.isArray(e)?e:[e]);IF[n]||(IF[n]=new WeakMap);var a=IF[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(PF.get(e)||0)+1,l=(a.get(e)||0)+1;PF.set(e,c),a.set(e,l),o.push(e),c===1&&i&&FF.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),LF++,function(){o.forEach(function(e){var t=PF.get(e)-1,i=a.get(e)-1;PF.set(e,t),a.set(e,i),t||(FF.has(e)||e.removeAttribute(r),FF.delete(e)),i||e.removeAttribute(n)}),LF--,LF||(PF=new WeakMap,PF=new WeakMap,FF=new WeakMap,IF={})}},VF=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||NF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),BF(r,i,n,`aria-hidden`)):function(){return null}},HF=function(){return HF=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},HF.apply(this,arguments)};function UF(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function WF(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var GF=`right-scroll-bar-position`,KF=`width-before-scroll-bar`,qF=`with-scroll-bars-hidden`,JF=`--removed-body-scroll-bar-size`;function YF(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function XF(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ZF=typeof window<`u`?I.useLayoutEffect:I.useEffect,QF=new WeakMap;function $F(e,t){var n=XF(t||null,function(t){return e.forEach(function(e){return YF(e,t)})});return ZF(function(){var t=QF.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||YF(e,null)}),i.forEach(function(e){r.has(e)||YF(e,a)})}QF.set(n,e)},[e]),n}function eI(e){return e}function tI(e,t){t===void 0&&(t=eI);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function nI(e){e===void 0&&(e={});var t=tI(null);return t.options=HF({async:!0,ssr:!1},e),t}var rI=function(e){var t=e.sideCar,n=UF(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,HF({},n))};rI.isSideCarExport=!0;function iI(e,t){return e.useMedium(t),rI}var aI=nI(),oI=function(){},sI=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:oI,onWheelCapture:oI,onTouchMoveCapture:oI}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=UF(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=$F([n,t]),C=HF(HF({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:aI,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),HF(HF({},C),{ref:S})):I.createElement(v,HF({},C,{className:c,ref:S}),s))});sI.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sI.classNames={fullWidth:KF,zeroRight:GF};var cI=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function lI(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=cI();return t&&e.setAttribute(`nonce`,t),e}function uI(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dI(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var fI=function(){var e=0,t=null;return{add:function(n){e==0&&(t=lI())&&(uI(t,n),dI(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},pI=function(){var e=fI();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},mI=function(){var e=pI();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},hI={left:0,top:0,right:0,gap:0},gI=function(e){return parseInt(e||``,10)||0},_I=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[gI(n),gI(r),gI(i)]},vI=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return hI;var t=_I(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},yI=mI(),bI=`data-scroll-locked`,xI=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
72
+ .${qF} {
73
+ overflow: hidden ${r};
74
+ padding-right: ${s}px ${r};
75
+ }
76
+ body[${bI}] {
77
+ overflow: hidden ${r};
78
+ overscroll-behavior: contain;
79
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
80
+ padding-left: ${i}px;
81
+ padding-top: ${a}px;
82
+ padding-right: ${o}px;
83
+ margin-left:0;
84
+ margin-top:0;
85
+ margin-right: ${s}px ${r};
86
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
87
+ }
88
+
89
+ .${GF} {
90
+ right: ${s}px ${r};
91
+ }
92
+
93
+ .${KF} {
94
+ margin-right: ${s}px ${r};
95
+ }
96
+
97
+ .${GF} .${GF} {
98
+ right: 0 ${r};
99
+ }
100
+
101
+ .${KF} .${KF} {
102
+ margin-right: 0 ${r};
103
+ }
104
+
105
+ body[${bI}] {
106
+ ${JF}: ${s}px;
107
+ }
108
+ `},SI=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},CI=function(){I.useEffect(function(){return document.body.setAttribute(bI,(SI()+1).toString()),function(){var e=SI()-1;e<=0?document.body.removeAttribute(bI):document.body.setAttribute(bI,e.toString())}},[])},wI=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;CI();var a=I.useMemo(function(){return vI(i)},[i]);return I.createElement(yI,{styles:xI(a,!t,i,n?``:`!important`)})},TI=!1;if(typeof window<`u`)try{var EI=Object.defineProperty({},"passive",{get:function(){return TI=!0,!0}});window.addEventListener(`test`,EI,EI),window.removeEventListener(`test`,EI,EI)}catch{TI=!1}var DI=TI?{passive:!1}:!1,OI=function(e){return e.tagName===`TEXTAREA`},kI=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!OI(e)&&n[t]===`visible`)},AI=function(e){return kI(e,`overflowY`)},jI=function(e){return kI(e,`overflowX`)},MI=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),FI(e,r)){var i=II(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},NI=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},PI=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},FI=function(e,t){return e===`v`?AI(t):jI(t)},II=function(e,t){return e===`v`?NI(t):PI(t)},LI=function(e,t){return e===`h`&&t===`rtl`?-1:1},RI=function(e,t,n,r,i){var a=LI(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=II(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&FI(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},zI=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},BI=function(e){return[e.deltaX,e.deltaY]},VI=function(e){return e&&`current`in e?e.current:e},HI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},UI=function(e){return`
109
+ .block-interactivity-${e} {pointer-events: none;}
110
+ .allow-interactivity-${e} {pointer-events: all;}
111
+ `},WI=0,GI=[];function KI(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(WI++)[0],a=I.useState(mI)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=WF([e.lockRef.current],(e.shards||[]).map(VI),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=zI(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=MI(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=MI(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return RI(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(GI.length&&GI[GI.length-1]===a){var r=`deltaY`in n?BI(n):zI(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&HI(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(VI).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:qI(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=zI(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,BI(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,zI(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return GI.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,DI),document.addEventListener(`touchmove`,c,DI),document.addEventListener(`touchstart`,u,DI),function(){GI=GI.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,DI),document.removeEventListener(`touchmove`,c,DI),document.removeEventListener(`touchstart`,u,DI)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:UI(i)}):null,p?I.createElement(wI,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function qI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var JI=iI(aI,KI),YI=I.forwardRef(function(e,t){return I.createElement(sI,HF({},e,{ref:t,sideCar:JI}))});YI.classNames=sI.classNames;var XI=Object.defineProperty,ZI=(e,t)=>XI(e,`name`,{value:t,configurable:!0}),QI=`Popover`,[$I,eL]=lj(QI,[UP]),tL=UP(),[nL,rL]=$I(QI),iL=ZI(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=tL(t),c=I.useRef(null),[l,u]=I.useState(!1),[d,f]=OF({prop:r,defaultProp:i??!1,onChange:a,caller:QI});return(0,L.jsx)(aF,{...s,children:(0,L.jsx)(nL,{scope:t,contentId:SM(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:I.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:I.useCallback(()=>u(!0),[]),onCustomAnchorRemove:I.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),aL=`PopoverAnchor`,oL=I.forwardRef(ZI(function(e,t){let{__scopePopover:n,...r}=e,i=rL(aL,n),a=tL(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return I.useEffect(()=>(o(),()=>s()),[o,s]),(0,L.jsx)(oF,{...a,...r,ref:t})},`PopoverAnchor`)),sL=`PopoverTrigger`,cL=I.forwardRef(ZI(function(e,t){let{__scopePopover:n,...r}=e,i=rL(sL,n),a=tL(n),o=aj(t,i.triggerRef),s=(0,L.jsx)(Oj.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":bL(i.open),...r,ref:o,onClick:XA(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,L.jsx)(oF,{asChild:!0,...a,children:s})},`PopoverTrigger`)),lL=`PopoverPortal`,[uL,dL]=$I(lL,{forceMount:void 0}),fL=ZI(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=rL(lL,t);return(0,L.jsx)(uL,{scope:t,forceMount:n,children:(0,L.jsx)(mF,{present:n||a.open,children:(0,L.jsx)(uF,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),pL=`PopoverContent`,mL=I.forwardRef(ZI(function(e,t){let n=dL(pL,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=rL(pL,e.__scopePopover);return(0,L.jsx)(mF,{present:r||a.open,children:a.modal?(0,L.jsx)(gL,{...i,ref:t}):(0,L.jsx)(_L,{...i,ref:t})})},`PopoverContent`)),hL=pj(`PopoverContent.RemoveScroll`),gL=I.forwardRef(ZI(function(e,t){let n=rL(pL,e.__scopePopover),r=I.useRef(null),i=aj(t,r),a=I.useRef(!1);return I.useEffect(()=>{let e=r.current;if(e)return VF(e)},[]),(0,L.jsx)(YI,{as:hL,allowPinchZoom:!0,children:(0,L.jsx)(vL,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:XA(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:XA(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:XA(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),_L=I.forwardRef(ZI(function(e,t){let n=rL(pL,e.__scopePopover),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(vL,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),vL=I.forwardRef(ZI(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=rL(pL,n),p=tL(n);return Qj(),(0,L.jsx)(aM,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Bj,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,L.jsx)(sF,{"data-state":bL(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),yL=I.forwardRef(ZI(function(e,t){let{__scopePopover:n,...r}=e,i=tL(n);return(0,L.jsx)(cF,{...i,...r,ref:t})},`PopoverArrow`));function bL(e){return e?`open`:`closed`}ZI(bL,`getState`);var xL=iL,SL=oL,CL=fL,wL=mL,TL=yL,EL=Object.defineProperty,DL=(e,t)=>EL(e,`name`,{value:t,configurable:!0});function OL(e){let t=e+`CollectionProvider`,[n,r]=lj(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=DL(e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=pj(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=aj(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=pj(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=aj(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return DL(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}DL(OL,`createCollection`);var kL=new WeakMap,AL=class e extends Map{static{DL(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],kL.set(this,!0)}set(e,t){return kL.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=NL(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=jL(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=jL(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return jL(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function jL(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ML(e,t);return n===-1?void 0:e[n]}DL(jL,`at`);function ML(e,t){let n=e.length,r=NL(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}DL(ML,`toSafeIndex`);function NL(e){return e!==e||e===0?0:Math.trunc(e)}DL(NL,`toSafeInteger`);function PL(e){let t=e+`CollectionProvider`,[n,r]=lj(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new AL,setItemMap:DL(()=>void 0,`setItemMap`)}),o=DL(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=DL(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=DL(e=>{let{scope:t,children:n,state:r}=e,a=I.useRef(null),[o,s]=I.useState(null),c=aj(a,s),[l,u]=r;return I.useEffect(()=>{if(!o)return;let e=RL(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=pj(l),d=I.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=aj(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=pj(f),m=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),[s,c]=I.useState(null),l=aj(t,o,c),{setItemMap:u}=a(f,n),d=I.useRef(i);FL(d.current,i)||(d.current=i);let m=d.current;return I.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(LL):(t.set(s,{...e,element:s}),t.toSorted(LL)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new AL(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return I.useState(new AL)}DL(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return DL(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}DL(PL,`createCollection`);function FL(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}DL(FL,`shallowEqual`);function IL(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}DL(IL,`isElementPreceding`);function LL(e,t){return!e[1].element||!t[1].element?0:IL(e[1].element,t[1].element)?-1:1}DL(LL,`sortByDocumentPosition`);function RL(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}DL(RL,`getChildListObserver`);var zL=Object.defineProperty,BL=(e,t)=>zL(e,`name`,{value:t,configurable:!0}),VL=I.createContext(void 0);function HL(e){let t=I.useContext(VL);return e||t||`ltr`}BL(HL,`useDirection`);var UL=Object.defineProperty,WL=(e,t)=>UL(e,`name`,{value:t,configurable:!0}),GL=!1;function KL(){let[e,t]=I.useState(GL);return I.useEffect(()=>{GL||(GL=!0,t(!0))},[]),e}WL(KL,`useIsHydrated`);var qL=I.useSyncExternalStore;function JL(){return()=>{}}WL(JL,`subscribe`);function YL(){return qL(JL,()=>!0,()=>!1)}WL(YL,`useIsHydratedModern`);var XL=typeof qL==`function`?YL:KL,ZL=Object.defineProperty,QL=(e,t)=>ZL(e,`name`,{value:t,configurable:!0}),$L=`rovingFocusGroup.onEntryFocus`,eR={bubbles:!1,cancelable:!0},tR=`RovingFocusGroup`,[nR,rR,iR]=OL(tR),[aR,oR]=lj(tR,[iR]),[sR,cR]=aR(tR),lR=I.forwardRef(QL(function(e,t){return(0,L.jsx)(nR.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(nR.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(uR,{...e,ref:t})})})},`RovingFocusGroup`)),uR=I.forwardRef(QL(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=aj(t,f),m=HL(a),[h,g]=OF({prop:o,defaultProp:s??null,onChange:c,caller:tR}),[_,v]=I.useState(!1),y=Mj(l),b=rR(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener($L,y),()=>e.removeEventListener($L,y)},[y]),(0,L.jsx)(sR,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(Oj.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:XA(e.onMouseDown,()=>{x.current=!0}),onFocus:XA(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent($L,eR);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);gR([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:XA(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),dR=`RovingFocusGroupItem`,fR=I.forwardRef(QL(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=SM(),l=a||c,u=cR(dR,n),d=u.currentTabStopId===l,f=rR(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=XL();return _M(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),I.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,L.jsx)(nR.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(Oj.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:XA(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:XA(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:XA(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=hR(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?_R(n,r+1):n.slice(r+1)}setTimeout(()=>gR(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),pR={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mR(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}QL(mR,`getDirectionAwareKey`);function hR(e,t,n){let r=mR(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return pR[r]}QL(hR,`getFocusIntent`);function gR(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}QL(gR,`focusFirst`);function _R(e,t){return e.map((n,r)=>e[(t+r)%e.length])}QL(_R,`wrapArray`);var vR=lR,yR=fR,bR=Object.defineProperty,xR=(e,t)=>bR(e,`name`,{value:t,configurable:!0}),SR=`horizontal`,CR=[`horizontal`,`vertical`],wR=I.forwardRef(xR(function(e,t){let{decorative:n,orientation:r=SR,...i}=e,a=TR(r)?r:SR,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,L.jsx)(Oj.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function TR(e){return CR.includes(e)}xR(TR,`isValidOrientation`);var ER=wR,DR=Object.defineProperty,OR=(e,t)=>DR(e,`name`,{value:t,configurable:!0}),kR=`Toggle`,AR=I.forwardRef(OR(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=OF({prop:n,onChange:i,defaultProp:r??!1,caller:kR});return(0,L.jsx)(Oj.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:XA(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),jR=Object.defineProperty,MR=(e,t)=>jR(e,`name`,{value:t,configurable:!0}),NR=`ToggleGroup`,[PR,FR]=lj(NR,[oR]),IR=oR(),LR=I.forwardRef(MR(function(e,t){let{type:n,...r}=e;if(n===`single`)return(0,L.jsx)(BR,{role:`radiogroup`,...r,ref:t});if(n===`multiple`)return(0,L.jsx)(VR,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${NR}\``)},`ToggleGroup`)),[RR,zR]=PR(NR),BR=I.forwardRef(MR(function(e,t){let{value:n,defaultValue:r,onValueChange:i=MR(()=>{},`onValueChange`),...a}=e,[o,s]=OF({prop:n,defaultProp:r??``,onChange:i,caller:NR});return(0,L.jsx)(RR,{scope:e.__scopeToggleGroup,type:`single`,value:I.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:I.useCallback(()=>s(``),[s]),children:(0,L.jsx)(WR,{...a,ref:t})})},`ToggleGroupImplSingle`)),VR=I.forwardRef(MR(function(e,t){let{value:n,defaultValue:r,onValueChange:i=MR(()=>{},`onValueChange`),...a}=e,[o,s]=OF({prop:n,defaultProp:r??[],onChange:i,caller:NR}),c=I.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=I.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,L.jsx)(RR,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,L.jsx)(WR,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[HR,UR]=PR(NR),WR=I.forwardRef(MR(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=IR(n),u=HL(o),d={dir:u,...c};return(0,L.jsx)(HR,{scope:n,rovingFocus:i,disabled:r,children:i?(0,L.jsx)(vR,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,L.jsx)(Oj.div,{...d,ref:t})}):(0,L.jsx)(Oj.div,{...d,ref:t})})},`ToggleGroupImpl`)),GR=`ToggleGroupItem`,KR=I.forwardRef(MR(function(e,t){let n=zR(GR,e.__scopeToggleGroup),r=UR(GR,e.__scopeToggleGroup),i=IR(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=I.useRef(null);return r.rovingFocus?(0,L.jsx)(yR,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,L.jsx)(qR,{...s,ref:t})}):(0,L.jsx)(qR,{...s,ref:t})},`ToggleGroupItem`)),qR=I.forwardRef(MR(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=zR(GR,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===`single`?o:void 0;return(0,L.jsx)(AR,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),JR=Object.defineProperty,YR=(e,t)=>JR(e,`name`,{value:t,configurable:!0}),XR=`Toolbar`,[ZR,QR]=lj(XR,[oR,FR]),$R=oR(),ez=FR(),[tz,nz]=ZR(XR),rz=I.forwardRef(YR(function(e,t){let{__scopeToolbar:n,orientation:r=`horizontal`,dir:i,loop:a=!0,...o}=e,s=$R(n),c=HL(i);return(0,L.jsx)(tz,{scope:n,orientation:r,dir:c,children:(0,L.jsx)(vR,{asChild:!0,...s,orientation:r,dir:c,loop:a,children:(0,L.jsx)(Oj.div,{role:`toolbar`,"aria-orientation":r,dir:c,...o,ref:t})})})},`Toolbar`)),iz=`ToolbarSeparator`,az=I.forwardRef(YR(function(e,t){let{__scopeToolbar:n,...r}=e,i=nz(iz,n);return(0,L.jsx)(ER,{orientation:i.orientation===`horizontal`?`vertical`:`horizontal`,...r,ref:t})},`ToolbarSeparator`)),oz=I.forwardRef(YR(function(e,t){let{__scopeToolbar:n,...r}=e,i=$R(n);return(0,L.jsx)(yR,{asChild:!0,...i,focusable:!e.disabled,children:(0,L.jsx)(Oj.button,{type:`button`,...r,ref:t})})},`ToolbarButton`)),sz=`ToolbarToggleGroup`,cz=I.forwardRef(YR(function(e,t){let{__scopeToolbar:n,...r}=e,i=nz(sz,n),a=ez(n);return(0,L.jsx)(LR,{"data-orientation":i.orientation,dir:i.dir,...a,...r,ref:t,rovingFocus:!1})},`ToolbarToggleGroup`)),lz=I.forwardRef(YR(function(e,t){let{__scopeToolbar:n,...r}=e,i=ez(n),a={__scopeToolbar:e.__scopeToolbar};return(0,L.jsx)(oz,{asChild:!0,...a,children:(0,L.jsx)(KR,{...i,...r,ref:t})})},`ToolbarToggleItem`)),uz=rz,dz=az,fz=oz,pz=cz,mz=lz;function hz(e,t){return e===null||e===t?!1:e.dataset.editorDialog!==void 0||e.dataset.toolbarItem!==void 0||e.dataset.editorDropdown?!0:hz(e.parentElement,t)}function gz(){let e=[...Array(256).keys()].map(e=>e.toString(16).padStart(2,`0`)),t=crypto.getRandomValues(new Uint8Array(16));return t[6]=t[6]&15|64,t[8]=t[8]&63|128,[...t.entries()].map(([t,n])=>[4,6,8,10].includes(t)?`-${e[n]}`:e[n]).join(``)}var _z=e=>e===0?`th`:`td`,vz={center:X.centeredCell,left:X.leftAlignedCell,right:X.rightAlignedCell};function yz(e){let t=Hu(e);return jz(t)?t:null}var bz=({mdastNode:e,parentEditor:t,lexicalTable:n})=>{let r=n.getKey(),[i,a]=I.useState(null),[o,s]=Ar(OO,LD),c=I.useMemo(()=>e=>(e.__cacheKey??=gz(),e.__cacheKey),[]),l=I.useCallback(e=>{let[n,i]=t.getEditorState().read(()=>{let e=yz(r);return e?[e.getColCount(),e.getRowCount()]:[0,0]});if(e===null){a(null);return}let[o,s]=e;if(o>n-1&&(o=0,s++),o<0&&(o=n-1,--s),s>i-1){a(null),t.update(()=>{let e=yz(r);if(e){if(e.getNextSibling())e.selectNext();else{let t=lu();e.insertAfter(t),t.select()}}});return}if(s<0){a(null),t.update(()=>{var e;(e=yz(r))==null||e.selectPrevious()});return}a([o,s])},[t,r]);I.useEffect(()=>{n.focusEmitter.subscribe(l)},[n,l]);let u=I.useCallback(e=>{e.preventDefault();let n=null;t.update(()=>{let e=yz(r);e&&(n=[0,e.getRowCount()],e.addRowToBottom())},{onUpdate:()=>{n&&a(n)}})},[t,r]),d=I.useCallback(e=>{e.preventDefault();let n=null;t.update(()=>{let e=yz(r);e&&(n=[e.getColCount(),0],e.addColumnToRight())},{onUpdate:()=>{n&&a(n)}})},[t,r]),[f,p]=I.useState([-1,-1]),m=I.useCallback(e=>{let t=e.target;for(;t&&![`TH`,`TD`].includes(t.tagName);){if(t===e.currentTarget)return;t=t.parentElement}if(t===null)return;let n=t.parentElement,r=n.parentElement.tagName===`TFOOT`?-1:Array.from(n.children).indexOf(t),i=t.tagName===`TH`?-1:Array.from(n.parentElement.children).indexOf(n);p([r,i])},[]),h=ik();return I.createElement(`table`,{className:X.tableEditor,onMouseOver:m,onMouseLeave:()=>{p([-1,-1])}},I.createElement(`colgroup`,null,s?null:I.createElement(`col`,null),Array.from({length:e.children[0].children.length},(t,n)=>{let r=vz[(e.align??[])[n]??`left`];return I.createElement(`col`,{key:n,className:r})}),s?null:I.createElement(`col`,null)),s||I.createElement(`thead`,null,I.createElement(`tr`,null,I.createElement(`th`,{className:X.tableToolsColumn}),Array.from({length:e.children[0].children.length},(r,i)=>I.createElement(`th`,{key:i,"data-tool-cell":!0},I.createElement(Cz,{setActiveCellWithBoundaries:l,parentEditor:t,colIndex:i,highlightedCoordinates:f,lexicalTable:n,align:(e.align??[])[i]}))),I.createElement(`th`,{className:X.tableToolsColumn,"data-tool-cell":!0},I.createElement(`button`,{className:X.iconButton,type:`button`,title:h(`table.deleteTable`,`Delete table`),onClick:e=>{e.preventDefault(),t.update(()=>{let e=yz(r);e&&(e.selectNext(),e.remove())})}},o(`delete_small`))))),I.createElement(`tbody`,null,e.children.map((r,a)=>{let u=_z(a);return I.createElement(`tr`,{key:a},s||I.createElement(u,{className:X.toolCell,"data-tool-cell":!0},I.createElement(wz,{setActiveCellWithBoundaries:l,parentEditor:t,rowIndex:a,highlightedCoordinates:f,lexicalTable:n})),r.children.map((r,o)=>I.createElement(xz,{align:e.align?.[o],key:c(r),contents:r.children,setActiveCell:l,rowIndex:a,colIndex:o,lexicalTable:n,parentEditor:t,activeCell:s?[-1,-1]:i})),s||a===0&&I.createElement(`th`,{rowSpan:n.getRowCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:X.addColumnButton,onClick:d},o(`add_column`))))})),s||I.createElement(`tfoot`,null,I.createElement(`tr`,null,I.createElement(`th`,null),I.createElement(`th`,{colSpan:n.getColCount(),"data-tool-cell":!0},I.createElement(`button`,{type:`button`,className:X.addRowButton,onClick:u},o(`add_row`))),I.createElement(`th`,null))))},xz=({align:e,...t})=>{let{activeCell:n,setActiveCell:r}=t,i=n?.[0]===t.colIndex&&n[1]===t.rowIndex,a=vz[e??`left`],o=_z(t.rowIndex);return I.createElement(o,{className:a,"data-active":i,onClick:()=>{r([t.colIndex,t.rowIndex])}},I.createElement(Sz,{...t,focus:i}))},Sz=({focus:e,setActiveCell:t,parentEditor:n,lexicalTable:r,contents:i,colIndex:a,rowIndex:o})=>{let s=r.getKey(),[c,l,u,d,f,p,m,h,g,_]=Ar(ZD,tO,QD,aO,sO,cO,lO,iO,ND,UO),[v,y]=I.useState(null);I.useEffect(()=>{let e=jD({name:`@mdxeditor/table-cell`,nodes:u,namespace:`TableCellEditor`,parentEditor:n,historyMode:`table-local`,initialEditorState:()=>{SE({root:Yu(),mdastRoot:{type:`root`,children:[{type:`paragraph`,children:i}]},visitors:c,jsxComponentDescriptors:d,directiveDescriptors:f,codeBlockEditorDescriptors:p,defaultCodeBlockLanguage:m})}});return y(e),()=>{e.dispose()}},[]);let b=I.useCallback(e=>{v&&(v.getEditorState().read(()=>{let e=OC({root:Yu(),jsxComponentDescriptors:d,visitors:l,jsxIsAvailable:h});n.update(()=>{let t=yz(s);t&&t.updateCellContents(a,o,e.children[0].children)},{discrete:!0}),n.dispatchCommand(MD,void 0)}),t(e))},[a,v,l,d,h,n,o,t,s]);return I.useEffect(()=>{if(v)return am(v.registerCommand(Ro,e=>{e.preventDefault();let t=e.shiftKey?[a-1,o]:[a+1,o];return b(t),!0},4),v.registerCommand(es,()=>(t([a,o]),!1),1),v.registerCommand(No,e=>{e?.preventDefault();let t=e?.shiftKey?[a,o-1]:[a,o+1];return b(t),!0},4),v.registerCommand(ts,e=>{let t=e.relatedTarget;return!hz(t,g.getRootElement())&&(b(null),!0)},0),v.registerCommand(MD,()=>(b(null),!0),0))},[a,v,g,o,b,t]),I.useEffect(()=>{e&&v&&v.focus()},[e,v]),v?I.createElement(ak,{initialEditor:v},I.createElement(mk,{contentEditable:I.createElement(gD,null),placeholder:I.createElement(`div`,null),ErrorBoundary:bD}),_.map((e,t)=>I.createElement(e,{key:t}))):null},Cz=({parentEditor:e,highlightedCoordinates:t,align:n,lexicalTable:r,colIndex:i,setActiveCellWithBoundaries:a})=>{let o=r.getKey(),[s,c]=Ar(uO,OO),l=I.useCallback(t=>{let n=!1;e.update(()=>{let e=yz(o);e&&(e.insertColumnAt(t),n=!0)},{onUpdate:()=>{n&&a([t,0])}})},[e,a,o]),u=I.useCallback(t=>{e.update(()=>{var e;(e=yz(o))==null||e.deleteColumnAt(t)})},[e,o]),d=I.useCallback((t,n)=>{e.update(()=>{var e;(e=yz(o))==null||e.setColumnAlign(t,n)})},[e,o]),f=ik();return I.createElement(xL,null,I.createElement(cL,{className:X.tableColumnEditorTrigger,"data-active":t[0]===i+1,title:f(`table.columnMenu`,`Column menu`)},c(`more_horiz`)),I.createElement(CL,{container:s?.current},I.createElement(mL,{className:(0,Ek.default)(X.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`top`},I.createElement(uz,{className:X.tableColumnEditorToolbar},I.createElement(pz,{className:X.toggleGroupRoot,onValueChange:e=>{d(i,e)},value:n??`left`,type:`single`,"aria-label":f(`table.textAlignment`,`Text alignment`)},I.createElement(mz,{value:`left`,title:f(`table.alignLeft`,`Align left`)},c(`format_align_left`)),I.createElement(mz,{value:`center`,title:f(`table.alignCenter`,`Align center`)},c(`format_align_center`)),I.createElement(mz,{value:`right`,title:f(`table.alignRight`,`Align right`)},c(`format_align_right`))),I.createElement(dz,null),I.createElement(fz,{onClick:l.bind(null,i),title:f(`table.insertColumnLeft`,`Insert a column to the left of this one`)},c(`insert_col_left`)),I.createElement(fz,{onClick:l.bind(null,i+1),title:f(`table.insertColumnRight`,`Insert a column to the right of this one`)},c(`insert_col_right`)),I.createElement(fz,{onClick:u.bind(null,i),title:f(`table.deleteColumn`,`Delete this column`)},c(`delete_small`))),I.createElement(TL,{className:X.popoverArrow}))))},wz=({parentEditor:e,highlightedCoordinates:t,lexicalTable:n,rowIndex:r,setActiveCellWithBoundaries:i})=>{let a=n.getKey(),[o,s]=Ar(uO,OO),c=I.useCallback(t=>{let n=!1;e.update(()=>{let e=yz(a);e&&(e.insertRowAt(t),n=!0)},{onUpdate:()=>{n&&i([0,t])}})},[e,i,a]),l=I.useCallback(t=>{e.update(()=>{var e;(e=yz(a))==null||e.deleteRowAt(t)})},[e,a]),u=ik();return I.createElement(xL,null,I.createElement(cL,{className:X.tableColumnEditorTrigger,"data-active":t[1]===r,title:u(`table.rowMenu`,`Row menu`)},s(`more_horiz`)),I.createElement(CL,{container:o?.current},I.createElement(mL,{className:(0,Ek.default)(X.tableColumnEditorPopoverContent),onOpenAutoFocus:e=>{e.preventDefault()},sideOffset:5,side:`bottom`},I.createElement(uz,{className:X.tableColumnEditorToolbar},I.createElement(fz,{onClick:c.bind(null,r),title:u(`table.insertRowAbove`,`Insert a row above this one`)},s(`insert_row_above`)),I.createElement(fz,{onClick:c.bind(null,r+1),title:u(`table.insertRowBelow`,`Insert a row below this one`)},s(`insert_row_below`)),I.createElement(fz,{onClick:l.bind(null,r),title:u(`table.deleteRow`,`Delete this row`)},s(`delete_small`))),I.createElement(TL,{className:X.popoverArrow}))))},Tz=Object.defineProperty,Ez=(e,t,n)=>t in e?Tz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dz=(e,t,n)=>Ez(e,typeof t==`symbol`?t:t+``,n),Oz={type:`tableCell`,children:[]};function kz(){let e=CE;return{publish:t=>{e(t)},subscribe:t=>{e=t}}}var Az=class e extends Wl{constructor(e,t){super(t),Dz(this,`__mdastNode`),Dz(this,`focusEmitter`,kz()),this.__mdastNode=e??{type:`table`,children:[]}}static getType(){return`table`}static clone(t){return new e(structuredClone(t.__mdastNode),t.__key)}static importJSON(e){return Mz(e.mdastNode)}static importDOM(){return{table:()=>({conversion:Nz,priority:3})}}exportJSON(){return{mdastNode:structuredClone(this.__mdastNode),type:`table`,version:1}}getMdastNode(){return this.__mdastNode}getRowCount(){return this.__mdastNode.children.length}getColCount(){return this.__mdastNode.children[0]?.children.length||0}createDOM(){return document.createElement(`div`)}updateDOM(){return!1}updateCellContents(e,t,n){let r=this.getWritable().__mdastNode,i=r.children[t],a=i.children,o=a[e],s=Array.from(a),c={...o,children:n},l={...i,children:s};s[e]=c,r.children[t]=l}insertColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,0,structuredClone(Oz)),t.children[n]=o}t.align&&t.align.length>0&&t.align.splice(e,0,`left`)}deleteColumnAt(e){let t=this.getWritable().__mdastNode;for(let n=0;n<t.children.length;n++){let r=t.children[n],i=r.children,a=Array.from(i),o={...r,children:a};a.splice(e,1),t.children[n]=o}}insertRowAt(e){let t=this.getWritable().__mdastNode,n={type:`tableRow`,children:Array.from({length:this.getColCount()},()=>structuredClone(Oz))};t.children.splice(e,0,n)}deleteRowAt(e){this.getRowCount()===1?(this.selectNext(),this.remove()):this.getWritable().__mdastNode.children.splice(e,1)}addRowToBottom(){this.insertRowAt(this.getRowCount())}addColumnToRight(){this.insertColumnAt(this.getColCount())}setColumnAlign(e,t){let n=this.getWritable().__mdastNode;n.align??=[],n.align[e]=t}decorate(e){return I.createElement(bz,{lexicalTable:this,mdastNode:this.__mdastNode,parentEditor:e})}select(e){this.focusEmitter.publish(e??[0,0])}isInline(){return!1}};function jz(e){return e instanceof Az}function Mz(e){return new Az(e)}function Nz(e){let t=e.querySelectorAll(`tr`);return{node:new Az({type:`table`,children:Array.from(t).map(e=>({type:`tableRow`,children:Array.from(e.querySelectorAll(`td, th`)).map(e=>({type:`tableCell`,children:[{type:`text`,value:e.textContent}]}))}))})}}var Pz={testLexicalNode:jz,visitLexicalNode({actions:e,mdastParent:t,lexicalNode:n}){e.appendToParent(t,n.getMdastNode())}},Fz={testNode:`table`,visitNode({mdastNode:e,lexicalParent:t}){t.append(Mz(e))}};function Iz(e=1,t=1){let n={type:`table`,children:[]};for(let r=0;r<e;r++){let e={type:`tableRow`,children:[]};for(let n=0;n<t;n++)e.children.push({type:`tableCell`,children:[]});n.children.push(e)}return n}var Lz=Tr(e=>{e.link(e.pipe(Lz,Mr(({rows:e,columns:t})=>()=>Mz(Iz(e,t)))),XO)}),Rz=zr({init(e,t){e.pubIn({[gO]:kA(),[hO]:VA(),[mO]:Fz,[pO]:Az,[_O]:Pz,[vO]:LA({tableCellPadding:t?.tableCellPadding??!0,tablePipeAlign:t?.tablePipeAlign??!0})})}}),zz=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),Bz=class e extends Hl{__url;__target;__rel;__title;static getType(){return`link`}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){let t=Ud().createElement(`a`);return this.updateLinkDOM(null,t,e),rm(t,e.theme.link),t}updateLinkDOM(e,t,n){if($d(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:Wz,priority:1})}}static importJSON(e){return Gz().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){let t=e;e=eB(e);try{let t=new URL(eB(e));if(!zz.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!zz.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Ad(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!H(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith(`mailto:`)}isWebSiteURI(){return this.__url.startsWith(`https://`)||this.__url.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}};function Vz(e){let t=Np(e,`next`);return[t,t.getFlipped()]}function Hz(e,t){for(let n of t)if(n.origin.isAttached()){Pp(e,Hp(n));return}}function Uz(e){let t=U(),n=null,r=null;function i(){H(t)&&(Hz(t.anchor,n),Hz(t.focus,r),sa(t))}H(t)&&(n=Vz(t.anchor),r=Vz(t.focus));let a=!1;for(let t of yp(e,`next`)){let n=t.origin;if(W(n)&&!n.isInline()){let r=n.getChildren();if(r.length>0){let t=Ad(e);t.append(...r),n.append(t),a=!0}Xp(n,Rp(t),{$shouldSplit:()=>!1})}}function o(e,t,n){let[r,i]=e,a=e=>up(e)&&e.origin.is(t);if(!a(r)&&!a(i))return e;let o=Hp(yp(n,`next`));return[o,o.getFlipped()]}if(e.isAttached()){let t=e.getPreviousSibling();if(Kz(t)&&t.shouldMergeAdjacentLink(e))return n&&=o(n,t,e),r&&=o(r,t,e),t.append(...e.getChildren()),e.remove(),void i();let s=e.getNextSibling();Kz(s)&&e.shouldMergeAdjacentLink(s)&&(n&&=o(n,e,s),r&&=o(r,e,s),e.append(...s.getChildren()),s.remove(),a=!0)}if(a){if(!e.canBeEmpty()&&e.isEmpty()){let t=e.getParent();e.remove(),t&&t.isEmpty()&&t.remove()}i()}}function Wz(e){let t=null;if($d(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=Gz(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function Gz(e=``,t){return jd(new Bz(e,t))}function Kz(e){return e instanceof Bz}var qz=class e extends Bz{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__isUnlinked}static getType(){return`autolink`}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?Ud().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Jz().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){let n=Jz(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};function Jz(e=``,t){return jd(new qz(e,t))}function Yz(e){return e instanceof qz}var Xz=B(`TOGGLE_LINK_COMMAND`);function Zz(e,t){if(e.type===`element`){let n=e.getNode();return W(n)||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function Qz(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=U();if(o===null||!H(o)&&!Cc(o))return;if(Cc(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=Af(e,e=>!Yz(e)&&Kz(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=Af(e,e=>!Yz(e)&&Kz(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a);else{let t=Gz(n,{rel:a,target:r});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=Af(e,e=>!Yz(e)&&Kz(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=Af(t,e=>!Yz(e)&&Kz(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||W(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=Ad(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=Af(e,Kz);if(t!==null)return l(t)}(function(e){let t=U();if(!H(t))return e();let n=sa(t),r=n.isBackward(),i=Zz(n.anchor,r?-1:0),a=Zz(n.focus,r?0:-1);if(e(),i||a){let e=U();if(H(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}Xu(sa(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=Af(t,Kz);if(o){l(o);continue}if(W(t)){if(!t.isInline())continue;if(Kz(t)){if(!(Yz(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();Kz(s)&&s.is(e)?s.append(t):(e=Gz(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var $z=/^\+?[0-9\s()-]{5,}$/;function eB(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:$z.test(e)?`tel:${e}`:`https://${e}`}Mg.tag(`a`);function tB(e,t){return am(e.registerNodeTransform(Bz,Uz),e.registerCommand(Xz,e=>{let n=t.validateUrl.peek(),r=t.attributes.peek();if(e===null)return Qz(null),!0;if(typeof e==`string`)return!(n!==void 0&&!n(e))&&(Qz(e,r),!0);{let{url:t,target:n,rel:i,title:a}=e;return Qz(t,{...r,rel:i,target:n,title:a}),!0}},0),th(()=>{let n=t.validateUrl.value;if(!n)return;let r=t.attributes.value;return e.registerCommand(vo,t=>{let i=U();if(!H(i)||i.isCollapsed()||!Dm(t,ClipboardEvent)||t.clipboardData===null)return!1;let a=t.clipboardData.getData(`text`);return n(a)?!i.getNodes().some(e=>W(e)||V(e)&&!e.isSimpleText())&&(e.dispatchCommand(Xz,{...r,url:a}),t.preventDefault(),!0):!1},1)}))}function nB(e,t=e=>e){return n=>{let r=e.exec(n);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function rB(e,t){for(let n=0;n<t.length;n++){let r=t[n](e);if(r)return r}return null}var iB=/[.,;\s]/;function aB(e,t){return t.test(e)}function oB(e,t){return aB(e[e.length-1],t)}function sB(e,t){return aB(e[0],t)}function cB(e,t){let n=e.getPreviousSibling();return W(n)&&(n=n.getLastDescendant()),n===null||ru(n)||V(n)&&oB(n.getTextContent(),t)}function lB(e,t){let n=e.getNextSibling();return W(n)&&(n=n.getFirstDescendant()),n===null||ru(n)||V(n)&&sB(n.getTextContent(),t)}function uB(e,t,n,r,i){return(e>0?aB(r[e-1],n):cB(i[0],n))?t<r.length?aB(r[t],n):lB(i[i.length-1],n):!1}function dB(e,t,n){let r=[],i=[],a=[],o=0,s=0,c=[...e];for(;c.length>0;){let e=c[0],l=e.getTextContent().length,u=s;s+l<=t?(r.push(e),o+=l):u>=n?a.push(e):i.push(e),s+=l,c.shift()}return[o,r,i,a]}function fB(e,t,n,r){let i=Jz(r.url,r.attributes);if(e.length===1){let a,o=e[0];t===0?[a,o]=o.splitText(n):[,a,o]=o.splitText(t,n);let s=dc(r.text);return s.setFormat(a.getFormat()),s.setDetail(a.getDetail()),s.setStyle(a.getStyle()),i.append(s),a.replace(i),o}if(e.length>1){let r=e[0],a,o=r.getTextContent().length;t===0?a=r:[,a]=r.splitText(t);let s=[],c;for(let t=1;t<e.length;t++){let r=e[t],i=r.getTextContent().length,a=o;if(a<n){if(o+i<=n)s.push(r);else{let[e,t]=r.splitText(n-a);s.push(e),c=t}}o+=i}let l=U(),u=l?l.getNodes().find(V):void 0,d=dc(a.getTextContent());return d.setFormat(a.getFormat()),d.setDetail(a.getDetail()),d.setStyle(a.getStyle()),i.append(d,...s),u&&u===a&&(H(l)?d.select(l.anchor.offset,l.focus.offset):Cc(l)&&d.select(0,d.getTextContent().length)),a.replace(i),c}}function pB(e,t,n,r){let i=e.getChildren(),a=i.length;for(let t=0;t<a;t++){let r=i[t];if(!V(r)||!r.isSimpleText())return mB(e),void n(null,e.getURL())}let o=e.getTextContent(),s=rB(o,t);if(s===null||s.text!==o||!cB(e,r)||!lB(e,r))return mB(e),void n(null,e.getURL());let c=e.getURL();if(c!==s.url&&(e.setURL(s.url),n(s.url,c)),s.attributes){let t=e.getRel();t!==s.attributes.rel&&(e.setRel(s.attributes.rel||null),n(s.attributes.rel||null,t));let r=e.getTarget();r!==s.attributes.target&&(e.setTarget(s.attributes.target||null),n(s.attributes.target||null,r))}}function mB(e){let t=e.getChildren();for(let n=t.length-1;n>=0;n--)e.insertAfter(t[n]);return e.remove(),t.map(e=>e.getLatest())}var hB={changeHandlers:[],excludeParents:[],matchers:[],separatorRegex:iB};function gB(e,t=hB){let{matchers:n,changeHandlers:r,excludeParents:i,separatorRegex:a=iB}=t,o=(e,t)=>{for(let n of r)n(e,t)};return am(e.registerNodeTransform(nc,e=>{let t=e.getParentOrThrow(),r=e.getPreviousSibling();Yz(t)?pB(t,n,o,a):!Kz(t)&&!i.some(e=>e(t))&&(e.isSimpleText()&&(sB(e.getTextContent(),a)||!Yz(r))&&(function(e,t,n,r){for(let t of e){let e=t.getParent();if(Yz(e)&&!e.getIsUnlinked())return}let i=[...e],a=i.map(e=>e.getTextContent()).join(``),o,s=a,c=0;for(;(o=rB(s,t))&&o!==null;){let e=o.index,t=e+o.length;if(uB(c+e,c+t,r,a,i)){let[r,,a,l]=dB(i,c+e,c+t),u=!1;for(let e of a){let t=e.getParent();if(Yz(t)&&!t.getIsUnlinked()){u=!0;break}}if(u){c+=t,s=s.substring(t);continue}let d=fB(a,c+e-r,c+t-r,o);i=d?[d,...l]:l,n(o.url,null),c=0}else c+=t;s=s.substring(t)}})(function(e){let t=[e],n=e.getNextSibling();for(;n!==null&&V(n)&&n.isSimpleText()&&(t.push(n),!/[\s]/.test(n.getTextContent()));)n=n.getNextSibling();return t}(e),n,o,a),(function(e,t,n,r){let i=e.getParent(),a=e.getPreviousSibling(),o=e.getNextSibling(),s=e.getTextContent();if(!Yz(i)||i.getIsUnlinked()){if(Yz(a)&&!a.getIsUnlinked()&&a.is(e.getPreviousSibling())&&e.getParent()===a.getParent()){if(!sB(s,r))return mB(a),void n(null,a.getURL());if(c=s,a.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(c):/^\.[a-zA-Z0-9]{1,}/.test(c)){let i=a.getTextContent()+s,o=rB(i,t);o!==null&&o.text===i&&(a.append(e),pB(a,t,n,r),n(null,a.getURL()))}}var c;!Yz(o)||o.getIsUnlinked()||oB(s,r)||o.is(e.getNextSibling())&&e.getParent()===o.getParent()&&(mB(o),n(null,o.getURL()))}})(e,n,o,a))}),e.registerCommand(Xz,e=>{let t=U();return e!==null||!H(t)||t.extract().forEach(e=>{let t=e.getParent();Yz(t)&&(t.setIsUnlinked(!t.getIsUnlinked()),t.markDirty())}),!1},1))}var _B={testNode:`link`,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(Gz(e.url,{title:e.title}))}},vB={testLexicalNode:Kz,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`link`,{url:e.getURL(),title:e.getTitle()})}};function yB({validateUrl:e,attributes:t}){let[n]=sD();return(0,I.useEffect)(()=>{if(!n.hasNodes([Bz]))throw Error(`LinkPlugin: LinkNode not registered on editor`)}),(0,I.useEffect)(()=>tB(n,nh({attributes:t,validateUrl:e})),[n,e,t]),null}function bB(e,t,n,r){(0,I.useEffect)(()=>{e.hasNodes([qz])||function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77)}),(0,I.useEffect)(()=>gB(e,{changeHandlers:n?[n]:[],excludeParents:r??[],matchers:t}),[e,t,n,r])}function xB({matchers:e,onChange:t,excludeParents:n}){let[r]=sD();return bB(r,e,t,n),null}var SB=[nB(/((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/,e=>e.startsWith(`http`)?e:`https://${e}`),nB(/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,e=>`mailto:${e}`)],CB=()=>I.createElement(xB,{matchers:SB}),wB=R(!1),TB=zr({init(e,t){let n=!!t?.disableAutoLink,r=t?.validateUrl?{validateUrl:t.validateUrl}:{},i=()=>I.createElement(I.Fragment,null,I.createElement(yB,{...r}),n?null:I.createElement(CB,null));e.pubIn({[ek]:`link`,[mO]:_B,[pO]:[Bz,qz],[_O]:vB,[wB]:n,[HO]:i,[WO]:i,[FO]:i})}}),EB=e=>e.type===`checkbox`,DB=e=>e.type===`file`,OB=e=>e instanceof Date,kB=e=>e==null,AB=e=>typeof e==`object`,jB=e=>!kB(e)&&!Array.isArray(e)&&AB(e)&&!OB(e),MB=e=>jB(e)&&e.target?EB(e.target)?e.target.checked:DB(e.target)?e.target.files:e.target.value:e,NB=/[.[\]'"]/,PB=e=>e.split(NB).filter(Boolean);function FB(e,t){let n=PB(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var IB=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),LB=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function RB(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof Blob<`u`&&e instanceof Blob,n=typeof FileList<`u`&&e instanceof FileList;if(LB&&(t||n))return e;let r=Array.isArray(e);if(!r&&e.constructor!==Object)return e;let i=r?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i[t]=RB(e[t]));return i}var zB={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},BB={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},VB={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},HB=[VB.required,VB.min,VB.max,VB.minLength,VB.maxLength,VB.pattern,VB.validate],UB=`form`,WB=`root`,GB=[`__proto__`,`constructor`,`prototype`],KB=/^\w*$/,qB=e=>KB.test(e),JB=e=>e===void 0,Z=(e,t,n)=>{if(!t||!jB(e))return n;let r=qB(t)?[t]:PB(t);if(r.some(e=>GB.includes(e)))return n;let i=r.reduce((e,t)=>kB(e)?void 0:e[t],e);return JB(i)||i===e?JB(e[t])?n:e[t]:i},YB=e=>typeof e==`boolean`,XB=e=>typeof e==`function`,ZB=(e,t,n)=>{let r=-1,i=qB(t)?[t]:PB(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=jB(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(GB.includes(t))return;e[t]=a,e=e[t]}},QB=I.createContext(null);QB.displayName=`HookFormControlContext`;var $B=()=>I.useContext(QB),eV=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==BB.all&&(t._proxyFormState[i]=!r||BB.all),n&&(n[i]=!0),e[i]}});return i},tV=LB?I.useLayoutEffect:I.useEffect,nV=e=>{let t=e.constructor&&e.constructor.prototype;return jB(t)&&t.hasOwnProperty(`isPrototypeOf`)},rV=e=>kB(e)||!AB(e),iV=(e,t)=>t.length===0&&!Array.isArray(e)&&!nV(e);function aV(e,t,n=new WeakMap){if(e===t)return!0;if(rV(e)||rV(t))return Object.is(e,t);if(OB(e)&&OB(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(iV(e,r)||iV(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(OB(r)&&OB(e)||(jB(r)||Array.isArray(r))&&(jB(e)||Array.isArray(e))?!aV(r,e,n):!Object.is(r,e))return!1}}return!0}function oV(e){let t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),i=I.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=RB(e())),{resyncIfNeeded:I.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();aV(r.current,e)||o(e)}t.current=!0},[]),snapshot:I.useCallback((e,t)=>{e&&(r.current=RB(t()))},[])}}function sV(e){let t=$B(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=I.useState(o),l=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:d}=oV(o);return tV(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),d(!r,o)}},[n,i,r,a,u,d]),I.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>eV(s,n,l.current,!1),[s,n])}var cV=e=>typeof e==`string`,lV=(e,t,n,r,i)=>cV(e)?(r&&t.watch.add(e),Z(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Z(n,e,Z(i,e)))):(r&&(t.watchAll=!0),n);function uV(e){let t=$B(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=I.useRef(i),l=I.useRef(s),u=I.useRef(n),d=I.useRef(r);l.current=s;let f=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[p,m]=I.useState(f),h=I.useRef(p),g=I.useCallback(e=>{let t=lV(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),_=I.useCallback(e=>{if(!a){let t=lV(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);aV(e,h.current)||(m(e),h.current=e)}else m(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:v,snapshot:y}=oV(f),b=I.useRef(_);b.current=_;let x=I.useRef(g);x.current=g,tV(()=>{u.current!==n||!aV(d.current,r)?(u.current=n,d.current=r,b.current()):v(!a,()=>x.current(),e=>{m(e),h.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>x.current())}},[n,o,r,a,v,y]),I.useEffect(()=>n._removeUnmounted());let S=u.current!==n,C=d.current;return I.useMemo(()=>{if(a)return!1;let e=!S&&!aV(C,r);return S||e},[a,S,r,C])?g():p}function dV(e){let t=$B(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=IB(i._names.array,n),l=uV({control:i,name:n,defaultValue:I.useMemo(()=>{let e=Z(i._formValues,n,Z(i._defaultValues,n,o));return JB(e)?FB(i,n):e},[i,n,o]),exact:s}),u=sV({control:i,name:n,exact:s}),d=I.useRef(e),f=I.useRef(null),p=I.useRef(i.register(n,{...e.rules,value:l,...YB(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(u.validatingFields,n)},error:{enumerable:!0,get:()=>Z(u.errors,n)}}),[u,n]),h=I.useCallback(e=>{let t=MB(e);return Z(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:MB(e),name:n},type:zB.CHANGE})},[n,i]),g=I.useCallback(()=>p.current.onBlur({target:{value:Z(i._formValues,n),name:n},type:zB.BLUR}),[n,i._formValues]),_=I.useCallback(e=>{e&&(f.current={focus:()=>XB(e.focus)&&e.focus(),select:()=>XB(e.select)&&e.select(),setCustomValidity:t=>XB(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>XB(e.reportValidity)&&e.reportValidity()});let t=Z(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current,t._f._c=!0)},[i._fields,n]),v=I.useMemo(()=>({name:n,value:l,...YB(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return I.useEffect(()=>{let e=i._options.shouldUnregister||a;p.current=i.register(n,{...d.current.rules,...YB(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Z(i._fields,e);n&&n._f&&(n._f.mount=t,n._f._c=t)};if(t(n,!0),e){let e=RB(Z(a?i._defaultValues:i._options.values||i._defaultValues,n,Z(i._options.defaultValues,n,d.current.defaultValue)));ZB(i._defaultValues,n,e),JB(Z(i._formValues,n))&&ZB(i._formValues,n,e)}if(!c&&i.register(n,{...d.current.rules,...YB(d.current.disabled)?{disabled:d.current.disabled}:{}}),f.current){let e=Z(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),I.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),I.useMemo(()=>({field:v,formState:u,fieldState:m}),[v,u,m])}var fV=e=>e.render(dV(e)),pV=e=>({isOnSubmit:!e||e===BB.onSubmit,isOnBlur:e===BB.onBlur,isOnChange:e===BB.onChange,isOnAll:e===BB.all,isOnTouch:e===BB.onTouched}),mV=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},hV=(e,t,n)=>{for(let r of n||Object.keys(e)){if(r===`_f`)continue;let i=n?Z(e,r):e[r];if(i){let{_f:e}=i;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],e.name)||e.ref&&t(e.ref,e.name)||hV(i,t))return!0}else if((jB(i)||Array.isArray(i))&&hV(i,t))return!0}}},gV=(e,t,n)=>{let r=Z(e,n),i=Array.isArray(r)?r:[];return ZB(i,WB,t[n]),ZB(e,n,i),e},_V=e=>jB(e)&&!Object.keys(e).length,vV=e=>{if(!LB)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},yV=e=>e.type===`radio`,bV=e=>e instanceof RegExp,xV=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},SV={value:!1,isValid:!1},CV={value:!0,isValid:!0},wV=e=>{if(!Array.isArray(e))return SV;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?SV:!t.attributes||!(`value`in t.attributes)||JB(t.value)||t.value===``?CV:{value:t.value,isValid:!0}},TV={isValid:!1,value:null},EV=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,TV):TV;function DV(e,t,n=`validate`){if(cV(e)||Array.isArray(e)&&e.every(cV)||YB(e)&&!e)return{type:n,message:cV(e)?e:``,ref:t}}var OV=e=>jB(e)&&!bV(e)?e:{value:e,message:``},kV=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_,_c:v}=e._f,y=Z(n,h);if(!_||t.has(h))return{};let b=s?s[0]:o,x=e=>{if(i&&b.reportValidity){let t=YB(e)?``:e||``;s?s.forEach(e=>XB(e.setCustomValidity)&&e.setCustomValidity(t)):b.setCustomValidity(t),b.reportValidity()}},S={},C=yV(o),w=EB(o),T=C||w,E=(g||DB(o))&&JB(o.value)&&JB(y)||vV(o)&&o.value===``&&!v||y===``||Array.isArray(y)&&!y.length,D=xV.bind(null,h,r,S),O=(e,t,n,r=VB.maxLength,i=VB.minLength)=>{let a=e?t:n;S[h]={type:e?r:i,message:a,ref:o,...D(e?r:i,a)}};if(a?!Array.isArray(y)||!y.length:c&&(!T&&(E||kB(y))||YB(y)&&!y||w&&!wV(s).isValid||C&&!EV(s).isValid)){let{value:e,message:t}=cV(c)?{value:!!c,message:c}:OV(c);if(e&&(S[h]={type:VB.required,message:t,ref:b,...D(VB.required,t)},!r))return x(t),S}if(!E&&(!kB(d)||!kB(f))){let e,t,n=OV(f),i=OV(d);if(!kB(y)&&!OB(y)&&!isNaN(y)){let r=o.valueAsNumber||y&&+y;kB(n.value)||(e=r>n.value),kB(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(y),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;cV(n.value)&&y&&(e=s?a(y)>a(n.value):c?y>n.value:r>new Date(n.value)),cV(i.value)&&y&&(t=s?a(y)<a(i.value):c?y<i.value:r<new Date(i.value))}if((e||t)&&(O(!!e,n.message,i.message,VB.max,VB.min),!r))return x(S[h].message),S}if((l||u)&&!E&&(cV(y)||a&&Array.isArray(y))){let e=OV(l),t=OV(u),n=!kB(e.value)&&y.length>+e.value,i=!kB(t.value)&&y.length<+t.value;if((n||i)&&(O(n,e.message,t.message),!r))return x(S[h].message),S}if(p&&!E&&cV(y)){let{value:e,message:t}=OV(p);if(bV(e)&&!y.match(e)&&(S[h]={type:VB.pattern,message:t,ref:o,...D(VB.pattern,t)},!r))return x(t),S}if(m){if(XB(m)){let e=DV(await m(y,n),b);if(e&&(S[h]={...e,...D(VB.validate,e.message)},!r))return x(e.message),S}else if(jB(m)){let e={};for(let t in m){if(!_V(e)&&!r)break;let i=DV(await m[t](y,n),b,t);i&&(e={...i,...D(t,i.message)},r||x(i.message),r&&(S[h]=e))}if(!_V(e)&&(S[h]={ref:b,...e},!r))return S}}let k=S[h];return x(!k||k.message),S},AV=e=>Array.isArray(e)?e:[e],jV=e=>Array.isArray(e)?e.filter(Boolean):[];function MV(e,t){let n=t.length-1,r=0;for(;r<n;){if(kB(e)){e=void 0;break}e=e[t[r]],r++}return e}function NV(e){for(let t in e)if(e.hasOwnProperty(t)&&!JB(e[t]))return!1;return!0}function PV(e,t){if(cV(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:qB(t)?[t]:PB(t);if(n.some(e=>GB.includes(String(e))))return e;let r=n.length===1?e:MV(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(jB(r)&&_V(r)||Array.isArray(r)&&NV(r))&&PV(e,n.slice(0,-1)),e}var FV=I.createContext(null);FV.displayName=`HookFormContext`;var IV=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function LV(e,t){let n=Array.isArray(e)?[]:{};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];i&&(jB(i)||Array.isArray(i))&&a?n[r]=LV(i,a):e[r]&&(n[r]=a)}return n}var RV=(e,t)=>e!==null&&AB(e)&&Object.prototype.hasOwnProperty.call(e,t),zV=(e,t)=>{if(!t)return!1;let n=e;for(let r of qB(t)?[t]:PB(t)){if(!RV(n,r))return RV(e,t);n=n[r]}return!0},BV=e=>e.type===`select-multiple`,VV=e=>yV(e)||EB(e),HV=e=>vV(e)&&e.isConnected;function UV(e){return Array.isArray(e)||jB(e)}function WV(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];UV(o)&&UV(Z(t,a))?WV(o,t,a,r):r.push(a)}return r}var GV=e=>{for(let t in e)if(XB(e[t]))return!0;return!1};function KV(e){return Array.isArray(e)||jB(e)&&!GV(e)}function qV(e){return!!(e&&`_f`in e)}function JV(e){return Array.isArray(e)?!e.some(e=>!JB(e)):!Object.keys(e).length}function YV(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function XV(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];KV(i)&&(!Array.isArray(i)||!qV(a))?(t[r]=Array.isArray(i)?[]:{},XV(i,t[r],a),JV(t[r])&&YV(t,r)):JB(i)||(t[r]=!0)}return t}function ZV(e,t,n,r){n||=XV(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];KV(a)&&(!Array.isArray(a)||!qV(o))?(JB(t)||rV(n[i])?n[i]=XV(a,Array.isArray(a)?[]:{},o):ZV(a,kB(t)?{}:t[i],n[i],o),JV(n[i])&&YV(n,i)):aV(a,t[i])?YV(n,i):n[i]=!0}return n}var QV=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},$V=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>JB(e)?e:t?e===``?NaN:e&&+e:n&&cV(e)?new Date(e):r?r(e):e;function eH(e){let t=e.ref;return DB(t)?t.files:yV(t)?EV(e.refs).value:BV(t)?[...t.selectedOptions].map(({value:e})=>e):EB(t)?wV(e.refs).value:$V(t.value,e)}var tH=(e,t,n,r)=>{let i={};for(let n of e){let e=Z(t,n);e&&ZB(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},nH=e=>JB(e)?e:bV(e)?e.source:jB(e)?bV(e.value)?e.value.source:e.value:e,rH=`AsyncFunction`,iH=e=>{if(!e||!e.validate)return!1;if(XB(e.validate))return e.validate.constructor.name===rH;if(jB(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===rH)return!0}return!1},aH=e=>e.mount&&(e.required||!JB(e.required)&&e.required!==!1||!JB(e.min)||!JB(e.max)||!JB(e.maxLength)||!JB(e.minLength)||e.pattern||e.validate);function oH(e,t,n){let r=Z(e,n);if(r?.type||r?.message||Array.isArray(r))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Z(t,r),o=Z(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var sH=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||BB.all))},cH=(e,t,n)=>!e||!t||e===t||AV(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),lH=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,uH=(e,t)=>{let n=Z(e,t);!jV(n).length&&!(n!=null&&n.root)&&PV(e,t)},dH={mode:BB.onSubmit,reValidateMode:BB.onChange,shouldFocusError:!0},fH=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},pH={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function mH(e={}){let t={...dH,...e},n={...RB(pH),isLoading:XB(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(jB(t.defaultValues)||jB(t.values))&&RB(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:RB(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=pV(t.mode),f=pV(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g=(...e)=>e.some(e=>m[e]||h[e]),_={array:IV(),state:IV()},v=0,y=0,b=t.criteriaMode===BB.all,x=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},S=e=>{clearTimeout(l[e]),delete l[e],delete c[e]},C=e=>{S(e);let t=`${e}.`;for(let e of Object.keys(c))e.startsWith(t)&&S(e)},w=async e=>{if(!o.keepIsValid&&!t.disabled&&(g(`isValid`)||e)){let e=++v,i;t.resolver?(i=_V((await M()).errors),e===v&&T()):i=await ae({fields:r,onlyCheckValid:!0,eventType:zB.VALID}),e===v&&i!==n.isValid&&_.state.next({isValid:i})}},T=(e,r)=>{!t.disabled&&g(`isValidating`,`validatingFields`)&&((e||s.mount).forEach(e=>{e&&(r?ZB(n.validatingFields,e,r):PV(n.validatingFields,e))}),_.state.next({validatingFields:n.validatingFields,isValidating:!_V(n.validatingFields)}))},E=()=>{n.dirtyFields=ZV(i,a,void 0,r)},D=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=Z(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&ZB(r,e,n)}let a=Z(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&ZB(n.errors,e,r),uH(n.errors,e)}let d=Z(n.touchedFields,e),f=u&&Array.isArray(d);if(f){let t=s(d,c.argA,c.argB);l&&ZB(n.touchedFields,e,t)}let p=Z(n.dirtyFields,e);if(u&&Array.isArray(p)){let t=s(p,c.argA,c.argB)||p;l&&ZB(n.dirtyFields,e,t)}g(`dirtyFields`)&&E(),_.state.next({name:e,isDirty:se(e,i),dirtyFields:n.dirtyFields,...f&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else ZB(a,e,i)},O=(e,t)=>{ZB(n.errors,e,t),n.errors={...n.errors},_.state.next({errors:n.errors})},k=e=>{Object.keys(c).forEach(S);let t=!_V(e);n.errors=e,_.state.next({errors:n.errors,...t?{isValid:!1}:{}}),!t&&o.mount&&w()},ee=e=>{let t=qB(e)?[e]:PB(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=kB(n)?n:n[i],r=kB(r)?r:r[i],n===null&&r!==null)return!0}return!1},te=e=>{if(!o.actionArrayLengths.size)return!1;let t=qB(e)?[e]:PB(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(kB(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;if(o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a],JB(n)&&i!==-1&&e>i&&+t[i]<s)return!0}return!1},A=(c,l,u,d)=>{let f=Z(r,c);if(f){if(ee(c)||te(c))return;let r=JB(Z(a,c)),p=Z(a,c,JB(u)?Z(i,c):u);JB(p)||d&&d.defaultChecked||l?ZB(a,c,l?p:eH(f._f)):ue(c,p),o.mount&&!o.action&&(t.resolver&&g(`isValidating`,`validatingFields`)?Promise.resolve().then(()=>w()):w(),r&&n.isDirty&&g(`isDirty`)&&(se()||(n.isDirty=!1,_.state.next({...n}))),e.shouldUnregister&&r&&!JB(Z(a,c))&&mV(c,s)&&(o.watch=!0))}},j=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=aV(Z(i,e),o);g(`isDirty`)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||se(),u=d!==f.isDirty),d=!!Z(n.dirtyFields,e),t===n.isDirty?t?PV(n.dirtyFields,e):ZB(n.dirtyFields,e,!0):fH(n.dirtyFields,ZV(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=g(`dirtyFields`)&&d!==!t}if(s){let t=Z(n.touchedFields,e);t||(ZB(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=g(`touchedFields`)&&t!==s)}u&&l&&_.state.next(f)}return u?f:{}},ne=(e,r,i,a)=>{let o=Z(n.errors,e),s=g(`isValid`)&&YB(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=x(e,()=>O(e,i)),c[e](t.delayError)):(S(e),i?ZB(n.errors,e,i):PV(n.errors,e),n.errors={...n.errors}),(i?!aV(o,i):o)||!_V(a)||s){let t={...a,...s&&YB(r)?{isValid:r}:{},errors:n.errors,name:e};_.state.next(t)}},M=async e=>(T(e,!0),await t.resolver(a,t.context,tH(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),re=async e=>{let t=y,{errors:i}=await M(e);if(t!==y)return i;if(T(e),e){for(let t of e){let e=Z(i,t);C(t);let a=s.array.has(t)&&jB(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e))),o=Z(r,t),c=jB(o)&&Object.keys(o).some(e=>e!==`_f`);a?gV(n.errors,{[t]:e},t):e?.type||e?.message||Array.isArray(e)||jB(e)&&c?ZB(n.errors,t,e):PV(n.errors,t)}n.errors={...n.errors}}else Object.keys(c).forEach(S),n.errors=i;return i},ie=async({name:e,eventType:r})=>{if(t.validate){let i=y,o=await t.validate({formValues:a,formState:n,name:e,eventType:r});if(i!==y)return!0;if(jB(o)){let e=!0;xe(UB);for(let t in o){let n=o[t];n&&(e=!1,Se(`${UB}.${t}`,{message:cV(n.message)?n.message:``,type:n.type||VB.validate}))}return e}return cV(o)||!o?(Se(UB,{message:o||``,type:VB.validate}),!1):(xe(UB),!0)}return!0},ae=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{let u=y;if(t.validate&&!l.runRootValidation&&(l.runRootValidation=!0,!await ie({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let d=r[o];if(d){let{_f:r,...f}=d;if(r){let o=s.array.has(r.name),c=d._f&&iH(d._f),f=g(`isValidating`,`validatingFields`);c&&f&&T([r.name],!0);let p=await kV(d,s.disabled,a,b,t.shouldUseNativeValidation&&!i,o);if(u!==y)return l.valid;if(c&&f&&T([r.name]),p[r.name]&&(l.valid=!1,i)||(i||(S(r.name),Z(p,r.name)?o?gV(n.errors,p,r.name):ZB(n.errors,r.name,p[r.name]):PV(n.errors,r.name)),e.shouldUseNativeValidation&&p[r.name]))break}!_V(f)&&await ae({context:l,onlyCheckValid:i,fields:f,name:o,eventType:c})}}return l.valid},oe=()=>{for(let e of s.unMount){let t=Z(r,e);t&&(t._f.refs?t._f.refs.every(e=>!HV(e)):!HV(t._f.ref))&&Ee(e)}s.unMount=new Set},se=(e,t)=>(e&&t&&ZB(a,e,t),!aV(o.mount?a:i,i)),ce=(e,t,n)=>lV(e,s,{...o.mount?a:JB(t)||cV(e)?i:t},n,t),le=e=>jV(Z(o.mount?a:i,e,t.shouldUnregister?Z(i,e,[]):[])),ue=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=Z(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&ZB(a,e,$V(t,n)),l=vV(n.ref)&&kB(t)?``:t,BV(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?EB(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):DB(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&_.state.next({name:e,values:i?a:RB(a)})))}(n.shouldDirty||n.shouldTouch)&&j(e,c&&c._f&&!c._f.disabled&&(c._f.valueAsNumber||c._f.valueAsDate||c._f.setValueAs)?$V(t,c._f):l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&_e(e,{delayError:n.delayError}),n.shouldValidate&&c&&c._f&&c._f.deps&&(!Array.isArray(c._f.deps)||c._f.deps.length>0)&&_e(c._f.deps)},de=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&_.array.next({name:e,values:i?a:RB(a)});for(let a in t){if(!t.hasOwnProperty(a))continue;let l=t[a],u=e+`.`+a,d=Z(r,u);(s.array.has(e)||jB(l)||d&&!d._f)&&!OB(l)?de(u,l,n,i,o,c):ue(u,l,n,i,o,c)}},fe=(e,t,i,c,l=!1)=>{let u=Z(r,e),d=s.array.has(e),f=c?t:RB(t),p=aV(Z(a,e),f);if(p||ZB(a,e,f),d)_.array.next({name:e,values:c?a:RB(a)}),g(`isDirty`,`dirtyFields`)&&i.shouldDirty&&(E(),l||_.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:se(e,f)})),i.shouldValidate&&_e(e,{delayError:i.delayError});else{let t=Array.isArray(f)&&!f.length||_V(f),n=!p&&!l;!u||u._f||kB(f)||t?ue(e,f,i,c,l,n):de(e,f,i,c,l,n)}if(!p&&!l){let t=mV(e,s),r=c?a:RB(a);if(_.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of QV(s.array,e))_.state.next({name:t,values:r})}},pe=(e,t,n={})=>fe(e,t,n,!1),me=(e,t={})=>{let r=XB(e)?e(a):e;if(!aV(a,r)){a={...a,...r};for(let e of s.mount)zV(r,e)&&fe(e,Z(r,e),t,!0,!0);_.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&w()}},he=async e=>{o.mount=!0;let i=e.target,l=i.name,p=!0,m=Z(r,l),h=e=>{p=Number.isNaN(e)||OB(e)&&isNaN(e.getTime())||aV(e,Z(a,l,e))};if(m){let o,v,x=i.type?eH(m._f):MB(e),S=e.type===zB.BLUR||e.type===zB.FOCUS_OUT,C=!aH(m._f)&&!t.validate&&!t.resolver&&!Z(n.errors,l)&&!m._f.deps,E=C||lH(S,Z(n.touchedFields,l),n.isSubmitted,f,d),D=mV(l,s,S);if(ZB(a,l,RB(x)),S){if(!i||!i.readOnly){m._f.onBlur&&m._f.onBlur(e);let t=c[l];t&&t(0)}}else m._f.onChange&&m._f.onChange(e);let O=j(l,x,S),k=!_V(O)||D;if(!S&&_.state.next({name:l,type:e.type,...u?{values:RB(a)}:{}}),E)return(!C||!n.isValid)&&g(`isValid`)&&(t.mode===`onBlur`?S&&w():S||w()),k&&_.state.next({name:l,...D?{}:O});if(!t.resolver&&t.validate&&await ie({name:l,eventType:e.type}),!S&&D&&_.state.next({...n}),t.resolver){let e=y,{errors:t}=await M([l]);if(e!==y)return;if(T([l]),h(x),!p){!_V(O)&&_.state.next(O);return}let i=oH(n.errors,r,l),a=oH(t,r,i.name||l);o=a.error,l=a.name,v=_V(t)}else{let n=y;if(T([l],!0),o=(await kV(m,s.disabled,a,b,t.shouldUseNativeValidation))[l],n!==y)return;if(T([l]),h(x),p){if(o)v=!1;else if(g(`isValid`)&&(v=await ae({fields:r,onlyCheckValid:!0,name:l,eventType:e.type}),n!==y))return}}p&&(m._f.deps&&(!Array.isArray(m._f.deps)||m._f.deps.length>0)&&_e(m._f.deps),ne(l,v,o,O))}},ge=(e,t)=>{if(Z(n.errors,t)&&e.focus)return e.focus(),1},_e=async(e,i={})=>{let a,o,l=AV(e);if(t.resolver){let t=y,n=await re(JB(e)?e:l);if(a=_V(n),o=e?!l.some(e=>Z(n,e)):a,t!==y)return o}else e?(o=(await Promise.all(l.map(async e=>{let t=Z(r,e);return await ae({fields:t&&t._f?{[e]:t}:t,eventType:zB.TRIGGER})}))).every(Boolean),(o||n.isValid)&&w()):o=a=await ae({fields:r,name:e,eventType:zB.TRIGGER});if(i.delayError&&t.delayError&&cV(e)){let r=Z(n.errors,e);r?(PV(n.errors,e),c[e]=x(e,()=>O(e,r)),c[e](t.delayError)):S(e)}if(i.shouldTouch)for(let t of e?l:s.mount)!s.array.has(t)&&ZB(n.touchedFields,t,!0);return _.state.next({...!cV(e)||g(`isValid`)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&g(`touchedFields`)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!o&&hV(r,ge,e?l:s.mount),o},ve=(e,t)=>{let r={...o.mount?a:i};return t&&(r=LV(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),JB(e)?r:cV(e)?Z(r,e):e.map(e=>Z(r,e))},ye=e=>JB(e)?{...n.errors}:cV(e)?Z(n.errors,e):e.map(e=>Z(n.errors,e)),be=(e,t)=>{let r=t||n,i=Z(r.errors,e);return{invalid:!!i,isDirty:!!Z(r.dirtyFields,e),error:i,isValidating:!!Z(r.validatingFields,e),isTouched:!!Z(r.touchedFields,e)}},xe=e=>{let t=e?AV(e):void 0;t?t.forEach(e=>{C(e),PV(n.errors,e),_.state.next({name:e,errors:n.errors})}):(Object.keys(c).forEach(S),n.errors={},_.state.next({errors:n.errors}))},Se=(e,t,i)=>{C(e);let a=(Z(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,types:l,...u}=Z(n.errors,e)||{};ZB(n.errors,e,{...u,...t,ref:a}),_.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},Ce=(e,t)=>{if(XB(e)){u++;let{unsubscribe:n}=_.state.subscribe({next:n=>`values`in n&&e(n.values||ce(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return ce(e,t,!0)},we=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=_.state.subscribe({next:t=>{if(cH(e.name,t.name,e.exact)&&sH(t,e.formState||m,Fe,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},Te=e=>(o.mount=!0,h={...h,...e.formState},we({...e,formState:{...p,...e.formState}})),Ee=(e,o={})=>{for(let c of e?AV(e):s.mount)s.mount.delete(c),s.array.delete(c),s.disabled.delete(c),o.keepValue||(PV(r,c),PV(a,c)),o.keepError||(C(c),PV(n.errors,c)),!o.keepDirty&&PV(n.dirtyFields,c),!o.keepTouched&&PV(n.touchedFields,c),!o.keepIsValidating&&PV(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&PV(i,c);u&&_.state.next({values:RB(a)}),_.state.next({...n,...o.keepDirty?{}:{isDirty:se()},...o.keepIsValidating?{}:{isValidating:!_V(n.validatingFields)}}),!o.keepIsValid&&w()},De=({disabled:e,name:t})=>{if(YB(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&w()}},Oe=(e,n={})=>{let a=Z(r,e),c=YB(n.disabled)||YB(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;if(ZB(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&a._f){let t=Z(r,e);for(let e of HB)e in n||delete t._f[e]}return a&&!l?De({disabled:YB(n.disabled)?n.disabled:t.disabled,name:e}):A(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:nH(n.min),max:nH(n.max),minLength:nH(n.minLength),maxLength:nH(n.maxLength),pattern:nH(n.pattern)}:{},name:e,onChange:he,onBlur:he,ref:c=>{if(c){s.registerName.add(e),Oe(e,n),s.registerName.delete(e),a=Z(r,e);let t=JB(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=VV(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(HV),t,...Array.isArray(Z(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),ZB(r,e,{_f:u}),A(e,!1,void 0,t)}else a=Z(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(IB(s.array,e)&&o.action)&&s.unMount.add(e)}}},ke=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&hV(r,ge,s.mount),Ae=e=>{YB(e)&&(_.state.next({disabled:e}),hV(r,(t,n)=>{let i=Z(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0))},je=(e,i)=>async o=>{let l,u;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let d=RB(a);if(_.state.next({isSubmitting:!0}),t.resolver){let e=y,{errors:t,values:r}=await M();if(e!==y)return;T(),Object.keys(c).forEach(S),n.errors=t,d=RB(r)}else{let e=y;if(await ae({fields:r,eventType:zB.SUBMIT}),e!==y)return;PV(n.errors,WB)}if(s.disabled.size)for(let e of s.disabled)PV(d,e);if(_V(n.errors)){_.state.next({errors:{}});try{l=await e(d,o)}catch(e){u=e}}else i&&await i({...n.errors},o),ke(),setTimeout(ke);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:_V(n.errors)&&!u,submitCount:n.submitCount+1,errors:n.errors}),u)throw u;return l},Me=(e,t={})=>{Z(r,e)&&(PV(n.validatingFields,e),JB(t.defaultValue)?pe(e,RB(Z(i,e))):(pe(e,t.defaultValue),ZB(i,e,RB(t.defaultValue))),t.keepTouched||PV(n.touchedFields,e),t.keepDirty||(PV(n.dirtyFields,e),n.isDirty=t.defaultValue?se(e,RB(Z(i,e))):se()),t.keepError||(C(e),PV(n.errors,e),w()),_.state.next({...n,isValidating:!_V(n.validatingFields)}))},Ne=(e,l={})=>{y++;let u=e?RB(e):i,d=RB(u),f=_V(e),p=d,h=r;if(Object.keys(c).forEach(S),l.keepDefaultValues||(i=u),!l.keepValues){if(l.keepDirtyValues){let e=new Set([...s.mount,...WV(ZV(i,a,void 0,h),n.dirtyFields)]);for(let t of e){let e=Z(n.dirtyFields,t),r=Z(a,t),i=Z(p,t);e&&!JB(r)?ZB(p,t,r):!e&&!JB(i)&&pe(t,i)}}else{if(LB&&JB(e))for(let e of s.mount){let t=Z(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(vV(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(l.keepFieldsRef)for(let e of s.mount)pe(e,Z(p,e));else r={}}if(t.shouldUnregister){if(a=l.keepDefaultValues?RB(i):{},l.keepFieldsRef)for(let e of s.mount)ZB(a,e,Z(p,e))}else a=RB(p);_.array.next({values:{...p}}),_.state.next({name:void 0,type:void 0,values:{...p}})}s={mount:l.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!l.keepIsValid||!!l.keepDirtyValues||!t.shouldUnregister&&!_V(p),o.watch=!!t.shouldUnregister,o.keepIsValid=!!l.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),l.keepErrors||(n.errors={}),_.state.next({submitCount:l.keepSubmitCount?n.submitCount:0,isDirty:f?!1:l.keepDirty?n.isDirty:l.keepValues?se():!(!l.keepDefaultValues||aV(e,i)),isSubmitted:l.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:f?{}:l.keepDirtyValues?l.keepDefaultValues&&a?ZV(i,a,void 0,h):n.dirtyFields:l.keepDefaultValues&&e?ZV(i,e,void 0,h):l.keepDirty?n.dirtyFields:l.keepValues?ZV(i,a,void 0,h):{},touchedFields:l.keepTouched?n.touchedFields:{},...!l.keepIsValidating&&(n.isValidating||!_V(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:l.keepErrors?n.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},N=(e,n)=>Ne(XB(e)?e(a):e,{...t.resetOptions,...n}),Pe=(e,t={})=>{let n=Z(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&XB(e.select)&&e.select()})}},Fe=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};_.state.subscribe({next:Fe});let Ie={control:{register:Oe,unregister:Ee,getFieldState:be,handleSubmit:je,setError:Se,_subscribe:we,_runSchema:M,_updateIsValidating:T,_focusError:ke,_getWatch:ce,_getDirty:se,_setValid:w,_setFieldArray:D,_setDisabledField:De,_setErrors:k,_getFieldArray:le,_reset:Ne,_resetDefaultValues:()=>XB(t.defaultValues)&&t.defaultValues().then(e=>{N(e,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:oe,_disableForm:Ae,_subjects:_,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=pV(t.mode),f=pV(t.reValidateMode),b=t.criteriaMode===BB.all}},subscribe:Te,trigger:_e,register:Oe,handleSubmit:je,watch:Ce,setValue:pe,setValues:me,getValues:ve,getErrors:ye,reset:N,resetField:Me,resetDefaultValues:(e,t={})=>{if(i=RB(e),!t.keepDirty){let e=ZV(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!_V(e)}t.keepIsValid||w(),_.state.next({...n,defaultValues:i})},clearErrors:xe,unregister:Ee,setError:Se,setFocus:Pe,getFieldState:be};return{...Ie,formControl:Ie}}function hH(e={}){let t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),i=I.useRef(!!e.validate),[a,o]=I.useState(()=>({...RB(pH),isLoading:XB(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:XB(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:a},e.defaultValues&&!XB(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=mH(e);t.current={...r,formState:a}}}let s=t.current.control;s._options={...e,validate:e.validate};let c=()=>({...s._formState,defaultValues:s._defaultValues}),{resyncIfNeeded:l,snapshot:u}=oV(c);return tV(()=>{l(!0,c,o);let e=s._subscribe({formState:s._proxyFormState,callback:()=>o({...s._formState,defaultValues:s._defaultValues}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),s._formState.isReady=!0,()=>{e(),u(!0,c)}},[s,l,u]),I.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),I.useEffect(()=>{e.mode&&(s._options.mode=e.mode),e.reValidateMode&&(s._options.reValidateMode=e.reValidateMode)},[s,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(s._setErrors(e.errors),s._focusError())},[s,e.errors]),I.useEffect(()=>{var n;i.current&&!e.validate&&((n=t.current)==null||n.clearErrors(UB)),i.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&s._subjects.state.next({values:s._getWatch()})},[s,e.shouldUnregister]),I.useEffect(()=>{if(s._proxyFormState.isDirty){let e=s._getDirty();e!==a.isDirty&&s._subjects.state.next({isDirty:e})}},[s,a.isDirty]),I.useEffect(()=>{e.values&&!aV(e.values,n.current)?(s._reset(e.values,{keepFieldsRef:!0,...s._options.resetOptions}),s._options.resetOptions?.keepIsValid||s._setValid(),n.current=e.values,o(e=>({...e}))):s._resetDefaultValues()},[s,e.values]),I.useEffect(()=>{s._state.mount||(s._setValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),t.current.formState=I.useMemo(()=>eV(a,s),[s,a]),t.current}function gH(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function _H(){return _H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_H.apply(null,arguments)}var vH=e(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),yH=e(((e,t)=>{var n=vH();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),bH=e(((e,t)=>{t.exports=yH()()})),xH=e((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}})),SH=e(((e,t)=>{t.exports=xH()})),CH=e=>typeof e==`object`&&!!e&&e.nodeType===1,wH=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,TH=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return wH(n.overflowY,t)||wH(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},EH=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,DH=e=>e.parentElement??(e.getRootNode().host||null),OH=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:o}=t,s=typeof a==`function`?a:e=>e!==a;if(!CH(e))throw TypeError(`Invalid target`);let c=document.scrollingElement||document.documentElement,l=[],u=e;for(;CH(u)&&s(u);){if(u=DH(u),u===c){l.push(u);break}u!=null&&u===document.body&&TH(u)&&!TH(document.documentElement)||u!=null&&TH(u,o)&&l.push(u)}let d=window.visualViewport?.width??innerWidth,f=window.visualViewport?.height??innerHeight,p=window.scrollX??pageXOffset,m=window.scrollY??pageYOffset,{height:h,width:g,top:_,right:v,bottom:y,left:b}=e.getBoundingClientRect(),x=r===`start`||r===`nearest`?_:r===`end`?y:_+h/2,S=i===`center`?b+g/2:i===`end`?v:b,C=[];for(let e=0;e<l.length;e++){let t=l[e],{height:a,width:o,top:s,right:u,bottom:w,left:T}=t.getBoundingClientRect();if(n===`if-needed`&&_>=0&&b>=0&&y<=f&&v<=d&&_>=s&&y<=w&&b>=T&&v<=u)return C;let E=getComputedStyle(t),D=parseInt(E.borderLeftWidth,10),O=parseInt(E.borderTopWidth,10),k=parseInt(E.borderRightWidth,10),ee=parseInt(E.borderBottomWidth,10),te=0,A=0,j=`offsetWidth`in t?t.offsetWidth-t.clientWidth-D-k:0,ne=`offsetHeight`in t?t.offsetHeight-t.clientHeight-O-ee:0,M=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,re=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(c===t)te=r===`start`?x:r===`end`?x-f:r===`nearest`?EH(m,m+f,f,O,ee,m+x,m+x+h,h):x-f/2,A=i===`start`?S:i===`center`?S-d/2:i===`end`?S-d:EH(p,p+d,d,D,k,p+S,p+S+g,g),te=Math.max(0,te+m),A=Math.max(0,A+p);else{te=r===`start`?x-s-O:r===`end`?x-w+ee+ne:r===`nearest`?EH(s,w,a,O,ee+ne,x,x+h,h):x-(s+a/2)+ne/2,A=i===`start`?S-T-D:i===`center`?S-(T+o/2)+j/2:i===`end`?S-u+k+j:EH(T,u,o,D,k+j,S,S+g,g);let{scrollLeft:e,scrollTop:n}=t;te=Math.max(0,Math.min(n+te/re,t.scrollHeight-a/re+ne)),A=Math.max(0,Math.min(e+A/M,t.scrollWidth-o/M+j)),x+=n-te,S+=e-A}C.push({el:t,top:te,left:A})}return C},Q=a(bH());SH();var kH=0;function AH(){}function jH(e,t){e&&OH(e,{boundary:t,block:`nearest`,scrollMode:`if-needed`}).forEach(function(e){var t=e.el,n=e.top,r=e.left;t.scrollTop=n,t.scrollLeft=r})}function MH(e,t,n){return e===t||t instanceof n.Node&&e.contains&&e.contains(t)}function NH(e,t){var n;function r(){n&&clearTimeout(n)}function i(){var i=[...arguments];r(),n=setTimeout(function(){n=null,e.apply(void 0,i)},t)}return i.cancel=r,i}function PH(){var e=[...arguments];return function(t){var n=[...arguments].slice(1);return e.some(function(e){return e&&e.apply(void 0,[t].concat(n)),t.preventDownshiftDefault||t.hasOwnProperty(`nativeEvent`)&&t.nativeEvent.preventDownshiftDefault})}}function FH(){var e=[...arguments];return function(t){e.forEach(function(e){typeof e==`function`?e(t):e&&(e.current=t)})}}function IH(){return String(kH++)}function LH(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:n+` result`+(n===1?` is`:`s are`)+` available, use up and down arrow keys to navigate. Press Enter key to select.`:`No results are available.`:``}function RH(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=zH(t,r)?t[r]:e[r],n},{})}function zH(e,t){return e[t]!==void 0}function BH(e){var t=e.key,n=e.keyCode;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow`+t:t}function VH(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!=`number`||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=HH(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function HH(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute(`disabled`))return t;if(e>0){for(var o=t+1;o<n;o++)if(!r(o).hasAttribute(`disabled`))return o}else for(var s=t-1;s>=0;s--)if(!r(s).hasAttribute(`disabled`))return s;return i?e>0?HH(1,0,n,r,!1):HH(-1,n-1,n,r,!1):-1}function UH(e,t,n,r){return r===void 0&&(r=!0),t.some(function(t){return t&&(MH(t,e,n)||r&&MH(t,n.document.activeElement,n))})}var WH=NH(function(e){KH(e).textContent=``},500);function GH(e,t){var n=KH(t);e&&(n.textContent=e,WH(t))}function KH(e){e===void 0&&(e=document);var t=e.getElementById(`a11y-status-message`);return t||(t=e.createElement(`div`),t.setAttribute(`id`,`a11y-status-message`),t.setAttribute(`role`,`status`),t.setAttribute(`aria-live`,`polite`),t.setAttribute(`aria-relevant`,`additions text`),Object.assign(t.style,{border:`0`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`}),e.body.appendChild(t),t)}var qH=[`isInitialMount`,`highlightedIndex`,`items`,`environment`],JH={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:``};function YH(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(r){XH(r,e,t,n),n[r]!==t[r]&&(a[r]=n[r])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(_H({type:i},a))}function XH(e,t,n,r){var i=t.props,a=t.type,o=`on`+aU(e)+`Change`;i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](_H({type:a},r))}function ZH(e,t){return t.changes}function QH(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+` has been selected.`:``}var $H=NH(function(e,t){GH(e(),t)},200),eU=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?I.useLayoutEffect:I.useEffect;function tU(e){var t=e.id,n=t===void 0?`downshift-`+IH():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId;return(0,I.useRef)({labelId:r||n+`-label`,menuId:i||n+`-menu`,getItemId:a||function(e){return n+`-item-`+e},toggleButtonId:o||n+`-toggle-button`,inputId:s||n+`-input`}).current}function nU(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function rU(e){return e?String(e):``}function iU(e){return/^\S{1}$/.test(e)}function aU(e){return``+e.slice(0,1).toUpperCase()+e.slice(1)}function oU(e){var t=(0,I.useRef)(e);return t.current=e,t}function sU(e,t,n){var r=(0,I.useRef)(),i=(0,I.useRef)(),a=(0,I.useCallback)(function(t,n){i.current=n,t=RH(t,n.props);var r=e(t,n);return n.props.stateReducer(t,_H({},n,{changes:r}))},[e]),o=(0,I.useReducer)(a,t),s=o[0],c=o[1],l=oU(n),u=(0,I.useCallback)(function(e){return c(_H({props:l.current},e))},[l]),d=i.current;return(0,I.useEffect)(function(){d&&r.current&&r.current!==s&&YH(d,RH(r.current,d.props),s),r.current=s},[s,n,d]),[s,u]}function cU(e,t,n){var r=sU(e,t,n),i=r[0],a=r[1];return[RH(i,n),a]}var lU={itemToString:rU,stateReducer:ZH,getA11ySelectionMessage:QH,scrollIntoView:jH,environment:typeof window>`u`?{}:window};function uU(e,t,n){n===void 0&&(n=JH);var r=e[`default`+aU(t)];return r===void 0?n[t]:r}function dU(e,t,n){n===void 0&&(n=JH);var r=e[t];if(r!==void 0)return r;var i=e[`initial`+aU(t)];return i===void 0?uU(e,t,n):i}function fU(e){var t=dU(e,`selectedItem`),n=dU(e,`isOpen`),r=dU(e,`highlightedIndex`),i=dU(e,`inputValue`);return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function pU(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a===void 0?o?r.indexOf(o):n===0?-1:n<0?r.length-1:0:a}function mU(e,t,n,r){var i=(0,I.useRef)({isMouseDown:!1,isTouchMove:!1});return(0,I.useEffect)(function(){if(n?.addEventListener!=null){var a=function(){i.current.isMouseDown=!0},o=function(a){i.current.isMouseDown=!1,e&&!UH(a.target,t.map(function(e){return e.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},c=function(){i.current.isTouchMove=!0},l=function(a){e&&!i.current.isTouchMove&&!UH(a.target,t.map(function(e){return e.current}),n,!1)&&r()};return n.addEventListener(`mousedown`,a),n.addEventListener(`mouseup`,o),n.addEventListener(`touchstart`,s),n.addEventListener(`touchmove`,c),n.addEventListener(`touchend`,l),function(){n.removeEventListener(`mousedown`,a),n.removeEventListener(`mouseup`,o),n.removeEventListener(`touchstart`,s),n.removeEventListener(`touchmove`,c),n.removeEventListener(`touchend`,l)}}},[e,n]),i}var hU=function(){return AH};function gU(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=gH(n,qH);(0,I.useEffect)(function(){r||$H(function(){return e(_H({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function _U(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=(0,I.useRef)(!0);return eU(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var vU=AH;function yU(e,t,n){n===void 0&&(n=!0);var r=e.items?.length&&t>=0;return _H({isOpen:!1,highlightedIndex:-1},r&&_H({selectedItem:e.items[t],isOpen:uU(e,`isOpen`),highlightedIndex:uU(e,`highlightedIndex`)},n&&{inputValue:e.itemToString(e.items[t])}))}function bU(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:pU(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:pU(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:uU(i,`highlightedIndex`),isOpen:uU(i,`isOpen`),selectedItem:uU(i,`selectedItem`),inputValue:uU(i,`inputValue`)};break;default:throw Error(`Reducer called without proper action type.`)}return _H({},e,a)}function xU(e){for(var t=e.keysSoFar,n=e.highlightedIndex,r=e.items,i=e.itemToString,a=e.getItemNodeFromIndex,o=t.toLowerCase(),s=0;s<r.length;s++){var c=(s+n+ +(t.length<2))%r.length,l=r[c];if(l!==void 0&&i(l).toLowerCase().startsWith(o)&&!a(c)?.hasAttribute(`disabled`))return c}return n}Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function SU(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n===r?``:`${n} result${n===1?` is`:`s are`} available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.`:`No results are available.`:``}var CU=HF(HF({},lU),{getA11yStatusMessage:SU}),wU=AH,TU=0,EU=1,DU=2,OU=3,kU=4,AU=5,jU=6,MU=7,NU=8,PU=9,FU=10,IU=11,LU=12,RU=13,zU=14,BU=15,VU=16,HU=17,UU=18,WU=19,GU=20,KU=21,qU=Object.freeze({__proto__:null,ToggleButtonClick:TU,ToggleButtonKeyDownArrowDown:EU,ToggleButtonKeyDownArrowUp:DU,ToggleButtonKeyDownCharacter:OU,ToggleButtonKeyDownEscape:kU,ToggleButtonKeyDownHome:AU,ToggleButtonKeyDownEnd:jU,ToggleButtonKeyDownEnter:MU,ToggleButtonKeyDownSpaceButton:NU,ToggleButtonKeyDownPageUp:PU,ToggleButtonKeyDownPageDown:FU,ToggleButtonBlur:IU,MenuMouseLeave:LU,ItemMouseMove:RU,ItemClick:zU,FunctionToggleMenu:BU,FunctionOpenMenu:VU,FunctionCloseMenu:HU,FunctionSetHighlightedIndex:UU,FunctionSelectItem:WU,FunctionSetInputValue:GU,FunctionReset:KU});function JU(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case zU:a={isOpen:uU(r,`isOpen`),highlightedIndex:uU(r,`highlightedIndex`),selectedItem:r.items[t.index]};break;case OU:var o=t.key,s=``+e.inputValue+o;a={inputValue:s,highlightedIndex:xU({keysSoFar:s,highlightedIndex:!e.isOpen&&e.selectedItem?r.items.indexOf(e.selectedItem):e.highlightedIndex,items:r.items,itemToString:r.itemToString,getItemNodeFromIndex:t.getItemNodeFromIndex}),isOpen:!0};break;case EU:a={highlightedIndex:e.isOpen?VH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):i&&e.selectedItem==null?-1:pU(r,e,1),isOpen:!0};break;case DU:a=e.isOpen&&i?yU(r,e.highlightedIndex,!1):{highlightedIndex:e.isOpen?VH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1):pU(r,e,-1),isOpen:!0};break;case MU:case NU:a=yU(r,e.highlightedIndex,!1);break;case AU:a={highlightedIndex:HH(1,0,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case jU:a={highlightedIndex:HH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1),isOpen:!0};break;case PU:a={highlightedIndex:VH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case FU:a={highlightedIndex:VH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case kU:a={isOpen:!1,highlightedIndex:-1};break;case IU:a=_H({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&{selectedItem:r.items[e.highlightedIndex]});break;case WU:a={selectedItem:t.selectedItem};break;default:return bU(e,t,qU)}return _H({},e,a)}var YU=[`onMouseLeave`,`refKey`,`onKeyDown`,`onBlur`,`ref`],XU=[`onBlur`,`onClick`,`onPress`,`onKeyDown`,`refKey`,`ref`],ZU=[`item`,`index`,`onMouseMove`,`onClick`,`onPress`,`refKey`,`ref`,`disabled`];QU.stateChangeTypes=qU;function QU(e){e===void 0&&(e={}),wU(e,QU);var t=_H({},CU,e),n=t.items,r=t.scrollIntoView,i=t.environment,a=t.itemToString,o=t.getA11ySelectionMessage,s=t.getA11yStatusMessage,c=cU(JU,fU(t),t),l=c[0],u=c[1],d=l.isOpen,f=l.highlightedIndex,p=l.selectedItem,m=l.inputValue,h=(0,I.useRef)(null),g=(0,I.useRef)(null),_=(0,I.useRef)({}),v=(0,I.useRef)(null),y=tU(t),b=(0,I.useRef)(),x=(0,I.useRef)(!0),S=oU({state:l,props:t}),C=(0,I.useCallback)(function(e){return _.current[y.getItemId(e)]},[y]);gU(s,[d,f,m,n],_H({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l)),gU(o,[p],_H({isInitialMount:x.current,previousResultCount:b.current,items:n,environment:i,itemToString:a},l));var w=_U({menuElement:g.current,highlightedIndex:f,isOpen:d,itemRefs:_,scrollIntoView:r,getItemNodeFromIndex:C});(0,I.useEffect)(function(){return v.current=NH(function(e){e({type:GU,inputValue:``})},500),function(){v.current.cancel()}},[]),(0,I.useEffect)(function(){m&&v.current(u)},[u,m]),vU({isInitialMount:x.current,props:t,state:l}),(0,I.useEffect)(function(){x.current||(b.current=n.length)});var T=mU(d,[g,h],i,function(){u({type:IU})}),E=hU(`getMenuProps`,`getToggleButtonProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){d||(_.current={})},[d]);var D=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),u({type:EU,getItemNodeFromIndex:C,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),u({type:DU,getItemNodeFromIndex:C,altKey:e.altKey})},Home:function(e){e.preventDefault(),u({type:AU,getItemNodeFromIndex:C})},End:function(e){e.preventDefault(),u({type:jU,getItemNodeFromIndex:C})},Escape:function(){S.current.state.isOpen&&u({type:kU})},Enter:function(e){e.preventDefault(),u({type:S.current.state.isOpen?MU:TU})},PageUp:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:PU,getItemNodeFromIndex:C}))},PageDown:function(e){S.current.state.isOpen&&(e.preventDefault(),u({type:FU,getItemNodeFromIndex:C}))}," ":function(e){e.preventDefault();var t=S.current.state;if(!t.isOpen){u({type:TU});return}t.inputValue?u({type:OU,key:` `,getItemNodeFromIndex:C}):u({type:NU})}}},[u,C,S]),O=(0,I.useCallback)(function(){u({type:BU})},[u]),k=(0,I.useCallback)(function(){u({type:HU})},[u]),ee=(0,I.useCallback)(function(){u({type:VU})},[u]),te=(0,I.useCallback)(function(e){u({type:UU,highlightedIndex:e})},[u]),A=(0,I.useCallback)(function(e){u({type:WU,selectedItem:e})},[u]),j=(0,I.useCallback)(function(){u({type:KU})},[u]),ne=(0,I.useCallback)(function(e){u({type:GU,inputValue:e})},[u]),M=(0,I.useCallback)(function(e){return _H({id:y.labelId,htmlFor:y.toggleButtonId},e)},[y]),re=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a;r.onKeyDown,r.onBlur;var s=r.ref,c=gH(r,YU),l=(t===void 0?{}:t).suppressRefError;return E(`getMenuProps`,l!==void 0&&l,o,g),_H((n={},n[o]=FH(s,function(e){g.current=e}),n.id=y.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+y.labelId,n.onMouseLeave=PH(i,function(){u({type:LU})}),n),c)},[u,E,y]);return{getToggleButtonProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onBlur,a=r.onClick;r.onPress;var o=r.onKeyDown,s=r.refKey,c=s===void 0?`ref`:s,l=r.ref,d=gH(r,XU),f=(t===void 0?{}:t).suppressRefError,p=f!==void 0&&f,m=S.current.state,g=function(){u({type:TU})},_=function(){m.isOpen&&!T.current.isMouseDown&&u({type:IU})},v=function(e){var t=BH(e);t&&D[t]?D[t](e):iU(t)&&u({type:OU,key:t,getItemNodeFromIndex:C})},b=_H((n={},n[c]=FH(l,function(e){h.current=e}),n[`aria-activedescendant`]=m.isOpen&&m.highlightedIndex>-1?y.getItemId(m.highlightedIndex):``,n[`aria-controls`]=y.menuId,n[`aria-expanded`]=S.current.state.isOpen,n[`aria-haspopup`]=`listbox`,n[`aria-labelledby`]=d&&d[`aria-label`]?void 0:``+y.labelId,n.id=y.toggleButtonId,n.role=`combobox`,n.tabIndex=0,n.onBlur=PH(i,_),n),d);return d.disabled||(b.onClick=PH(a,g),b.onKeyDown=PH(o,v)),E(`getToggleButtonProps`,p,c,h),b},[S,y,E,u,T,D,C]),getLabelProps:M,getMenuProps:re,getItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.item,i=n.index,a=n.onMouseMove,o=n.onClick;n.onPress;var s=n.refKey,c=s===void 0?`ref`:s,l=n.ref,d=n.disabled,f=gH(n,ZU),m=S.current,h=m.state,g=m.props,v=nU(r,i,g.items,`Pass either item or index to getItemProps!`),b=v[0],x=v[1],C=function(){x!==h.highlightedIndex&&(w.current=!1,u({type:RU,index:x,disabled:d}))},T=function(){u({type:zU,index:x})},E=_H((t={disabled:d,role:`option`,"aria-selected":``+(b===p),id:y.getItemId(x)},t[c]=FH(l,function(e){e&&(_.current[y.getItemId(x)]=e)}),t),f);return d||(E.onClick=PH(o,T)),E.onMouseMove=PH(a,C),E},[S,p,y,w,u]),toggleMenu:O,openMenu:ee,closeMenu:k,setHighlightedIndex:te,selectItem:A,reset:j,setInputValue:ne,highlightedIndex:f,isOpen:d,selectedItem:p,inputValue:m}}var $U=0,eW=1,tW=2,nW=3,rW=4,iW=5,aW=6,oW=7,sW=8,cW=9,lW=10,uW=11,dW=12,fW=13,pW=14,mW=15,hW=16,gW=17,_W=18,vW=19,yW=20,bW=21,xW=22,SW=Object.freeze({__proto__:null,InputKeyDownArrowDown:$U,InputKeyDownArrowUp:eW,InputKeyDownEscape:tW,InputKeyDownHome:nW,InputKeyDownEnd:rW,InputKeyDownPageUp:iW,InputKeyDownPageDown:aW,InputKeyDownEnter:oW,InputChange:sW,InputBlur:cW,InputFocus:lW,MenuMouseLeave:uW,ItemMouseMove:dW,ItemClick:fW,ToggleButtonClick:pW,FunctionToggleMenu:mW,FunctionOpenMenu:hW,FunctionCloseMenu:gW,FunctionSetHighlightedIndex:_W,FunctionSelectItem:vW,FunctionSetInputValue:yW,FunctionReset:bW,ControlledPropUpdatedSelectedItem:xW});function CW(e){var t=fU(e),n=t.selectedItem,r=t.inputValue;return r===``&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),_H({},t,{inputValue:r})}Q.default.array.isRequired,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.bool,Q.default.bool,Q.default.bool,Q.default.any,Q.default.any,Q.default.any,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.string,Q.default.func,Q.default.string,Q.default.string,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.func,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});function wW(e,t,n){var r=(0,I.useRef)(),i=sU(e,t,n),a=i[0],o=i[1];return(0,I.useEffect)(function(){zH(n,`selectedItem`)&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:xW,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[RH(a,n),o]}var TW=AH,EW=_H({},lU,{selectedItemChanged:function(e,t){return e!==t},getA11yStatusMessage:LH});function DW(e,t){var n=t.type,r=t.props,i=t.altKey,a;switch(n){case fW:a={isOpen:uU(r,`isOpen`),highlightedIndex:uU(r,`highlightedIndex`),selectedItem:r.items[t.index],inputValue:r.itemToString(r.items[t.index])};break;case $U:a=e.isOpen?{highlightedIndex:VH(1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:i&&e.selectedItem==null?-1:pU(r,e,1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case eW:a=e.isOpen?i?yU(r,e.highlightedIndex):{highlightedIndex:VH(-1,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!0)}:{highlightedIndex:pU(r,e,-1,t.getItemNodeFromIndex),isOpen:r.items.length>=0};break;case oW:a=yU(r,e.highlightedIndex);break;case tW:a=_H({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:``});break;case iW:a={highlightedIndex:VH(-10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case aW:a={highlightedIndex:VH(10,e.highlightedIndex,r.items.length,t.getItemNodeFromIndex,!1)};break;case nW:a={highlightedIndex:HH(1,0,r.items.length,t.getItemNodeFromIndex,!1)};break;case rW:a={highlightedIndex:HH(-1,r.items.length-1,r.items.length,t.getItemNodeFromIndex,!1)};break;case cW:a=_H({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&r.items?.length&&t.selectItem&&{selectedItem:r.items[e.highlightedIndex],inputValue:r.itemToString(r.items[e.highlightedIndex])});break;case sW:a={isOpen:!0,highlightedIndex:uU(r,`highlightedIndex`),inputValue:t.inputValue};break;case lW:a={isOpen:!0,highlightedIndex:pU(r,e,0)};break;case vW:a={selectedItem:t.selectedItem,inputValue:r.itemToString(t.selectedItem)};break;case xW:a={inputValue:t.inputValue};break;default:return bU(e,t,SW)}return _H({},e,a)}var OW=[`onMouseLeave`,`refKey`,`ref`],kW=[`item`,`index`,`refKey`,`ref`,`onMouseMove`,`onMouseDown`,`onClick`,`onPress`,`disabled`],AW=[`onClick`,`onPress`,`refKey`,`ref`],jW=[`onKeyDown`,`onChange`,`onInput`,`onFocus`,`onBlur`,`onChangeText`,`refKey`,`ref`];MW.stateChangeTypes=SW;function MW(e){e===void 0&&(e={}),TW(e,MW);var t=_H({},EW,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,c=t.getA11ySelectionMessage,l=t.itemToString,u=wW(DW,CW(t),t),d=u[0],f=u[1],p=d.isOpen,m=d.highlightedIndex,h=d.selectedItem,g=d.inputValue,_=(0,I.useRef)(null),v=(0,I.useRef)({}),y=(0,I.useRef)(null),b=(0,I.useRef)(null),x=(0,I.useRef)(!0),S=tU(t),C=(0,I.useRef)(),w=oU({state:d,props:t}),T=(0,I.useCallback)(function(e){return v.current[S.getItemId(e)]},[S]);gU(s,[p,m,g,i],_H({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d)),gU(c,[h],_H({isInitialMount:x.current,previousResultCount:C.current,items:i,environment:o,itemToString:l},d));var E=_U({menuElement:_.current,highlightedIndex:m,isOpen:p,itemRefs:v,scrollIntoView:a,getItemNodeFromIndex:T});vU({isInitialMount:x.current,props:t,state:d}),(0,I.useEffect)(function(){(n||r||p)&&y.current&&y.current.focus()},[]),(0,I.useEffect)(function(){x.current||(C.current=i.length)});var D=mU(p,[y,_,b],o,function(){f({type:cW,selectItem:!1})}),O=hU(`getInputProps`,`getMenuProps`);(0,I.useEffect)(function(){return x.current=!1,function(){x.current=!0}},[]),(0,I.useEffect)(function(){if(!p)v.current={};else if(o.document?.activeElement!==y.current){var e;y==null||(e=y.current)==null||e.focus()}},[p,o]);var k=(0,I.useMemo)(function(){return{ArrowDown:function(e){e.preventDefault(),f({type:$U,altKey:e.altKey,getItemNodeFromIndex:T})},ArrowUp:function(e){e.preventDefault(),f({type:eW,altKey:e.altKey,getItemNodeFromIndex:T})},Home:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:nW,getItemNodeFromIndex:T}))},End:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:rW,getItemNodeFromIndex:T}))},Escape:function(e){var t=w.current.state;(t.isOpen||t.inputValue||t.selectedItem||t.highlightedIndex>-1)&&(e.preventDefault(),f({type:tW}))},Enter:function(e){w.current.state.isOpen&&e.which!==229&&(e.preventDefault(),f({type:oW,getItemNodeFromIndex:T}))},PageUp:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:iW,getItemNodeFromIndex:T}))},PageDown:function(e){w.current.state.isOpen&&(e.preventDefault(),f({type:aW,getItemNodeFromIndex:T}))}}},[f,w,T]),ee=(0,I.useCallback)(function(e){return _H({id:S.labelId,htmlFor:S.inputId},e)},[S]),te=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onMouseLeave,a=r.refKey,o=a===void 0?`ref`:a,s=r.ref,c=gH(r,OW),l=(t===void 0?{}:t).suppressRefError;return O(`getMenuProps`,l!==void 0&&l,o,_),_H((n={},n[o]=FH(s,function(e){_.current=e}),n.id=S.menuId,n.role=`listbox`,n[`aria-labelledby`]=c&&c[`aria-label`]?void 0:``+S.labelId,n.onMouseLeave=PH(i,function(){f({type:uW})}),n),c)},[f,O,S]),A=(0,I.useCallback)(function(e){var t,n,r=e===void 0?{}:e,i=r.item,a=r.index,o=r.refKey,s=o===void 0?`ref`:o,c=r.ref,l=r.onMouseMove,u=r.onMouseDown,d=r.onClick;r.onPress;var p=r.disabled,m=gH(r,kW),h=w.current,g=h.props,_=h.state,y=nU(i,a,g.items,`Pass either item or index to getItemProps!`)[1],b=`onClick`,x=d;return _H((t={},t[s]=FH(c,function(e){e&&(v.current[S.getItemId(y)]=e)}),t.disabled=p,t.role=`option`,t[`aria-selected`]=``+(y===_.highlightedIndex),t.id=S.getItemId(y),t),!p&&(n={},n[b]=PH(x,function(){f({type:fW,index:y})}),n),{onMouseMove:PH(l,function(){y!==_.highlightedIndex&&(E.current=!1,f({type:dW,index:y,disabled:p}))}),onMouseDown:PH(u,function(e){return e.preventDefault()})},m)},[f,w,E,S]),j=(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.onClick;n.onPress;var i=n.refKey,a=i===void 0?`ref`:i,o=n.ref,s=gH(n,AW),c=w.current.state;return _H((t={},t[a]=FH(o,function(e){b.current=e}),t[`aria-controls`]=S.menuId,t[`aria-expanded`]=c.isOpen,t.id=S.toggleButtonId,t.tabIndex=-1,t),!s.disabled&&_H({},{onClick:PH(r,function(){f({type:pW})})}),s)},[f,w,S]),ne=(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.onKeyDown,a=r.onChange,s=r.onInput,c=r.onFocus,l=r.onBlur;r.onChangeText;var u=r.refKey,d=u===void 0?`ref`:u,p=r.ref,m=gH(r,jW),h=(t===void 0?{}:t).suppressRefError;O(`getInputProps`,h!==void 0&&h,d,y);var g=w.current.state,_=function(e){var t=BH(e);t&&k[t]&&k[t](e)},v=function(e){f({type:sW,inputValue:e.target.value})},b=function(e){g.isOpen&&!D.current.isMouseDown&&f({type:cW,selectItem:e.relatedTarget!==null||o.document.activeElement===o.document.body})},x=function(){g.isOpen||f({type:lW})},C=`onChange`,T={};if(!m.disabled){var E;T=(E={},E[C]=PH(a,s,v),E.onKeyDown=PH(i,_),E.onBlur=PH(l,b),E.onFocus=PH(c,x),E)}return _H((n={},n[d]=FH(p,function(e){y.current=e}),n[`aria-activedescendant`]=g.isOpen&&g.highlightedIndex>-1?S.getItemId(g.highlightedIndex):``,n[`aria-autocomplete`]=`list`,n[`aria-controls`]=S.menuId,n[`aria-expanded`]=g.isOpen,n[`aria-labelledby`]=m&&m[`aria-label`]?void 0:``+S.labelId,n.autoComplete=`off`,n.id=S.inputId,n.role=`combobox`,n.value=g.inputValue,n),T,m)},[O,w,S,k,f,D,o]),M=(0,I.useCallback)(function(){f({type:mW})},[f]),re=(0,I.useCallback)(function(){f({type:gW})},[f]),ie=(0,I.useCallback)(function(){f({type:hW})},[f]),ae=(0,I.useCallback)(function(e){f({type:_W,highlightedIndex:e})},[f]),oe=(0,I.useCallback)(function(e){f({type:vW,selectedItem:e})},[f]);return{getItemProps:A,getLabelProps:ee,getMenuProps:te,getInputProps:ne,getToggleButtonProps:j,toggleMenu:M,openMenu:ie,closeMenu:re,setHighlightedIndex:ae,setInputValue:(0,I.useCallback)(function(e){f({type:yW,inputValue:e})},[f]),selectItem:oe,reset:(0,I.useCallback)(function(){f({type:bW})},[f]),highlightedIndex:m,isOpen:p,selectedItem:h,inputValue:g}}var NW={activeIndex:-1,selectedItems:[]};function PW(e,t){return dU(e,t,NW)}function FW(e,t){return uU(e,t,NW)}function IW(e){return{activeIndex:PW(e,`activeIndex`),selectedItems:PW(e,`selectedItems`)}}function LW(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==``&&(t.selectionStart!==0||t.selectionEnd!==0))}function RW(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+` has been removed.`}Q.default.array,Q.default.array,Q.default.array,Q.default.func,Q.default.func,Q.default.func,Q.default.number,Q.default.number,Q.default.number,Q.default.func,Q.default.func,Q.default.string,Q.default.string,Q.default.shape({addEventListener:Q.default.func,removeEventListener:Q.default.func,document:Q.default.shape({getElementById:Q.default.func,activeElement:Q.default.any,body:Q.default.any})});var zW={itemToString:lU.itemToString,stateReducer:lU.stateReducer,environment:lU.environment,getA11yRemovalMessage:RW,keyNavigationNext:`ArrowRight`,keyNavigationPrevious:`ArrowLeft`},BW=AH,VW=0,HW=1,UW=2,WW=3,GW=4,KW=5,qW=6,JW=7,YW=8,XW=9,ZW=10,QW=11,$W=12,eG=Object.freeze({__proto__:null,SelectedItemClick:VW,SelectedItemKeyDownDelete:HW,SelectedItemKeyDownBackspace:UW,SelectedItemKeyDownNavigationNext:WW,SelectedItemKeyDownNavigationPrevious:GW,DropdownKeyDownNavigationPrevious:KW,DropdownKeyDownBackspace:qW,DropdownClick:JW,FunctionAddSelectedItem:YW,FunctionRemoveSelectedItem:XW,FunctionSetSelectedItems:ZW,FunctionSetActiveIndex:QW,FunctionReset:$W});function tG(e,t){var n=t.type,r=t.index,i=t.props,a=t.selectedItem,o=e.activeIndex,s=e.selectedItems,c;switch(n){case VW:c={activeIndex:r};break;case GW:c={activeIndex:o-1<0?0:o-1};break;case WW:c={activeIndex:o+1>=s.length?-1:o+1};break;case UW:case HW:if(o<0)break;var l=o;s.length===1?l=-1:o===s.length-1&&(l=s.length-2),c=_H({selectedItems:[].concat(s.slice(0,o),s.slice(o+1))},{activeIndex:l});break;case KW:c={activeIndex:s.length-1};break;case qW:c={selectedItems:s.slice(0,s.length-1)};break;case YW:c={selectedItems:[].concat(s,[a])};break;case JW:c={activeIndex:-1};break;case XW:var u=o,d=s.indexOf(a);if(d<0)break;s.length===1?u=-1:d===s.length-1&&(u=s.length-2),c={selectedItems:[].concat(s.slice(0,d),s.slice(d+1)),activeIndex:u};break;case ZW:c={selectedItems:t.selectedItems};break;case QW:c={activeIndex:t.activeIndex};break;case $W:c={activeIndex:FW(i,`activeIndex`),selectedItems:FW(i,`selectedItems`)};break;default:throw Error(`Reducer called without proper action type.`)}return _H({},e,c)}var nG=[`refKey`,`ref`,`onClick`,`onKeyDown`,`selectedItem`,`index`],rG=[`refKey`,`ref`,`onKeyDown`,`onClick`,`preventKeyAction`];iG.stateChangeTypes=eG;function iG(e){e===void 0&&(e={}),BW(e,iG);var t=_H({},zW,e),n=t.getA11yRemovalMessage,r=t.itemToString,i=t.environment,a=t.keyNavigationNext,o=t.keyNavigationPrevious,s=cU(tG,IW(t),t),c=s[0],l=s[1],u=c.activeIndex,d=c.selectedItems,f=(0,I.useRef)(!0),p=(0,I.useRef)(null),m=(0,I.useRef)(d),h=(0,I.useRef)();h.current=[];var g=oU({state:c,props:t});(0,I.useEffect)(function(){if(!f.current){if(d.length<m.current.length){var e=m.current.find(function(e){return d.indexOf(e)<0});GH(n({itemToString:r,resultCount:d.length,removedSelectedItem:e,activeIndex:u,activeSelectedItem:d[u]}),i.document)}m.current=d}},[d.length]),(0,I.useEffect)(function(){f.current||(u===-1&&p.current?p.current.focus():h.current[u]&&h.current[u].focus())},[u]),vU({isInitialMount:f.current,props:t,state:c});var _=hU(`getDropdownProps`);(0,I.useEffect)(function(){return f.current=!1,function(){f.current=!0}},[]);var v=(0,I.useMemo)(function(){var e={};return e[o]=function(){l({type:GW})},e[a]=function(){l({type:WW})},e.Delete=function(){l({type:HW})},e.Backspace=function(){l({type:UW})},e},[l,a,o]),y=(0,I.useMemo)(function(){var e={};return e[o]=function(e){LW(e)&&l({type:KW})},e.Backspace=function(e){LW(e)&&l({type:qW})},e},[l,o]);return{getSelectedItemProps:(0,I.useCallback)(function(e){var t,n=e===void 0?{}:e,r=n.refKey,i=r===void 0?`ref`:r,a=n.ref,o=n.onClick,s=n.onKeyDown,c=n.selectedItem,u=n.index,d=gH(n,nG),f=g.current.state,p=nU(c,u,f.selectedItems,`Pass either item or index to getSelectedItemProps!`)[1],m=p>-1&&p===f.activeIndex;return _H((t={},t[i]=FH(a,function(e){e&&h.current.push(e)}),t.tabIndex=m?0:-1,t.onClick=PH(o,function(){l({type:VW,index:p})}),t.onKeyDown=PH(s,function(e){var t=BH(e);t&&v[t]&&v[t](e)}),t),d)},[l,g,v]),getDropdownProps:(0,I.useCallback)(function(e,t){var n,r=e===void 0?{}:e,i=r.refKey,a=i===void 0?`ref`:i,o=r.ref,s=r.onKeyDown,c=r.onClick,u=r.preventKeyAction,d=u!==void 0&&u,f=gH(r,rG),m=(t===void 0?{}:t).suppressRefError;return _(`getDropdownProps`,m!==void 0&&m,a,p),_H((n={},n[a]=FH(o,function(e){e&&(p.current=e)}),n),!d&&{onKeyDown:PH(s,function(e){var t=BH(e);t&&y[t]&&y[t](e)}),onClick:PH(c,function(){l({type:JW})})},f)},[l,y,_]),addSelectedItem:(0,I.useCallback)(function(e){l({type:YW,selectedItem:e})},[l]),removeSelectedItem:(0,I.useCallback)(function(e){l({type:XW,selectedItem:e})},[l]),setSelectedItems:(0,I.useCallback)(function(e){l({type:ZW,selectedItems:e})},[l]),setActiveIndex:(0,I.useCallback)(function(e){l({type:QW,activeIndex:e})},[l]),reset:(0,I.useCallback)(function(){l({type:$W})},[l]),selectedItems:d,activeIndex:u}}var aG=20,oG=e=>e.suggestions.length>0?I.createElement(sG,{...e}):I.createElement(`input`,{className:X.textInput,size:40,autoFocus:!0,...e.register(e.inputName)}),sG=({autofocus:e,suggestions:t,control:n,inputName:r,placeholder:i,initialInputValue:a,setValue:o})=>{let[s,c]=I.useState(t.slice(0,aG)),l=kr(OO),u=t.length>0,{isOpen:d,getToggleButtonProps:f,getMenuProps:p,getInputProps:m,highlightedIndex:h,getItemProps:g,selectedItem:_}=MW({initialInputValue:a,onInputValueChange({inputValue:e=``}){o(r,e),e=e.toLowerCase()||``;let n=[];for(let r of t)if(r.toLowerCase().includes(e)&&(n.push(r),n.length>=aG))break;c(n)},items:s,itemToString(e){return e??``}}),v=d&&s.length>0;return I.createElement(`div`,{className:X.downshiftAutocompleteContainer},I.createElement(`div`,{"data-visible-dropdown":v,className:X.downshiftInputWrapper},I.createElement(fV,{name:r,control:n,render:({field:t})=>{let n=m();return I.createElement(`input`,{...n,name:t.name,placeholder:i,className:X.downshiftInput,size:30,"data-editor-dialog":!0,autoFocus:e})}}),u&&I.createElement(`button`,{"aria-label":`toggle menu`,type:`button`,...f()},l(`arrow_drop_down`))),I.createElement(`div`,{className:X.downshiftAutocompleteContainer},I.createElement(`ul`,{...p(),"data-visible":v},s.map((e,t)=>I.createElement(`li`,{"data-selected":_===e,"data-highlighted":h===t,key:`${e}${t}`,...g({item:e,index:t})},e)))))},cG={testNode:`blockquote`,visitNode({actions:e}){e.addAndStepInto(D_())}},lG={testLexicalNode:O_,visitLexicalNode:({actions:e})=>{e.addAndStepInto(`blockquote`)}},uG=zr({init(e){e.pubIn({[ek]:`quote`,[mO]:cG,[pO]:E_,[_O]:lG})}});function dG(){let e=CE;return{publish:()=>{e()},subscribe:t=>{e=t}}}function fG(e,t,n,r){let i=[...e].sort((e,t)=>t.priority-e.priority),a=n??``;return i.find(e=>e.match(t??``,a))??i.find(e=>e.match(r??``,a))}var pG=Object.defineProperty,mG=(e,t,n)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hG=(e,t,n)=>mG(e,typeof t==`symbol`?t:t+``,n),gG=class e extends Wl{constructor(e,t,n,r){super(r),hG(this,`__code`),hG(this,`__meta`),hG(this,`__language`),hG(this,`__focusEmitter`,dG()),hG(this,`setCode`,e=>{e!==this.__code&&(this.getWritable().__code=e)}),hG(this,`setMeta`,e=>{e!==this.__meta&&(this.getWritable().__meta=e)}),hG(this,`setLanguage`,e=>{e!==this.__language&&(this.getWritable().__language=e)}),hG(this,`select`,()=>{this.__focusEmitter.publish()}),this.__code=e,this.__meta=n,this.__language=t}static getType(){return`codeblock`}static clone(t){return new e(t.__code,t.__language,t.__meta,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__code=e.__code,this.__meta=e.__meta,this.__language=e.__language,this.__focusEmitter=dG()}static importJSON(e){return xG({code:typeof e.code==`string`?e.code:``,language:typeof e.language==`string`?e.language:``,meta:typeof e.meta==`string`?e.meta:``})}static importDOM(){return{pre:()=>({conversion:CG,priority:3})}}exportJSON(){return{code:this.getCode(),language:this.getLanguage(),meta:this.getMeta(),type:`codeblock`,version:1}}createDOM(e,t){return document.createElement(`div`)}updateDOM(){return!1}getCode(){return this.__code}getMeta(){return this.__meta}getLanguage(){return this.__language}decorate(e){return I.createElement(bG,{parentEditor:e,code:this.getCode(),meta:this.getMeta(),language:this.getLanguage(),codeBlockNode:this,nodeKey:this.getKey(),focusEmitter:this.__focusEmitter})}isInline(){return!1}},_G=I.createContext(null),vG=({parentEditor:e,lexicalNode:t,children:n})=>{let r=I.useMemo(()=>({lexicalNode:t,parentEditor:e,setCode:n=>{e.update(()=>{t.setCode(n),setTimeout(()=>{e.dispatchCommand(MD,void 0)},0)})},setLanguage:n=>{e.update(()=>{t.setLanguage(n)})},setMeta:n=>{e.update(()=>{t.setMeta(n)})}}),[t,e]);return I.createElement(_G.Provider,{value:r},n)};function yG(){let e=I.useContext(_G);if(!e)throw Error(`useCodeBlockEditor must be used within a CodeBlockEditor`);return e}var bG=e=>{let t=kr(cO),n=kr(lO),r=fG(t,e.language,e.meta,n);if(!r)throw Error(`No CodeBlockEditor registered for language=${e.language} meta=${e.meta}`);let i=r.Editor,{codeBlockNode:a,parentEditor:o,...s}=e;return I.createElement(vG,{parentEditor:e.parentEditor,lexicalNode:e.codeBlockNode},I.createElement(i,{...s}))};function xG(e){let{code:t=``,language:n=``,meta:r=``}=e;return new gG(t,n,r)}function SG(e){return e instanceof gG}function CG(e){let t=e,n=t.textContent,r=e.getAttribute(`class`)??``,i=e.getAttribute(`data-language`)??``,a=/language-(\w+)/.exec(r);return{node:xG({code:n,language:a?a[1]:i,meta:t.getAttribute(`data-meta`)??``})}}var wG={testLexicalNode:SG,visitLexicalNode:({lexicalNode:e,actions:t})=>{t.addAndStepInto(`code`,{value:e.getCode(),lang:e.getLanguage(),meta:e.getMeta()})}},TG={testNode:(e,{codeBlockEditorDescriptors:t,defaultCodeBlockLanguage:n})=>e.type===`code`&&fG(t,e.lang,e.meta,n)!==void 0,visitNode({mdastNode:e,actions:t}){t.addAndStepInto(xG({code:e.value,language:e.lang??``,meta:e.meta??``}))}},EG=Tr(e=>{e.link(e.pipe(EG,Nr(lO),Mr(([e,t])=>()=>xG({language:t,...e}))),XO)}),DG=kO(cO),OG=zr({update(e,t){e.pub(lO,t?.defaultCodeBlockLanguage??``)},init(e,t){e.pubIn({[ek]:`codeblock`,[lO]:t?.defaultCodeBlockLanguage??``,[cO]:t?.codeBlockEditorDescriptors??[],[mO]:TG,[pO]:gG,[_O]:wG})}});function $(e){return new Ge(we.define(e))}function kG(e){return o(()=>import(`./dist-itDgDZqI.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([0,1,2]))}var AG=[N.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return o(()=>import(`./dist-KG4lrraG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1]))}}),N.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return o(()=>import(`./dist-KG4lrraG.js`).then(e=>e.cpp()),__vite__mapDeps([3,1]))}}),N.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return kG(`Cassandra`)}}),N.of({name:`CSS`,extensions:[`css`],load(){return o(()=>import(`./dist-BXQtebmM.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([4,5,6,1]))}}),N.of({name:`Go`,extensions:[`go`],load(){return o(()=>import(`./dist-D7O3CloR.js`).then(e=>e.go()),__vite__mapDeps([7,1,2]))}}),N.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return o(()=>import(`./dist-CHSqB1rM.js`).then(e=>e.t).then(e=>e.html()),__vite__mapDeps([8,5,6,1,4,9,2]))}}),N.of({name:`Java`,extensions:[`java`],load(){return o(()=>import(`./dist-CzkTIkYD.js`).then(e=>e.java()),__vite__mapDeps([10,1]))}}),N.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return o(()=>import(`./dist-B2o7tVdJ.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return o(()=>import(`./dist-DwpQHmP7.js`).then(e=>e.jinja()),__vite__mapDeps([11,1,8,5,6,4,9,2]))}}),N.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return o(()=>import(`./dist-Ko3fuaif.js`).then(e=>e.json()),__vite__mapDeps([12,1]))}}),N.of({name:`JSX`,extensions:[`jsx`],load(){return o(()=>import(`./dist-B2o7tVdJ.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`LESS`,extensions:[`less`],load(){return o(()=>import(`./dist-BpYRdsio.js`).then(e=>e.less()),__vite__mapDeps([13,1,4,5,6]))}}),N.of({name:`Liquid`,extensions:[`liquid`],load(){return o(()=>import(`./dist-BYDYk38f.js`).then(e=>e.liquid()),__vite__mapDeps([14,1,8,5,6,4,9,2]))}}),N.of({name:`MariaDB SQL`,load(){return kG(`MariaSQL`)}}),N.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return o(()=>import(`./dist-DJzkq2t-.js`).then(e=>e.markdown()),[])}}),N.of({name:`MS SQL`,load(){return kG(`MSSQL`)}}),N.of({name:`MySQL`,load(){return kG(`MySQL`)}}),N.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return o(()=>import(`./dist-CVpPKkOb.js`).then(e=>e.php()),__vite__mapDeps([15,1,8,5,6,4,9,2]))}}),N.of({name:`PLSQL`,extensions:[`pls`],load(){return kG(`PLSQL`)}}),N.of({name:`PostgreSQL`,load(){return kG(`PostgreSQL`)}}),N.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return o(()=>import(`./dist-p_qW90fR.js`).then(e=>e.python()),__vite__mapDeps([16,1,2]))}}),N.of({name:`Rust`,extensions:[`rs`],load(){return o(()=>import(`./dist-Dctj7Mr3.js`).then(e=>e.rust()),__vite__mapDeps([17,1]))}}),N.of({name:`Sass`,extensions:[`sass`],load(){return o(()=>import(`./dist-BgakrfmB.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([18,1,4,5,6]))}}),N.of({name:`SCSS`,extensions:[`scss`],load(){return o(()=>import(`./dist-BgakrfmB.js`).then(e=>e.sass()),__vite__mapDeps([18,1,4,5,6]))}}),N.of({name:`SQL`,extensions:[`sql`],load(){return kG(`StandardSQL`)}}),N.of({name:`SQLite`,load(){return kG(`SQLite`)}}),N.of({name:`TSX`,extensions:[`tsx`],load(){return o(()=>import(`./dist-B2o7tVdJ.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return o(()=>import(`./dist-B2o7tVdJ.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([9,5,6,1,2]))}}),N.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return o(()=>import(`./dist-BA7UaMHM.js`).then(e=>e.wast()),__vite__mapDeps([19,1]))}}),N.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return o(()=>import(`./dist-f7v359XP.js`).then(e=>e.xml()),__vite__mapDeps([20,1]))}}),N.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return o(()=>import(`./dist-xi1nJU9x.js`).then(e=>e.yaml()),__vite__mapDeps([21,1]))}}),N.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return o(()=>import(`./apl-gfMMiTNf.js`).then(e=>$(e.apl)),[])}}),N.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return o(()=>import(`./asciiarmor-C_eisQCp.js`).then(e=>$(e.asciiArmor)),[])}}),N.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return o(()=>import(`./asn1-DCl_8MCW.js`).then(e=>$(e.asn1({}))),[])}}),N.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return o(()=>import(`./asterisk-BEn0Cwpx.js`).then(e=>$(e.asterisk)),[])}}),N.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return o(()=>import(`./brainfuck-D5EjA2JK.js`).then(e=>$(e.brainfuck)),[])}}),N.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return o(()=>import(`./cobol-DHLQUbN7.js`).then(e=>$(e.cobol)),[])}}),N.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.csharp)),[])}}),N.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`ClojureScript`,extensions:[`cljs`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return o(()=>import(`./css-CnaYoQib.js`).then(e=>$(e.gss)),[])}}),N.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return o(()=>import(`./cmake-84nbDH0I.js`).then(e=>$(e.cmake)),[])}}),N.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return o(()=>import(`./coffeescript-De_zI4J0.js`).then(e=>$(e.coffeeScript)),[])}}),N.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return o(()=>import(`./commonlisp-DgAKBe0r.js`).then(e=>$(e.commonLisp)),[])}}),N.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return o(()=>import(`./cypher-p9eYesGn.js`).then(e=>$(e.cypher)),[])}}),N.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return o(()=>import(`./python-B_1Jd8HM.js`).then(e=>$(e.cython)),[])}}),N.of({name:`Crystal`,extensions:[`cr`],load(){return o(()=>import(`./crystal-Bsdphhtm.js`).then(e=>$(e.crystal)),[])}}),N.of({name:`D`,extensions:[`d`],load(){return o(()=>import(`./d-DWkQyNnU.js`).then(e=>$(e.d)),[])}}),N.of({name:`Dart`,extensions:[`dart`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.dart)),[])}}),N.of({name:`diff`,extensions:[`diff`,`patch`],load(){return o(()=>import(`./diff-ChtP43wD.js`).then(e=>$(e.diff)),[])}}),N.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return o(()=>import(`./dockerfile-DJkHQgkl.js`).then(e=>$(e.dockerFile)),__vite__mapDeps([22,23]))}}),N.of({name:`DTD`,extensions:[`dtd`],load(){return o(()=>import(`./dtd-DTF72YNO.js`).then(e=>$(e.dtd)),[])}}),N.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return o(()=>import(`./dylan-BCDoL_-p.js`).then(e=>$(e.dylan)),[])}}),N.of({name:`EBNF`,load(){return o(()=>import(`./ebnf-D4c0_ac3.js`).then(e=>$(e.ebnf)),[])}}),N.of({name:`ECL`,extensions:[`ecl`],load(){return o(()=>import(`./ecl-BVIeWmwY.js`).then(e=>$(e.ecl)),[])}}),N.of({name:`edn`,extensions:[`edn`],load(){return o(()=>import(`./clojure-BflJGmDX.js`).then(e=>$(e.clojure)),[])}}),N.of({name:`Eiffel`,extensions:[`e`],load(){return o(()=>import(`./eiffel-BEjRio4Q.js`).then(e=>$(e.eiffel)),[])}}),N.of({name:`Elm`,extensions:[`elm`],load(){return o(()=>import(`./elm-Cshzl8qu.js`).then(e=>$(e.elm)),[])}}),N.of({name:`Erlang`,extensions:[`erl`],load(){return o(()=>import(`./erlang-BV0c4Hdn.js`).then(e=>$(e.erlang)),[])}}),N.of({name:`Esper`,load(){return o(()=>import(`./sql-DuQMFDvy.js`).then(e=>$(e.esper)),[])}}),N.of({name:`Factor`,extensions:[`factor`],load(){return o(()=>import(`./factor-LKH5gN8L.js`).then(e=>$(e.factor)),__vite__mapDeps([24,23]))}}),N.of({name:`FCL`,load(){return o(()=>import(`./fcl-ClOhbFR7.js`).then(e=>$(e.fcl)),[])}}),N.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return o(()=>import(`./forth-D6RzAl64.js`).then(e=>$(e.forth)),[])}}),N.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return o(()=>import(`./fortran-Bt6PBEDR.js`).then(e=>$(e.fortran)),[])}}),N.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.fSharp)),[])}}),N.of({name:`Gas`,extensions:[`s`],load(){return o(()=>import(`./gas-BHEdbvp9.js`).then(e=>$(e.gas)),[])}}),N.of({name:`Gherkin`,extensions:[`feature`],load(){return o(()=>import(`./gherkin-oBAE_ms0.js`).then(e=>$(e.gherkin)),[])}}),N.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return o(()=>import(`./groovy-CUpZ7dEl.js`).then(e=>$(e.groovy)),[])}}),N.of({name:`Haskell`,extensions:[`hs`],load(){return o(()=>import(`./haskell-BRsoo5mP.js`).then(e=>$(e.haskell)),[])}}),N.of({name:`Haxe`,extensions:[`hx`],load(){return o(()=>import(`./haxe-DjVOVvNP.js`).then(e=>$(e.haxe)),[])}}),N.of({name:`HXML`,extensions:[`hxml`],load(){return o(()=>import(`./haxe-DjVOVvNP.js`).then(e=>$(e.hxml)),[])}}),N.of({name:`HTTP`,load(){return o(()=>import(`./http-CLVgA2GD.js`).then(e=>$(e.http)),[])}}),N.of({name:`IDL`,extensions:[`pro`],load(){return o(()=>import(`./idl-BUZw3wgd.js`).then(e=>$(e.idl)),[])}}),N.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return o(()=>import(`./javascript-Bu8mWwtz.js`).then(e=>$(e.jsonld)),[])}}),N.of({name:`Julia`,extensions:[`jl`],load(){return o(()=>import(`./julia-CQfgDRfP.js`).then(e=>$(e.julia)),[])}}),N.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.kotlin)),[])}}),N.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return o(()=>import(`./livescript-BXxG0Yva.js`).then(e=>$(e.liveScript)),[])}}),N.of({name:`Lua`,extensions:[`lua`],load(){return o(()=>import(`./lua-DPCEkfD_.js`).then(e=>$(e.lua)),[])}}),N.of({name:`mIRC`,extensions:[`mrc`],load(){return o(()=>import(`./mirc-C9zpzAZU.js`).then(e=>$(e.mirc)),[])}}),N.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return o(()=>import(`./mathematica-u8YMmbU0.js`).then(e=>$(e.mathematica)),[])}}),N.of({name:`Modelica`,extensions:[`mo`],load(){return o(()=>import(`./modelica-CqHI_q-D.js`).then(e=>$(e.modelica)),[])}}),N.of({name:`MUMPS`,extensions:[`mps`],load(){return o(()=>import(`./mumps-BSzj6Xyz.js`).then(e=>$(e.mumps)),[])}}),N.of({name:`Mbox`,extensions:[`mbox`],load(){return o(()=>import(`./mbox-BEMVcqjs.js`).then(e=>$(e.mbox)),[])}}),N.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return o(()=>import(`./nginx-8H7HVH4w.js`).then(e=>$(e.nginx)),[])}}),N.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return o(()=>import(`./nsis-viPvXFiq.js`).then(e=>$(e.nsis)),__vite__mapDeps([25,23]))}}),N.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return o(()=>import(`./ntriples-B9h1VB_g.js`).then(e=>$(e.ntriples)),[])}}),N.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.objectiveC)),[])}}),N.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.objectiveCpp)),[])}}),N.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.oCaml)),[])}}),N.of({name:`Octave`,extensions:[`m`],load(){return o(()=>import(`./octave-D2Q8cUp1.js`).then(e=>$(e.octave)),[])}}),N.of({name:`Oz`,extensions:[`oz`],load(){return o(()=>import(`./oz-BwTct_5T.js`).then(e=>$(e.oz)),[])}}),N.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return o(()=>import(`./pascal-Dp_KdFgX.js`).then(e=>$(e.pascal)),[])}}),N.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return o(()=>import(`./perl-BkSkiI9m.js`).then(e=>$(e.perl)),[])}}),N.of({name:`Pig`,extensions:[`pig`],load(){return o(()=>import(`./pig-AF4Hwhju.js`).then(e=>$(e.pig)),[])}}),N.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return o(()=>import(`./powershell-BcIto6Sf.js`).then(e=>$(e.powerShell)),[])}}),N.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return o(()=>import(`./properties-C357ku5U.js`).then(e=>$(e.properties)),[])}}),N.of({name:`ProtoBuf`,extensions:[`proto`],load(){return o(()=>import(`./protobuf-D1ij_kNL.js`).then(e=>$(e.protobuf)),[])}}),N.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return o(()=>import(`./pug-3K-JMW4g.js`).then(e=>$(e.pug)),__vite__mapDeps([26,27]))}}),N.of({name:`Puppet`,extensions:[`pp`],load(){return o(()=>import(`./puppet-BZyAS7I4.js`).then(e=>$(e.puppet)),[])}}),N.of({name:`Q`,extensions:[`q`],load(){return o(()=>import(`./q-B9NhS7L_.js`).then(e=>$(e.q)),[])}}),N.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return o(()=>import(`./r-CxDmU1I4.js`).then(e=>$(e.r)),[])}}),N.of({name:`RPM Changes`,load(){return o(()=>import(`./rpm-gpDK5sbt.js`).then(e=>$(e.rpmChanges)),[])}}),N.of({name:`RPM Spec`,extensions:[`spec`],load(){return o(()=>import(`./rpm-gpDK5sbt.js`).then(e=>$(e.rpmSpec)),[])}}),N.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return o(()=>import(`./ruby-ChfNwlCY.js`).then(e=>$(e.ruby)),[])}}),N.of({name:`SAS`,extensions:[`sas`],load(){return o(()=>import(`./sas-C2OyD2Y6.js`).then(e=>$(e.sas)),[])}}),N.of({name:`Scala`,extensions:[`scala`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.scala)),[])}}),N.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return o(()=>import(`./scheme-D9qYN0V5.js`).then(e=>$(e.scheme)),[])}}),N.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return o(()=>import(`./shell-DwuoZtxw.js`).then(e=>$(e.shell)),[])}}),N.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return o(()=>import(`./sieve-tLWDfEkZ.js`).then(e=>$(e.sieve)),[])}}),N.of({name:`Smalltalk`,extensions:[`st`],load(){return o(()=>import(`./smalltalk-BLp5-jwC.js`).then(e=>$(e.smalltalk)),[])}}),N.of({name:`Solr`,load(){return o(()=>import(`./solr-B78wSQJQ.js`).then(e=>$(e.solr)),[])}}),N.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return o(()=>import(`./mllike-B45xgp2S.js`).then(e=>$(e.sml)),[])}}),N.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return o(()=>import(`./sparql-Dz-mlCAC.js`).then(e=>$(e.sparql)),[])}}),N.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return o(()=>import(`./spreadsheet-CTIncYxj.js`).then(e=>$(e.spreadsheet)),[])}}),N.of({name:`Squirrel`,extensions:[`nut`],load(){return o(()=>import(`./clike-D_6L3tnO.js`).then(e=>$(e.squirrel)),[])}}),N.of({name:`Stylus`,extensions:[`styl`],load(){return o(()=>import(`./stylus-BOVgKnng.js`).then(e=>$(e.stylus)),[])}}),N.of({name:`Swift`,extensions:[`swift`],load(){return o(()=>import(`./swift-DKB6_1j6.js`).then(e=>$(e.swift)),[])}}),N.of({name:`sTeX`,load(){return o(()=>import(`./stex-DNzd62Q_.js`).then(e=>$(e.stex)),[])}}),N.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return o(()=>import(`./stex-DNzd62Q_.js`).then(e=>$(e.stex)),[])}}),N.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return o(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>$(e.verilog)),[])}}),N.of({name:`Tcl`,extensions:[`tcl`],load(){return o(()=>import(`./tcl-BGfruO1u.js`).then(e=>$(e.tcl)),[])}}),N.of({name:`Textile`,extensions:[`textile`],load(){return o(()=>import(`./textile-C4jVoHG1.js`).then(e=>$(e.textile)),[])}}),N.of({name:`TiddlyWiki`,load(){return o(()=>import(`./tiddlywiki-VlUiK86J.js`).then(e=>$(e.tiddlyWiki)),[])}}),N.of({name:`Tiki wiki`,load(){return o(()=>import(`./tiki-AK6FwT8q.js`).then(e=>$(e.tiki)),[])}}),N.of({name:`TOML`,extensions:[`toml`],load(){return o(()=>import(`./toml-BPTmHmyx.js`).then(e=>$(e.toml)),[])}}),N.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return o(()=>import(`./troff-C2dAgh7P.js`).then(e=>$(e.troff)),[])}}),N.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return o(()=>import(`./ttcn-PPSTk1ow.js`).then(e=>$(e.ttcn)),[])}}),N.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return o(()=>import(`./ttcn-cfg-2b4Gb5sE.js`).then(e=>$(e.ttcnCfg)),[])}}),N.of({name:`Turtle`,extensions:[`ttl`],load(){return o(()=>import(`./turtle-Cx3rYX2g.js`).then(e=>$(e.turtle)),[])}}),N.of({name:`Web IDL`,extensions:[`webidl`],load(){return o(()=>import(`./webidl-D5jiJvOU.js`).then(e=>$(e.webIDL)),[])}}),N.of({name:`VB.NET`,extensions:[`vb`],load(){return o(()=>import(`./vb-BthdM_4N.js`).then(e=>$(e.vb)),[])}}),N.of({name:`VBScript`,extensions:[`vbs`],load(){return o(()=>import(`./vbscript-D9f6rSsU.js`).then(e=>$(e.vbScript)),[])}}),N.of({name:`Velocity`,extensions:[`vtl`],load(){return o(()=>import(`./velocity-CqftRsjg.js`).then(e=>$(e.velocity)),[])}}),N.of({name:`Verilog`,extensions:[`v`],load(){return o(()=>import(`./verilog-CjI9Y6RI.js`).then(e=>$(e.verilog)),[])}}),N.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return o(()=>import(`./vhdl-kS471soi.js`).then(e=>$(e.vhdl)),[])}}),N.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return o(()=>import(`./xquery-BKJx4mf9.js`).then(e=>$(e.xQuery)),[])}}),N.of({name:`Yacas`,extensions:[`ys`],load(){return o(()=>import(`./yacas-CXXgtw0p.js`).then(e=>$(e.yacas)),[])}}),N.of({name:`Z80`,extensions:[`z80`],load(){return o(()=>import(`./z80-Co3PbHdE.js`).then(e=>$(e.z80)),[])}}),N.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.mscgen)),[])}}),N.of({name:`Xù`,extensions:[`xu`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.xu)),[])}}),N.of({name:`MsGenny`,extensions:[`msgenny`],load(){return o(()=>import(`./mscgen-qgSLujhx.js`).then(e=>$(e.msgenny)),[])}}),N.of({name:`Vue`,extensions:[`vue`],load(){return o(()=>import(`./dist-DtEBn0Pj.js`).then(e=>e.vue()),__vite__mapDeps([28,1,8,5,6,4,9,2]))}}),N.of({name:`Angular Template`,load(){return o(()=>import(`./dist-BpUghI2_.js`).then(e=>e.angular()),__vite__mapDeps([29,1,8,5,6,4,9,2]))}})],jG=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=IG(e.state,n.from);return r.line?NG(e):r.block?FG(e):!1};function MG(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var NG=MG(VG,0),PG=MG(BG,0),FG=MG((e,t)=>BG(e,t,zG(t)),0);function IG(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var LG=50;function RG(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-LG,r),o=e.sliceDoc(i,i+LG),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=100?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+LG),d=e.sliceDoc(i-LG,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:+!!/\s/.test(u.charAt(f+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(d.charAt(m-1))}}:null}function zG(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function BG(e,t,n=t.selection.ranges){let r=n.map(e=>IG(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>RG(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function VG(e,t,n=t.selection.ranges){let r=[],i=-1;ranges:for(let{from:e,to:a}of n){let n=r.length,o=1e9,s;for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(s==null&&(s=IG(t,c.from).line,!s))continue ranges;if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var HG=Be.define(),UG=Be.define(),WG=ve.define(),GG=ve.define({combine(e){return O(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),KG=m.define({create(){return dK.empty},update(e,t){let n=t.state.facet(GG),r=t.annotation(HG);if(r){let i=$G.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?eK(o,o.length,n.minDepth,i):oK(o,t.startState.selection),new dK(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(UG);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(Ne.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=$G.fromTransaction(t),o=t.annotation(Ne.time),s=t.annotation(Ne.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new dK(e.done.map($G.fromJSON),e.undone.map($G.fromJSON))}});function qG(e={}){return[KG,GG.of(e),le.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?YG:e.inputType==`historyRedo`?XG:null;return n?(e.preventDefault(),n(t)):!1}})]}function JG(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(KG,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var YG=JG(0,!1),XG=JG(1,!1),ZG=JG(0,!0),QG=JG(1,!0),$G=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&Oe.fromJSON(t.changes),[],t.mapped&&Fe.fromJSON(t.mapped),t.startSelection&&P.fromJSON(t.startSelection),t.selectionsAfter.map(P.fromJSON))}static fromTransaction(t,n){let r=iK;for(let e of t.startState.facet(WG)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,iK)}static selection(t){return new e(void 0,iK,void 0,void 0,t)}};function eK(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function tK(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function nK(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function rK(e,t){return e.length?t.length?e.concat(t):e:t}var iK=[],aK=200;function oK(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-aK));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),eK(e,e.length-1,1e9,n.setSelAfter(r)))}return[$G.selection([t])]}function sK(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function cK(e,t){if(!e.length)return e;let n=e.length,r=iK;for(;n;){let i=lK(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[$G.selection(r)]:iK}function lK(e,t,n){let r=rK(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):iK,n);if(!e.changes)return $G.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new $G(i,g.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var uK=/^(input\.type|delete)($|\.)/,dK=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||uK.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,tK(s.changes,t.changes))||r==`input.type.compose`)?eK(o,o.length-1,i.minDepth,new $G(t.changes.compose(s.changes),rK(g.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,iK)):eK(o,o.length,i.minDepth,t),new e(o,iK,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:iK;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&nK(a[a.length-1],t)?this:new e(oK(this.done,t),this.undone,n,r)}addMapping(t){return new e(cK(this.done,t),cK(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:HG.of({side:e,rest:sK(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?iK:r.slice(0,r.length-1);return i.mapped&&(n=cK(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:HG.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}return null}};dK.empty=new dK(iK,iK);var fK=[{key:`Mod-z`,run:YG,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:XG,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:XG,preventDefault:!0},{key:`Mod-u`,run:ZG,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:QG,preventDefault:!0}];function pK(e,t){return P.create(e.ranges.map(t),e.mainIndex)}function mK(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function hK({state:e,dispatch:t},n){let r=pK(e.selection,n);return!r.eq(e.selection,!0)&&(t(mK(e,r)),!0)}function gK(e,t){return P.cursor(t?e.to:e.from)}function _K(e,t){return hK(e,n=>n.empty?e.moveByChar(n,t):gK(n,t))}function vK(e){return e.textDirectionAt(e.state.selection.main.head)==u.LTR}var yK=e=>_K(e,!vK(e)),bK=e=>_K(e,vK(e));function xK(e,t){return hK(e,n=>n.empty?e.moveByGroup(n,t):gK(n,t))}var SK=e=>xK(e,!vK(e)),CK=e=>xK(e,vK(e));typeof Intl<`u`&&Intl.Segmenter;function wK(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function TK(e,t,n){let r=_(e).resolveInner(t.head),i=n?E.closedBy:E.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;wK(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?D(e,r.from,1):D(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,P.cursor(s,n?-1:1)}var EK=e=>hK(e,t=>TK(e.state,t,!vK(e))),DK=e=>hK(e,t=>TK(e.state,t,vK(e)));function OK(e,t){return hK(e,n=>{if(!n.empty)return gK(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var kK=e=>OK(e,!1),AK=e=>OK(e,!0);function jK(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(le.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function MK(e,t){let n=jK(e),{state:r}=e,i=pK(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):gK(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=le.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(mK(r,i),{effects:a}),!0}var NK=e=>MK(e,!1),PK=e=>MK(e,!0);function FK(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=P.cursor(r.from+n))}return i}var IK=e=>hK(e,t=>FK(e,t,!0)),LK=e=>hK(e,t=>FK(e,t,!1)),RK=e=>hK(e,t=>FK(e,t,!vK(e))),zK=e=>hK(e,t=>FK(e,t,vK(e))),BK=e=>hK(e,t=>e.moveToLineBoundary(t,!1,!1)),VK=e=>hK(e,t=>e.moveToLineBoundary(t,!0,!1));function HK(e,t,n){let r=!1,i=pK(e.selection,t=>{let i=D(e,t.head,-1)||D(e,t.head,1)||t.head>0&&D(e,t.head-1,1)||t.head<e.doc.length&&D(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?P.range(t.anchor,a):P.cursor(a)});return r?(t(mK(e,i)),!0):!1}var UK=({state:e,dispatch:t})=>HK(e,t,!1);function WK(e,t,n){let r=pK(e.state.selection,e=>{e.undirectional&&e.head>=e.anchor!=t&&(e=P.range(e.head,e.anchor));let r=n(e);return P.range(e.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return!r.eq(e.state.selection)&&(e.dispatch(mK(e.state,r)),!0)}function GK(e,t){return WK(e,t,n=>e.moveByChar(n,t))}var KK=e=>GK(e,!vK(e)),qK=e=>GK(e,vK(e));function JK(e,t){return WK(e,t,n=>e.moveByGroup(n,t))}var YK=e=>JK(e,!vK(e)),XK=e=>JK(e,vK(e)),ZK=e=>{let t=!vK(e);return WK(e,t,n=>TK(e.state,n,t))},QK=e=>{let t=vK(e);return WK(e,t,n=>TK(e.state,n,t))};function $K(e,t){return WK(e,t,n=>e.moveVertically(n,t))}var eq=e=>$K(e,!1),tq=e=>$K(e,!0);function nq(e,t){return WK(e,t,n=>e.moveVertically(n,t,jK(e).height))}var rq=e=>nq(e,!1),iq=e=>nq(e,!0),aq=e=>WK(e,!0,t=>FK(e,t,!0)),oq=e=>WK(e,!1,t=>FK(e,t,!1)),sq=e=>{let t=!vK(e);return WK(e,t,n=>FK(e,n,t))},cq=e=>{let t=vK(e);return WK(e,t,n=>FK(e,n,t))},lq=e=>WK(e,!1,t=>P.cursor(e.lineBlockAt(t.head).from)),uq=e=>WK(e,!0,t=>P.cursor(e.lineBlockAt(t.head).to)),dq=({state:e,dispatch:t})=>(t(mK(e,{anchor:0})),!0),fq=({state:e,dispatch:t})=>(t(mK(e,{anchor:e.doc.length})),!0),pq=({state:e,dispatch:t})=>(t(mK(e,{anchor:e.selection.main.anchor,head:0})),!0),mq=({state:e,dispatch:t})=>(t(mK(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),hq=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),gq=({state:e,dispatch:t})=>{let n=Fq(e).map(({from:t,to:n})=>P.undirectionalRange(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:P.create(n),userEvent:`select`})),!0},_q=({state:e,dispatch:t})=>{let n=pK(e.selection,t=>{let n=_(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return P.undirectionalRange(n.from,n.to)}return t});return!n.eq(e.selection)&&(t(mK(e,n)),!0)};function vq(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(mK(n,P.create(i,i.length-1))),!0)}var yq=e=>vq(e,!1),bq=e=>vq(e,!0),xq=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=P.create([n.main]):n.main.empty||(r=P.create([P.cursor(n.main.head)])),r?(t(mK(e,r)),!0):!1};function Sq(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=Cq(e,o,!1)):o>i&&(n=`delete.forward`,o=Cq(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=Cq(e,i,!1),a=Cq(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:P.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?le.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function Cq(e,t,n){if(e instanceof le)for(let r of e.state.facet(le.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var wq=(e,t,n)=>Sq(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=k(s,a.tabSize)%oe(a)||oe(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=j(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=j(o.text,c-o.from,!1,!1)+o.from);return c}),Tq=e=>wq(e,!1,!0),Eq=e=>wq(e,!0,!1),Dq=(e,t)=>Sq(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=j(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),Oq=e=>Dq(e,!1),kq=e=>Dq(e,!0),Aq=e=>Sq(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),jq=e=>Sq(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),Mq=e=>Sq(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),Nq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:te.of([``,``])},range:P.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},Pq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:j(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:j(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:P.cursor(a)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function Fq(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function Iq(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of Fq(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(P.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(P.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:P.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var Lq=({state:e,dispatch:t})=>Iq(e,t,!1),Rq=({state:e,dispatch:t})=>Iq(e,t,!0);function zq(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of Fq(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:`input.copyline`})),!0}var Bq=({state:e,dispatch:t})=>zq(e,t,!1),Vq=({state:e,dispatch:t})=>zq(e,t,!0),Hq=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Fq(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=pK(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function Uq(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=_(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(E.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var Wq=Kq(!1),Gq=Kq(!0);function Kq(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&Uq(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Le(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=h(s,r);for(c??=k(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Me(t,c)];return o&&l.push(Me(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:te.of(l)},range:P.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function qq(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:P.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var Jq=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Le(e,{overrideIndentation:e=>n[e]??-1}),i=qq(e,(t,i,a)=>{let o=h(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Me(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},Yq=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(qq(e,(t,n)=>{n.push({from:t.from,insert:e.facet(c)})}),{userEvent:`input.indent`})),!0),Xq=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(qq(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=k(r,e.tabSize),a=0,o=Me(e,Math.max(0,i-oe(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),Zq=e=>(e.setTabFocusMode(),!0),Qq=[{key:`Ctrl-b`,run:yK,shift:KK,preventDefault:!0},{key:`Ctrl-f`,run:bK,shift:qK},{key:`Ctrl-p`,run:kK,shift:eq},{key:`Ctrl-n`,run:AK,shift:tq},{key:`Ctrl-a`,run:BK,shift:lq},{key:`Ctrl-e`,run:VK,shift:uq},{key:`Ctrl-d`,run:Eq},{key:`Ctrl-h`,run:Tq},{key:`Ctrl-k`,run:Aq},{key:`Ctrl-Alt-h`,run:Oq},{key:`Ctrl-o`,run:Nq},{key:`Ctrl-t`,run:Pq},{key:`Ctrl-v`,run:PK}],$q=[{key:`ArrowLeft`,run:yK,shift:KK,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:SK,shift:YK,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:RK,shift:sq,preventDefault:!0},{key:`ArrowRight`,run:bK,shift:qK,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:CK,shift:XK,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:zK,shift:cq,preventDefault:!0},{key:`ArrowUp`,run:kK,shift:eq,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:dq,shift:pq},{mac:`Ctrl-ArrowUp`,run:NK,shift:rq},{key:`ArrowDown`,run:AK,shift:tq,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:fq,shift:mq},{mac:`Ctrl-ArrowDown`,run:PK,shift:iq},{key:`PageUp`,run:NK,shift:rq},{key:`PageDown`,run:PK,shift:iq},{key:`Home`,run:LK,shift:oq,preventDefault:!0},{key:`Mod-Home`,run:dq,shift:pq},{key:`End`,run:IK,shift:aq,preventDefault:!0},{key:`Mod-End`,run:fq,shift:mq},{key:`Enter`,run:Wq,shift:Wq},{key:`Mod-a`,run:hq},{key:`Backspace`,run:Tq,shift:Tq,preventDefault:!0},{key:`Delete`,run:Eq,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:Oq,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:kq,preventDefault:!0},{mac:`Mod-Backspace`,run:jq,preventDefault:!0},{mac:`Mod-Delete`,run:Mq,preventDefault:!0}].concat(Qq.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),eJ=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:EK,shift:ZK},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:DK,shift:QK},{key:`Alt-ArrowUp`,run:Lq},{key:`Shift-Alt-ArrowUp`,run:Bq},{key:`Alt-ArrowDown`,run:Rq},{key:`Shift-Alt-ArrowDown`,run:Vq},{key:`Mod-Alt-ArrowUp`,run:yq},{key:`Mod-Alt-ArrowDown`,run:bq},{key:`Escape`,run:xq},{key:`Mod-Enter`,run:Gq},{key:`Alt-l`,mac:`Ctrl-l`,run:gq},{key:`Mod-i`,run:_q,preventDefault:!0},{key:`Mod-[`,run:Xq},{key:`Mod-]`,run:Yq},{key:`Mod-Alt-\\`,run:Jq},{key:`Shift-Mod-k`,run:Hq},{key:`Shift-Mod-\\`,run:UK},{key:`Mod-/`,run:jG},{key:`Alt-A`,mac:`Ctrl-A`,run:PG},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:Zq}].concat($q),tJ={key:`Tab`,run:Yq,shift:Xq},nJ=`#2e3440`,rJ=`#3b4252`,iJ=`#434c5e`,aJ=`#4c566a`,oJ=`#e5e9f0`,sJ=`#eceff4`,cJ=`#8fbcbb`,lJ=`#88c0d0`,uJ=`#81a1c1`,dJ=`#5e81ac`,fJ=`#bf616a`,pJ=`#d08770`,mJ=`#ebcb8b`,hJ=`#a3be8c`,gJ=`#b48ead`,_J=`#d30102`,vJ=sJ,yJ=vJ,bJ=`#ffffff`,xJ=rJ,SJ=vJ,CJ=rJ,wJ=le.theme({"&":{color:nJ,backgroundColor:bJ},".cm-content":{caretColor:CJ},".cm-cursor, .cm-dropCursor":{borderLeftColor:CJ},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:SJ},".cm-panels":{backgroundColor:vJ,color:aJ},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid ${aJ}`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:oJ},".cm-activeLine":{backgroundColor:yJ},".cm-selectionMatch":{backgroundColor:oJ},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{outline:`1px solid ${aJ}`},"&.cm-focused .cm-matchingBracket":{backgroundColor:sJ},".cm-gutters":{backgroundColor:sJ,color:nJ,border:`none`},".cm-activeLineGutter":{backgroundColor:yJ},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:xJ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:xJ,borderBottomColor:xJ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:yJ,color:aJ}}},{dark:!1}),TJ=ge.define([{tag:M.keyword,color:dJ},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:pJ},{tag:[M.variableName],color:pJ},{tag:[M.function(M.variableName)],color:dJ},{tag:[M.labelName],color:uJ},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:dJ},{tag:[M.definition(M.name),M.separator],color:hJ},{tag:[M.brace],color:cJ},{tag:[M.annotation],color:_J},{tag:[M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:lJ},{tag:[M.typeName,M.className],color:mJ},{tag:[M.operator,M.operatorKeyword],color:hJ},{tag:[M.tagName],color:gJ},{tag:[M.squareBracket],color:fJ},{tag:[M.angleBracket],color:pJ},{tag:[M.attributeName],color:mJ},{tag:[M.regexp],color:dJ},{tag:[M.quote],color:rJ},{tag:[M.string],color:pJ},{tag:M.link,color:cJ,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[M.url,M.escape,M.special(M.string)],color:pJ},{tag:[M.meta],color:lJ},{tag:[M.comment],color:iJ,fontStyle:`italic`},{tag:M.strong,fontWeight:`bold`,color:dJ},{tag:M.emphasis,fontStyle:`italic`,color:dJ},{tag:M.strikethrough,textDecoration:`line-through`},{tag:M.heading,fontWeight:`bold`,color:dJ},{tag:M.special(M.heading1),fontWeight:`bold`,color:dJ},{tag:M.heading1,fontWeight:`bold`,color:dJ},{tag:[M.heading2,M.heading3,M.heading4],fontWeight:`bold`,color:dJ},{tag:[M.heading5,M.heading6],color:dJ},{tag:[M.atom,M.bool,M.special(M.variableName)],color:pJ},{tag:[M.processingInstruction,M.inserted],color:cJ},{tag:[M.contentSeparator],color:mJ},{tag:M.invalid,color:iJ,borderBottom:`1px dotted ${_J}`}]),EJ=[wJ,A(TJ)],DJ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,OJ=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(DJ(e)):DJ,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return l(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=v(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=je(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(OJ.prototype[Symbol.iterator]=function(){return this});var kJ={from:-1,to:-1,match:/.*/.exec(``),precise:!0},AJ=`gm`+(/x/.unicode==null?``:`u`),jJ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=kJ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new PJ(e,t,n,r,i);this.re=new RegExp(t,AJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter();let a=e.lineAt(r);this.curLineStart=a.from,this.matchPos=IJ(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=IJ(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},MJ=new WeakMap,NJ=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=MJ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return MJ.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),MJ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},PJ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=kJ,this.matchPos=IJ(e,r),this.re=new RegExp(t,AJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=NJ.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=IJ(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=NJ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(jJ.prototype[Symbol.iterator]=PJ.prototype[Symbol.iterator]=function(){return this});function FJ(e){try{return new RegExp(e,AJ),!0}catch{return!1}}function IJ(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var LJ=e=>{let t=pe(e,`cm-goto-line`);if(t){let e=t.dom.querySelector(`input[type=text]`);return e&&e.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:i,result:a}=be(e,{class:`cm-goto-line`,label:n.phrase(`Go to line`),input:{type:`text`,name:`line`,value:r},focus:!0,submitLabel:n.phrase(`go`)});return a.then(t=>{let r=t&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.elements.line.value);if(!r){e.dispatch({effects:i});return}let a=n.doc.lineAt(n.selection.main.head),[,o,s,c,l]=r,u=c?+c.slice(1):0,d=s?+s:a.number;if(s&&l){let e=d/100;o&&(e=e*(o==`-`?-1:1)+a.number/n.doc.lines),d=Math.round(n.doc.lines*e)}else s&&o&&(d=d*(o==`-`?-1:1)+a.number);let f=n.doc.line(Math.max(1,Math.min(n.doc.lines,d))),p=P.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[i,le.scrollIntoView(p.from,{y:`center`})],selection:p})}),!0},RJ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zJ=ve.define({combine(e){return O(e,RJ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function BJ(e){let t=[KJ,GJ];return e&&t.push(zJ.of(e)),t}var VJ=Ye.mark({class:`cm-selectionMatch`}),HJ=Ye.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function UJ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=De.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=De.Word)}function WJ(e,t,n,r){return e(t.sliceDoc(n,n+1))==De.Word&&e(t.sliceDoc(r-1,r))==De.Word}var GJ=se.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(zJ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ye.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ye.none;let e=n.wordAt(i.head);if(!e)return Ye.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Ye.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(UJ(o,n,i.from,i.to)&&WJ(o,n,i.from,i.to)))return Ye.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ye.none}let s=[];for(let r of e.visibleRanges){let e=new OJ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||UJ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(HJ.range(r,a)):(r>=i.to||a<=i.from)&&s.push(VJ.range(r,a)),s.length>t.maxMatches))return Ye.none}}return Ye.set(s)}},{decorations:e=>e.decorations}),KJ=le.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),qJ=({state:e,dispatch:t})=>{let{selection:n}=e,r=P.create(n.ranges.map(t=>e.wordAt(t.head)||P.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)};function JJ(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new OJ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new OJ(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var YJ=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return qJ({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=JJ(e,r);return i?(t(e.update({selection:e.selection.addRange(P.range(i.from,i.to),!1),effects:le.scrollIntoView(i.to)})),!0):!1},XJ=ve.define({combine(e){return O(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new AY(e),scrollToMatch:e=>le.scrollIntoView(e)})}}),ZJ=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||FJ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
112
+ `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new cY(this):new nY(this)}getCursor(e,t=0,n){let r=e.doc?e:Je.create({doc:e});return n??=r.doc.length,this.regexp?iY(this,r,t,n):eY(this,r,t,n)}},QJ=class{constructor(e){this.spec=e}};function $J(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function eY(e,t,n,r){let i;return e.wholeWord&&(i=tY(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=$J(e.test,t,i)),new OJ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function tY(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(aY(i,n-a))!=De.Word||t(oY(i,n-a))!=De.Word)&&(t(oY(i,r-a))!=De.Word||t(aY(i,r-a))!=De.Word))}var nY=class extends QJ{constructor(e){super(e)}nextMatch(e,t,n){let r=eY(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=eY(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=eY(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=eY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=eY(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function rY(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function iY(e,t,n,r){let i;return e.wholeWord&&(i=sY(t.charCategorizer(t.selection.main.head))),e.test&&(i=rY(e.test,t,i)),new jJ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function aY(e,t){return e.slice(j(e,t,!1),t)}function oY(e,t){return e.slice(t,j(e,t))}function sY(e){return(t,n,r)=>!r[0].length||(e(aY(r.input,r.index))!=De.Word||e(oY(r.input,r.index))!=De.Word)&&(e(oY(r.input,r.index+r[0].length))!=De.Word||e(aY(r.input,r.index+r[0].length))!=De.Word)}var cY=class extends QJ{nextMatch(e,t,n){let r=iY(this.spec,e,n,e.doc.length).next();return r.done&&(r=iY(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=iY(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=iY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=iY(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},lY=g.define(),uY=g.define(),dY=m.define({create(e){return new fY(wY(e).create(),null)},update(e,t){for(let n of t.effects)n.is(lY)?e=new fY(n.value.create(),e.panel):n.is(uY)&&(e=new fY(e.query,n.value?CY:null));return e},provide:e=>Pe.from(e,e=>e.panel)}),fY=class{constructor(e,t){this.query=e,this.panel=t}},pY=Ye.mark({class:`cm-searchMatch`}),mY=Ye.mark({class:`cm-searchMatch cm-searchMatch-selected`}),hY=se.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(dY))}update(e){let t=e.state.field(dY);(t!=e.startState.field(dY)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ye.none;let{view:n}=this,r=new qe;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?mY:pY)})}return r.finish()}},{decorations:e=>e.decorations});function gY(e){return t=>{let n=t.state.field(dY,!1);return n&&n.query.spec.valid?e(t,n):DY(t)}}var _Y=gY((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=P.single(r.from,r.to),a=e.state.facet(XJ);return e.dispatch({selection:i,effects:[PY(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),EY(e),!0}),vY=gY((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=P.single(i.from,i.to),o=e.state.facet(XJ);return e.dispatch({selection:a,effects:[PY(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),EY(e),!0}),yY=gY((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:P.create(n.map(e=>P.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),bY=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new OJ(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(P.range(t.value.from,t.value.to))}return t(e.update({selection:P.create(a,o),userEvent:`select.search.matches`})),!0},xY=gY((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(le.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let d=e.state.changes(s);return o&&(c=P.single(o.from,o.to).map(d),u.push(PY(e,o)),u.push(n.facet(XJ).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),SY=gY((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:le.announce.of(r),userEvent:`input.replace.all`}),!0});function CY(e){return e.state.facet(XJ).createPanel(e)}function wY(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(XJ);return new ZJ({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function TY(e){let t=fe(e,CY);return t&&t.dom.querySelector(`[main-field]`)}function EY(e){let t=TY(e);t&&t==e.root.activeElement&&t.select()}var DY=e=>{let t=e.state.field(dY,!1);if(t&&t.panel){let n=TY(e);if(n&&n!=e.root.activeElement){let r=wY(e.state,t.query.spec);r.valid&&e.dispatch({effects:lY.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[uY.of(!0),t?lY.of(wY(e.state,t.query.spec)):g.appendConfig.of(IY)]});return!0},OY=e=>{let t=e.state.field(dY,!1);if(!t||!t.panel)return!1;let n=fe(e,CY);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:uY.of(!1)}),!0},kY=[{key:`Mod-f`,run:DY,scope:`editor search-panel`},{key:`F3`,run:_Y,shift:vY,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:_Y,shift:vY,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:OY,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:bY},{key:`Mod-Alt-g`,run:LJ},{key:`Mod-d`,run:YJ,preventDefault:!0}],AY=class{constructor(e){this.view=e;let t=this.query=e.state.field(dY).query.spec;this.commit=this.commit.bind(this),this.searchField=Se(`input`,{value:t.search,placeholder:jY(e,`Find`),"aria-label":jY(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=Se(`input`,{value:t.replace,placeholder:jY(e,`Replace`),"aria-label":jY(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=Se(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=Se(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=Se(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return Se(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=Se(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>_Y(e),[jY(e,`next`)]),n(`prev`,()=>vY(e),[jY(e,`previous`)]),n(`select`,()=>yY(e),[jY(e,`all`)]),Se(`label`,null,[this.caseField,jY(e,`match case`)]),Se(`label`,null,[this.reField,jY(e,`regexp`)]),Se(`label`,null,[this.wordField,jY(e,`by word`)]),...e.state.readOnly?[]:[Se(`br`),this.replaceField,n(`replace`,()=>xY(e),[jY(e,`replace`)]),n(`replaceAll`,()=>SY(e),[jY(e,`replace all`)])],Se(`button`,{name:`close`,onclick:()=>OY(e),"aria-label":jY(e,`close`),type:`button`},[`×`])])}commit(){let e=new ZJ({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:lY.of(e)}))}keydown(e){Ue(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?vY:_Y)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),xY(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(lY)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(XJ).top}};function jY(e,t){return e.state.phrase(t)}var MY=30,NY=/[\s\.,:;?!]/;function PY(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-MY),o=Math.min(i,n+MY),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<MY;e++)if(!NY.test(s[e+1])&&NY.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-MY;e--)if(!NY.test(s[e-1])&&NY.test(s[e])){s=s.slice(0,e);break}}return le.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var FY=le.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),IY=[dY,ae.low(hY),FY],LY=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},RY=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(QY).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new qe,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=lX(s);if(i)o.add(n,n,Ye.widget({widget:new nX(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Ye.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,zY(f))}};function zY(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0)){if(!r)r=new LY(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new LY(r.from,n,r.diagnostic)}}),r}function BY(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(QY).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(HY))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function VY(e,t){return e.field(GY,!1)?t:t.concat(g.appendConfig.of(dX))}var HY=g.define(),UY=g.define(),WY=g.define(),GY=m.define({create(){return new RY(Ye.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=zY(n,e.selected.diagnostic,i)||zY(n,null,i)}!n.size&&i&&t.state.facet(QY).autoPanel&&(i=null),e=new RY(n,i,r)}for(let n of t.effects)if(n.is(HY)){let r=t.state.facet(QY).autoPanel?n.value.length?iX.open:null:e.panel;e=RY.init(n.value,r,t.state)}else n.is(UY)?e=new RY(e.diagnostics,n.value?iX.open:null,e.selected):n.is(WY)&&(e=new RY(e.diagnostics,e.panel,n.value));return e},provide:e=>[Pe.from(e,e=>e.panel),le.decorations.from(e,e=>e.diagnostics)]}),KY=Ye.mark({class:`cm-lintRange cm-lintRange-active`});function qY(e,t,n){let{diagnostics:r}=e.state.field(GY),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(QY).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:JY(e,i)}}}:null}function JY(e,t){return Se(`ul`,{class:`cm-tooltip-lint`},t.map(t=>tX(e,t,!1)))}var YY=e=>{let t=e.state.field(GY,!1);(!t||!t.panel)&&e.dispatch({effects:VY(e.state,[UY.of(!0)])});let n=fe(e,iX.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},XY=e=>{let t=e.state.field(GY,!1);return!t||!t.panel?!1:(e.dispatch({effects:UY.of(!1)}),!0)},ZY=[{key:`Mod-Shift-m`,run:YY,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(GY,!1);if(!t)return!1;let n=e.state.selection.main,r=zY(t.diagnostics,null,n.to+1);return!r&&(r=zY(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),y(e,r.from,1,{tooltip:uX,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],QY=ve.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...O(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:$Y,tooltipFilter:$Y,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function $Y(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function eX(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function tX(e,t,n){let r=n?eX(t.actions):[];return Se(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},Se(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=zY(e.state.field(GY).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),Se(`u`,s.slice(c,c+1)),s.slice(c+1)],u=n.markClass?` `+n.markClass:``;return Se(`button`,{type:`button`,class:`cm-diagnosticAction`+u,onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&Se(`div`,{class:`cm-diagnosticSource`},t.source))}var nX=class extends de{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Se(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},rX=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=tX(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},iX=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)XY(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=eX(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=zY(this.view.state.field(GY).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=Se(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=Se(`div`,{class:`cm-panel-lint`},this.list,Se(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>XY(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(GY).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(GY),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new rX(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new rX(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=zY(this.view.state.field(GY).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:WY.of(t)})}static open(t){return new e(t)}};function aX(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function oX(e){return aX(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var sX=le.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:oX(`#f11`)},".cm-lintRange-warning":{backgroundImage:oX(`orange`)},".cm-lintRange-info":{backgroundImage:oX(`#999`)},".cm-lintRange-hint":{backgroundImage:oX(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function cX(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function lX(e){let t=`hint`,n=1;for(let r of e){let e=cX(r.severity);e>n&&(n=e,t=r.severity)}return t}var uX=Ie(qY,{hideOn:BY}),dX=[GY,le.decorations.compute([GY],e=>{let{selected:t,panel:n}=e.field(GY);return!t||!n||t.from==t.to?Ye.none:Ye.set([KY.range(t.from,t.to)])}),uX,sX],fX=[ke(),Ce(),We(),qG(),_e(),Ve(),C(),Je.allowMultipleSelections.of(!0),ee(),A(Ee,{fallback:!0}),ze(),nt(),et(),Re(),w(),s(),BJ(),He.of([...$e,...eJ,...kY,...fK,...ie,...tt,...ZY])];function pX(e,t,n){let r=kr(PD),i=jr(EO),a=I.useRef(null),{lexicalNode:o}=yG(),s=I.useRef(!1),c=I.useRef(!1),l=I.useCallback(()=>{i({editorType:`codeblock`,rootNode:o,editorRef:a.current})},[o,i]),u=I.useCallback(t=>{if(t.key===`ArrowDown`){let t=a.current?.getCodemirror()?.state;t&&t.doc.length===t.selection.ranges[0].to&&(s.current?(r?.update(()=>{var t;let n=Hu(e);n.getNextSibling()?((t=a.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectNext()):n.insertAfter(lu())}),s.current=!1):s.current=!0)}else if(t.key===`ArrowUp`){let t=a.current?.getCodemirror()?.state;t&&t.selection.ranges[0].from===0&&(c.current?(r?.update(()=>{var t;let n=Hu(e);n.getPreviousSibling()&&((t=a.current?.getCodemirror())==null||t.contentDOM.blur(),n.selectPrevious())}),c.current=!1):c.current=!0)}else t.key===`Enter`?t.stopPropagation():(t.key===`Backspace`||t.key===`Delete`)&&(a.current?.getCodemirror()?.state)?.doc.length===0&&r?.update(()=>{Hu(e).remove()})},[r,e]);return I.useEffect(()=>{let e=a.current;return setTimeout(()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.addEventListener(`focus`,l),(n=e?.getCodemirror())==null||n.contentDOM.addEventListener(`keydown`,u)},300),()=>{var t,n;(t=e?.getCodemirror())==null||t.contentDOM.removeEventListener(`focus`,l),(n=e?.getCodemirror())==null||n.contentDOM.removeEventListener(`keydown`,u)}},[a,l,u,t]),I.useEffect(()=>{n.subscribe(()=>{var e;(e=a.current?.getCodemirror())==null||e.focus(),l()})},[n,a,e,l]),a}var mX=Object.defineProperty,hX=(e,t)=>mX(e,`name`,{value:t,configurable:!0});function gX(e,[t,n]){return Math.min(n,Math.max(t,e))}hX(gX,`clamp`);var _X=Object.defineProperty,vX=(e,t)=>_X(e,`name`,{value:t,configurable:!0});function yX(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}vX(yX,`usePrevious`);var bX=Object.defineProperty,xX=(e,t)=>bX(e,`name`,{value:t,configurable:!0}),SX=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),CX=I.forwardRef(xX(function(e,t){return(0,L.jsx)(Oj.span,{...e,ref:t,style:{...SX,...e.style}})},`VisuallyHidden`)),wX=Object.defineProperty,TX=(e,t)=>wX(e,`name`,{value:t,configurable:!0}),EX=[` `,`Enter`,`ArrowUp`,`ArrowDown`],DX=[` `,`Enter`],OX=`Select`,[kX,AX,jX]=OL(OX),[MX,NX]=lj(OX,[jX,UP]),PX=UP(),[FX,IX]=MX(OX),[LX,RX]=MX(OX);function zX(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=PX(t),[_,v]=I.useState(null),[y,b]=I.useState(null),[x,S]=I.useState(!1),C=HL(l),[w,T]=OF({prop:r,defaultProp:i??!1,onChange:a,caller:OX}),[E,D]=OF({prop:o,defaultProp:s,onChange:c,caller:OX}),O=I.useRef(null),k=I.useRef(E);I.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=TX(()=>D(k.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,D]);let ee=!_||!!m||!!_.closest(`form`),[te,A]=I.useState(new Set),j=SM(),ne=Array.from(te).map(e=>e.props.value).join(`;`),M=I.useCallback(e=>{A(t=>new Set(t).add(e))},[]),re=I.useCallback(e=>{A(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:p,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:j,value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:te,nativeSelectKey:ne,isFormControl:ee};return(0,L.jsx)(aF,{...g,children:(0,L.jsx)(FX,{scope:t,...ie,children:(0,L.jsx)(kX.Provider,{scope:t,children:(0,L.jsx)(LX,{scope:t,onNativeOptionAdd:M,onNativeOptionRemove:re,children:bZ(h)?h(ie):n})})})})}TX(zX,`SelectProvider`);var BX=TX(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(zX,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(yZ,{__scopeSelect:t}):null]})})},`Select`),VX=`SelectTrigger`,HX=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=PX(n),o=IX(VX,n),s=o.disabled||r,c=aj(t,o.onTriggerChange),l=AX(n),u=I.useRef(`touch`),[d,f,p]=SZ(e=>{let t=l().filter(e=>!e.disabled),n=CZ(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=TX(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,L.jsx)(oF,{asChild:!0,...a,children:(0,L.jsx)(Oj.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":xZ(o.value)?``:void 0,...i,ref:c,onClick:XA(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:XA(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:XA(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&EX.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),UX=`SelectValue`,WX=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=IX(UX,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=aj(t,c.onValueNodeChange);_M(()=>{l(u)},[l,u]);let f=xZ(c.value);return(0,L.jsx)(Oj.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,L.jsx)(I.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),GX=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(Oj.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[KX,qX]=MX(`SelectPortal`,{forceMount:void 0}),JX=TX(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(KX,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(uF,{asChild:!0,...r})})},`SelectPortal`),YX=`SelectContent`,XX=I.forwardRef(TX(function(e,t){let n=qX(YX,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=IX(YX,e.__scopeSelect),[o,s]=I.useState();return _M(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(mF,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(nZ,{...i,ref:t}):(0,L.jsx)(ZX,{...i,fragment:o})})},`SelectContent`)),ZX=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?SD.createPortal((0,L.jsx)($X,{scope:n,children:(0,L.jsx)(kX.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),QX=10,[$X,eZ]=MX(YX),tZ=pj(`SelectContent.RemoveScroll`),nZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=IX(YX,n),[y,b]=I.useState(null),[x,S]=I.useState(null),C=aj(t,b),[w,T]=I.useState(null),[E,D]=I.useState(null),O=AX(n),[k,ee]=I.useState(!1),te=I.useRef(!1);I.useEffect(()=>{if(y)return VF(y)},[y]),Qj();let A=I.useCallback(e=>{let[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[O,x]),j=I.useCallback(()=>A([w,y]),[A,w,y]);I.useEffect(()=>{k&&j()},[k,j]);let{onOpenChange:ne,triggerPointerDownPosRef:M}=v;I.useEffect(()=>{if(y){let e={x:0,y:0},t=TX(t=>{e={x:Math.abs(Math.round(t.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(M.current?.y??0))}},`handlePointerMove`),n=TX(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||ne(!1),document.removeEventListener(`pointermove`,t),M.current=null},`handlePointerUp`);return M.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,ne,M]),I.useEffect(()=>{let e=TX(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[re,ie]=SZ(e=>{let t=O().filter(e=>!e.disabled),n=CZ(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=I.useCallback((e,t,n)=>{let r=!te.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(te.current=!0))},[v.value]),oe=I.useCallback(()=>y?.focus(),[y]),se=I.useCallback((e,t,n)=>{let r=!te.current&&!n;(v.value!==void 0&&v.value===t||r)&&D(e)},[v.value]),ce=r===`popper`?iZ:rZ,le=ce===iZ?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)($X,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ae,selectedItem:w,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:j,selectedItemText:E,position:r,isPositioned:k,searchRef:re,children:(0,L.jsx)(YI,{as:tZ,allowPinchZoom:!0,children:(0,L.jsx)(aM,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:XA(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(Bj,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,L.jsx)(ce,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...le,onPlaced:()=>ee(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:XA(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>A(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),rZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=IX(YX,n),o=eZ(YX,n),[s,c]=I.useState(null),[l,u]=I.useState(null),d=aj(t,u),f=AX(n),p=I.useRef(!1),m=I.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-QX,d=gX(a,[QX,Math.max(QX,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-QX,d=gX(a,[QX,Math.max(QX,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-QX*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-QX,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,ee=m+v+k,te=x-ee;if(ee<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=ee+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+te;s.style.height=t+`px`,h.scrollTop=ee-E+h.offsetTop}s.style.margin=`${QX}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);_M(()=>y(),[y]);let[b,x]=I.useState();_M(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=I.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,L.jsx)(aZ,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,L.jsx)(Oj.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),iZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=QX,...a}=e,o=PX(n);return(0,L.jsx)(sF,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[aZ,oZ]=MX(YX,{}),sZ=`SelectViewport`,cZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=eZ(sZ,n),o=oZ(sZ,n),s=aj(t,a.onViewportChange),c=I.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,L.jsx)(kX.Slot,{scope:n,children:(0,L.jsx)(Oj.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:XA(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-QX*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[lZ,uZ]=MX(`SelectGroup`),dZ=`SelectItem`,[fZ,pZ]=MX(dZ),mZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=IX(dZ,n),c=eZ(dZ,n),l=s.value===r,[u,d]=I.useState(a??``),[f,p]=I.useState(!1),m=aj(t,Mj(e=>c.itemRefCallback?.(e,r,i))),h=SM(),g=I.useRef(`touch`),_=TX(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,L.jsx)(fZ,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:I.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(kX.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(Oj.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:XA(o.onFocus,()=>p(!0)),onBlur:XA(o.onBlur,()=>p(!1)),onClick:XA(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:XA(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:XA(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:XA(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:XA(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:XA(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(DX.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),hZ=`SelectItemText`,gZ=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=IX(hZ,n),s=eZ(hZ,n),c=pZ(hZ,n),l=RX(hZ,n),[u,d]=I.useState(null),f=Mj(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=aj(t,d,c.onItemTextChange,f),m=u?.textContent,h=I.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return _M(()=>(g(h),()=>_(h)),[g,_,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Oj.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!xZ(o.value)?SD.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),_Z=I.forwardRef(TX(function(e,t){let{__scopeSelect:n,...r}=e;return(0,L.jsx)(Oj.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),vZ=`SelectBubbleInput`,yZ=I.forwardRef(TX(function({__scopeSelect:e,...t},n){let r=IX(vZ,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=I.useRef(null),m=aj(n,p),h=i??``,g=yX(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return I.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,L.jsxs)(Oj.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...SX,...t.style},ref:m,defaultValue:h,children:[xZ(i)&&!_?(0,L.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function bZ(e){return typeof e==`function`}TX(bZ,`isFunction`);function xZ(e){return e===``||e===void 0}TX(xZ,`shouldShowPlaceholder`);function SZ(e){let t=Mj(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i),TX((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}TX(SZ,`useTypeaheadSearch`);function CZ(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=wZ(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}TX(CZ,`findNextItem`);function wZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}TX(wZ,`wrapArray`);var TZ=Object.defineProperty,EZ=(e,t)=>TZ(e,`name`,{value:t,configurable:!0}),[DZ,OZ]=lj(`Tooltip`,[UP]),kZ=UP(),AZ=`TooltipProvider`,jZ=700,MZ=`tooltip.open`,[NZ,PZ]=DZ(AZ),FZ=EZ(e=>{let{__scopeTooltip:t,delayDuration:n=jZ,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(NZ,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:I.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),IZ=`Tooltip`,[LZ,RZ]=DZ(IZ),zZ=EZ(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=PZ(IZ,e.__scopeTooltip),l=kZ(t),[u,d]=I.useState(null),[f,p]=I.useState(void 0),m=SM(),h=I.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=I.useRef(!1),[y,b]=OF({prop:r,defaultProp:i??!1,onChange:EZ(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(MZ))):c.onClose(),a?.(e)},`onChange`),caller:IZ}),x=I.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=I.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=I.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=I.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);I.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,L.jsx)(aF,{...l,children:(0,L.jsx)(LZ,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:I.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),BZ=`TooltipTrigger`,VZ=I.forwardRef(EZ(function(e,t){let{__scopeTooltip:n,...r}=e,i=RZ(BZ,n),a=PZ(BZ,n),o=kZ(n),s=aj(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(oF,{asChild:!0,...o,children:(0,L.jsx)(Oj.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:XA(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:XA(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:XA(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:XA(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:XA(e.onBlur,i.onClose),onClick:XA(e.onClick,i.onClose)})})},`TooltipTrigger`)),HZ=`TooltipPortal`,[UZ,WZ]=DZ(HZ,{forceMount:void 0}),GZ=EZ(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=RZ(HZ,t);return(0,L.jsx)(UZ,{scope:t,forceMount:n,children:(0,L.jsx)(mF,{present:n||a.open,children:(0,L.jsx)(uF,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),KZ=`TooltipContent`,qZ=I.forwardRef(EZ(function(e,t){let n=WZ(KZ,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=RZ(KZ,e.__scopeTooltip);return(0,L.jsx)(mF,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(XZ,{side:i,...a,ref:t}):(0,L.jsx)(JZ,{side:i,...a,ref:t})})},`TooltipContent`)),JZ=I.forwardRef(EZ(function(e,t){let n=RZ(KZ,e.__scopeTooltip),r=PZ(KZ,e.__scopeTooltip),i=I.useRef(null),a=aj(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=$Z(r,QZ(r,n.getBoundingClientRect())),a=eQ(t.getBoundingClientRect()),o=nQ([...i,...a]);s(o),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=EZ(e=>p(e,u),`handleTriggerLeave`),t=EZ(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=EZ(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!tQ(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(XZ,{...e,ref:a})},`TooltipContentHoverable`)),YZ=hj(`TooltipContent`),XZ=I.forwardRef(EZ(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=RZ(KZ,n),u=kZ(n),{onClose:d}=l;I.useEffect(()=>(document.addEventListener(MZ,d),()=>document.removeEventListener(MZ,d)),[d]),I.useEffect(()=>{if(l.trigger){let e=EZ(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return _M(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(Bj,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(sF,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(YZ,{children:r}),i?(0,L.jsx)(CX,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),ZZ=I.forwardRef(EZ(function(e,t){let{__scopeTooltip:n,...r}=e,i=kZ(n);return(0,L.jsx)(cF,{...i,...r,ref:t})},`TooltipArrow`));function QZ(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}EZ(QZ,`getExitSideFromRect`);function $Z(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}EZ($Z,`getPaddedExitPoints`);function eQ(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}EZ(eQ,`getPointsFromRect`);function tQ(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}EZ(tQ,`isPointInPolygon`);function nQ(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),rQ(t)}EZ(nQ,`getHull`);function rQ(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}EZ(rQ,`getHullPresorted`);var iQ=FZ,aQ=zZ,oQ=VZ,sQ=GZ,cQ=qZ,lQ=ZZ,uQ=I.forwardRef(({title:e,children:t},n)=>{let r=kr(uO);return I.createElement(iQ,{delayDuration:100},I.createElement(aQ,null,I.createElement(oQ,{ref:n,asChild:!0},I.createElement(`span`,{className:X.tooltipTrigger},t)),I.createElement(sQ,{container:r?.current},I.createElement(cQ,{className:(0,Ek.default)(X.tooltipContent),sideOffset:10},e))))}),dQ=I.forwardRef(({children:e,className:t,...n},r)=>I.createElement(mZ,{...n,ref:r,className:(0,Ek.default)(t,X.selectItem)},I.createElement(gZ,null,e))),fQ=({title:e,placeholder:t,className:n})=>{let[r,i]=Ar(LD,OO);return I.createElement(uQ,{title:e},I.createElement(HX,{"aria-label":t,className:(0,Ek.default)(X.selectTrigger,n),"data-toolbar-item":!0,disabled:r},I.createElement(WX,{placeholder:t}),I.createElement(GX,{className:X.selectDropdownArrow},i(`arrow_drop_down`))))},pQ=({children:e,className:t=X.selectContainer})=>{let n=kr(uO);return I.createElement(JX,{container:n?.current},I.createElement(XX,{className:(0,Ek.default)(t,`mdxeditor-select-content`),onCloseAutoFocus:e=>{e.preventDefault()},position:`popper`},I.createElement(cZ,{"data-editor-dropdown":!0,style:{maxHeight:`var(--radix-select-content-available-height)`}},e)))},mQ=e=>I.createElement(BX,{value:e.value||``,onValueChange:e.onChange,disabled:e.disabled},I.createElement(fQ,{title:e.triggerTitle,placeholder:e.placeholder}),I.createElement(pQ,null,e.items.map((e,t)=>e===`separator`?I.createElement(_Z,{key:t}):I.createElement(dQ,{key:t,value:e.value},e.label)))),hQ=({language:e,nodeKey:t,code:n,focusEmitter:r})=>{let i=ik(),{parentEditor:a,lexicalNode:o}=yG(),[s,c,l,u,d]=Ar(LD,xQ,SQ,OO,yQ),f=pX(t,e,r),{setCode:p}=yG(),m=I.useRef(null),h=I.useRef(null),{value:g,items:_}=I.useMemo(()=>vQ(d,e),[d,e]),v=I.useRef(p);return v.current=p,f.current={getCodemirror:()=>m.current},I.useEffect(()=>{let t=h.current;return(async()=>{let r=[...c,fX,EJ,ke(),He.of([tJ]),le.lineWrapping,le.updateListener.of(({state:e})=>{v.current(e.doc.toString())}),le.domEventHandlers({focus:()=>{a.update(()=>{Xu(null)})}})];if(s&&r.push(Je.readOnly.of(!0)),e!==``){let t=d.keyMap[e]??e,n=d.supportMap[t];if(n)r.push(n.extension);else if(l){let t=AG.find(t=>t.name===e||t.alias.includes(e)||t.extensions.includes(e));if(t)try{let e=await t.load();r.push(e.extension)}catch{console.warn(`failed to load language support for`,e)}}}t.innerHTML=``,m.current=new le({parent:t,state:Je.create({doc:n,extensions:r})}),t.addEventListener(`keydown`,gQ)})(),()=>{var e;(e=m.current)==null||e.destroy(),m.current=null,t.removeEventListener(`keydown`,gQ)}},[s,e,...c]),I.createElement(`div`,{className:X.codeMirrorWrapper},I.createElement(`div`,{className:X.codeMirrorToolbar},I.createElement(mQ,{disabled:s,value:g,onChange:e=>{a.update(()=>{o.setLanguage(e===`__EMPTY_VALUE__`?``:e),setTimeout(()=>{a.update(()=>{o.getLatest().select()})})})},triggerTitle:i(`codeBlock.selectLanguage`,`Select code block language`),placeholder:i(`codeBlock.inlineLanguage`,`Language`),items:_}),I.createElement(`button`,{className:X.iconButton,type:`button`,disabled:s,title:i(`codeblock.delete`,`Delete code block`),onClick:e=>{e.preventDefault(),a.update(()=>{o.remove()})}},u(`delete_small`))),I.createElement(`div`,{ref:h}))};function gQ(e){e.stopPropagation()}function _Q(e){let t=[],n={},r={};if(Array.isArray(e))for(let i of e){let e=i.alias?.[0]??i.name.toLowerCase(),a=e||`__EMPTY_VALUE__`;if(t.push({value:a,label:i.name}),n[e]=a,i.alias)for(let e of i.alias)n[e]=a;if(i.extensions)for(let e of i.extensions)n[e]=a;n[i.name.toLowerCase()]=a,i.support&&(r[a]=i.support)}else{let r={};for(let[i,a]of Object.entries(e))a in r||(r[a]=i,t.push({value:i||`__EMPTY_VALUE__`,label:a})),n[i]=r[a]||`__EMPTY_VALUE__`}return{items:t,keyMap:n,supportMap:r}}function vQ(e,t){let n=e.keyMap[t]??t;return!n||e.items.some(e=>e.value===n)?{value:n,items:e.items}:{value:n,items:[...e.items,{value:n,label:t}]}}var yQ=R(_Q({js:`JavaScript`,ts:`TypeScript`,tsx:`TypeScript (React)`,jsx:`JavaScript (React)`,css:`CSS`})),bQ=Tr(e=>{e.link(e.pipe(bQ,Mr(({language:e,code:t})=>({code:t,language:e,meta:``}))),EG)}),xQ=R([]),SQ=R(!0),CQ=zr({update(e,t){e.pubIn({[yQ]:_Q(t?.codeBlockLanguages??{}),[xQ]:t?.codeMirrorExtensions??[],[SQ]:t?.autoLoadLanguageSupport??!0})},init(e,t){let n=_Q(t?.codeBlockLanguages??{});e.pubIn({[yQ]:n,[xQ]:t?.codeMirrorExtensions??[],[DG]:wQ(n),[SQ]:t?.autoLoadLanguageSupport??!0})}});function wQ(e){return{match(t,n){return!n||Object.hasOwn(e.keyMap,t??``)},priority:1,Editor:hQ}}function TQ({url:e,title:t,text:n,onSubmit:r,onCancel:i,linkAutocompleteSuggestions:a,showLinkTitleField:o,showAnchorTextField:s}){let{register:c,handleSubmit:l,control:u,setValue:d,reset:f}=hH({values:{url:e,title:t,text:n}}),p=ik();return I.createElement(`form`,{onSubmit:e=>{l(r)(e),e.stopPropagation(),e.preventDefault()},onReset:e=>{e.stopPropagation(),i()},onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),i())},className:(0,Ek.default)(X.multiFieldForm,X.linkDialogEditForm)},I.createElement(`div`,{className:X.formField},I.createElement(`label`,{htmlFor:`link-url`},p(`createLink.url`,`URL`)),I.createElement(oG,{register:c,initialInputValue:e,inputName:`url`,suggestions:a,setValue:d,control:u,placeholder:p(`createLink.urlPlaceholder`,`Select or paste an URL`),autofocus:!0})),s?I.createElement(`div`,{className:X.formField},I.createElement(`label`,{htmlFor:`link-text`,title:p(`createLink.textTooltip`,`The text to be displayed for the link`)},p(`createLink.text`,`Anchor text`)),I.createElement(`input`,{id:`link-text`,className:X.textInput,size:40,...c(`text`)})):null,o?I.createElement(`div`,{className:X.formField},I.createElement(`label`,{htmlFor:`link-title`,title:p(`createLink.titleTooltip`,`The link's title attribute, shown on hover`)},p(`createLink.title`,`Link title`)),I.createElement(`input`,{id:`link-title`,className:X.textInput,size:40,...c(`title`)})):null,I.createElement(`div`,{style:{display:`flex`,justifyContent:`flex-end`,gap:`var(--spacing-2)`}},I.createElement(`button`,{type:`submit`,title:p(`createLink.saveTooltip`,`Set URL`),"aria-label":p(`createLink.saveTooltip`,`Set URL`),className:(0,Ek.default)(X.primaryButton)},p(`dialogControls.save`,`Save`)),I.createElement(`button`,{type:`reset`,title:p(`createLink.cancelTooltip`,`Cancel change`),"aria-label":p(`createLink.cancelTooltip`,`Cancel change`),className:(0,Ek.default)(X.secondaryButton)},p(`dialogControls.cancel`,`Cancel`))))}var EQ=()=>{let[e,t,n,r,i,a,o,s]=Ar(uO,CO,PD,OO,MQ,RQ,zQ,HQ),c=jr(jQ),l=jr(NQ),u=jr(PQ),d=jr(FQ),f=jr(IQ);I.useEffect(()=>{let e=t?.closest(`.mdxeditor-root-contenteditable`),r=()=>{n?.getEditorState().read(()=>{c(!0)})};return window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r),e?.addEventListener(`scroll`,r),()=>{window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r),e?.removeEventListener(`scroll`,r)}},[n,t,c]);let[p,m]=I.useState(!1),h=ik();if(i.type===`inactive`)return null;let g=i.rectangle,_=i.type===`preview`&&i.url.startsWith(`http`);return I.createElement(xL,{open:!0},I.createElement(SL,{"data-visible":i.type===`edit`,className:X.linkDialogAnchor,style:{top:`${g.top}px`,left:`${g.left}px`,width:`${g.width}px`,height:`${g.height}px`}}),I.createElement(CL,{container:e?.current},I.createElement(wL,{className:(0,Ek.default)(X.linkDialogPopoverContent),sideOffset:5,updatePositionStrategy:`always`,onOpenAutoFocus:e=>{e.preventDefault()},key:i.linkNodeKey},i.type===`edit`&&I.createElement(TQ,{url:i.url,title:i.title,text:i.text,onSubmit:l,onCancel:u.bind(null),linkAutocompleteSuggestions:a,showLinkTitleField:s,showAnchorTextField:i.withAnchorText}),i.type===`preview`&&I.createElement(I.Fragment,null,I.createElement(`a`,{className:X.linkDialogPreviewAnchor,"data-testid":`link-dialog-preview`,href:i.href??`about:blank`,..._?{target:`_blank`,rel:`noreferrer`}:{},onClick:e=>{o!==null&&(e.preventDefault(),o(i.url))},title:_?h(`linkPreview.open`,`Open {{url}} in new window`,{url:i.url}):i.url},I.createElement(`span`,null,i.url),_&&r(`open_in_new`)),I.createElement(DQ,{onClick:()=>{d()},title:h(`linkPreview.edit`,`Edit link URL`),"aria-label":h(`linkPreview.edit`,`Edit link URL`)},r(`edit`)),I.createElement(iQ,null,I.createElement(aQ,{open:p},I.createElement(oQ,{asChild:!0},I.createElement(DQ,{title:h(`linkPreview.copyToClipboard`,`Copy to clipboard`),"aria-label":h(`linkPreview.copyToClipboard`,`Copy to clipboard`),onClick:()=>{window.navigator.clipboard.writeText(i.url).then(()=>{m(!0),setTimeout(()=>{m(!1)},1e3)})}},r(p?`check`:`content_copy`))),I.createElement(sQ,{container:e?.current},I.createElement(cQ,{className:(0,Ek.default)(X.tooltipContent),sideOffset:5},h(`linkPreview.copied`,`Copied!`),I.createElement(lQ,null))))),I.createElement(DQ,{title:h(`linkPreview.remove`,`Remove link`),"aria-label":h(`linkPreview.remove`,`Remove link`),onClick:()=>{f()}},r(`link_off`))),I.createElement(TL,{className:X.popoverArrow}))))},DQ=I.forwardRef(({className:e,...t},n)=>I.createElement(`button`,{className:(0,Ek.default)(X.actionButton,e),ref:n,...t}));function OQ(e){if(!e)return null;let t=vk(e);if(t===null)return null;let n=t.getParent();return Kz(n)?n:Kz(t)?t:null}function kQ(e=U()){if(!Cc(e))return null;let t=e.getNodes(),n=t.length===1?t[0]:null;return Gl(n)&&n.isInline()?n:null}function AQ(e,t,n){return e?e.getEditorState().read(()=>{let e=t===``?null:Hu(t),r=U(),i=H(r)?OQ(r):null;return(Kz(e)?e:i)?.sanitizeUrl(n)??`about:blank`}):`about:blank`}var jQ=Tr(),MQ=R({type:`inactive`},e=>{e.pub(MO,t=>t.registerCommand(Io,()=>e.getValue(MQ).type===`preview`&&(e.pub(MQ,{type:`inactive`}),!0),1)),e.sub(e.pipe(ZO),t=>{t!==`rich-text`&&e.pub(MQ,{type:`inactive`})}),e.pub(MO,t=>t.registerCommand(Eo,t=>{if(t.key===`k`&&(Lk?t.metaKey:t.ctrlKey)&&!e.getValue(LD)){let n=U();return H(n)||kQ(n)!==null?(e.pub(LQ),t.stopPropagation(),t.preventDefault(),!0):!1}return!1},3)),e.sub(e.pipe(FQ,Nr(MQ,PD)),([,t,n])=>{if(t.type===`preview`)setTimeout(()=>{n?.getEditorState().read(()=>{let n=Hu(t.linkNodeKey),r=Kz(n)?n.getTextContent().length>0&&n.getChildrenSize()<=1:!1,i=r&&n?n.getTextContent():``;e.pub(MQ,{type:`edit`,initialUrl:t.url,url:t.url,title:t.title,text:i,withAnchorText:r,linkNodeKey:t.linkNodeKey,decoratorNodeKey:t.decoratorNodeKey,rectangle:t.rectangle})})});else throw Error(`Cannot switch to edit mode when not in preview mode`)}),e.sub(e.pipe(NQ,Nr(PD,MQ,GD)),([t,n,r,i])=>{let a=t.text?.trim()??``,o=t.url?.trim()??``,s=t.title?.trim()??``;if(o!==``){if(r.decoratorNodeKey!==void 0){let t=``,i=!1;if(n?.update(()=>{let e=Hu(r.decoratorNodeKey);if(e===null)return;let a=Kc();if(a.add(e.getKey()),Xu(a),i=n.dispatchCommand(Xz,o),!i)return;let c=e.getParent();Kz(c)&&(c.setTitle(s),t=c.getKey())},{discrete:!0}),t===``)return;e.pub(MQ,{type:`preview`,linkNodeKey:t,decoratorNodeKey:r.decoratorNodeKey,rectangle:r.rectangle,title:s,url:o,href:AQ(n,t,o)});return}if(i?.isCollapsed()){let e=a||s||o;n?.update(()=>{let t=OQ(i);if(!t){let t=Gz(o,{title:s});t.append(dc(e)),nl([t]),t.select()}else if(Yz(t)){let e=Gz(o,{title:s});e.append(dc(a)),t.replace(e),e.select()}else t.setURL(o),t.setTitle(s),VQ(t.getFirstChild(),a)},{discrete:!0})}else n?.update(()=>{VQ(i?.anchor.getNode(),a)}),n?.dispatchCommand(Xz,{url:o,title:s});e.pub(MQ,{type:`preview`,linkNodeKey:r.linkNodeKey,rectangle:r.rectangle,title:s,url:o,href:AQ(n,r.linkNodeKey??``,o)})}else r.type===`edit`&&r.initialUrl!==``&&(r.decoratorNodeKey===void 0?n?.dispatchCommand(Xz,null):n?.update(()=>{let e=Hu(r.decoratorNodeKey);if(e===null)return;let t=Kc();t.add(e.getKey()),Xu(t),n.dispatchCommand(Xz,null)})),e.pub(MQ,{type:`inactive`})}),e.link(e.pipe(PQ,Nr(MQ,PD),Mr(([,e,t])=>{if(e.type===`edit`)return t?.focus(),e.initialUrl===``?{type:`inactive`}:{type:`preview`,url:e.initialUrl,href:AQ(t,e.linkNodeKey,e.initialUrl),linkNodeKey:e.linkNodeKey,decoratorNodeKey:e.decoratorNodeKey,rectangle:e.rectangle};throw Error(`Cannot cancel edit when not in edit mode`)})),MQ),e.link(e.pipe(e.combine(GD,jQ),Nr(PD,MQ,LD),Mr(([[e],t,n,r])=>{if(n.decoratorNodeKey!==void 0&&t&&!r){if(t.getEditorState().read(()=>{let e=U();if(!Cc(e))return null;let t=e.getNodes();return t.length===1?t[0].getKey():null})!==n.decoratorNodeKey)return{type:`inactive`};let e=Ck(t,n.decoratorNodeKey);return e===null?{type:`inactive`}:{...n,rectangle:e}}if(H(e)&&t&&!r){let n=OQ(e);if(!e.isCollapsed())return{type:`inactive`};if(n){let e=wk(t);return e?{type:`preview`,url:n.getURL(),href:n.sanitizeUrl(n.getURL()),linkNodeKey:n.getKey(),title:n.getTitle(),rectangle:e}:{type:`inactive`}}return{type:`inactive`}}return{type:`inactive`}})),MQ)}),NQ=Tr(),PQ=Er();Er();var FQ=Er(),IQ=Er(e=>{e.sub(e.pipe(IQ,Nr(PD)),([,e])=>{e?.dispatchCommand(Xz,null)})}),LQ=Er(e=>{e.sub(e.pipe(LQ,Nr(GD,PD)),([,t,n])=>{if(!n)return;let r=n.getEditorState().read(()=>{let e=kQ();if(e===null)return null;let t=e.getParent(),n=Kz(t)?t:null;return{nodeKey:e.getKey(),url:n?.getURL()??``,title:n?.getTitle()??``,linkNodeKey:n?.getKey()??``}});if(r!==null){let t=Ck(n,r.nodeKey);if(t===null)return;e.pub(MQ,{type:`edit`,initialUrl:r.url,url:r.url,title:r.title,text:``,withAnchorText:!1,linkNodeKey:r.linkNodeKey,decoratorNodeKey:r.nodeKey,rectangle:t});return}H(t)&&n.focus(()=>{setTimeout(()=>{n.getEditorState().read(()=>{let r=OQ(t),i=wk(n);if(i===null)return;let a=r?.getURL()??``,o=r?.getURL()??``,s=r?.getTitle()??``,c=r?.getKey()??``,l=r?r.getTextContent().length>0&&r.getChildrenSize()<=1:t.isCollapsed(),u=l&&r?r.getTextContent():``;e.pub(MQ,{type:`edit`,initialUrl:a,url:o,title:s,text:u,withAnchorText:l,linkNodeKey:c,rectangle:i})})})})})}),RQ=R([]),zQ=R(null),BQ=R(null,e=>{e.pub(MO,t=>{function n(n){let[r,i]=e.getValues([LD,BQ]);r&&i!==null&&t.update(()=>{let e=Ku(n.target);if(e!==null){let t=Af(e,e=>e instanceof Bz);t!==null&&i(n,t,t.getURL())}})}return t.registerRootListener((e,t)=>{e&&e.addEventListener(`click`,n),t&&t.removeEventListener(`click`,n)})})});function VQ(e,t){V(e)&&t&&(e.setTextContent(t),e.selectStart())}var HQ=R(!0),UQ=zr({init(e,t){e.pub(FO,t?.LinkDialog??EQ),e.pub(zQ,t?.onClickLinkCallback??null),e.pub(BQ,t?.onReadOnlyClickLinkCallback??null),e.pub(HQ,t?.showLinkTitleField??!0)},update(e,t={}){e.pub(RQ,t.linkAutocompleteSuggestions??[])}});function WQ(e,t){return I.forwardRef((n,r)=>{let i=(0,Ek.default)(t.className,n.className);return I.createElement(e,{...t,...n,className:i,ref:r})})}function GQ(e){return({title:t,children:n,...r})=>I.createElement(e,{"aria-label":t,...r},I.createElement(uQ,{title:t},n))}var KQ=({readOnly:e,children:t,className:n})=>I.createElement(uz,{className:(0,Ek.default)(`mdxeditor-toolbar`,X.toolbarRoot,{[X.readOnlyToolbarRoot]:e},n),...e?{tabIndex:-1}:{}},t),qQ=GQ(WQ(fz,{className:X.toolbarButton,"data-toolbar-item":!0})),JQ=WQ(mz,{className:X.toolbarToggleItem,"data-toolbar-item":!0});WQ(pz,{type:`single`,className:X.toolbarToggleSingleGroup});var YQ=I.forwardRef(({on:e,title:t,children:n,disabled:r,...i},a)=>I.createElement(pz,{type:`single`,className:X.toolbarToggleSingleGroup,...i,value:e?`on`:`off`,ref:a},I.createElement(JQ,{"aria-label":t,value:`on`,disabled:r},I.createElement(uQ,{title:t},n)))),XQ=({items:e})=>I.createElement(`div`,{className:X.toolbarGroupOfGroups},e.map((e,t)=>I.createElement(YQ,{key:t,title:e.title,on:e.active,onValueChange:t=>{e.onChange(t===`on`)},disabled:e.disabled},e.contents))),ZQ=({value:e,onChange:t,className:n,ggClassName:r,items:i,disabled:a})=>{let o=ik();return I.createElement(`div`,{className:(0,Ek.default)(X.toolbarGroupOfGroups,r)},I.createElement(pz,{"aria-label":o(`toolbar.toggleGroup`,`toggle group`),type:`single`,className:(0,Ek.default)(X.toolbarToggleSingleGroup,n),onValueChange:t,value:e||``,disabled:a,onFocus:e=>{e.preventDefault()}},i.map((e,t)=>I.createElement(JQ,{key:t,"aria-label":e.title,value:e.value},I.createElement(uQ,{title:e.title},e.contents)))))},QQ=R(()=>null),$Q=R(``),e$=()=>"This is an empty toolbar. Pass `{toolbarContents: () => { return <>toolbar components</> }}` to the toolbarPlugin to customize it.",t$=zr({init(e,t){let n=t?.toolbarPosition===`bottom`?zO:LO;e.pubIn({[QQ]:t?.toolbarContents??e$,[$Q]:t?.toolbarClassName??``,[n]:()=>{let[e,t,n]=Ar(QQ,LD,$Q);return I.createElement(KQ,{className:n,readOnly:t},e())}})},update(e,t){e.pub(QQ,t?.toolbarContents??e$),e.pub($Q,t?.toolbarClassName??``)}}),n$=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function r$(e,t,n,r,i,a){if(e==r)return[];let o=p$(e,t,n,r,i,a),s=m$(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new n$(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new n$(t,t+o,i,i),new n$(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new n$(t,t,i,i+o),new n$(n,n,i+o+c,a)]}if(c==1||l==1)return[new n$(t,n,i,a)];let u=g$(e,t,n,r,i,a);if(u){let[o,s,c]=u;return r$(e,t,o,r,i,s).concat(r$(e,o+c,n,r,s+c,a))}return s$(e,t,n,r,i,a)}var i$=1e9,a$=0,o$=!1;function s$(e,t,n,r,i,a){let o=n-t,s=a-i;if(i$<1e9&&Math.min(o,s)>i$*16||a$>0&&Date.now()>a$)return Math.min(o,s)>i$*64?[new n$(t,n,i,a)]:_$(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);l$.reset(c),u$.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:u$,f=d?null:l$;for(let p=0;p<c;p++){if(p>i$||a$>0&&!(p&63)&&Date.now()>a$)return _$(e,t,n,r,i,a);let m=l$.advance(p,o,s,c,d,!1,l)||u$.advance(p,o,s,c,f,!0,u);if(m)return d$(e,t,n,t+m[0],r,i,a,i+m[1])}return[new n$(t,n,i,a)]}var c$=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1){if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}}return null}},l$=new c$,u$=new c$;function d$(e,t,n,r,i,a,o,s){let c=!1;return!M$(e,r)&&++r==n&&(c=!0),!M$(i,s)&&++s==o&&(c=!0),c?[new n$(t,n,a,o)]:r$(e,t,r,i,a,s).concat(r$(e,r,n,i,s,o))}function f$(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function p$(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=f$(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!M$(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function m$(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=f$(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!M$(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function h$(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){M$(e,s)||s++;let u=s+o;if(M$(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=p$(e,u,n,r,i+f+d.length,a),c=m$(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function g$(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=g$(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:h$(e,t,n,r,i,a,Math.floor(o/4),-1)}function _$(e,t,n,r,i,a){o$=!0;let o=n-t,s=a-i,c;if(o<s){let s=h$(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=h$(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new n$(t,n,i,a)];let[l,u,d]=c;return r$(e,t,l,r,i,u).concat(r$(e,l+d,n,r,u+d,a))}function v$(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new n$(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function y$(e,t,n){for(;;){v$(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=p$(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new n$(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=m$(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new n$(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new n$(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new n$(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function b$(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=D$(t,a.fromA,l),f=E$(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new n$(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=E$(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new n$(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=D$(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new n$(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=k$(n,a.fromB,a.toB),r,o=t<0?-1:O$(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=k$(t,a.fromA,a.toA),r,o=n<0?-1:O$(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return v$(e,3),e}var x$;try{x$=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function S$(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function C$(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!S$(n):x$?!A$(n)||t==e.length-1?+!!x$.test(String.fromCharCode(n)):x$.test(e.slice(t,t+2))?2:0:0}function w$(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!S$(n):x$?!j$(n)||t==1?+!!x$.test(String.fromCharCode(n)):x$.test(e.slice(t-2,t))?2:0:0}var T$=8;function E$(e,t,n){if(t==e.length||!w$(e,t))return t;for(let r=t,i=t+n,a=0;a<T$;a++){let t=C$(e,r);if(!t||r+t>i)return r;r+=t}return t}function D$(e,t,n){if(!t||!C$(e,t))return t;for(let r=t,i=t-n,a=0;a<T$;a++){let t=w$(e,r);if(!t||r-t<i)return r;r-=t}return t}function O$(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function k$(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var A$=e=>e>=55296&&e<=56319,j$=e=>e>=56320&&e<=57343;function M$(e,t){return!t||t==e.length||!A$(e.charCodeAt(t-1))||!j$(e.charCodeAt(t))}function N$(e,t,n){let r=n?.override;return r?r(e,t):(i$=(n?.scanLimit??1e9)>>1,a$=n?.timeout?Date.now()+n.timeout:0,o$=!1,y$(e,t,r$(e,0,e.length,t,0,t.length)))}function P$(){return!o$}function F$(e,t,n){return b$(N$(e,t,n),e,t)}var I$=ve.define({combine:e=>e[0]}),L$=g.define(),R$=ve.define(),z$=m.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(L$)&&(e=n.value);for(let n of t.state.facet(R$))e=n(e,t);return e}}),B$=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return U$(F$(e.toString(),t.toString(),n),e,t,0,0,P$())}static updateA(e,t,n,r,i){return q$(K$(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return q$(K$(e,r,!1,t.length),e,t,n,i)}};function V$(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function H$(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function U$(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=V$(c.fromA+r,c.fromB+i,t,n),[d,f]=H$(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=V$(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=H$(a.toA+r,a.toB+i,t,n),s++}o.push(new B$(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var W$=1e3;function G$(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function K$(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>W$&&([l,d]=G$(e,a-W$,n,!0)),o<t.length-W$&&([u,f]=G$(e,o+W$,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function q$(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=F$(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of U$(h,n,r,d,f,P$()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var J$={scanLimit:500},Y$=se.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=a1(e))}update(e){(e.docChanged||e.viewportChanged||Z$(e.startState,e.state)||Q$(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=a1(e.view))}},{decorations:e=>e.deco}),X$=ae.low(ne({class:`cm-changeGutter`,markers:e=>e.plugin(Y$)?.gutter||f.empty}));function Z$(e,t){return e.field(z$,!1)!=t.field(z$,!1)}function Q$(e,t){return e.facet(I$)!=t.facet(I$)}var $$=Ye.line({class:`cm-changedLine`}),e1=Ye.mark({class:`cm-changedText`}),t1=Ye.mark({tagName:`ins`,class:`cm-insertedLine`}),n1=Ye.mark({tagName:`del`,class:`cm-deletedLine`}),r1=new class extends b{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function i1(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,$$),i.add(o,s,n?n1:t1),a&&a.add(o,o,r1);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,$$),a&&a.add(u,u,r1);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,e1),s<t)c++;else break}u=t}}}function a1(e){let t=e.state.field(z$),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(I$),o=n==`a`,s=new qe,c=i?new qe:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&i1(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var o1=class extends de{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},s1=g.define({map:(e,t)=>e.map(t)}),c1=m.define({create:()=>Ye.none,update:(e,t)=>{for(let e of t.effects)if(e.is(s1))return e.value;return e.map(t.changes)},provide:e=>le.decorations.from(e)}),l1=.01;function u1(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function d1(e,t,n){let r=new qe,i=new qe,a=e.state.field(c1).iter(),o=t.state.field(c1).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-.01?(l-=n,r.add(s,s,Ye.widget({widget:new o1(-n),block:!0,side:-1}))):n>l1&&(u+=n,i.add(c,c,Ye.widget({widget:new o1(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<l1?r.add(e.state.doc.length,e.state.doc.length,Ye.widget({widget:new o1(-p),block:!0,side:1})):p>l1&&i.add(t.state.doc.length,t.state.doc.length,Ye.widget({widget:new o1(p),block:!0,side:1}));let m=r.finish(),h=i.finish();u1(m,e.state.field(c1))||e.dispatch({effects:s1.of(m)}),u1(h,t.state.field(c1))||t.dispatch({effects:s1.of(h)})}var f1=g.define({map:(e,t)=>t.mapPos(e)}),p1=class extends de{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:f1.of(n)});let{side:r,sibling:i}=e.state.facet(I$);i&&i().dispatch({effects:f1.of(m1(n,e.state.field(z$),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function m1(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var h1=m.define({create(e){return Ye.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(f1)&&(e=e.update({filter:e=>e!=n.value}));if(e.size&&t.state.field(z$)!=t.startState.field(z$,!1)){let n=t.state.facet(I$).side==`a`,r=[];for(let i of t.state.field(z$))e.between(n?i.fromA:i.fromB,n?i.toA:i.toB,e=>{r.push(e)});r.length&&(e=e.update({filter:e=>r.indexOf(e)<0}))}return e},provide:e=>le.decorations.from(e)});function g1({margin:e=3,minSize:t=4}){return h1.init(n=>_1(n,e,t))}function _1(e,t,n){let r=new qe,i=e.facet(I$).side==`a`,a=e.field(z$),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,Ye.replace({widget:new p1(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var v1=le.styleModule.of(new Te({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),y1=le.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),b1=new he,x1=new he,S1=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||J$;let t=[ae.low(Y$),y1,v1,c1,le.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(s1)))&&this.measure()})],n=[I$.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(X$);let r=Je.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],le.editorAttributes.of({class:`cm-merge-a`}),x1.of(n),t]}),i=[I$.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(X$);let a=Je.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],le.editorAttributes.of({class:`cm-merge-b`}),x1.of(i),t]});this.chunks=B$.build(r.doc,a.doc,this.diffConf);let o=[z$.init(()=>this.chunks),b1.of(e.collapseUnchanged?g1(e.collapseUnchanged):[])];r=r.update({effects:g.appendConfig.of(o)}).state,a=a.update({effects:g.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new le({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new le({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),Oe.empty(e[0].startState.doc.length));this.chunks=t==this.a?B$.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):B$.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:L$.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:L$.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(I$),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(x1.reconfigure([I$.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?X$:[]])),a.push(x1.reconfigure([I$.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?X$:[]]))}if(r){let t=b1.reconfigure(e.collapseUnchanged?g1(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){d1(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=C1(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=C1(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function C1(e){let t=e.nextSibling;return e.remove(),t}var w1=[fX,EJ,sr(),ke(),le.lineWrapping],T1=()=>{let[e,t,n]=Ar(qD,LD,A1),r=jr(QO),i=jr(DO),a=I.useRef(null),o=I.useCallback(o=>{var s;if(o!==null){let s=[...n,...w1,le.updateListener.of(({state:e})=>{r(e.doc.toString())}),le.focusChangeEffect.of((e,t)=>(t||i(new FocusEvent(`blur`)),null))];t&&s.push(Je.readOnly.of(!0)),o.innerHTML=``,a.current=new le({parent:o,state:Je.create({doc:e,extensions:s})})}else(s=a.current)==null||s.destroy(),a.current=null},[e,t,r,n,i]);return I.createElement(`div`,{ref:o,className:`cm-sourceView mdxeditor-source-editor`})};function E1(e,t){e!==void 0&&e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}})}var D1=()=>{let e=Or(),[t,n,r,i]=Ar(qD,k1,LD,j1),a=jr(QO),o=I.useRef(null),s=I.useRef(null),c=kr(A1),l=jr(DO);return I.useEffect(()=>e.sub(k1,e=>{E1(s.current?.a,e)}),[e]),I.useEffect(()=>e.sub(qD,e=>{E1(s.current?.b,e)}),[e]),I.useEffect(()=>{let e=r||i;return s.current=new S1({...e?{renderRevertControl:void 0,revertControls:void 0}:{renderRevertControl:()=>{let e=document.createElement(`button`);return e.classList.add(`cm-merge-revert`),e.appendChild(document.createTextNode(`⮕`)),e},revertControls:`a-to-b`},parent:o.current,orientation:`a-b`,gutter:!0,a:{doc:n,extensions:[...c,...w1,Je.readOnly.of(!0)]},b:{doc:t,extensions:[...c,...w1,Je.readOnly.of(e),le.updateListener.of(({state:e})=>{let t=e.doc.toString();a(t)}),le.focusChangeEffect.of((e,t)=>(t||l(new FocusEvent(`blur`)),null))]}}),()=>{var e;(e=s.current)==null||e.destroy(),s.current=null}},[a,c]),I.createElement(`div`,{ref:o,className:`mdxeditor-diff-editor`})},O1=({children:e})=>{let[t,n]=Ar(HD,ZO);return I.createElement(`div`,{className:`mdxeditor-diff-source-wrapper`},t?I.createElement(`div`,{className:X.markdownParseError},I.createElement(`p`,null,t.error,`.`),I.createElement(`p`,null,`You can fix the errors in source mode and switch to rich text mode when you are ready.`)):null,I.createElement(`div`,{className:`mdxeditor-rich-text-editor`,style:{display:n===`rich-text`&&t==null?`block`:`none`}},e),n===`diff`?I.createElement(D1,null):null,n===`source`?I.createElement(T1,null):null)},k1=R(``),A1=R([]),j1=R(!1),M1=zr({update:(e,t)=>{e.pub(k1,t?.diffMarkdown??``)},init(e,t){e.pubIn({[k1]:t?.diffMarkdown??``,[A1]:t?.codeMirrorExtensions??[],[VO]:O1,[j1]:t?.readOnlyDiff??!1,[ZO]:t?.viewMode??`rich-text`})}});function N1(e,t){let n=e;for(let r=hp(e,t);r&&(Q1(r.origin)||hc(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function P1(e){return N1(e,`previous`)}function F1(e,t){for(let n of e.childNodes)if(K(n)&&n.tagName===t||F1(n,t))return!0;return!1}var I1=`data-language`,L1=`data-highlight-language`,R1=`data-theme`,z1=class e extends Hl{__language;__theme;__isSyntaxHighlightSupported;static getType(){return`code`}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=Ud().createElement(`code`);rm(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(I1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(L1,n));let r=this.getTheme();r&&t.setAttribute(R1,r);let i=this.getStyle();return i&&Js(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(I1,r):i&&t.removeAttribute(I1);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(L1,r):t.removeAttribute(L1):a&&r&&t.setAttribute(L1,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(R1,o):s&&t.removeAttribute(R1);let c=this.__style,l=e.__style;return c!==l&&Js(t.style,c,l),!1}exportDOM(e){let t=Ud().createElement(`pre`);rm(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(I1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(L1,n));let r=this.getTheme();r&&t.setAttribute(R1,r);let i=this.getStyle();return i&&Js(t.style,i),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||F1(e,`BR`))?{conversion:H1,priority:1}:null,div:()=>({conversion:U1,priority:1}),pre:()=>({conversion:H1,priority:0}),table:e=>q1(e)?{conversion:W1,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&q1(n)?{conversion:G1,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&q1(t)?{conversion:G1,priority:3}:null}}}static importJSON(e){return B1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!Ph(cf(),`@lexical/code`)){let t=J1(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(V(i)){let e=P1(i),t=[];for(;;)if(hc(e))t.push(mc()),e=e.getNextSibling();else{if(!Q1(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(Z1(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],a=n.offset===0?0:1,o=r.getIndexWithinParent()+a,s=i.getParentOrThrow(),c=[nu(),...t];s.splice(o,0,c);let l=t[t.length-1];l?l.select():n.offset===0?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(V1(i)){let{offset:t}=e.anchor;i.splice(t,0,[nu()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=lu();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function B1(e,t){return kf(z1).setLanguage(e).setTheme(t)}function V1(e){return e instanceof z1}function H1(e){return{node:B1(e.getAttribute(I1))}}function U1(e){let t=e,n=K1(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(K1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?B1():null}:{node:null}}function W1(){return{node:B1()}}function G1(){return{node:null}}function K1(e){return e.style.fontFamily.match(`monospace`)!==null}function q1(e){return e.classList.contains(`js-file-line-container`)}function J1(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(V1(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(ru(t)&&ru(t.getPreviousSibling())){let t=lu();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var Y1=class e extends nc{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}static getType(){return`code-highlight`}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return rm(t,X1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=X1(n.theme,e.__highlightType),a=X1(n.theme,this.__highlightType);return i!==a&&(i&&im(t,i),a&&rm(t,a)),r}static importJSON(e){return Z1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return B1()}};function X1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function Z1(e=``,t){return jd(new Y1(e,t))}function Q1(e){return e instanceof Y1}Mg.tag(`tr`,`td`),Mg.tag(`pre`),Mg.tag(`code`),Mg.tag(`div`),Mg.tag(`div`,`br`),Mg.tag(`div`),Mg.tag(`table`).classAll(`js-file-line-container`),Mg.tag(`td`).classAll(`js-file-line`);function $1(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function e0(e){let t=$1(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var t0=/[!-/:-@[-`{-~\s]/;function n0(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}var r0=/^(\s*)(\d{1,})\.\s/,i0=/^(\s*)[-*+]\s/,a0=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,o0=/^(#{1,6})\s/,s0=/^>\s/,c0=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,l0=/^[ \t]*`{3,}$/,u0=Gi(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),d0=Gi(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),f0=Gi(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function p0(e){if(e.endsWith(`\\`))return[e.slice(0,-1),`\\`];let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function m0(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!V(r))return null;let i=r.getTextContent(),a=p0(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(ru(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}function h0(e){let t=nu(),n=m0(e);return n!==null&&qi(t,f0,n),t}var g0=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)},_0=e=>(t,n,r,i)=>{let a=t.getPreviousSibling(),o=t.getNextSibling(),s=fv(e===`check`?r[3]===`x`:void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==u0.parse(c)?void 0:c;if(J(o)&&o.getListType()===e){l&&qi(o,u0,l);let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&o.setStart(Number(r[2])),t.remove()}else if(J(a)&&a.getListType()===e)l&&qi(a,u0,l),a.append(s),t.remove();else{let n=_v(e,e===`number`?Number(r[2]):void 0);l&&qi(n,u0,l),n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0);let u=function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);u&&s.setIndent(u)},v0=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(q(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(J(e)){let a=v0(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Ki(e,u0),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
113
+ `)},y0={dependencies:[k_],export:(e,t)=>{if(!P_(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:o0,replace:g0(e=>N_(`h`+e[1].length)),triggerOnEnter:!0,type:`element`},b0={dependencies:[E_],export:(e,t)=>{if(!O_(e))return null;let n=t(e).split(`
114
+ `),r=[];for(let e of n)r.push(`> `+e);return r.join(`
115
+ `)},regExp:s0,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(O_(n))return n.splice(n.getChildrenSize(),0,[h0(n),...t]),void e.remove()}let i=D_();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},x0={dependencies:[z1],export:e=>{if(!V1(e))return null;let t=e.getTextContent(),n=Ki(e,d0);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}return n+(e.getLanguage()||``)+(t?`
116
+ `+t:``)+`
117
+ `+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,x0.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=o.slice(r[0].length);return l.length>0&&c.unshift(l),x0.replace(t,null,r,s,c,!0),[!0,i]}}let d=e.slice(n+1),f=o.slice(r[0].length);return f.length>0&&d.unshift(f),x0.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:l0},regExpStart:c0,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0;if(!t&&i){if(i.length===1)r?(o=B1(l),s=i[0]):(o=B1(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=B1(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.join(`
118
+ `)}qi(o,d0,c);let t=dc(s);o.append(t),e.append(o)}else t&&g0(e=>B1(e?e[2]:void 0))(e,t,n,a)},type:`multiline-element`},S0={dependencies:[pv,cv],export:(e,t,n)=>J(e)?v0(e,t,0,n):null,regExp:i0,replace:_0(`bullet`),triggerOnEnter:!0,type:`element`},C0={dependencies:[pv,cv],export:(e,t,n)=>J(e)?v0(e,t,0,n):null,regExp:a0,replace:_0(`check`),triggerOnEnter:!0,type:`element`},w0={dependencies:[pv,cv],export:(e,t,n)=>J(e)?v0(e,t,0,n):null,regExp:r0,replace:_0(`number`),triggerOnEnter:!0,type:`element`},T0={format:[`code`],tag:"`",type:`text-format`},E0={format:[`highlight`],tag:`==`,type:`text-format`},D0={format:[`bold`,`italic`],tag:`***`,type:`text-format`},O0={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},k0={format:[`bold`],tag:`**`,type:`text-format`},A0={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},j0={format:[`strikethrough`],tag:`~~`,type:`text-format`},M0={format:[`italic`],tag:`*`,type:`text-format`},N0={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`},P0={dependencies:[Bz],export:(e,t,n)=>{if(!Kz(e)||Yz(e))return null;let r=t(e),i=e.getTitle();return i!=null&&(i=i.replace(/([\\"])/g,`\\$1`)),i?`[${r}](${e.getURL()} "${i}")`:`[${r}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(Af(e,Kz))return;let[,n,r,i]=t,a=Gz(r==null?void 0:n0(r),{title:i==null?void 0:n0(i)}),o=n.split(`[`).length-1,s=n.split(`]`).length-1,c=n,l=``;if(o<s)return;if(o>s){let e=n.split(`[`);l=`[`+e[0],c=e.slice(1).join(`[`)}let u=dc(c);return u.setFormat(e.getFormat()),a.append(u),e.replace(a),l&&a.insertBefore(dc(l)),u},trigger:`)`,type:`text-match`},F0=[y0,b0,S0,w0],I0=[x0],L0=[T0,D0,O0,k0,A0,E0,M0,N0,j0],R0=[P0],z0=[...F0,...I0,...L0,...R0];function B0(e){return V(e)&&!e.hasFormat(`code`)}function V0(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function H0(e,t,n,r,i){if(!kd(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExp:o,replace:s}of r){let r=a.match(o),c=i||r&&r[0].endsWith(` `)?n:n-1;if(r&&r[0].length===c){let i=t.getNextSiblings(),[a,o]=t.splitText(n);if(!1!==s(e,o?[o,...i]:i,r,!1))return a.remove(),!0}}return!1}function U0(e,t,n,r,i){if(!kd(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExpStart:o,replace:s,regExpEnd:c}of r){if(c&&!(`optional`in c)||c&&`optional`in c&&!c.optional)continue;let r=a.match(o);if(r){let a=i||r[0].endsWith(` `)?n:n-1;if(r[0].length!==a)continue;let o=t.getNextSiblings(),[c,l]=t.splitText(n);if(!1!==s(e,l?[l,...o]:o,r,null,null,!1))return c.remove(),!0}}return!1}function W0(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)r[e]==="`"&&n++;return n%2!=0}function G0(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(K0(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function K0(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function q0(e,t=z0){let n=e0(t),r=n.element.filter(e=>e.triggerOnEnter),i=$1(n.textFormat,({tag:e})=>e[e.length-1]),a=$1(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||V0(173,n.getType())}}let s=(e,t,r)=>!!H0(e,t,r,n.element)||!!U0(e,t,r,n.multilineElement)||!!function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,r,a)||!!function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!K0(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!t0.test(c))continue;let l=e,u=l,d=G0(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!ru(f);)if(V(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=G0(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!t0.test(m)||!t.format.includes(`code`)&&W0(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=U(),y=Gc();Xu(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,pi[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return H(v)&&(y.format=v.format),!0}return!1}(t,r,i);return am(e.registerUpdateListener(({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let a=t.has(Ws),c=r.read(U),l=i.read(U);if(!H(l)||!H(c)||!c.isCollapsed()||c.is(l)&&!a)return;let u=c.anchor.key,d=c.anchor.offset,f=r._nodeMap.get(u);if(V(f)&&n.has(u)&&(a||d===1||!(d>l.anchor.offset+1))){if(a){let e=r.read(()=>f.getTextContent())[d-1];if(!o.has(e))return}e.update(()=>{if(!B0(f))return;let e=f.getParent();e===null||V1(e)||s(e,f,c.anchor.offset)&&xd(`history-push`)})}}),e.registerCommand(No,e=>{if(e!==null&&e.shiftKey)return!1;let t=U();if(!H(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!V(a)||!B0(a))return!1;let o=a.getParent();return o===null||V1(o)?!1:i===a.getTextContent().length&&!(!U0(o,a,i,n.multilineElement,!0)&&!H0(o,a,i,r,!0))&&(e!==null&&e.preventDefault(),!0)},1))}var J0=[{dependencies:[Lh],export:e=>Bh(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=zh();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},triggerOnEnter:!0,type:`element`},...z0];function Y0({transformers:e=J0}){let[t]=sD();return(0,I.useEffect)(()=>q0(t,e),[t,e]),null}var X0=zr({init(e){let t=e.getValue($O),n=e2(t,t.includes(`headings`)?e.getValue(Wk):[]),r=n.filter(e=>!$0.has(e));e.pubIn({[FO]:()=>I.createElement(Y0,{transformers:n}),[HO]:()=>I.createElement(Y0,{transformers:n}),[WO]:()=>I.createElement(Y0,{transformers:r})})}}),Z0=e=>(t,n,r)=>{let i=e(r);i.append(...n),t.replace(i),i.select(0,0)},Q0={dependencies:[Yk],export:e=>Bh(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=Zk();r||e.getNextSibling()!=null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},$0=new Set([w0,S0,C0]);function e2(e,t){let n=[D0,O0,k0,A0,T0,M0,N0];if(e.includes(`headings`)){let e=Math.min(...t),r=Math.max(...t),i=RegExp(`^(#{${e},${r}})\\s`),a={dependencies:[k_],export:(e,t)=>{if(!P_(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:i,replace:Z0(e=>N_(`h${e[1].length}`)),type:`element`};n.push(a)}if(e.includes(`thematicBreak`)&&n.push(Q0),e.includes(`quote`)&&n.push(b0),e.includes(`link`)&&n.push(P0),e.includes(`lists`)&&n.push(w0,S0,C0),e.includes(`codeblock`)){let e={...x0,dependencies:[gG],replace:(e,t,n)=>{let r=xG({code:``,language:n[1]??``,meta:``});e.selectPrevious(),e.replace(r),setTimeout(()=>{r.select()},80)}};n.push(e)}return n}var t2=()=>{let e=jr(JO),t=kr(qO),n=kr($O),r=n.includes(`quote`),i=n.includes(`headings`),a=ik();if(!r&&!i)return null;let o=[{label:a(`toolbar.blockTypes.paragraph`,`Paragraph`),value:`paragraph`}];if(r&&o.push({label:a(`toolbar.blockTypes.quote`,`Quote`),value:`quote`}),i){let e=kr(Wk);o.push(...e.map(e=>({label:a(`toolbar.blockTypes.heading`,`Heading {{level}}`,{level:e}),value:`h${e}`})))}return I.createElement(mQ,{value:t,onChange:t=>{switch(t){case`quote`:e(()=>D_());break;case`paragraph`:e(()=>lu());break;case``:break;default:if(t.startsWith(`h`))e(()=>N_(t));else throw Error(`Unknown block type: ${t}`)}},triggerTitle:a(`toolbar.blockTypeSelect.selectBlockTypeTooltip`,`Select block type`),placeholder:a(`toolbar.blockTypeSelect.placeholder`,`Block type`),items:o})},n2=({format:e,addTitle:t,removeTitle:n,icon:r,formatName:i})=>{let[a,o]=Ar(VD,OO),s=jr(WD),c=(a&e)!==0;return I.createElement(YQ,{title:c?n:t,on:c,onValueChange:()=>{s(i)}},o(r))},r2=({options:e})=>{let t=ik(),n=e===void 0;return I.createElement(`div`,{className:X.toolbarGroupOfGroups},n||e.includes(`Bold`)?I.createElement(n2,{format:1,addTitle:t(`toolbar.bold`,`Bold`),removeTitle:t(`toolbar.removeBold`,`Remove bold`),icon:`format_bold`,formatName:`bold`}):null,n||e.includes(`Italic`)?I.createElement(n2,{format:2,addTitle:t(`toolbar.italic`,`Italic`),removeTitle:t(`toolbar.removeItalic`,`Remove italic`),icon:`format_italic`,formatName:`italic`}):null,n||e.includes(`Underline`)?I.createElement(n2,{format:8,addTitle:t(`toolbar.underline`,`Underline`),removeTitle:t(`toolbar.removeUnderline`,`Remove underline`),icon:`format_underlined`,formatName:`underline`}):null)},i2=()=>{let[e,t]=Ar(VD,OO),n=jr(WD),r=ik(),i=!!(e&16),a=i?r(`toolbar.removeInlineCode`,`Remove code format`):r(`toolbar.inlineCode`,`Inline code format`);return I.createElement(XQ,{items:[{title:a,contents:t(`code`),active:i,onChange:n.bind(null,`code`)}]})},a2=()=>{let e=jr(LQ),t=kr(OO),n=ik();return I.createElement(qQ,{"aria-label":n(`toolbar.link`,`Create link`),title:n(`toolbar.link`,`Create link`),onPointerDown:e=>{e.preventDefault()},onClick:t=>{e()}},t(`link`))},o2=({children:e,SourceToolbar:t,options:n=[`rich-text`,`diff`,`source`]})=>{let[r,i]=Ar(ZO,OO),a=jr(ZO),o=ik(),s=[];return n.includes(`rich-text`)&&s.push({title:o(`toolbar.richText`,`Rich text`),contents:i(`rich_text`),value:`rich-text`}),n.includes(`diff`)&&s.push({title:o(`toolbar.diffMode`,`Diff mode`),contents:i(`difference`),value:`diff`}),n.includes(`source`)&&s.push({title:o(`toolbar.source`,`Source mode`),contents:i(`markdown`),value:`source`}),I.createElement(I.Fragment,null,r===`rich-text`?e:r===`diff`?I.createElement(`span`,{className:X.toolbarTitleMode},o(`toolbar.diffMode`,`Diff mode`)):t??I.createElement(`span`,{className:X.toolbarTitleMode},o(`toolbar.source`,`Source mode`)),I.createElement(`div`,{className:X.diffSourceToggleWrapper},I.createElement(ZQ,{className:X.diffSourceToggle,ggClassName:X.ggDiffSourceToggle,value:r,items:s,onChange:e=>{a(e===``?`rich-text`:e)}})))},s2=()=>{let e=jr(EG),t=kr(OO),n=ik();return I.createElement(qQ,{title:n(`toolbar.codeBlock`,`Insert Code Block`),onClick:()=>{e({})}},t(`frame_source`))},c2=()=>{let e=kr(OO),t=jr(Lz),n=ik(),r=kr(GO);return I.createElement(qQ,{title:n(`toolbar.table`,`Insert Table`),onClick:()=>{t({rows:3,columns:3})},...r?{"aria-disabled":!0,"data-disabled":!0,disabled:!0}:{}},e(`table`))},l2=()=>{let e=jr(tA),t=kr(OO),n=ik();return I.createElement(qQ,{title:n(`toolbar.thematicBreak`,`Insert thematic break`),onClick:()=>{e()}},t(`horizontal_rule`))},u2={bullet:`format_list_bulleted`,number:`format_list_numbered`,check:`format_list_checked`},d2=({options:e=[`bullet`,`number`,`check`]})=>{let[t,n,r]=Ar(bA,OO,GO),i=jr(xA),a=ik(),o={bullet:a(`toolbar.bulletedList`,`Bulleted list`),number:a(`toolbar.numberedList`,`Numbered list`),check:a(`toolbar.checkList`,`Check list`)},s=e.map(e=>({value:e,title:o[e],contents:n(u2[e])}));return I.createElement(ZQ,{value:t||``,items:s,onChange:i,disabled:r})},f2=()=>{let[e,t]=Ar(OO,PD),[n,r]=I.useState(!1),[i,a]=I.useState(!1),o=ik();return I.useEffect(()=>{if(t)return am(t.registerCommand($o,e=>(r(e),!1),4),t.registerCommand(Qo,e=>(a(e),!1),4))},[t]),I.createElement(XQ,{items:[{title:o(`toolbar.undo`,`Undo {{shortcut}}`,{shortcut:Lk?`⌘Z`:`Ctrl+Z`}),disabled:!n,contents:e(`undo`),active:!1,onChange:()=>t?.dispatchCommand(wo,void 0)},{title:o(`toolbar.redo`,`Redo {{shortcut}}`,{shortcut:Lk?`⌘Y`:`Ctrl+Y`}),disabled:!i,contents:e(`redo`),active:!1,onChange:()=>t?.dispatchCommand(To,void 0)}]})};function p2(){let e=()=>document.documentElement.dataset.theme!==`light`,[t,n]=(0,I.useState)(e);return(0,I.useEffect)(()=>{let t=new MutationObserver(()=>n(e()));return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},[]),t}function m2(e){let t=[],n=!1,r=/^(\s*([-*+]|\d+[.)])\s|#{1,6}\s|\||>|\s*```|---\s*$|\s*[-*_]{3,}\s*$|\s*\\?\[\^[^\]]+\]:)/;for(let i of e.split(`
119
+ `)){if(/^\s*```/.test(i)){n=!n,t.push(i);continue}let e=t[t.length-1];!n&&e!==void 0&&e.trim()!==``&&i.trim()!==``&&!/^(#{1,6}\s|\||>|\s*```)/.test(e)&&!/ {2}$|\\$/.test(e)&&!r.test(i)&&!/^\s*<|^\s*!\[/.test(i)?t[t.length-1]=`${e.replace(/\s+$/,``)} ${i.trim()}`:t.push(i)}return t.join(`
120
+ `)}function h2(e){return e.replace(/\\\[\\\[([^\]]*?)\\\]\\\]/g,`[[$1]]`).replace(/\\\[\\\[([^\]]*?)\]\]/g,`[[$1]]`).replace(/\\\[\^/g,`[^`)}function g2(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?{head:t[0],body:e.slice(t[0].length)}:{head:``,body:e}}function _2(){return[Gk(),SA(),uG(),nA(),TB(),UQ(),Rz(),OG({defaultCodeBlockLanguage:``}),CQ({codeBlockLanguages:{"":`text`,txt:`text`,js:`JavaScript`,ts:`TypeScript`,json:`JSON`,yaml:`YAML`,bash:`Shell`,md:`Markdown`}}),X0(),M1({viewMode:`rich-text`}),t$({toolbarContents:()=>(0,L.jsxs)(o2,{children:[(0,L.jsx)(f2,{}),(0,L.jsx)(t2,{}),(0,L.jsx)(r2,{}),(0,L.jsx)(i2,{}),(0,L.jsx)(d2,{}),(0,L.jsx)(a2,{}),(0,L.jsx)(c2,{}),(0,L.jsx)(l2,{}),(0,L.jsx)(s2,{})]})})]}function v2({markdown:e,onChange:t,onError:n,autoFocus:r=!0}){let i=p2(),a=(0,I.useMemo)(()=>_2(),[]);return(0,L.jsx)(Ik,{className:`editor-mdx ${i?`dark-theme`:``}`,contentEditableClassName:`editor-content md-body`,markdown:e,plugins:a,autoFocus:r?{defaultSelection:`rootStart`,preventScroll:!0}:void 0,onChange:(e,n)=>{n||t(h2(e))},onError:n})}export{v2 as DocEditor,sr as a,fr as c,Qn as i,ir as n,ar as o,$n as r,Gn as s,g2 as splitFrontmatter,Wn as t,h2 as unescapeExtensions,m2 as unwrapParagraphs,p2 as useIsDark};