reactjs-tiptap-editor 0.3.21 → 0.3.23

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 (222) hide show
  1. package/lib/{ActionMenuButton-BTFBZyG2.cjs → ActionMenuButton-5AJJxQy1.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DXwnYZhJ.js → ActionMenuButton-DwzYAKDg.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +28 -28
  5. package/lib/Attachment.d.ts +28 -28
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +28 -28
  9. package/lib/Blockquote.d.ts +28 -28
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +28 -28
  13. package/lib/Bold.d.ts +28 -28
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +28 -28
  17. package/lib/BulletList.d.ts +28 -28
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +28 -28
  21. package/lib/Clear.d.ts +28 -28
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +28 -28
  25. package/lib/Code.d.ts +28 -28
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +28 -28
  29. package/lib/CodeBlock.d.ts +28 -28
  30. package/lib/CodeBlock.js +1 -1
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +28 -28
  33. package/lib/CodeView.d.ts +28 -28
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +28 -28
  37. package/lib/Color.d.ts +28 -28
  38. package/lib/Color.js +1 -1
  39. package/lib/Document.d.cts +28 -28
  40. package/lib/Document.d.ts +28 -28
  41. package/lib/{Drawer-BrHHs2E9.cjs → Drawer-CCzPaigS.cjs} +1 -1
  42. package/lib/{Drawer-CVuwyG50.js → Drawer-Dc03j6W1.js} +1 -1
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +28 -28
  45. package/lib/Drawer.d.ts +28 -28
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +28 -28
  49. package/lib/Emoji.d.ts +28 -28
  50. package/lib/Emoji.js +116 -109
  51. package/lib/{Excalidraw-Be_GDV4Q.cjs → Excalidraw-Bxo4S3ET.cjs} +1 -1
  52. package/lib/{Excalidraw-frMX4K62.js → Excalidraw-yQ7O39ws.js} +1 -1
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +28 -28
  55. package/lib/Excalidraw.d.ts +28 -28
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +1 -1
  58. package/lib/ExportPdf.d.cts +28 -28
  59. package/lib/ExportPdf.d.ts +28 -28
  60. package/lib/ExportPdf.js +1 -1
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +28 -28
  63. package/lib/ExportWord.d.ts +28 -28
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +28 -28
  67. package/lib/FontFamily.d.ts +28 -28
  68. package/lib/FontFamily.js +2 -2
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +28 -28
  71. package/lib/FontSize.d.ts +28 -28
  72. package/lib/FontSize.js +2 -2
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +28 -28
  75. package/lib/FormatPainter.d.ts +28 -28
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +28 -28
  79. package/lib/Heading.d.ts +28 -28
  80. package/lib/Heading.js +2 -2
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +28 -28
  83. package/lib/Highlight.d.ts +28 -28
  84. package/lib/Highlight.js +1 -1
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +28 -28
  87. package/lib/History.d.ts +28 -28
  88. package/lib/History.js +1 -1
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +28 -28
  91. package/lib/HorizontalRule.d.ts +28 -28
  92. package/lib/HorizontalRule.js +1 -1
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +28 -28
  95. package/lib/Iframe.d.ts +28 -28
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +28 -28
  99. package/lib/Image.d.ts +28 -28
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +28 -28
  103. package/lib/ImageGif.d.ts +28 -28
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +1 -1
  106. package/lib/ImportWord.d.cts +28 -28
  107. package/lib/ImportWord.d.ts +28 -28
  108. package/lib/ImportWord.js +1 -1
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +28 -28
  111. package/lib/Indent.d.ts +28 -28
  112. package/lib/Indent.js +1 -1
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +28 -28
  115. package/lib/Italic.d.ts +28 -28
  116. package/lib/Italic.js +1 -1
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +28 -28
  119. package/lib/Katex.d.ts +28 -28
  120. package/lib/Katex.js +2 -2
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +28 -28
  123. package/lib/LineHeight.d.ts +28 -28
  124. package/lib/LineHeight.js +1 -1
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +28 -28
  127. package/lib/Link.d.ts +28 -28
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +28 -28
  130. package/lib/ListItem.d.ts +28 -28
  131. package/lib/Mention.d.cts +28 -28
  132. package/lib/Mention.d.ts +28 -28
  133. package/lib/Mermaid.cjs +1 -1
  134. package/lib/Mermaid.d.cts +28 -28
  135. package/lib/Mermaid.d.ts +28 -28
  136. package/lib/Mermaid.js +2 -2
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +28 -28
  139. package/lib/MoreMark.d.ts +28 -28
  140. package/lib/MoreMark.js +1 -1
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +28 -28
  143. package/lib/MultiColumn.d.ts +28 -28
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +28 -28
  147. package/lib/OrderedList.d.ts +28 -28
  148. package/lib/OrderedList.js +1 -1
  149. package/lib/{RichTextEditor-CAxwVWUE.cjs → RichTextEditor-BnC1uaUo.cjs} +6 -3
  150. package/lib/{RichTextEditor-DjTnd5Uu.js → RichTextEditor-CqgbZwS5.js} +8 -5
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +28 -28
  153. package/lib/SearchAndReplace.d.ts +28 -28
  154. package/lib/SearchAndReplace.js +1 -1
  155. package/lib/Selection.d.cts +28 -28
  156. package/lib/Selection.d.ts +28 -28
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +28 -28
  159. package/lib/SlashCommand.d.ts +28 -28
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +28 -28
  163. package/lib/Strike.d.ts +28 -28
  164. package/lib/Strike.js +1 -1
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +28 -28
  167. package/lib/SubAndSuperScript.d.ts +28 -28
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +28 -28
  171. package/lib/Table.d.ts +28 -28
  172. package/lib/Table.js +1 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +28 -28
  175. package/lib/TableOfContent.d.ts +28 -28
  176. package/lib/TableOfContent.js +1 -1
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +28 -28
  179. package/lib/TaskList.d.ts +28 -28
  180. package/lib/TaskList.js +1 -1
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +28 -28
  183. package/lib/TextAlign.d.ts +28 -28
  184. package/lib/TextAlign.js +1 -1
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +28 -28
  187. package/lib/TextBubble.d.ts +28 -28
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +28 -28
  191. package/lib/TextDirection.d.ts +28 -28
  192. package/lib/TextDirection.js +1 -1
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +28 -28
  195. package/lib/TextUnderline.d.ts +28 -28
  196. package/lib/TextUnderline.js +1 -1
  197. package/lib/TrailingNode.d.cts +28 -28
  198. package/lib/TrailingNode.d.ts +28 -28
  199. package/lib/{Twitter-V0OzBT_E.cjs → Twitter-2BEmpZYn.cjs} +1 -1
  200. package/lib/{Twitter-dRxbZOad.js → Twitter-DjzxXZcS.js} +1 -1
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +28 -28
  203. package/lib/Twitter.d.ts +28 -28
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +28 -28
  207. package/lib/Video.d.ts +28 -28
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +28 -28
  211. package/lib/bubble-extra.d.ts +28 -28
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +28 -28
  215. package/lib/index.d.ts +28 -28
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +28 -28
  218. package/lib/locale-bundle.d.ts +28 -28
  219. package/lib/style.css +1 -1
  220. package/lib/{textarea-6c8drwXJ.js → textarea-ClmQTGYC.js} +1 -1
  221. package/lib/{textarea-BsJTSgT-.cjs → textarea-DsAuYgt7.cjs} +1 -1
  222. package/package.json +2 -2
@@ -2,12 +2,14 @@
2
2
  `,H0="️",q0="‍",ii="";let Lr=null,$r=null;function F0(e=[]){const t={};Ee.groups=t;const r=new Ee;Lr==null&&(Lr=ec(L0)),$r==null&&($r=ec($0)),R(r,"'",Oa),R(r,"{",or),R(r,"}",ar),R(r,"[",Yr),R(r,"]",Jr),R(r,"(",Zr),R(r,")",Qr),R(r,"<",en),R(r,">",tn),R(r,"(",rn),R(r,")",nn),R(r,"「",on),R(r,"」",an),R(r,"『",sn),R(r,"』",cn),R(r,"<",ln),R(r,">",un),R(r,"&",dn),R(r,"*",fn),R(r,"@",mt),R(r,"`",pn),R(r,"^",mn),R(r,":",gt),R(r,",",ka),R(r,"$",gn),R(r,".",He),R(r,"=",xn),R(r,"!",Na),R(r,"-",Oe),R(r,"%",sr),R(r,"|",vn),R(r,"+",yn),R(r,"#",bn),R(r,"?",cr),R(r,'"',Ma),R(r,"/",qe),R(r,";",La),R(r,"~",lr),R(r,"_",wn),R(r,"\\",hn),R(r,"・",td);const n=he(r,et,Ra,{[aa]:!0});he(n,et,n);const i=he(n,Qe,Qu,{[ir]:!0}),o=he(n,er,ed,{[rr]:!0}),a=he(r,Qe,tt,{[sa]:!0});he(a,et,i),he(a,Qe,a),he(i,et,i),he(i,Qe,i);const s=he(r,er,ua,{[ca]:!0});he(s,Qe),he(s,et,o),he(s,er,s),he(o,et,o),he(o,Qe),he(o,er,o);const l=R(r,ni,Pa,{[ei]:!0}),u=R(r,Qs,ha,{[ei]:!0}),f=he(r,ri,ha,{[ei]:!0});R(r,ii,f),R(u,ni,l),R(u,ii,f),he(u,ri,f),R(f,Qs),R(f,ni),he(f,ri,f),R(f,ii,f);const d=he(r,ti,rd,{[Zu]:!0});R(d,"#"),he(d,ti,d),R(d,H0,d);const h=R(d,q0);R(h,"#"),he(h,ti,d);const p=[[Qe,a],[et,i]],m=[[Qe,null],[er,s],[et,o]];for(let x=0;x<Lr.length;x++)ht(r,Lr[x],da,tt,p);for(let x=0;x<$r.length;x++)ht(r,$r[x],fa,ua,m);At(da,{tld:!0,ascii:!0},t),At(fa,{utld:!0,alpha:!0},t),ht(r,"file",Fr,tt,p),ht(r,"mailto",Fr,tt,p),ht(r,"http",Lt,tt,p),ht(r,"https",Lt,tt,p),ht(r,"ftp",Lt,tt,p),ht(r,"ftps",Lt,tt,p),At(Fr,{scheme:!0,ascii:!0},t),At(Lt,{slashscheme:!0,ascii:!0},t),e=e.sort((x,g)=>x[0]>g[0]?1:-1);for(let x=0;x<e.length;x++){const g=e[x][0],S=e[x][1]?{[_0]:!0}:{[D0]:!0};g.indexOf("-")>=0?S[la]=!0:Qe.test(g)?et.test(g)?S[ir]=!0:S[sa]=!0:S[aa]=!0,Zs(r,g,g,S)}return Zs(r,"localhost",mr,{ascii:!0}),r.jd=new Ee(Sn),{start:r,tokens:zt({groups:t},nd)}}function id(e,t){const r=U0(t.replace(/[A-Z]/g,s=>s.toLowerCase())),n=r.length,i=[];let o=0,a=0;for(;a<n;){let s=e,l=null,u=0,f=null,d=-1,h=-1;for(;a<n&&(l=s.go(r[a]));)s=l,s.accepts()?(d=0,h=0,f=s):d>=0&&(d+=r[a].length,h++),u+=r[a].length,o+=r[a].length,a++;o-=d,a-=h,u-=d,i.push({t:f.t,v:t.slice(o-u,o),s:o-u,e:o})}return i}function U0(e){const t=[],r=e.length;let n=0;for(;n<r;){let i=e.charCodeAt(n),o,a=i<55296||i>56319||n+1===r||(o=e.charCodeAt(n+1))<56320||o>57343?e[n]:e.slice(n,n+2);t.push(a),n+=a.length}return t}function ht(e,t,r,n,i){let o;const a=t.length;for(let s=0;s<a-1;s++){const l=t[s];e.j[l]?o=e.j[l]:(o=new Ee(n),o.jr=i.slice(),e.j[l]=o),e=o}return o=new Ee(r),o.jr=i.slice(),e.j[t[a-1]]=o,o}function ec(e){const t=[],r=[];let n=0,i="0123456789";for(;n<e.length;){let o=0;for(;i.indexOf(e[n+o])>=0;)o++;if(o>0){t.push(r.join(""));for(let a=parseInt(e.substring(n,n+o),10);a>0;a--)r.pop();n+=o}else r.push(e[n]),n++}return t}const gr={defaultProtocol:"http",events:null,format:tc,formatHref:tc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function $a(e,t=null){let r=zt({},gr);e&&(r=zt(r,e instanceof $a?e.o:e));const n=r.ignoreTags,i=[];for(let o=0;o<n.length;o++)i.push(n[o].toUpperCase());this.o=r,t&&(this.defaultRender=t),this.ignoreTags=i}$a.prototype={o:gr,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,r){const n=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=r.t in i?i[r.t]:gr[e],typeof i=="function"&&n&&(i=i(t,r))):typeof i=="function"&&n&&(i=i(t,r.t,r)),i)},getObj(e,t,r){let n=this.o[e];return typeof n=="function"&&t!=null&&(n=n(t,r.t,r)),n},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function tc(e){return e}function od(e,t){this.t="token",this.v=e,this.tk=t}od.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),r=e.get("truncate",t,this),n=e.get("format",t,this);return r&&n.length>r?n.substring(0,r)+"…":n},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=gr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,r=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",r,this),i=e.get("tagName",r,t),o=this.toFormattedString(e),a={},s=e.get("className",r,t),l=e.get("target",r,t),u=e.get("rel",r,t),f=e.getObj("attributes",r,t),d=e.getObj("events",r,t);return a.href=n,s&&(a.class=s),l&&(a.target=l),u&&(a.rel=u),f&&zt(a,f),{tagName:i,attributes:a,content:o,eventListeners:d}}};function Tn(e,t){class r extends od{constructor(i,o){super(i,o),this.t=e}}for(const n in t)r.prototype[n]=t[n];return r.t=e,r}const rc=Tn("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),nc=Tn("text"),W0=Tn("nl"),_r=Tn("url",{isLink:!0,toHref(e=gr.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==mr&&e[1].t===gt}}),Pe=e=>new Ee(e);function G0({groups:e}){const t=e.domain.concat([dn,fn,mt,hn,pn,mn,gn,xn,Oe,Ra,sr,vn,yn,bn,qe,Sn,lr,wn]),r=[gt,ka,He,Na,sr,cr,Ma,La,en,tn,or,ar,Jr,Yr,Zr,Qr,rn,nn,on,an,sn,cn,ln,un],n=[dn,Oa,fn,hn,pn,mn,gn,xn,Oe,or,ar,sr,vn,yn,bn,cr,qe,Sn,lr,wn],i=Pe(),o=R(i,lr);Z(o,n,o),Z(o,e.domain,o);const a=Pe(),s=Pe(),l=Pe();Z(i,e.domain,a),Z(i,e.scheme,s),Z(i,e.slashscheme,l),Z(a,n,o),Z(a,e.domain,a);const u=R(a,mt);R(o,mt,u),R(s,mt,u),R(l,mt,u);const f=R(o,He);Z(f,n,o),Z(f,e.domain,o);const d=Pe();Z(u,e.domain,d),Z(d,e.domain,d);const h=R(d,He);Z(h,e.domain,d);const p=Pe(rc);Z(h,e.tld,p),Z(h,e.utld,p),R(u,mr,p);const m=R(d,Oe);R(m,Oe,m),Z(m,e.domain,d),Z(p,e.domain,d),R(p,He,h),R(p,Oe,m);const x=R(p,gt);Z(x,e.numeric,rc);const g=R(a,Oe),y=R(a,He);R(g,Oe,g),Z(g,e.domain,a),Z(y,n,o),Z(y,e.domain,a);const S=Pe(_r);Z(y,e.tld,S),Z(y,e.utld,S),Z(S,e.domain,a),Z(S,n,o),R(S,He,y),R(S,Oe,g),R(S,mt,u);const E=R(S,gt),T=Pe(_r);Z(E,e.numeric,T);const j=Pe(_r),M=Pe();Z(j,t,j),Z(j,r,M),Z(M,t,j),Z(M,r,M),R(S,qe,j),R(T,qe,j);const L=R(s,gt),k=R(l,gt),O=R(k,qe),$=R(O,qe);Z(s,e.domain,a),R(s,He,y),R(s,Oe,g),Z(l,e.domain,a),R(l,He,y),R(l,Oe,g),Z(L,e.domain,j),R(L,qe,j),R(L,cr,j),Z($,e.domain,j),Z($,t,j),R($,qe,j);const C=[[or,ar],[Yr,Jr],[Zr,Qr],[en,tn],[rn,nn],[on,an],[sn,cn],[ln,un]];for(let A=0;A<C.length;A++){const[P,D]=C[A],U=R(j,P);R(M,P,U),R(U,D,j);const H=Pe(_r);Z(U,t,H);const K=Pe();Z(U,r),Z(H,t,H),Z(H,r,K),Z(K,t,H),Z(K,r,K),R(H,D,j),R(K,D,j)}return R(i,mr,S),R(i,Pa,W0),{start:i,tokens:nd}}function V0(e,t,r){let n=r.length,i=0,o=[],a=[];for(;i<n;){let s=e,l=null,u=null,f=0,d=null,h=-1;for(;i<n&&!(l=s.go(r[i].t));)a.push(r[i++]);for(;i<n&&(u=l||s.go(r[i].t));)l=null,s=u,s.accepts()?(h=0,d=s):h>=0&&h++,i++,f++;if(h<0)i-=f,i<n&&(a.push(r[i]),i++);else{a.length>0&&(o.push(oi(nc,t,a)),a=[]),i-=h,f-=h;const p=d.t,m=r.slice(i-f,i);o.push(oi(p,t,m))}}return a.length>0&&o.push(oi(nc,t,a)),o}function oi(e,t,r){const n=r[0].s,i=r[r.length-1].e,o=t.slice(n,i);return new e(o,r)}const K0=typeof console<"u"&&console&&console.warn||(()=>{}),X0="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",de={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Y0(){return Ee.groups={},de.scanner=null,de.parser=null,de.tokenQueue=[],de.pluginQueue=[],de.customSchemes=[],de.initialized=!1,de}function ic(e,t=!1){if(de.initialized&&K0(`linkifyjs: already initialized - will not register custom scheme "${e}" ${X0}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
3
3
  1. Must only contain digits, lowercase ASCII letters or "-"
4
4
  2. Cannot start or end with "-"
5
- 3. "-" cannot repeat`);de.customSchemes.push([e,t])}function J0(){de.scanner=F0(de.customSchemes);for(let e=0;e<de.tokenQueue.length;e++)de.tokenQueue[e][1]({scanner:de.scanner});de.parser=G0(de.scanner.tokens);for(let e=0;e<de.pluginQueue.length;e++)de.pluginQueue[e][1]({scanner:de.scanner,parser:de.parser});return de.initialized=!0,de}function _a(e){return de.initialized||J0(),V0(de.parser.start,e,id(de.scanner.start,e))}_a.scan=id;function ad(e,t=null,r=null){if(t&&typeof t=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);r=t,t=null}const n=new $a(r),i=_a(e),o=[];for(let a=0;a<i.length;a++){const s=i[a];s.isLink&&(!t||s.t===t)&&n.check(s)&&o.push(s.toFormattedObject(n))}return o}const Da="[\0-   ᠎ -\u2029  ]",Z0=new RegExp(Da),Q0=new RegExp(`${Da}$`),e1=new RegExp(Da,"g");function t1(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function r1(e){return new B.Plugin({key:new B.PluginKey("autolink"),appendTransaction:(t,r,n)=>{const i=t.some(u=>u.docChanged)&&!r.doc.eq(n.doc),o=t.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=n,s=B.combineTransactionSteps(r.doc,[...t]);if(B.getChangedRanges(s).forEach(({newRange:u})=>{const f=B.findChildrenInRange(n.doc,u,p=>p.isTextblock);let d,h;if(f.length>1)d=f[0],h=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(f.length){const p=n.doc.textBetween(u.from,u.to," "," ");if(!Q0.test(p))return;d=f[0],h=n.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&h){const p=h.split(Z0).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],x=d.pos+h.lastIndexOf(m);if(!m)return!1;const g=_a(m).map(y=>y.toObject(e.defaultProtocol));if(!t1(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:x+y.start+1,to:x+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{B.getMarksBetween(y.from,y.to,n.doc).some(S=>S.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function n1(e){return new B.Plugin({key:new B.PluginKey("handleClickLink"),props:{handleClick:(t,r,n)=>{var i,o;if(n.button!==0||!t.editable)return!1;let a=n.target;const s=[];for(;a.nodeName!=="DIV";)s.push(a),a=a.parentNode;if(!s.find(h=>h.nodeName==="A"))return!1;const l=B.getAttributes(t.state,e.type.name),u=n.target,f=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,d=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&f?(window.open(f,d),!0):!1}}})}function i1(e){return new B.Plugin({key:new B.PluginKey("handlePasteLink"),props:{handlePaste:(t,r,n)=>{const{state:i}=t,{selection:o}=i,{empty:a}=o;if(a)return!1;let s="";n.content.forEach(u=>{s+=u.textContent});const l=ad(s,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===s);return!s||!l?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function wt(e,t){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!e||e.replace(e1,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const o1=B.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){ic(e);return}ic(e.scheme,e.optionalSlashes)})},onDestroy(){Y0()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!wt(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:r=>!!wt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!wt(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",B.mergeAttributes(this.options.HTMLAttributes,e),0]:["a",B.mergeAttributes(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:r}=e;return this.options.isAllowedUri(r,{defaultValidate:n=>!!wt(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:r}=e;return this.options.isAllowedUri(r,{defaultValidate:n=>!!wt(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[B.markPasteRule({find:e=>{const t=[];if(e){const{protocols:r,defaultProtocol:n}=this.options,i=ad(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!wt(a,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(o=>t.push({text:o.value,data:{href:o.href},index:o.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:r}=this.options;return this.options.autolink&&e.push(r1({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!wt(i,t),protocols:t,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(n1({type:this.type})),this.options.linkOnPaste&&e.push(i1({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}});function a1(e){const[t,r]=w.useState(!1);function n(i,o,a){e.action&&(e.action({link:i,text:o,openInNewTab:a}),r(!1))}return c.jsxs(Wt,{modal:!0,open:t,onOpenChange:r,children:[c.jsx(Gt,{disabled:e==null?void 0:e.disabled,asChild:!0,children:c.jsx(W,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:c.jsx(me,{name:e==null?void 0:e.icon})})}),c.jsx(It,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:c.jsx(cd,{editor:e.editor,onSetLink:n})})]})}const sd=o1.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",B.mergeAttributes(this.options.HTMLAttributes,e,{class:"link"}),0]},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),openOnClick:!0,button:({editor:t,t:r})=>({component:a1,componentProps:{editor:t,action:n=>{const{link:i,text:o,openInNewTab:a}=n,{state:s}=t,{from:l}=s.selection,u=o.length,f=l+u;t.chain().extendMarkRange("link").insertContent({type:"text",text:o,marks:[{type:"link",attrs:{href:i,target:a?"_blank":""}}]}).setLink({href:i}).setTextSelection({from:l,to:f}).focus().run()},id:"linkk",isActive:()=>t.isActive("link")||!1,disabled:!t.can().setLink({href:""}),icon:"Link",tooltip:r("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new B.Plugin({props:{handleClick:(e,t)=>{const{schema:r,doc:n,tr:i}=e.state,o=B.getMarkRange(n.resolve(t),r.marks.link);if(!o)return!1;const a=n.resolve(o.from),s=n.resolve(o.to),l=i.setSelection(new B.TextSelection(a,s));e.dispatch(l)}}})]}});function cd(e){const{t}=q.useLocale(),[r,n]=w.useState({text:"",link:""}),[i,o]=w.useState(!1);w.useEffect(()=>{const s=()=>{var l,u,f;if((l=e.editor)!=null&&l.isActive("link")){const{href:d,target:h}=e.editor.getAttributes("link"),{from:p,to:m}=e.editor.state.selection,x=e.editor.state.doc.textBetween(p,m," ");n({link:d||"",text:x}),o(h==="_blank")}else{const d=(u=e.editor.extensionManager.extensions.find(h=>h.name===sd.name))==null?void 0:u.options;o(((f=d==null?void 0:d.HTMLAttributes)==null?void 0:f.target)==="_blank")}};return s(),e.editor.on("selectionUpdate",s),()=>{e.editor.off("selectionUpdate",s)}},[e.editor]);function a(s){s.preventDefault(),s.stopPropagation(),e==null||e.onSetLink(r.link,r.text,i),n({text:"",link:""})}return c.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:c.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-gap-2",children:[c.jsx(Ue,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),c.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:c.jsx(Te,{className:"richtext-w-80",onChange:s=>n({...r,text:s.target.value}),placeholder:"Text",required:!0,type:"text",value:r.text})})}),c.jsx(Ue,{className:"mb-[6px]",children:t("editor.link.dialog.link")}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[c.jsx(Te,{className:"richtext-pl-10",onChange:s=>n({...r,link:s.target.value}),required:!0,type:"url",value:r.link}),c.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:c.jsx(me,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[c.jsx(Ue,{children:t("editor.link.dialog.openInNewTab")}),c.jsx(Ka,{checked:i,onCheckedChange:s=>{o(s)}})]}),c.jsx(we,{className:"richtext-mt-2 richtext-self-end",onClick:a,type:"button",children:t("editor.link.dialog.button.apply")})]})})}function s1(e){const{t}=q.useLocale();return c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[c.jsx("a",{href:e==null?void 0:e.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:lx(e==null?void 0:e.link,{length:50,omission:"…"})}),(e==null?void 0:e.link)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-4"}),c.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[c.jsx(W,{icon:"Pencil",tooltip:t("editor.link.edit.tooltip"),action:()=>{e==null||e.onEdit()},tooltipOptions:{sideOffset:15}}),c.jsx(W,{icon:"Unlink",tooltip:t("editor.link.unlink.tooltip"),action:()=>{e==null||e.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function c1({editor:e,disabled:t}){const[r,n]=w.useState(!1),i=w.useMemo(()=>{const{href:l}=e.getAttributes("link");return l},[e]),o=w.useCallback(({editor:l})=>l.isActive("link"),[]),a=(l,u,f)=>{const d=e.state.selection,{from:h}=d,p=(u==null?void 0:u.length)??0,m=h+p;e.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:f?"_blank":""}}]}).setLink({href:l}).setTextSelection({from:h,to:m}).focus().run(),n(!1)},s=w.useCallback(()=>{e.chain().extendMarkRange("link").unsetLink().focus().run(),n(!1)},[e]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:t?c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{children:r?c.jsx(cd,{onSetLink:a,editor:e}):c.jsx(s1,{editor:e,onClear:s,onEdit:()=>{n(!0)},link:i})})})})}const l1=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ba=B.Node.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",B.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[B.nodeInputRule({find:l1,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Cr=ke.Root,jr=ke.Trigger,u1=ke.Portal,ld=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Overlay,{ref:r,className:re("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));ld.displayName=ke.Overlay.displayName;const Ft=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(u1,{children:[c.jsx(ld,{}),c.jsxs(ke.Content,{ref:n,className:re("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,c.jsxs(ke.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[c.jsx(N.X,{className:"richtext-h-4 richtext-w-4"}),c.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));Ft.displayName=ke.Content.displayName;function ud({className:e,...t}){return c.jsx("div",{className:re("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}ud.displayName="DialogHeader";function In({className:e,...t}){return c.jsx("div",{className:re("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}In.displayName="DialogFooter";const Ut=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Title,{ref:r,className:re("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));Ut.displayName=ke.Title.displayName;const d1=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Description,{ref:r,className:re("richtext-text-sm richtext-text-muted-foreground",e),...t}));d1.displayName=ke.Description.displayName;const oc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ac=pe.clsx,Rn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ac(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(u=>{const f=r==null?void 0:r[u],d=o==null?void 0:o[u];if(f===null)return null;const h=oc(f)||oc(d);return i[u][h]}),s=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(m=>{let[x,g]=m;return Array.isArray(g)?g.includes({...o,...s}[x]):{...o,...s}[x]===g})?[...u,d,h]:u},[]);return ac(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},f1=Rn("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),we=oe.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const a=n?tu.Slot:"button";return c.jsx(a,{className:re(f1({variant:t,size:r,className:e})),ref:o,...i})});we.displayName="Button";function h1(e){return e.replace(/^.*\/|\..+$/g,"")}function p1(e){return e.split(".").pop()}function m1(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function g1(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function x1(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function dd(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[r.length-1]);let o=i.length;const a=new Uint8Array(o);for(;o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:n})}function v1(e,t){const r=e.type,n=e.name.toLowerCase(),i=n.split(".").pop();if(!i)return!1;const a=r||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[i];return t.some(s=>{if(s.startsWith("."))return n.endsWith(s);if(s.endsWith("/*")){const l=s.split("/")[0];return a==null?void 0:a.startsWith(l+"/")}return a===s})}function fd(e,t){const{acceptMimes:r,maxSize:n,t:i,toast:o}=t,a=[];return(Array.isArray(e)?e:Object.values(e)).forEach(l=>{if(!v1(l,r)){t.onError?t.onError({type:"type",message:i("editor.upload.fileTypeNotSupported",{fileName:l.name}),file:l}):o({variant:"default",title:i("editor.upload.fileTypeNotSupported",{fileName:l.name})});return}if(l.size>n){const u=(n/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:i("editor.upload.fileSizeTooBig",{fileName:l.name,size:u}),file:l}):o({variant:"default",title:i("editor.upload.fileSizeTooBig",{fileName:l.name,size:u})});return}a.push(l)}),a}function y1({editor:e,imageInline:t,onClose:r,disabled:n,alt:i}){var $,C;const{t:o}=q.useLocale(),{toast:a}=Nn(),[s,l]=w.useState(!1),[u,f]=w.useState(!1),d=w.useRef(null),[h,p]=w.useState(),[m,x]=w.useState(""),g=w.useRef(null),[y,S]=w.useState({src:"",file:null}),E=w.useMemo(()=>{var A;return(A=e.extensionManager.extensions.find(P=>P.name===Ht.name))==null?void 0:A.options},[e]);function T(A){if(d.current&&A.width&&A.height){const P=j(d.current,A);x(P)}}function j(A,P){const D=document.createElement("canvas"),U=A.naturalWidth/A.width,H=A.naturalHeight/A.height;D.width=P.width*U,D.height=P.height*H;const K=D.getContext("2d");return K&&(K.imageSmoothingEnabled=!1,K.drawImage(A,P.x*U,P.y*H,P.width*U,P.height*H,0,0,P.width*U,P.height*H)),D.toDataURL("image/png",1)}const M=w.useCallback(async()=>{var A;if(!u){f(!0);try{const P=dd(m,((A=y==null?void 0:y.file)==null?void 0:A.name)||"image.png");let D="";E.upload?D=await E.upload(P):D=URL.createObjectURL(P),e.chain().focus().setImageInline({src:D,inline:t,alt:i}).run(),l(!1),S({src:"",file:null}),O(),r()}catch(P){console.log("Error cropping image",P)}finally{f(!1)}}},[m,e,t,u,r,($=y==null?void 0:y.file)==null?void 0:$.name,E]);function L(A){var P;A.preventDefault(),(P=g.current)==null||P.click()}const k=async A=>{var K;const P=(K=A==null?void 0:A.target)==null?void 0:K.files;if(!e||e.isDestroyed||P.length===0){A.target.value="";return}const D=fd(P,{acceptMimes:E==null?void 0:E.acceptMimes,maxSize:E==null?void 0:E.maxSize,t:o,toast:a,onError:E.onError});if(D.length<=0){A.target.value="";return}const U=D[0],H=await x1(U);l(!0),S({src:H.src,file:U})},O=()=>{g.current&&(g.current.value="")};return c.jsxs(c.Fragment,{children:[c.jsx(we,{className:"richtext-mt-1 richtext-w-full",disabled:n,onClick:L,size:"sm",children:o("editor.image.dialog.tab.uploadCrop")}),c.jsxs(Cr,{open:s,onOpenChange:A=>{l(A),A||(S({src:"",file:null}),O())},children:[c.jsx(jr,{}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:o("editor.image.dialog.tab.uploadCrop")}),c.jsx("div",{children:y.src&&c.jsx(Cf,{className:"richtext-w-full",crop:h,onChange:A=>p(A),onComplete:A=>T(A),children:c.jsx("img",{alt:"Crop me",ref:d,src:y.src})})}),c.jsxs(In,{children:[c.jsxs(we,{disabled:u,onClick:()=>{l(!1),S({src:"",file:null}),O()},children:[o("editor.imageUpload.cancel"),c.jsx(me,{className:"richtext-ml-1",name:"Trash2"})]}),c.jsx(we,{className:"richtext-w-fit",disabled:u||!h,onClick:M,children:u?c.jsxs(c.Fragment,{children:[o("editor.imageUpload.uploading"),c.jsx(me,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):c.jsxs(c.Fragment,{children:[o("editor.imageUpload.crop"),c.jsx(me,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),c.jsx("input",{accept:((C=E==null?void 0:E.acceptMimes)==null?void 0:C.join(","))||"image/*",multiple:!1,onChange:k,ref:g,style:{display:"none"},type:"file"})]})}function Pn(e){function t(){const o=w.useRef(e),a=w.useCallback(()=>o.current,[]),s=w.useRef(new Set),l=w.useCallback(f=>{o.current={...o.current,...f},s.current.forEach(d=>d())},[]),u=w.useCallback(f=>(s.current.add(f),()=>s.current.delete(f)),[]);return{get:a,set:l,subscribe:u}}const r=w.createContext(null);function n({children:o}){return c.jsx(r.Provider,{value:t(),children:o})}function i(o){const a=w.useContext(r);if(!a)throw new Error("Store not found");return[w.useSyncExternalStore(a.subscribe,()=>o(a.get()),()=>o(e)),a.set]}return{Provider:n,useStore:i}}Pn({value:!1});Pn({value:!1});const{Provider:b1,useStore:hd}=Pn({value:!1}),{Provider:w1,useStore:pd}=Pn({value:"light"});q.d("0");function xr(e,t){return window.addEventListener(e,t),()=>{window.removeEventListener(e,t)}}function On(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const vt={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EDIT:e=>`EDIT-${e}`,UPDATE_THEME:e=>`UPDATE_THEME-${e}`,SEARCH_REPLCE:"SEARCH_REPLACE"},md={setOpen:(e,t)=>{On(vt.UPLOAD_IMAGE(e),t)}};function S1(e){var T;const{t}=q.useLocale(),{toast:r}=Nn(),[n,i]=w.useState(!1),[o,a]=w.useState(!1),s=j=>{i(j.detail)},[l,u]=w.useState(""),[f,d]=w.useState(""),h=w.useRef(null),p=((T=e.editor.extensionManager.extensions.find(j=>j.name===Ht.name))==null?void 0:T.options.defaultInline)||!1,[m,x]=w.useState(p),g=w.useMemo(()=>{var M;return(M=e.editor.extensionManager.extensions.find(L=>L.name===Ht.name))==null?void 0:M.options},[e.editor]);w.useEffect(()=>{const j=xr(vt.UPLOAD_IMAGE(e.editor.id),s);return()=>{j()}},[]);async function y(j){var k;const M=(k=j==null?void 0:j.target)==null?void 0:k.files;if(!e.editor||e.editor.isDestroyed||M.length===0||o){j.target.value="";return}const L=fd(M,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t,toast:r,onError:g.onError});if(L.length<=0){j.target.value="";return}a(!0);try{if(g!=null&&g.multiple){const O=L.map(async C=>{let A="";return g.upload?A=await g.upload(C):A=URL.createObjectURL(C),A});(await Promise.all(O)).forEach(C=>{e.editor.chain().focus().setImageInline({src:C,inline:m,alt:f}).run()})}else{const O=L[0];let $="";g.upload?$=await g.upload(O):$=URL.createObjectURL(O),e.editor.chain().focus().setImageInline({src:$,inline:m,alt:f}).run()}i(!1),d(""),x(p)}catch(O){console.error("Error uploading image",O),g.onError?g.onError({type:"upload",message:t("editor.upload.error")}):r({variant:"destructive",title:t("editor.upload.error")})}finally{a(!1),j.target.value=""}}function S(j){j.preventDefault(),j.stopPropagation(),e.editor.chain().focus().setImageInline({src:l,inline:m,alt:f}).run(),i(!1),x(p),u(""),d("")}function E(j){var M;j.preventDefault(),(M=h.current)==null||M.click()}return c.jsxs(Cr,{onOpenChange:i,open:n,children:[c.jsx(jr,{asChild:!0,children:c.jsx(W,{action:()=>i(!0),icon:e.icon,tooltip:e.tooltip})}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:t("editor.image.dialog.title")}),c.jsxs(Sd,{activationMode:"manual",defaultValue:g.resourceImage==="both"||g.resourceImage==="upload"?"upload":"link",children:[c.jsxs(Xa,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[g.resourceImage==="both"||g.resourceImage==="upload"?c.jsx(yr,{value:"upload",children:t("editor.image.dialog.tab.upload")}):c.jsx(c.Fragment,{}),g.resourceImage==="both"||g.resourceImage==="link"?c.jsx(yr,{value:"link",children:t("editor.image.dialog.tab.url")}):c.jsx(c.Fragment,{})]}),c.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[c.jsx(Id,{checked:m,onCheckedChange:j=>{x(j)}}),c.jsx(Ue,{children:t("editor.link.dialog.inline")})]}),g.enableAlt&&c.jsxs("div",{className:"richtext-my-[10px] ",children:[c.jsx(Ue,{className:"mb-[6px]",children:t("editor.imageUpload.alt")}),c.jsx(Te,{onChange:j=>d(j.target.value),required:!0,type:"text",value:f})]}),c.jsxs(br,{value:"upload",children:[c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[c.jsx(we,{className:"richtext-mt-1 richtext-w-full",disabled:o,onClick:E,size:"sm",children:o?c.jsxs(c.Fragment,{children:[t("editor.imageUpload.uploading"),c.jsx(me,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):t("editor.image.dialog.tab.upload")}),c.jsx(y1,{alt:f,disabled:o,editor:e.editor,imageInline:m,onClose:()=>{md.setOpen(e.editor.id,!1),d("")}})]}),c.jsx("input",{accept:g.acceptMimes.join(",")||"image/*",multiple:g.multiple,onChange:y,ref:h,style:{display:"none"},type:"file"})]}),c.jsx(br,{value:"link",children:c.jsx("form",{onSubmit:S,children:c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[c.jsx(Te,{autoFocus:!0,onChange:j=>u(j.target.value),placeholder:t("editor.image.dialog.placeholder"),required:!0,type:"url",value:l}),c.jsx(we,{type:"submit",children:t("editor.image.dialog.button.apply")})]})})})]})]})]})}const Dr={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function A1(e){var k,O,$;const[t,r]=w.useState({width:q.IMAGE_MAX_SIZE,height:q.IMAGE_MAX_SIZE}),[n,i]=w.useState({width:0,height:0}),[o]=w.useState([Dr.TOP_LEFT,Dr.TOP_RIGHT,Dr.BOTTOM_LEFT,Dr.BOTTOM_RIGHT]),[a,s]=w.useState(!1),[l,u]=w.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f,inline:d}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,h=d&&(f==="left"||f==="right"),p=w.useMemo(()=>{var Le;const{src:C,alt:A,width:P,height:D,flipX:U,flipY:H}=(Le=e==null?void 0:e.node)==null?void 0:Le.attrs,K=Kr(P)?`${P}px`:P,te=Kr(D)?`${D}px`:D,ne=[];U&&ne.push("rotateX(180deg)"),H&&ne.push("rotateY(180deg)");const ve=ne.join(" ");return{src:C||void 0,alt:A||void 0,style:{width:K||void 0,height:te||void 0,transform:ve||"none",...h?{float:f}:{}}}},[(O=e==null?void 0:e.node)==null?void 0:O.attrs]),m=w.useMemo(()=>{const{style:{width:C}}=p;return{width:C==="100%"?C:void 0}},[p]);function x(C){i({width:C.target.width,height:C.target.height})}function g(){const{editor:C,getPos:A}=e;C.commands.setNodeSelection(A())}const y=w.useCallback(Bt(()=>{const{editor:C}=e,{width:A}=getComputedStyle(C.view.dom);r(P=>({...P,width:Number.parseInt(A,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(C,A){C.preventDefault(),C.stopPropagation();const P=n.width,D=n.height,U=P/D;let H=Number(e.node.attrs.width),K=Number(e.node.attrs.height);const te=t.width;H&&!K?(H=H>te?te:H,K=Math.round(H/U)):K&&!H?(H=Math.round(K*U),H=H>te?te:H):!H&&!K?(H=P>te?te:P,K=Math.round(H/U)):H=H>te?te:H,s(!0),u({x:C.clientX,y:C.clientY,w:H,h:K,dir:A})}const E=w.useCallback(Bt(C=>{if(C.preventDefault(),C.stopPropagation(),!a)return;const{x:A,w:P,dir:D}=l,U=(C.clientX-A)*(/l/.test(D)?-1:1),H=Tu(P+U,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:H,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),T=w.useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),g())},[a,g]),j=w.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",T,!0)},[E,T]),M=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",T,!0)},[E,T]);w.useEffect(()=>(a?j():M(),()=>{M()}),[a,j,M]);const L=w.useMemo(()=>new ResizeObserver(()=>y()),[y]);return w.useEffect(()=>(L.observe(e.editor.view.dom),()=>{L.disconnect()}),[e.editor.view.dom,L]),c.jsx(pe.NodeViewWrapper,{as:d?"span":"div",className:"image-view",style:{float:h?f:void 0,margin:h?f==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:d?"inline":"block",textAlign:h?void 0:f,width:(($=p.style)==null?void 0:$.width)??"auto",...h?{}:m},children:c.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:m,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${a?"image-view__body--resizing":""}`,children:[c.jsx("img",{alt:p.alt,className:"image-view__body__image block",height:"auto",onClick:g,onLoad:x,src:p.src,style:p.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||a)&&c.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(C=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${C}`,onMouseDown:A=>S(A,C)},`image-dir-${C}`))})]})})}const Dt=new B.PluginKey("upload-image");function C1(){return new B.Plugin({key:Dt,state:{init(){return B.DecorationSet.empty},apply(e,t){t=t.map(e.mapping,e.doc);const r=e.getMeta(Dt);if(r!=null&&r.add)for(const{id:n,pos:i,src:o}of r.add){const a=j1(o),s=B.Decoration.widget(i,a,{id:n});t=t.add(e.doc,[s])}else if(r!=null&&r.remove)for(const n of r.remove)t=t.remove(t.find(void 0,void 0,i=>i.id===n));return t}},props:{decorations(e){return this.getState(e)}}})}function j1(e){const t=document.createElement("div"),r=document.createElement("img");return r.setAttribute("class","opacity-50"),r.src=e,r.addEventListener("load",()=>{t.setAttribute("class","img-placeholder")}),t.append(r),t}function E1(e,t){var i;const n=Dt.getState(e).find(void 0,void 0,o=>o.id===t);return n.length>0?(i=n[0])==null?void 0:i.from:null}function T1({validateFn:e,onUpload:t,postUpload:r,defaultInline:n=!1}){return(i,o,a)=>{for(const s of i){if(e&&!e(s))continue;const l=Date.now().toString(),u=o.state.tr;u.selection.empty||u.deleteSelection();const f=URL.createObjectURL(s);u.setMeta(Dt,{add:[{id:l,pos:a,src:f}]}),o.dispatch(u),t(s).then(async d=>{var S;r&&typeof d=="string"&&(d=await r(d));const{schema:h}=o.state;let p=E1(o.state,l);if(p===null)return;const m=typeof d=="object"?f:d,x=(S=h.nodes.image)==null?void 0:S.create({src:m,inline:n});if(!x)return;const{doc:g}=o.state;p>g.content.size&&(p=g.content.size-1);const y=o.state.tr.replaceWith(p,p,x).setMeta(Dt,{remove:[l]});o.dispatch(y)},()=>{const d=o.state.tr.delete(a,a).setMeta(Dt,{remove:[l]});o.dispatch(d)})}}}function I1(e,t,r){var i;const n=[...((i=t.clipboardData)==null?void 0:i.files)||[]];if(n.length>0){t.preventDefault();const o=e.state.selection.from;return r(n,e,o+1),!0}return!1}function R1(e,t,r,n){var o;const i=[...((o=t.dataTransfer)==null?void 0:o.files)||[]];if(!r&&i.length>0){t.preventDefault();const a=e.posAtCoords({left:t.clientX,top:t.clientY});if(a)return n(i,e,a.pos+1),!0}return!1}const P1={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},Ht=Ba.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...P1,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var i,o;return{component:S1,componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((o=(i=t.can()).setImage)!=null&&o.call(i,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip"),editor:t}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return pe.ReactNodeViewRenderer(A1)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:i}=e,o=i&&(n==="left"||n==="right"),a=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",s=o?"":`text-align: ${n};`,f=`${o?`float: ${n};`:""}${o?n==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${a}`;return[i?"span":"div",{style:s,class:"image"},["img",B.mergeAttributes({height:"auto",style:f},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var o;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,i=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((o=t==null?void 0:t.style)==null?void 0:o.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,i=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}}]},addProseMirrorPlugins(){const t=T1({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload,defaultInline:this.options.defaultInline});return[new B.Plugin({props:{handlePaste:(r,n)=>!n.clipboardData||[...n.clipboardData.files||[]].some(o=>o.type==="text/html")?!1:I1(r,n,t),handleDrop:(r,n,i,o)=>(!(n instanceof DragEvent)||!n.dataTransfer||R1(r,n,o,t),!1)}}),C1()]}});function O1({selectImage:e,giphyApiKey:t,children:r}){const[n,i]=w.useState([]),[o]=w.useState(15),a=w.useRef(null),s=(u,f="search")=>{if(!t)return;const h=`${f==="search"?`https://api.giphy.com/v1/gifs/search?q=${u}`:`https://api.giphy.com/v1/gifs/trending?q=${u}`}&limit=${o}&api_key=${t}`;fetch(h).then(p=>p.json()).then(p=>{i(p.data)}).catch(p=>{console.log(p)})};w.useEffect(()=>{s("","trend")},[]);const l=w.useCallback(Ar(u=>{if(!u.target.value){s("","trend");return}s(u.target.value)},350),[]);return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,children:r}),c.jsx(It,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:c.jsx(Te,{onChange:l,placeholder:"Search GIF",ref:a,type:"text"})}),c.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:c.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:n!=null&&n.length?n==null?void 0:n.map(u=>c.jsx("img",{alt:"giphy",className:"richtext-cursor-pointer richtext-text-center",height:u.images.fixed_width_downsampled.height,onClick:()=>e(u),src:u.images.fixed_width_downsampled.url,width:u.images.fixed_width_downsampled.width},`giphy-${u.id}`)):c.jsx("p",{children:"No GIFs found"})})})]}):c.jsx("div",{children:c.jsx("p",{children:"Missing Giphy API Key"})})})]})}function k1({editor:e,icon:t,giphyApiKey:r,...n}){const i=o=>{const{url:a}=o.images.original;e.chain().focus().setImageGif({src:a}).run()};return c.jsx(O1,{giphyApiKey:r,selectImage:i,children:c.jsx(W,{icon:t,tooltip:n==null?void 0:n.tooltip})})}const Br={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function N1(e){var M,L;const[t,r]=w.useState({width:q.IMAGE_MAX_SIZE,height:q.IMAGE_MAX_SIZE}),[n,i]=w.useState({width:0,height:0}),[o]=w.useState([Br.TOP_LEFT,Br.TOP_RIGHT,Br.BOTTOM_LEFT,Br.BOTTOM_RIGHT]),[a,s]=w.useState(!1),[l,u]=w.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f}=(M=e==null?void 0:e.node)==null?void 0:M.attrs,d=w.useMemo(()=>{var D;const{src:k,alt:O,width:$,height:C}=(D=e==null?void 0:e.node)==null?void 0:D.attrs,A=Kr($)?`${$}px`:$,P=Kr(C)?`${C}px`:C;return{src:k||void 0,alt:O||void 0,style:{width:A||void 0,height:P||void 0}}},[(L=e==null?void 0:e.node)==null?void 0:L.attrs]),h=w.useMemo(()=>{const{style:{width:k}}=d;return{width:k==="100%"?k:void 0}},[d]);function p(k){i({width:k.target.width,height:k.target.height})}function m(){const{editor:k,getPos:O}=e;k.commands.setNodeSelection(O())}const x=w.useCallback(Bt(()=>{const{editor:k}=e,{width:O}=getComputedStyle(k.view.dom);r($=>({...$,width:Number.parseInt(O,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function g(k,O){k.preventDefault(),k.stopPropagation();const $=n.width,C=n.height,A=$/C;let P=Number(e.node.attrs.width),D=Number(e.node.attrs.height);const U=t.width;P&&!D?(P=P>U?U:P,D=Math.round(P/A)):D&&!P?(P=Math.round(D*A),P=P>U?U:P):!P&&!D?(P=$>U?U:$,D=Math.round(P/A)):P=P>U?U:P,s(!0),u({x:k.clientX,y:k.clientY,w:P,h:D,dir:O})}const y=w.useCallback(Bt(k=>{if(k.preventDefault(),k.stopPropagation(),!a)return;const{x:O,w:$,dir:C}=l,A=(k.clientX-O)*(/l/.test(C)?-1:1),P=Tu($+A,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:P,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),S=w.useCallback(k=>{k.preventDefault(),k.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),m())},[a,m]),E=w.useCallback(()=>{document==null||document.addEventListener("mousemove",y,!0),document==null||document.addEventListener("mouseup",S,!0)},[y,S]),T=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",y,!0),document==null||document.removeEventListener("mouseup",S,!0)},[y,S]);w.useEffect(()=>(a?E():T(),()=>{T()}),[a,E,T]);const j=w.useMemo(()=>new ResizeObserver(()=>x()),[x]);return w.useEffect(()=>(j.observe(e.editor.view.dom),()=>{j.disconnect()}),[e.editor.view.dom,j]),c.jsx(pe.NodeViewWrapper,{className:"image-view",style:{...h,width:"100%",textAlign:f},children:c.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:h,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${a?"image-view__body--resizing":""}`,children:[c.jsx("img",{alt:d.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:p,src:d.src,style:d.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||a)&&c.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(k=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${k}`,onMouseDown:O=>g(O,k)},`image-dir-${k}`))})]})})}const za=Ba.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:n})=>{var o;const i=((o=r==null?void 0:r.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:k1,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),giphyApiKey:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return pe.ReactNodeViewRenderer(N1)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",B.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});function M1(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const i=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(r.hostname)}return r.hostname.includes(n)})}function L1(e){const{t}=q.useLocale(),[r,n]=w.useState(""),i=w.useRef(null),[o,a]=w.useState(""),[s,l]=w.useState(!1),u=m=>{l(m.detail)};w.useEffect(()=>{const m=xr(vt.UPLOAD_VIDEO(e.editor.id),u);return()=>{m()}},[]);const f=w.useMemo(()=>{var x;return(x=e.editor.extensionManager.extensions.find(g=>g.name===Ha.name))==null?void 0:x.options},[e.editor]);async function d(m){var S;const x=(S=m==null?void 0:m.target)==null?void 0:S.files;if(!e.editor||e.editor.isDestroyed||x.length===0)return;const g=x[0];let y="";f.upload?y=await f.upload(g):y=URL.createObjectURL(g),e.editor.chain().focus().setVideo({src:y,width:"100%"}).run(),l(!1)}function h(m){m.preventDefault(),m.stopPropagation(),r&&(e.editor.chain().focus().setVideo({src:r,width:"100%"}).run(),l(!1))}function p(m){var x;m.preventDefault(),(x=i.current)==null||x.click()}return c.jsxs(Cr,{onOpenChange:l,open:s,children:[c.jsx(jr,{asChild:!0,children:c.jsx(W,{action:()=>l(!0),icon:e.icon,tooltip:e.tooltip})}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:t("editor.video.dialog.title")}),c.jsxs(Sd,{activationMode:"manual",defaultValue:(f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload"?"upload":"link",children:[c.jsxs(Xa,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload")&&c.jsx(yr,{value:"upload",children:t("editor.video.dialog.tab.upload")}),((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="link")&&c.jsx(yr,{value:"link",children:t("editor.video.dialog.link")})]}),c.jsxs(br,{value:"upload",children:[c.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:c.jsx(we,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.video.dialog.tab.upload")})}),c.jsx("input",{accept:"video/*",multiple:!0,onChange:d,ref:i,type:"file",style:{display:"none"}})]}),c.jsxs(br,{value:"link",children:[c.jsx("form",{onSubmit:h,children:c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[c.jsx(Te,{autoFocus:!0,placeholder:t("editor.video.dialog.placeholder"),required:!0,type:"url",value:r,onChange:m=>{n(m.target.value)},onBlur:m=>{const x=m.target.value,g=f.videoProviders||["."];x&&!M1(x,g)?a("Invalid video URL"):a("")}}),c.jsx(we,{type:"submit",children:t("editor.video.dialog.button.apply")})]})}),o&&c.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:o})]})]})]})]})}function $1(e,t,r){return e<t?t:e>r?r:e}const _1=e=>typeof e=="number",D1=e=>typeof e=="string",B1=e=>typeof e=="function";function z1(e,t="px"){if(!e)return e;const r=_1(e)?String(e):e,n=Number.parseFloat(r),i=r.match(/[%a-z]+$/i),o=i?i[0]:t;return Number.isNaN(n)?e:n+o}function gd(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(i=>i.name===t)}function H1(e){return e.map(t=>D1(t)?{value:t,name:t}:t)}function q1(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const r=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(r){const i=r[1],o=r[2];o?e=`https://player.vimeo.com/video/${i}?h=${o}`:e=`https://player.vimeo.com/video/${i}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Ha=B.Node.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:q.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var r,n;return{component:L1,componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?q1(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:z1(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:r="center"}=e??{},n={...e,width:"100%",height:"100%"},i=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,o=`flex: 1;padding-bottom: ${9/16*100}%;`,f=["div",{style:`display: flex; justify-content: ${r};`},["div",{style:i},["div",{style:o}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},f]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}}),qa={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function Fa({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?c.jsx(w.Fragment,{children:e.type==="divider"?c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):c.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r})}):c.jsx(c.Fragment,{})}function F1(e){return e.type.name===Ht.name}function U1(e){return e.type.name===za.name}function W1(e){return e.type.name===Ha.name}function G1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(F1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:Yx(e.editor),[e.disabled,e.editor,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-${o}`))})}):c.jsx(c.Fragment,{})})})}function V1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(U1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:Jx(e.editor),[e.disabled,e.editor,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-gif-${o}`))})}):c.jsx(c.Fragment,{})})})}function K1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(W1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:e0(e.editor),[e.editor,e.disabled,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-video-${o}`))})}):c.jsx(c.Fragment,{})})})}function X1(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function Y1(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function J1(e,t,r=null){const n=Y1(e),i=[];for(let o=0;o<t;o+=1){const a=X1(n.column,o,r);a&&i.push(a)}return n.columns.createChecked({cols:t},i)}function ai({state:e,dispatch:t,type:r}){const n=B.findParentNode(o=>o.type.name===vr.name)(e.selection),i=B.findParentNode(o=>o.type.name===Ua.name)(e.selection);if(t&&n&&i){const o=n.node,a=i.node.attrs.index,s=o.toJSON();let l=a;r==="delete"?(l=a-1,s.content.splice(a,1)):(l=r==="addBefore"?a:a+1,s.content.splice(l,0,{type:"column",attrs:{index:a},content:[{type:"paragraph"}]})),s.attrs.cols=s.content.length,s.content.forEach((h,p)=>{h.attrs.index=p});const u=B.Node$1.fromJSON(e.schema,s);let f=n.pos;u.content.forEach((h,p,m)=>{m<l&&(f+=h.nodeSize)});const d=e.tr.setTime(Date.now());d.replaceWith(n.pos,n.pos+n.node.nodeSize,u).setSelection(B.TextSelection.near(d.doc.resolve(f))),t(d)}return!0}function sc({state:e,dispatch:t,type:r}){const n=B.findParentNode(o=>o.type.name===vr.name)(e.selection),i=B.findParentNode(o=>o.type.name===Ua.name)(e.selection);if(t&&n&&i){const o=n.node,a=i.node.attrs.index;let s=0;r==="before"?s=(a-1+o.attrs.cols)%o.attrs.cols:s=(a+1)%o.attrs.cols;let l=n.pos;o.content.forEach((f,d,h)=>{h<s&&(l+=f.nodeSize)});const u=e.tr.setTime(Date.now());return u.setSelection(B.TextSelection.near(u.doc.resolve(l))),t(u),!0}return!1}const Ua=B.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",B.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Z1=B.Extension.create({name:"columnActionButton",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({component:W,componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),xd=200,vr=B.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:xd,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",B.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const i=J1(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(B.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>sc({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>sc({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});function Wa(e,t){const{state:r}=t,n=r.selection.$anchor;let i=!1;if(n.depth)for(let o=n.depth;o>0;o--)n.node(o).type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(n.before(o),n.after(o)).scrollIntoView()),i=!0);else{const o=r.selection.node;o&&o.type.name===e&&(t.chain().deleteSelection().run(),i=!0)}if(!i){const o=n.pos;if(o){const a=r.tr.doc.nodeAt(o);a&&a.type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(o,o+a.nodeSize)),i=!0)}}return i}function Q1({editor:e}){const{t}=q.useLocale(),r=w.useCallback(()=>e.isActive(vr.name),[e]),n=w.useCallback(()=>Wa(vr.name,e),[e]),i=w.useCallback(()=>e.chain().focus().addColBefore().run(),[e]),o=w.useCallback(()=>e.chain().focus().addColAfter().run(),[e]),a=w.useCallback(()=>e.chain().focus().deleteCol().run(),[e]);return c.jsx(pe.BubbleMenu,{editor:e,pluginKey:"columns-bubble-menu",shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:c.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[c.jsx(W,{action:i,icon:"ColumnAddLeft",tooltip:t("editor.table.menu.insertColumnBefore")}),c.jsx(W,{action:o,icon:"ColumnAddRight",tooltip:t("editor.table.menu.insertColumnAfter")}),c.jsx(W,{action:a,icon:"DeleteColumn",tooltip:t("editor.table.menu.deleteColumn")}),c.jsx(W,{action:n,icon:"Trash2",tooltip:t("editor.table.menu.delete_column")})]})})}const vd=fe.Root,yd=fe.Trigger,cc=fe.Portal,lc=fe.Sub,pa=oe.forwardRef(({className:e,inset:t,children:r,...n},i)=>c.jsxs(fe.SubTrigger,{ref:i,className:re("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",t&&"richtext-pl-8",e),...n,children:[r,c.jsx(N.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));pa.displayName=fe.SubTrigger.displayName;const ma=oe.forwardRef(({className:e,...t},r)=>c.jsx(fe.SubContent,{ref:r,className:re("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...t}));ma.displayName=fe.SubContent.displayName;const Ga=oe.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(fe.Portal,{children:c.jsx(fe.Content,{ref:n,sideOffset:t,className:re("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r})}));Ga.displayName=fe.Content.displayName;const ze=oe.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(fe.Item,{ref:n,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t&&"richtext-pl-8",e),...r}));ze.displayName=fe.Item.displayName;const bd=oe.forwardRef(({className:e,children:t,checked:r,...n},i)=>c.jsxs(fe.CheckboxItem,{ref:i,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),checked:r,...n,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:c.jsx(fe.ItemIndicator,{children:c.jsx(N.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));bd.displayName=fe.CheckboxItem.displayName;const ev=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fe.RadioItem,{ref:n,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...r,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:c.jsx(fe.ItemIndicator,{children:c.jsx(N.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));ev.displayName=fe.RadioItem.displayName;const tv=oe.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(fe.Label,{ref:n,className:re("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...r}));tv.displayName=fe.Label.displayName;const Va=oe.forwardRef(({className:e,...t},r)=>c.jsx(fe.Separator,{ref:r,className:re("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));Va.displayName=fe.Separator.displayName;function wd({className:e,...t}){return c.jsx("span",{className:re("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}wd.displayName="DropdownMenuShortcut";const Te=oe.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:re("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:n,...r}));Te.displayName="Input";const rv=Rn("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),Ue=oe.forwardRef(({className:e,...t},r)=>c.jsx(ou.Root,{ref:r,className:re(rv(),e),...t}));Ue.displayName=ou.Root.displayName;const Wt=dr.Root,Gt=dr.Trigger,It=oe.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},i)=>c.jsx(dr.Portal,{children:c.jsx(dr.Content,{ref:i,align:t,sideOffset:r,className:re("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...n})}));It.displayName=dr.Content.displayName;const Be=oe.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>c.jsx(nu.Root,{ref:i,decorative:r,orientation:t,className:re("richtext-shrink-0 richtext-bg-border",t==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...n}));Be.displayName=nu.Root.displayName;const Ka=oe.forwardRef(({className:e,...t},r)=>c.jsx(Vo.Root,{className:re("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",e),...t,ref:r,children:c.jsx(Vo.Thumb,{className:re("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));Ka.displayName=Vo.Root.displayName;const Sd=jt.Root,Xa=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.List,{ref:r,className:re("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));Xa.displayName=jt.List.displayName;const yr=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.Trigger,{ref:r,className:re("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));yr.displayName=jt.Trigger.displayName;const br=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.Content,{ref:r,className:re("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",e),...t}));br.displayName=jt.Content.displayName;const nv=Re.Provider,Ad=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Viewport,{ref:r,className:re("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",e),...t}));Ad.displayName=Re.Viewport.displayName;const iv=Rn("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Cd=oe.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(Re.Root,{ref:n,className:re(iv({variant:t}),e),...r}));Cd.displayName=Re.Root.displayName;const ov=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Action,{ref:r,className:re("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",e),...t}));ov.displayName=Re.Action.displayName;const jd=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Close,{ref:r,className:re("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(N.X,{className:"richtext-h-4 richtext-w-4"})}));jd.displayName=Re.Close.displayName;const Ed=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Title,{ref:r,className:re("richtext-text-sm richtext-font-semibold",e),...t}));Ed.displayName=Re.Title.displayName;const Td=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Description,{ref:r,className:re("richtext-text-sm richtext-opacity-90",e),...t}));Td.displayName=Re.Description.displayName;const av=Rn("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Ya=oe.forwardRef(({className:e,variant:t,size:r,...n},i)=>c.jsx(iu.Root,{ref:i,className:re(av({variant:t,size:r,className:e})),...n}));Ya.displayName=iu.Root.displayName;const sv=Sr.Provider,Ja=Sr.Root,Za=Sr.Trigger,kn=oe.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Sr.Content,{ref:n,sideOffset:t,className:re("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));kn.displayName=Sr.Content.displayName;const cv=1,lv=1e6;let si=0;function uv(){return si=(si+1)%Number.MAX_SAFE_INTEGER,si.toString()}const ci=new Map;function uc(e){if(ci.has(e))return;const t=setTimeout(()=>{ci.delete(e),ur({type:"REMOVE_TOAST",toastId:e})},lv);ci.set(e,t)}function dv(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,cv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?uc(r):e.toasts.forEach(n=>{uc(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const Ur=[];let Wr={toasts:[]};function ur(e){Wr=dv(Wr,e),Ur.forEach(t=>{t(Wr)})}function fv({...e}){const t=uv(),r=i=>ur({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>ur({type:"DISMISS_TOAST",toastId:t});return ur({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Nn(){const[e,t]=oe.useState(Wr);return oe.useEffect(()=>(Ur.push(t),()=>{const r=Ur.indexOf(t);r>-1&&Ur.splice(r,1)}),[e]),{...e,toast:fv,dismiss:r=>ur({type:"DISMISS_TOAST",toastId:r})}}const Id=oe.forwardRef(({className:e,...t},r)=>c.jsx(Go.Root,{ref:r,className:re("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:c.jsx(Go.Indicator,{className:re("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:c.jsx(N.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Id.displayName=Go.Root.displayName;const hv={padding:"0 12px 12px"},Rd=({width:e,maxWidth:t,height:r,onOk:n,children:i})=>{const{t:o}=q.useLocale(),[a,s]=w.useState({width:"",height:"",maxWidth:""});w.useEffect(()=>{s({width:e,height:r,maxWidth:t})},[r,t,e]);function l(u){u.preventDefault(),u.stopPropagation(),n(a)}return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,children:i}),c.jsx(It,{children:c.jsx("div",{style:hv,children:c.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:l,children:[c.jsx(Ue,{className:"mb-[6px]",children:"Width"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.width,required:!0,onChange:u=>s({...a,width:u.target.value})})})}),c.jsx(Ue,{className:"mb-[6px]",children:"Max Width"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.maxWidth,required:!0,onChange:u=>s({...a,maxWidth:u.target.value})})})}),c.jsx(Ue,{className:"mb-[6px]",children:"Height"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.height,required:!0,onChange:u=>s({...a,height:u.target.value})})})}),c.jsx(we,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})},Vt={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function pv(e){const t=Vt.youtube,r=e.matchedUrl;e.validLink=!0;const n=r.split("="),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}/${o}`,e.validId=!0}return e}function mv(e){const t=Vt.youku,r=e.matchedUrl,n=t.idRule,i=new RegExp(n),o=r.match(i);if(o&&o.length>0){const a=o[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${a}`}else e.validId=!1;return e}function gv(e){const t=Vt.bilibili,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function xv(e){const t=Vt.qqvideo,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function vv(e,t){return t.src=e,t.validId=!0,t}function yv(e,t){return t.src=e,t.validId=!0,t}function bv(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function wv(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Sv(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Av(e){const t=Vt.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function Cv(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function jv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Ev(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function Tv(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function Iv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Rv(e,t,r){if(e==="googlemaps")return r.validLink=!0,r.matchedUrl=t,r;const i=Vt[e].linkRule;for(const o of i){const a=new RegExp(o),s=t.match(a);if(s&&s.length>0)return r.validLink=!0,r.matchedUrl=e==="youtube"?s[1]:s[0],r}return r}function Pv(e){var r,n;let t="iframe";return((r=e.includes)!=null&&r.call(e,"youtube")||(n=e.includes)!=null&&n.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function Pd(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const r=Pv(e);if(t=Rv(r,e,t),!t.validLink)return t;switch(r){case"youtube":return pv(t);case"youku":return mv(t);case"bilibili":return gv(t);case"qqvideo":return xv(t);case"amap":return vv(e,t);case"baidu_map":return yv(e,t);case"googlemaps":return bv(e,t);case"modao":return wv(t);case"lanhu":return Sv(t);case"figma":return Av(t);case"canva":return Cv(e,t);case"processon":return jv(e,t);case"codepen":return Ev(t);case"jinshuju":return Tv(e,t);case"iframe":return Iv(e,t);default:return e}}function Od(){const[e]=hd(t=>t.value);return e}const Ov={setDisable:(e,t)=>{On(vt.EDIT(e),t)}},kv="_wrap_5y04w_1",Nv="_innerWrap_5y04w_15",dc={wrap:kv,innerWrap:Nv};function Mv({editor:e,node:t,updateAttributes:r}){const n=Od(),{src:i,width:o,height:a}=t.attrs,[s,l]=w.useState("");function u(){if(!s)return;const d=Pd(s);e.chain().updateAttributes(St.name,{src:(d==null?void 0:d.src)||s}).setNodeSelection(e.state.selection.from).focus().run()}const f=w.useCallback(d=>{r({width:d.width,height:d.height})},[r]);return c.jsxs(pe.NodeViewWrapper,{children:[!i&&c.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]",children:[c.jsx(Te,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:s}),c.jsx(we,{className:"richtext-w-[60px]",onClick:u,children:"OK"})]}),i&&c.jsx(Af.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(a)},onResizeStop:(d,h,p,m)=>{f({width:Number.parseInt(o)+m.width,height:Number.parseInt(a)+m.height})},children:c.jsx("div",{className:pe.clsx(dc.wrap,"render-wrapper"),children:c.jsx("div",{className:dc.innerWrap,style:{pointerEvents:n?"none":"auto"},children:c.jsx("iframe",{className:"richtext-my-[12px] ",src:i})})})})]})}const St=B.Node.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:r,t:n})=>({component:W,componentProps:{action:i=>t.commands.setIframe(i),upload:r.options.upload,disabled:!t.can().setIframe({}),icon:"Iframe",tooltip:n("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:pe.getDatasetAttribute("width")},height:{default:300,parseHTML:pe.getDatasetAttribute("height")},src:{default:null,parseHTML:pe.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",B.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:r,chain:n})=>{var o,a,s;if(((s=(a=(o=t.selection)==null?void 0:o.node)==null?void 0:a.type)==null?void 0:s.name)==this.name)return r.updateAttributes(this.name,e);const i=e||{url:""};return n().insertContent({type:this.name,attrs:i}).run()}}},addInputRules(){return[B.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return pe.ReactNodeViewRenderer(Mv)}});var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nd(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var li,fc;function Md(){if(fc)return li;fc=1;var e=Object.prototype.toString;return li=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},li}var ui,hc;function Lv(){if(hc)return ui;hc=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Md(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var p=h.constructor;return p&&p.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&t.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),d=function(h){if(typeof window>"u"||!f)return l(h);try{return l(h)}catch{return!1}};e=function(p){var m=p!==null&&typeof p=="object",x=r.call(p)==="[object Function]",g=n(p),y=m&&r.call(p)==="[object String]",S=[];if(!m&&!x&&!g)throw new TypeError("Object.keys called on a non-object");var E=a&&x;if(y&&p.length>0&&!t.call(p,0))for(var T=0;T<p.length;++T)S.push(String(T));if(g&&p.length>0)for(var j=0;j<p.length;++j)S.push(String(j));else for(var M in p)!(E&&M==="prototype")&&t.call(p,M)&&S.push(String(M));if(o)for(var L=d(p),k=0;k<s.length;++k)!(L&&s[k]==="constructor")&&t.call(p,s[k])&&S.push(s[k]);return S}}return ui=e,ui}var di,pc;function Qa(){if(pc)return di;pc=1;var e=Array.prototype.slice,t=Md(),r=Object.keys,n=r?function(a){return r(a)}:Lv(),i=Object.keys;return n.shim=function(){if(Object.keys){var a=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);a||(Object.keys=function(l){return t(l)?i(e.call(l)):i(l)})}else Object.keys=n;return Object.keys||n},di=n,di}var fi,mc;function Mn(){if(mc)return fi;mc=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return fi=e,fi}var hi,gc;function es(){return gc||(gc=1,hi=SyntaxError),hi}var pi,xc;function Me(){return xc||(xc=1,pi=TypeError),pi}var mi,vc;function $v(){return vc||(vc=1,mi=Object.getOwnPropertyDescriptor),mi}var gi,yc;function Rt(){if(yc)return gi;yc=1;var e=$v();if(e)try{e([],"length")}catch{e=null}return gi=e,gi}var xi,bc;function ts(){if(bc)return xi;bc=1;var e=Mn(),t=es(),r=Me(),n=Rt();return xi=function(o,a,s){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,h=!!n&&n(o,a);if(e)e(o,a,{configurable:f===null&&h?h.configurable:!f,enumerable:l===null&&h?h.enumerable:!l,value:s,writable:u===null&&h?h.writable:!u});else if(d||!l&&!u&&!f)o[a]=s;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xi}var vi,wc;function rs(){if(wc)return vi;wc=1;var e=Mn(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},vi=t,vi}var yi,Sc;function Pt(){if(Sc)return yi;Sc=1;var e=Qa(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=ts(),o=function(u){return typeof u=="function"&&r.call(u)==="[object Function]"},a=rs()(),s=function(u,f,d,h){if(f in u){if(h===!0){if(u[f]===d)return}else if(!o(h)||!h())return}a?i(u,f,d,!0):i(u,f,d)},l=function(u,f){var d=arguments.length>2?arguments[2]:{},h=e(f);t&&(h=n.call(h,Object.getOwnPropertySymbols(f)));for(var p=0;p<h.length;p+=1)s(u,h[p],f[h[p]],d[h[p]])};return l.supportsDescriptors=!!a,yi=l,yi}var bi={exports:{}},wi,Ac;function ns(){return Ac||(Ac=1,wi=Object),wi}var Si,Cc;function Ld(){return Cc||(Cc=1,Si=Error),Si}var Ai,jc;function _v(){return jc||(jc=1,Ai=EvalError),Ai}var Ci,Ec;function Dv(){return Ec||(Ec=1,Ci=RangeError),Ci}var ji,Tc;function Bv(){return Tc||(Tc=1,ji=ReferenceError),ji}var Ei,Ic;function zv(){return Ic||(Ic=1,Ei=URIError),Ei}var Ti,Rc;function Hv(){return Rc||(Rc=1,Ti=Math.abs),Ti}var Ii,Pc;function qv(){return Pc||(Pc=1,Ii=Math.floor),Ii}var Ri,Oc;function Fv(){return Oc||(Oc=1,Ri=Math.max),Ri}var Pi,kc;function Uv(){return kc||(kc=1,Pi=Math.min),Pi}var Oi,Nc;function Wv(){return Nc||(Nc=1,Oi=Math.pow),Oi}var ki,Mc;function Gv(){return Mc||(Mc=1,ki=Math.round),ki}var Ni,Lc;function Vv(){return Lc||(Lc=1,Ni=Number.isNaN||function(t){return t!==t}),Ni}var Mi,$c;function Kv(){if($c)return Mi;$c=1;var e=Vv();return Mi=function(r){return e(r)||r===0?r:r<0?-1:1},Mi}var Li,_c;function Ln(){return _c||(_c=1,Li=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),Li}var $i,Dc;function is(){if(Dc)return $i;Dc=1;var e=typeof Symbol<"u"&&Symbol,t=Ln();return $i=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},$i}var _i,Bc;function $d(){return Bc||(Bc=1,_i=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),_i}var Di,zc;function _d(){if(zc)return Di;zc=1;var e=ns();return Di=e.getPrototypeOf||null,Di}var Bi,Hc;function Xv(){if(Hc)return Bi;Hc=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var h=0;h<u.length;h+=1)f[h+l.length]=u[h];return f},o=function(l,u){for(var f=[],d=u,h=0;d<l.length;d+=1,h+=1)f[h]=l[d];return f},a=function(s,l){for(var u="",f=0;f<s.length;f+=1)u+=s[f],f+1<s.length&&(u+=l);return u};return Bi=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var f=o(arguments,1),d,h=function(){if(this instanceof d){var y=u.apply(this,i(f,arguments));return Object(y)===y?y:this}return u.apply(l,i(f,arguments))},p=r(0,u.length-f.length),m=[],x=0;x<p;x++)m[x]="$"+x;if(d=Function("binder","return function ("+a(m,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var g=function(){};g.prototype=u.prototype,d.prototype=new g,g.prototype=null}return d},Bi}var zi,qc;function Er(){if(qc)return zi;qc=1;var e=Xv();return zi=Function.prototype.bind||e,zi}var Hi,Fc;function os(){return Fc||(Fc=1,Hi=Function.prototype.call),Hi}var qi,Uc;function as(){return Uc||(Uc=1,qi=Function.prototype.apply),qi}var Fi,Wc;function Yv(){return Wc||(Wc=1,Fi=typeof Reflect<"u"&&Reflect&&Reflect.apply),Fi}var Ui,Gc;function Dd(){if(Gc)return Ui;Gc=1;var e=Er(),t=as(),r=os(),n=Yv();return Ui=n||e.call(r,t),Ui}var Wi,Vc;function ss(){if(Vc)return Wi;Vc=1;var e=Er(),t=Me(),r=os(),n=Dd();return Wi=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return n(e,r,o)},Wi}var Gi,Kc;function Jv(){if(Kc)return Gi;Kc=1;var e=ss(),t=Rt(),r;try{r=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return Gi=n&&typeof n.get=="function"?e([n.get]):typeof o=="function"?function(s){return o(s==null?s:i(s))}:!1,Gi}var Vi,Xc;function Bd(){if(Xc)return Vi;Xc=1;var e=$d(),t=_d(),r=Jv();return Vi=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,Vi}var Ki,Yc;function cs(){if(Yc)return Ki;Yc=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Er();return Ki=r.call(e,t),Ki}var Xi,Jc;function at(){if(Jc)return Xi;Jc=1;var e,t=ns(),r=Ld(),n=_v(),i=Dv(),o=Bv(),a=es(),s=Me(),l=zv(),u=Hv(),f=qv(),d=Fv(),h=Uv(),p=Wv(),m=Gv(),x=Kv(),g=Function,y=function(ie){try{return g('"use strict"; return ('+ie+").constructor;")()}catch{}},S=Rt(),E=Mn(),T=function(){throw new s},j=S?function(){try{return arguments.callee,T}catch{try{return S(arguments,"callee").get}catch{return T}}}():T,M=is()(),L=Bd(),k=_d(),O=$d(),$=as(),C=os(),A={},P=typeof Uint8Array>"u"||!L?e:L(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&L?L([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&L?L(L([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!L?e:L(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!L?e:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&L?L(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":$,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":k,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":m,"%Math.sign%":x,"%Reflect.getPrototypeOf%":O};if(L)try{null.error}catch(ie){var U=L(L(ie));D["%Error.prototype%"]=U}var H=function ie(F){var G;if(F==="%AsyncFunction%")G=y("async function () {}");else if(F==="%GeneratorFunction%")G=y("function* () {}");else if(F==="%AsyncGeneratorFunction%")G=y("async function* () {}");else if(F==="%AsyncGenerator%"){var z=ie("%AsyncGeneratorFunction%");z&&(G=z.prototype)}else if(F==="%AsyncIteratorPrototype%"){var J=ie("%AsyncGenerator%");J&&L&&(G=L(J.prototype))}return D[F]=G,G},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},te=Er(),ne=cs(),ve=te.call(C,Array.prototype.concat),ge=te.call($,Array.prototype.splice),Le=te.call(C,String.prototype.replace),$e=te.call(C,String.prototype.slice),I=te.call(C,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,V=function(F){var G=$e(F,0,1),z=$e(F,-1);if(G==="%"&&z!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&G!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return Le(F,_,function(xe,ye,be,Se){J[J.length]=be?Le(Se,X,"$1"):ye||xe}),J},ee=function(F,G){var z=F,J;if(ne(K,z)&&(J=K[z],z="%"+J[0]+"%"),ne(D,z)){var xe=D[z];if(xe===A&&(xe=H(z)),typeof xe>"u"&&!G)throw new s("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:J,name:z,value:xe}}throw new a("intrinsic "+F+" does not exist!")};return Xi=function(F,G){if(typeof F!="string"||F.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new s('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,F)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=V(F),J=z.length>0?z[0]:"",xe=ee("%"+J+"%",G),ye=xe.name,be=xe.value,Se=!1,Ce=xe.alias;Ce&&(J=Ce[0],ge(z,ve([0,1],Ce)));for(var Ke=1,_e=!0;Ke<z.length;Ke+=1){var je=z[Ke],Xe=$e(je,0,1),Ye=$e(je,-1);if((Xe==='"'||Xe==="'"||Xe==="`"||Ye==='"'||Ye==="'"||Ye==="`")&&Xe!==Ye)throw new a("property names with quotes must have matching quotes");if((je==="constructor"||!_e)&&(Se=!0),J+="."+je,ye="%"+J+"%",ne(D,ye))be=D[ye];else if(be!=null){if(!(je in be)){if(!G)throw new s("base intrinsic for "+F+" exists, but the property is not available.");return}if(S&&Ke+1>=z.length){var Je=S(be,je);_e=!!Je,_e&&"get"in Je&&!("originalValue"in Je.get)?be=Je.get:be=be[je]}else _e=ne(be,je),be=be[je];_e&&!Se&&(D[ye]=be)}}return be},Xi}var Yi,Zc;function Zv(){if(Zc)return Yi;Zc=1;var e=at(),t=ts(),r=rs()(),n=Rt(),i=Me(),o=e("%Math.floor%");return Yi=function(s,l){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,d=!0;if("length"in s&&n){var h=n(s,"length");h&&!h.configurable&&(f=!1),h&&!h.writable&&(d=!1)}return(f||d||!u)&&(r?t(s,"length",l,!0,!0):t(s,"length",l)),s},Yi}var Ji,Qc;function Qv(){if(Qc)return Ji;Qc=1;var e=Er(),t=as(),r=Dd();return Ji=function(){return r(e,t,arguments)},Ji}var el;function Kt(){return el||(el=1,function(e){var t=Zv(),r=Mn(),n=ss(),i=Qv();e.exports=function(a){var s=n(arguments),l=a.length-(arguments.length-1);return t(s,1+(l>0?l:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(bi)),bi.exports}var Zi,tl;function Ae(){if(tl)return Zi;tl=1;var e=at(),t=ss(),r=t([e("%String.prototype.indexOf%")]);return Zi=function(i,o){var a=e(i,!!o);return typeof a=="function"&&r(i,".prototype.")>-1?t([a]):a},Zi}var Qi,rl;function zd(){if(rl)return Qi;rl=1;var e=Qa(),t=Ln()(),r=Ae(),n=ns(),i=r("Array.prototype.push"),o=r("Object.prototype.propertyIsEnumerable"),a=t?n.getOwnPropertySymbols:null;return Qi=function(l,u){if(l==null)throw new TypeError("target must be an object");var f=n(l);if(arguments.length===1)return f;for(var d=1;d<arguments.length;++d){var h=n(arguments[d]),p=e(h),m=t&&(n.getOwnPropertySymbols||a);if(m)for(var x=m(h),g=0;g<x.length;++g){var y=x[g];o(h,y)&&i(p,y)}for(var S=0;S<p.length;++S){var E=p[S];if(o(h,E)){var T=h[E];f[E]=T}}}return f},Qi}var eo,nl;function Hd(){if(nl)return eo;nl=1;var e=zd(),t=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",i=n.split(""),o={},a=0;a<i.length;++a)o[i[a]]=i[a];var s=Object.assign({},o),l="";for(var u in s)l+=u;return n!==l},r=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return eo=function(){return!Object.assign||t()||r()?e:Object.assign},eo}var to,il;function ey(){if(il)return to;il=1;var e=Pt(),t=Hd();return to=function(){var n=t();return e(Object,{assign:n},{assign:function(){return Object.assign!==n}}),n},to}var ro,ol;function ty(){if(ol)return ro;ol=1;var e=Pt(),t=Kt(),r=zd(),n=Hd(),i=ey(),o=t.apply(n()),a=function(l,u){return o(Object,arguments)};return e(a,{getPolyfill:n,implementation:r,shim:i}),ro=a,ro}var no,al;function qd(){if(al)return no;al=1;var e=at(),t=Kt(),r=t(e("String.prototype.indexOf"));return no=function(i,o){var a=e(i,!!o);return typeof a=="function"&&r(i,".prototype.")>-1?t(a):a},no}var io,sl;function ry(){if(sl)return io;sl=1;var e=function(){return typeof(function(){}).name=="string"},t=Object.getOwnPropertyDescriptor;if(t)try{t([],"length")}catch{t=null}e.functionsHaveConfigurableNames=function(){if(!e()||!t)return!1;var i=t(function(){},"name");return!!i&&!!i.configurable};var r=Function.prototype.bind;return e.boundFunctionsHaveNames=function(){return e()&&typeof r=="function"&&(function(){}).bind().name!==""},io=e,io}var oo,cl;function ny(){if(cl)return oo;cl=1;var e=ts(),t=rs()(),r=ry().functionsHaveConfigurableNames(),n=Me();return oo=function(o,a){if(typeof o!="function")throw new n("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||r)&&(t?e(o,"name",a,!0,!0):e(o,"name",a)),o},oo}var ao,ll;function Fd(){if(ll)return ao;ll=1;var e=ny(),t=Me(),r=Object;return ao=e(function(){if(this==null||this!==r(this))throw new t("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),ao}var so,ul;function Ud(){if(ul)return so;ul=1;var e=Fd(),t=Pt().supportsDescriptors,r=Object.getOwnPropertyDescriptor;return so=function(){if(t&&/a/mig.flags==="gim"){var i=r(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(a,"sticky",{get:function(){o+="y"}}),i.get.call(a),o==="dy")return i.get}}return e},so}var co,dl;function iy(){if(dl)return co;dl=1;var e=Pt().supportsDescriptors,t=Ud(),r=Rt(),n=Object.defineProperty,i=Ld(),o=Bd(),a=/a/;return co=function(){if(!e||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=t(),u=o(a),f=r(u,"flags");return(!f||f.get!==l)&&n(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},co}var lo,fl;function oy(){if(fl)return lo;fl=1;var e=Pt(),t=Kt(),r=Fd(),n=Ud(),i=iy(),o=t(n());return e(o,{getPolyfill:n,implementation:r,shim:i}),lo=o,lo}var tr={exports:{}},uo,hl;function Ot(){if(hl)return uo;hl=1;var e=Ln();return uo=function(){return e()&&!!Symbol.toStringTag},uo}var fo,pl;function Wd(){if(pl)return fo;pl=1;var e=Ot()(),t=Ae(),r=t("Object.prototype.toString"),n=function(s){return e&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:r(s)==="[object Arguments]"},i=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&r(s)!=="[object Array]"&&"callee"in s&&r(s.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,fo=o?n:i,fo}const ay={},sy=Object.freeze(Object.defineProperty({__proto__:null,default:ay},Symbol.toStringTag,{value:"Module"})),cy=Nd(sy);var ho,ml;function $n(){if(ml)return ho;ml=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,s=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,d=f?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,p=h?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,x=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,S=String.prototype.slice,E=String.prototype.replace,T=String.prototype.toUpperCase,j=String.prototype.toLowerCase,M=RegExp.prototype.test,L=Array.prototype.concat,k=Array.prototype.join,O=Array.prototype.slice,$=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,D=typeof Symbol=="function"&&typeof Symbol.iterator=="object",U=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===D||!0)?Symbol.toStringTag:null,H=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(v){return v.__proto__}:null);function te(v,b){if(v===1/0||v===-1/0||v!==v||v&&v>-1e3&&v<1e3||M.call(/e/,b))return b;var ae=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof v=="number"){var se=v<0?-$(-v):$(v);if(se!==v){var ce=String(se),Q=S.call(b,ce.length+1);return E.call(ce,ae,"$&_")+"."+E.call(E.call(Q,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(b,ae,"$&_")}var ne=cy,ve=ne.custom,ge=xe(ve)?ve:null,Le={__proto__:null,double:'"',single:"'"},$e={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ho=function v(b,ae,se,ce){var Q=ae||{};if(Se(Q,"quoteStyle")&&!Se(Le,Q.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(Q,"maxStringLength")&&(typeof Q.maxStringLength=="number"?Q.maxStringLength<0&&Q.maxStringLength!==1/0:Q.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var lt=Se(Q,"customInspect")?Q.customInspect:!0;if(typeof lt!="boolean"&&lt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(Q,"indent")&&Q.indent!==null&&Q.indent!==" "&&!(parseInt(Q.indent,10)===Q.indent&&Q.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(Q,"numericSeparator")&&typeof Q.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var bt=Q.numericSeparator;if(typeof b>"u")return"undefined";if(b===null)return"null";if(typeof b=="boolean")return b?"true":"false";if(typeof b=="string")return kt(b,Q);if(typeof b=="number"){if(b===0)return 1/0/b>0?"0":"-0";var Ie=String(b);return bt?te(b,Ie):Ie}if(typeof b=="bigint"){var ut=String(b)+"n";return bt?te(b,ut):ut}var Bn=typeof Q.depth>"u"?5:Q.depth;if(typeof se>"u"&&(se=0),se>=Bn&&Bn>0&&typeof b=="object")return V(b)?"[Array]":"[Object]";var Nt=df(Q,se);if(typeof ce>"u")ce=[];else if(_e(ce,b)>=0)return"[Circular]";function De(Mt,Pr,hf){if(Pr&&(ce=O.call(ce),ce.push(Pr)),hf){var vs={depth:Q.depth};return Se(Q,"quoteStyle")&&(vs.quoteStyle=Q.quoteStyle),v(Mt,vs,se+1,ce)}return v(Mt,Q,se+1,ce)}if(typeof b=="function"&&!ie(b)){var ds=Ke(b),fs=Ir(b,De);return"[Function"+(ds?": "+ds:" (anonymous)")+"]"+(fs.length>0?" { "+k.call(fs,", ")+" }":"")}if(xe(b)){var hs=D?E.call(String(b),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(b);return typeof b=="object"&&!D?ct(hs):hs}if(st(b)){for(var Yt="<"+j.call(String(b.nodeName)),zn=b.attributes||[],Rr=0;Rr<zn.length;Rr++)Yt+=" "+zn[Rr].name+"="+I(_(zn[Rr].value),"double",Q);return Yt+=">",b.childNodes&&b.childNodes.length&&(Yt+="..."),Yt+="</"+j.call(String(b.nodeName))+">",Yt}if(V(b)){if(b.length===0)return"[]";var Hn=Ir(b,De);return Nt&&!uf(Hn)?"["+Dn(Hn,Nt)+"]":"[ "+k.call(Hn,", ")+" ]"}if(F(b)){var qn=Ir(b,De);return!("cause"in Error.prototype)&&"cause"in b&&!H.call(b,"cause")?"{ ["+String(b)+"] "+k.call(L.call("[cause]: "+De(b.cause),qn),", ")+" }":qn.length===0?"["+String(b)+"]":"{ ["+String(b)+"] "+k.call(qn,", ")+" }"}if(typeof b=="object"&&lt){if(ge&&typeof b[ge]=="function"&&ne)return ne(b,{depth:Bn-se});if(lt!=="symbol"&&typeof b.inspect=="function")return b.inspect()}if(je(b)){var ps=[];return n&&n.call(b,function(Mt,Pr){ps.push(De(Pr,b,!0)+" => "+De(Mt,b))}),us("Map",r.call(b),ps,Nt)}if(Je(b)){var ms=[];return s&&s.call(b,function(Mt){ms.push(De(Mt,b))}),us("Set",a.call(b),ms,Nt)}if(Xe(b))return _n("WeakMap");if(Tr(b))return _n("WeakSet");if(Ye(b))return _n("WeakRef");if(z(b))return ct(De(Number(b)));if(ye(b))return ct(De(C.call(b)));if(J(b))return ct(m.call(b));if(G(b))return ct(De(String(b)));if(typeof window<"u"&&b===window)return"{ [object Window] }";if(typeof globalThis<"u"&&b===globalThis||typeof wr<"u"&&b===wr)return"{ [object globalThis] }";if(!ee(b)&&!ie(b)){var Fn=Ir(b,De),gs=K?K(b)===Object.prototype:b instanceof Object||b.constructor===Object,Un=b instanceof Object?"":"null prototype",xs=!gs&&U&&Object(b)===b&&U in b?S.call(Ce(b),8,-1):Un?"Object":"",ff=gs||typeof b.constructor!="function"?"":b.constructor.name?b.constructor.name+" ":"",Wn=ff+(xs||Un?"["+k.call(L.call([],xs||[],Un||[]),": ")+"] ":"");return Fn.length===0?Wn+"{}":Nt?Wn+"{"+Dn(Fn,Nt)+"}":Wn+"{ "+k.call(Fn,", ")+" }"}return String(b)};function I(v,b,ae){var se=ae.quoteStyle||b,ce=Le[se];return ce+v+ce}function _(v){return E.call(String(v),/"/g,"&quot;")}function X(v){return!U||!(typeof v=="object"&&(U in v||typeof v[U]<"u"))}function V(v){return Ce(v)==="[object Array]"&&X(v)}function ee(v){return Ce(v)==="[object Date]"&&X(v)}function ie(v){return Ce(v)==="[object RegExp]"&&X(v)}function F(v){return Ce(v)==="[object Error]"&&X(v)}function G(v){return Ce(v)==="[object String]"&&X(v)}function z(v){return Ce(v)==="[object Number]"&&X(v)}function J(v){return Ce(v)==="[object Boolean]"&&X(v)}function xe(v){if(D)return v&&typeof v=="object"&&v instanceof Symbol;if(typeof v=="symbol")return!0;if(!v||typeof v!="object"||!P)return!1;try{return P.call(v),!0}catch{}return!1}function ye(v){if(!v||typeof v!="object"||!C)return!1;try{return C.call(v),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function(v){return v in this};function Se(v,b){return be.call(v,b)}function Ce(v){return x.call(v)}function Ke(v){if(v.name)return v.name;var b=y.call(g.call(v),/^function\s*([\w$]+)/);return b?b[1]:null}function _e(v,b){if(v.indexOf)return v.indexOf(b);for(var ae=0,se=v.length;ae<se;ae++)if(v[ae]===b)return ae;return-1}function je(v){if(!r||!v||typeof v!="object")return!1;try{r.call(v);try{a.call(v)}catch{return!0}return v instanceof Map}catch{}return!1}function Xe(v){if(!u||!v||typeof v!="object")return!1;try{u.call(v,u);try{d.call(v,d)}catch{return!0}return v instanceof WeakMap}catch{}return!1}function Ye(v){if(!p||!v||typeof v!="object")return!1;try{return p.call(v),!0}catch{}return!1}function Je(v){if(!a||!v||typeof v!="object")return!1;try{a.call(v);try{r.call(v)}catch{return!0}return v instanceof Set}catch{}return!1}function Tr(v){if(!d||!v||typeof v!="object")return!1;try{d.call(v,d);try{u.call(v,u)}catch{return!0}return v instanceof WeakSet}catch{}return!1}function st(v){return!v||typeof v!="object"?!1:typeof HTMLElement<"u"&&v instanceof HTMLElement?!0:typeof v.nodeName=="string"&&typeof v.getAttribute=="function"}function kt(v,b){if(v.length>b.maxStringLength){var ae=v.length-b.maxStringLength,se="... "+ae+" more character"+(ae>1?"s":"");return kt(S.call(v,0,b.maxStringLength),b)+se}var ce=$e[b.quoteStyle||"single"];ce.lastIndex=0;var Q=E.call(E.call(v,ce,"\\$1"),/[\x00-\x1f]/g,Xt);return I(Q,"single",b)}function Xt(v){var b=v.charCodeAt(0),ae={8:"b",9:"t",10:"n",12:"f",13:"r"}[b];return ae?"\\"+ae:"\\x"+(b<16?"0":"")+T.call(b.toString(16))}function ct(v){return"Object("+v+")"}function _n(v){return v+" { ? }"}function us(v,b,ae,se){var ce=se?Dn(ae,se):k.call(ae,", ");return v+" ("+b+") {"+ce+"}"}function uf(v){for(var b=0;b<v.length;b++)if(_e(v[b],`
5
+ 3. "-" cannot repeat`);de.customSchemes.push([e,t])}function J0(){de.scanner=F0(de.customSchemes);for(let e=0;e<de.tokenQueue.length;e++)de.tokenQueue[e][1]({scanner:de.scanner});de.parser=G0(de.scanner.tokens);for(let e=0;e<de.pluginQueue.length;e++)de.pluginQueue[e][1]({scanner:de.scanner,parser:de.parser});return de.initialized=!0,de}function _a(e){return de.initialized||J0(),V0(de.parser.start,e,id(de.scanner.start,e))}_a.scan=id;function ad(e,t=null,r=null){if(t&&typeof t=="object"){if(r)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);r=t,t=null}const n=new $a(r),i=_a(e),o=[];for(let a=0;a<i.length;a++){const s=i[a];s.isLink&&(!t||s.t===t)&&n.check(s)&&o.push(s.toFormattedObject(n))}return o}const Da="[\0-   ᠎ -\u2029  ]",Z0=new RegExp(Da),Q0=new RegExp(`${Da}$`),e1=new RegExp(Da,"g");function t1(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function r1(e){return new B.Plugin({key:new B.PluginKey("autolink"),appendTransaction:(t,r,n)=>{const i=t.some(u=>u.docChanged)&&!r.doc.eq(n.doc),o=t.some(u=>u.getMeta("preventAutolink"));if(!i||o)return;const{tr:a}=n,s=B.combineTransactionSteps(r.doc,[...t]);if(B.getChangedRanges(s).forEach(({newRange:u})=>{const f=B.findChildrenInRange(n.doc,u,p=>p.isTextblock);let d,h;if(f.length>1)d=f[0],h=n.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(f.length){const p=n.doc.textBetween(u.from,u.to," "," ");if(!Q0.test(p))return;d=f[0],h=n.doc.textBetween(d.pos,u.to,void 0," ")}if(d&&h){const p=h.split(Z0).filter(Boolean);if(p.length<=0)return!1;const m=p[p.length-1],x=d.pos+h.lastIndexOf(m);if(!m)return!1;const g=_a(m).map(y=>y.toObject(e.defaultProtocol));if(!t1(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:x+y.start+1,to:x+y.end+1})).filter(y=>n.schema.marks.code?!n.doc.rangeHasMark(y.from,y.to,n.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{B.getMarksBetween(y.from,y.to,n.doc).some(S=>S.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function n1(e){return new B.Plugin({key:new B.PluginKey("handleClickLink"),props:{handleClick:(t,r,n)=>{var i,o;if(n.button!==0||!t.editable)return!1;let a=n.target;const s=[];for(;a.nodeName!=="DIV";)s.push(a),a=a.parentNode;if(!s.find(h=>h.nodeName==="A"))return!1;const l=B.getAttributes(t.state,e.type.name),u=n.target,f=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,d=(o=u==null?void 0:u.target)!==null&&o!==void 0?o:l.target;return u&&f?(window.open(f,d),!0):!1}}})}function i1(e){return new B.Plugin({key:new B.PluginKey("handlePasteLink"),props:{handlePaste:(t,r,n)=>{const{state:i}=t,{selection:o}=i,{empty:a}=o;if(a)return!1;let s="";n.content.forEach(u=>{s+=u.textContent});const l=ad(s,{defaultProtocol:e.defaultProtocol}).find(u=>u.isLink&&u.value===s);return!s||!l?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function wt(e,t){const r=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&r.push(i)}),!e||e.replace(e1,"").match(new RegExp(`^(?:(?:${r.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const o1=B.Mark.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){ic(e);return}ic(e.scheme,e.optionalSlashes)})},onDestroy(){Y0()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!wt(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:r=>!!wt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!wt(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",B.mergeAttributes(this.options.HTMLAttributes,e),0]:["a",B.mergeAttributes(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:r}=e;return this.options.isAllowedUri(r,{defaultValidate:n=>!!wt(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:r}=e;return this.options.isAllowedUri(r,{defaultValidate:n=>!!wt(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[B.markPasteRule({find:e=>{const t=[];if(e){const{protocols:r,defaultProtocol:n}=this.options,i=ad(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:a=>!!wt(a,r),protocols:r,defaultProtocol:n}));i.length&&i.forEach(o=>t.push({text:o.value,data:{href:o.href},index:o.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:r}=this.options;return this.options.autolink&&e.push(r1({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!wt(i,t),protocols:t,defaultProtocol:r}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(n1({type:this.type})),this.options.linkOnPaste&&e.push(i1({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}});function a1(e){const[t,r]=w.useState(!1);function n(i,o,a){e.action&&(e.action({link:i,text:o,openInNewTab:a}),r(!1))}return c.jsxs(Wt,{modal:!0,open:t,onOpenChange:r,children:[c.jsx(Gt,{disabled:e==null?void 0:e.disabled,asChild:!0,children:c.jsx(W,{tooltip:e==null?void 0:e.tooltip,isActive:e==null?void 0:e.isActive,disabled:e==null?void 0:e.disabled,children:c.jsx(me,{name:e==null?void 0:e.icon})})}),c.jsx(It,{hideWhenDetached:!0,className:"richtext-w-full",align:"start",side:"bottom",children:c.jsx(cd,{editor:e.editor,onSetLink:n})})]})}const sd=o1.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",B.mergeAttributes(this.options.HTMLAttributes,e,{class:"link"}),0]},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),openOnClick:!0,button:({editor:t,t:r})=>({component:a1,componentProps:{editor:t,action:n=>{const{link:i,text:o,openInNewTab:a}=n,{state:s}=t,{from:l}=s.selection,u=o.length,f=l+u;t.chain().extendMarkRange("link").insertContent({type:"text",text:o,marks:[{type:"link",attrs:{href:i,target:a?"_blank":""}}]}).setLink({href:i}).setTextSelection({from:l,to:f}).focus().run()},id:"linkk",isActive:()=>t.isActive("link")||!1,disabled:!t.can().setLink({href:""}),icon:"Link",tooltip:r("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new B.Plugin({props:{handleClick:(e,t)=>{const{schema:r,doc:n,tr:i}=e.state,o=B.getMarkRange(n.resolve(t),r.marks.link);if(!o)return!1;const a=n.resolve(o.from),s=n.resolve(o.to),l=i.setSelection(new B.TextSelection(a,s));e.dispatch(l)}}})]}});function cd(e){const{t}=q.useLocale(),[r,n]=w.useState({text:"",link:""}),[i,o]=w.useState(!1);w.useEffect(()=>{const s=()=>{var l,u,f;if((l=e.editor)!=null&&l.isActive("link")){const{href:d,target:h}=e.editor.getAttributes("link"),{from:p,to:m}=e.editor.state.selection,x=e.editor.state.doc.textBetween(p,m," ");n({link:d||"",text:x}),o(h==="_blank")}else{const d=(u=e.editor.extensionManager.extensions.find(h=>h.name===sd.name))==null?void 0:u.options;o(((f=d==null?void 0:d.HTMLAttributes)==null?void 0:f.target)==="_blank")}};return s(),e.editor.on("selectionUpdate",s),()=>{e.editor.off("selectionUpdate",s)}},[e.editor]);function a(s){s.preventDefault(),s.stopPropagation(),e==null||e.onSetLink(r.link,r.text,i),n({text:"",link:""})}return c.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:c.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-gap-2",children:[c.jsx(Ue,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),c.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:c.jsx(Te,{className:"richtext-w-80",onChange:s=>n({...r,text:s.target.value}),placeholder:"Text",required:!0,type:"text",value:r.text})})}),c.jsx(Ue,{className:"mb-[6px]",children:t("editor.link.dialog.link")}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsxs("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:[c.jsx(Te,{className:"richtext-pl-10",onChange:s=>n({...r,link:s.target.value}),required:!0,type:"url",value:r.link}),c.jsx("span",{className:"richtext-absolute richtext-inset-y-0 richtext-start-0 richtext-flex richtext-items-center richtext-justify-center richtext-px-2",children:c.jsx(me,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-space-x-2",children:[c.jsx(Ue,{children:t("editor.link.dialog.openInNewTab")}),c.jsx(Ka,{checked:i,onCheckedChange:s=>{o(s)}})]}),c.jsx(we,{className:"richtext-mt-2 richtext-self-end",onClick:a,type:"button",children:t("editor.link.dialog.button.apply")})]})})}function s1(e){const{t}=q.useLocale();return c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2 richtext-p-2 richtext-bg-white !richtext-border richtext-rounded-lg richtext-shadow-sm dark:richtext-bg-black richtext-border-neutral-200 dark:richtext-border-neutral-800",children:[c.jsx("a",{href:e==null?void 0:e.link,target:"_blank",rel:"noopener noreferrer",className:"richtext-text-sm richtext-underline richtext-break-all",children:lx(e==null?void 0:e.link,{length:50,omission:"…"})}),(e==null?void 0:e.link)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-4"}),c.jsxs("div",{className:"richtext-flex richtext-flex-nowrap",children:[c.jsx(W,{icon:"Pencil",tooltip:t("editor.link.edit.tooltip"),action:()=>{e==null||e.onEdit()},tooltipOptions:{sideOffset:15}}),c.jsx(W,{icon:"Unlink",tooltip:t("editor.link.unlink.tooltip"),action:()=>{e==null||e.onClear()},tooltipOptions:{sideOffset:15}})]})]})}function c1({editor:e,disabled:t}){const[r,n]=w.useState(!1),i=w.useMemo(()=>{const{href:l}=e.getAttributes("link");return l},[e]),o=w.useCallback(({editor:l})=>l.isActive("link"),[]),a=(l,u,f)=>{const d=e.state.selection,{from:h}=d,p=(u==null?void 0:u.length)??0,m=h+p;e.chain().extendMarkRange("link").insertContent({type:"text",text:u,marks:[{type:"link",attrs:{href:l,target:f?"_blank":""}}]}).setLink({href:l}).setTextSelection({from:h,to:m}).focus().run(),n(!1)},s=w.useCallback(()=>{e.chain().extendMarkRange("link").unsetLink().focus().run(),n(!1)},[e]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e,shouldShow:o,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n(!1)}},children:t?c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{children:r?c.jsx(cd,{onSetLink:a,editor:e}):c.jsx(s1,{editor:e,onClear:s,onEdit:()=>{n(!0)},link:i})})})})}const l1=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ba=B.Node.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",B.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[B.nodeInputRule({find:l1,type:this.type,getAttributes:e=>{const[,,t,r,n]=e;return{src:r,alt:t,title:n}}})]}}),Cr=ke.Root,jr=ke.Trigger,u1=ke.Portal,ld=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Overlay,{ref:r,className:re("richtext-fixed richtext-inset-0 richtext-z-50 richtext-bg-black/80 richtext- data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0",e),...t}));ld.displayName=ke.Overlay.displayName;const Ft=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(u1,{children:[c.jsx(ld,{}),c.jsxs(ke.Content,{ref:n,className:re("richtext-dialog-content richtext-fixed richtext-left-[50%] richtext-top-[50%] richtext-z-50 richtext-grid richtext-w-full richtext-max-w-lg richtext-translate-x-[-50%] richtext-translate-y-[-50%] richtext-gap-4 richtext-border richtext-bg-background richtext-p-6 richtext-shadow-lg richtext-duration-200 data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[state=closed]:richtext-slide-out-to-left-1/2 data-[state=closed]:richtext-slide-out-to-top-[48%] data-[state=open]:richtext-slide-in-from-left-1/2 data-[state=open]:richtext-slide-in-from-top-[48%] sm:richtext-rounded-lg",e),...r,children:[t,c.jsxs(ke.Close,{className:"richtext-absolute richtext-right-4 richtext-top-4 richtext-rounded-sm richtext-opacity-70 richtext-ring-offset-background richtext-transition-opacity hover:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none data-[state=open]:richtext-bg-accent data-[state=open]:richtext-text-muted-foreground",children:[c.jsx(N.X,{className:"richtext-h-4 richtext-w-4"}),c.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));Ft.displayName=ke.Content.displayName;function ud({className:e,...t}){return c.jsx("div",{className:re("richtext-flex richtext-flex-col richtext-space-y-1.5 richtext-text-center sm:richtext-text-left",e),...t})}ud.displayName="DialogHeader";function In({className:e,...t}){return c.jsx("div",{className:re("richtext-flex richtext-flex-col-reverse sm:richtext-flex-row sm:richtext-justify-end sm:richtext-space-x-2",e),...t})}In.displayName="DialogFooter";const Ut=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Title,{ref:r,className:re("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));Ut.displayName=ke.Title.displayName;const d1=oe.forwardRef(({className:e,...t},r)=>c.jsx(ke.Description,{ref:r,className:re("richtext-text-sm richtext-text-muted-foreground",e),...t}));d1.displayName=ke.Description.displayName;const oc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ac=pe.clsx,Rn=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return ac(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(u=>{const f=r==null?void 0:r[u],d=o==null?void 0:o[u];if(f===null)return null;const h=oc(f)||oc(d);return i[u][h]}),s=r&&Object.entries(r).reduce((u,f)=>{let[d,h]=f;return h===void 0||(u[d]=h),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,f)=>{let{class:d,className:h,...p}=f;return Object.entries(p).every(m=>{let[x,g]=m;return Array.isArray(g)?g.includes({...o,...s}[x]):{...o,...s}[x]===g})?[...u,d,h]:u},[]);return ac(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},f1=Rn("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50",{variants:{variant:{default:"!richtext-bg-primary !richtext-text-primary-foreground hover:!richtext-bg-primary/90",destructive:"richtext-bg-destructive richtext-text-destructive-foreground hover:richtext-bg-destructive/90",outline:"richtext-border richtext-border-input richtext-bg-background hover:richtext-bg-accent hover:richtext-text-accent-foreground",secondary:"richtext-bg-secondary richtext-text-secondary-foreground hover:richtext-bg-secondary/80",ghost:"hover:richtext-bg-accent hover:richtext-text-accent-foreground",link:"richtext-text-primary richtext-underline-offset-4 hover:richtext-underline"},size:{default:"richtext-h-10 richtext-px-4 richtext-py-2",sm:"richtext-h-9 richtext-rounded-md richtext-px-3",lg:"richtext-h-11 richtext-rounded-md richtext-px-8",icon:"richtext-h-10 richtext-w-10"}},defaultVariants:{variant:"default",size:"default"}}),we=oe.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const a=n?tu.Slot:"button";return c.jsx(a,{className:re(f1({variant:t,size:r,className:e})),ref:o,...i})});we.displayName="Button";function h1(e){return e.replace(/^.*\/|\..+$/g,"")}function p1(e){return e.split(".").pop()}function m1(e){return e<1024?`${e} Byte`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function g1(e){return e?e==="application/pdf"?"pdf":e.startsWith("application/")&&[".document","word"].some(t=>e.includes(t))?"word":e.startsWith("application/")&&["presentation"].some(t=>e.includes(t))?"excel":e.startsWith("application/")&&["sheet"].some(t=>e.includes(t))?"ppt":e.startsWith("image")?"image":e.startsWith("audio")?"audio":e.startsWith("video")?"video":"file":"file"}function x1(e){return new Promise(t=>{const r=new FileReader;r.addEventListener("load",()=>{t({alt:e.name,src:r.result})},!1),r.readAsDataURL(e)})}function dd(e,t){const r=e.split(","),n=r[0].match(/:(.*?);/)[1],i=atob(r[r.length-1]);let o=i.length;const a=new Uint8Array(o);for(;o--;)a[o]=i.charCodeAt(o);return new File([a],t,{type:n})}function v1(e,t){const r=e.type,n=e.name.toLowerCase(),i=n.split(".").pop();if(!i)return!1;const a=r||{heif:"image/heif",heic:"image/heic",dng:"image/x-adobe-dng",cr2:"image/x-canon-cr2",nef:"image/x-nikon-nef",arw:"image/x-sony-arw",raf:"image/x-fuji-raf",orf:"image/x-olympus-orf"}[i];return t.some(s=>{if(s.startsWith("."))return n.endsWith(s);if(s.endsWith("/*")){const l=s.split("/")[0];return a==null?void 0:a.startsWith(l+"/")}return a===s})}function fd(e,t){const{acceptMimes:r,maxSize:n,t:i,toast:o}=t,a=[];return(Array.isArray(e)?e:Object.values(e)).forEach(l=>{if(!v1(l,r)){t.onError?t.onError({type:"type",message:i("editor.upload.fileTypeNotSupported",{fileName:l.name}),file:l}):o({variant:"default",title:i("editor.upload.fileTypeNotSupported",{fileName:l.name})});return}if(l.size>n){const u=(n/1024/1024).toFixed(2);t.onError?t.onError({type:"size",message:i("editor.upload.fileSizeTooBig",{fileName:l.name,size:u}),file:l}):o({variant:"default",title:i("editor.upload.fileSizeTooBig",{fileName:l.name,size:u})});return}a.push(l)}),a}function y1({editor:e,imageInline:t,onClose:r,disabled:n,alt:i}){var $,C;const{t:o}=q.useLocale(),{toast:a}=Nn(),[s,l]=w.useState(!1),[u,f]=w.useState(!1),d=w.useRef(null),[h,p]=w.useState(),[m,x]=w.useState(""),g=w.useRef(null),[y,S]=w.useState({src:"",file:null}),E=w.useMemo(()=>{var A;return(A=e.extensionManager.extensions.find(P=>P.name===Ht.name))==null?void 0:A.options},[e]);function T(A){if(d.current&&A.width&&A.height){const P=j(d.current,A);x(P)}}function j(A,P){const D=document.createElement("canvas"),U=A.naturalWidth/A.width,H=A.naturalHeight/A.height;D.width=P.width*U,D.height=P.height*H;const K=D.getContext("2d");return K&&(K.imageSmoothingEnabled=!1,K.drawImage(A,P.x*U,P.y*H,P.width*U,P.height*H,0,0,P.width*U,P.height*H)),D.toDataURL("image/png",1)}const M=w.useCallback(async()=>{var A;if(!u){f(!0);try{const P=dd(m,((A=y==null?void 0:y.file)==null?void 0:A.name)||"image.png");let D="";E.upload?D=await E.upload(P):D=URL.createObjectURL(P),e.chain().focus().setImageInline({src:D,inline:t,alt:i}).run(),l(!1),S({src:"",file:null}),O(),r()}catch(P){console.log("Error cropping image",P)}finally{f(!1)}}},[m,e,t,u,r,($=y==null?void 0:y.file)==null?void 0:$.name,E]);function L(A){var P;A.preventDefault(),(P=g.current)==null||P.click()}const k=async A=>{var K;const P=(K=A==null?void 0:A.target)==null?void 0:K.files;if(!e||e.isDestroyed||P.length===0){A.target.value="";return}const D=fd(P,{acceptMimes:E==null?void 0:E.acceptMimes,maxSize:E==null?void 0:E.maxSize,t:o,toast:a,onError:E.onError});if(D.length<=0){A.target.value="";return}const U=D[0],H=await x1(U);l(!0),S({src:H.src,file:U})},O=()=>{g.current&&(g.current.value="")};return c.jsxs(c.Fragment,{children:[c.jsx(we,{className:"richtext-mt-1 richtext-w-full",disabled:n,onClick:L,size:"sm",children:o("editor.image.dialog.tab.uploadCrop")}),c.jsxs(Cr,{open:s,onOpenChange:A=>{l(A),A||(S({src:"",file:null}),O())},children:[c.jsx(jr,{}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:o("editor.image.dialog.tab.uploadCrop")}),c.jsx("div",{children:y.src&&c.jsx(Cf,{className:"richtext-w-full",crop:h,onChange:A=>p(A),onComplete:A=>T(A),children:c.jsx("img",{alt:"Crop me",ref:d,src:y.src})})}),c.jsxs(In,{children:[c.jsxs(we,{disabled:u,onClick:()=>{l(!1),S({src:"",file:null}),O()},children:[o("editor.imageUpload.cancel"),c.jsx(me,{className:"richtext-ml-1",name:"Trash2"})]}),c.jsx(we,{className:"richtext-w-fit",disabled:u||!h,onClick:M,children:u?c.jsxs(c.Fragment,{children:[o("editor.imageUpload.uploading"),c.jsx(me,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):c.jsxs(c.Fragment,{children:[o("editor.imageUpload.crop"),c.jsx(me,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),c.jsx("input",{accept:((C=E==null?void 0:E.acceptMimes)==null?void 0:C.join(","))||"image/*",multiple:!1,onChange:k,ref:g,style:{display:"none"},type:"file"})]})}function Pn(e){function t(){const o=w.useRef(e),a=w.useCallback(()=>o.current,[]),s=w.useRef(new Set),l=w.useCallback(f=>{o.current={...o.current,...f},s.current.forEach(d=>d())},[]),u=w.useCallback(f=>(s.current.add(f),()=>s.current.delete(f)),[]);return{get:a,set:l,subscribe:u}}const r=w.createContext(null);function n({children:o}){return c.jsx(r.Provider,{value:t(),children:o})}function i(o){const a=w.useContext(r);if(!a)throw new Error("Store not found");return[w.useSyncExternalStore(a.subscribe,()=>o(a.get()),()=>o(e)),a.set]}return{Provider:n,useStore:i}}Pn({value:!1});Pn({value:!1});const{Provider:b1,useStore:hd}=Pn({value:!1}),{Provider:w1,useStore:pd}=Pn({value:"light"});q.d("0");function xr(e,t){return window.addEventListener(e,t),()=>{window.removeEventListener(e,t)}}function On(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const vt={UPLOAD_IMAGE:e=>`UPLOAD_IMAGE-${e}`,UPLOAD_VIDEO:e=>`UPLOAD_VIDEO-${e}`,EDIT:e=>`EDIT-${e}`,UPDATE_THEME:e=>`UPDATE_THEME-${e}`,SEARCH_REPLCE:"SEARCH_REPLACE"},md={setOpen:(e,t)=>{On(vt.UPLOAD_IMAGE(e),t)}};function S1(e){var T;const{t}=q.useLocale(),{toast:r}=Nn(),[n,i]=w.useState(!1),[o,a]=w.useState(!1),s=j=>{i(j.detail)},[l,u]=w.useState(""),[f,d]=w.useState(""),h=w.useRef(null),p=((T=e.editor.extensionManager.extensions.find(j=>j.name===Ht.name))==null?void 0:T.options.defaultInline)||!1,[m,x]=w.useState(p),g=w.useMemo(()=>{var M;return(M=e.editor.extensionManager.extensions.find(L=>L.name===Ht.name))==null?void 0:M.options},[e.editor]);w.useEffect(()=>{const j=xr(vt.UPLOAD_IMAGE(e.editor.id),s);return()=>{j()}},[]);async function y(j){var k;const M=(k=j==null?void 0:j.target)==null?void 0:k.files;if(!e.editor||e.editor.isDestroyed||M.length===0||o){j.target.value="";return}const L=fd(M,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t,toast:r,onError:g.onError});if(L.length<=0){j.target.value="";return}a(!0);try{if(g!=null&&g.multiple){const O=L.map(async C=>{let A="";return g.upload?A=await g.upload(C):A=URL.createObjectURL(C),A});(await Promise.all(O)).forEach(C=>{e.editor.chain().focus().setImageInline({src:C,inline:m,alt:f}).run()})}else{const O=L[0];let $="";g.upload?$=await g.upload(O):$=URL.createObjectURL(O),e.editor.chain().focus().setImageInline({src:$,inline:m,alt:f}).run()}i(!1),d(""),x(p)}catch(O){console.error("Error uploading image",O),g.onError?g.onError({type:"upload",message:t("editor.upload.error")}):r({variant:"destructive",title:t("editor.upload.error")})}finally{a(!1),j.target.value=""}}function S(j){j.preventDefault(),j.stopPropagation(),e.editor.chain().focus().setImageInline({src:l,inline:m,alt:f}).run(),i(!1),x(p),u(""),d("")}function E(j){var M;j.preventDefault(),(M=h.current)==null||M.click()}return c.jsxs(Cr,{onOpenChange:i,open:n,children:[c.jsx(jr,{asChild:!0,children:c.jsx(W,{action:()=>i(!0),icon:e.icon,tooltip:e.tooltip})}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:t("editor.image.dialog.title")}),c.jsxs(Sd,{activationMode:"manual",defaultValue:g.resourceImage==="both"||g.resourceImage==="upload"?"upload":"link",children:[c.jsxs(Xa,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[g.resourceImage==="both"||g.resourceImage==="upload"?c.jsx(yr,{value:"upload",children:t("editor.image.dialog.tab.upload")}):c.jsx(c.Fragment,{}),g.resourceImage==="both"||g.resourceImage==="link"?c.jsx(yr,{value:"link",children:t("editor.image.dialog.tab.url")}):c.jsx(c.Fragment,{})]}),c.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[c.jsx(Id,{checked:m,onCheckedChange:j=>{x(j)}}),c.jsx(Ue,{children:t("editor.link.dialog.inline")})]}),g.enableAlt&&c.jsxs("div",{className:"richtext-my-[10px] ",children:[c.jsx(Ue,{className:"mb-[6px]",children:t("editor.imageUpload.alt")}),c.jsx(Te,{onChange:j=>d(j.target.value),required:!0,type:"text",value:f})]}),c.jsxs(br,{value:"upload",children:[c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[c.jsx(we,{className:"richtext-mt-1 richtext-w-full",disabled:o,onClick:E,size:"sm",children:o?c.jsxs(c.Fragment,{children:[t("editor.imageUpload.uploading"),c.jsx(me,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):t("editor.image.dialog.tab.upload")}),c.jsx(y1,{alt:f,disabled:o,editor:e.editor,imageInline:m,onClose:()=>{md.setOpen(e.editor.id,!1),d("")}})]}),c.jsx("input",{accept:g.acceptMimes.join(",")||"image/*",multiple:g.multiple,onChange:y,ref:h,style:{display:"none"},type:"file"})]}),c.jsx(br,{value:"link",children:c.jsx("form",{onSubmit:S,children:c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[c.jsx(Te,{autoFocus:!0,onChange:j=>u(j.target.value),placeholder:t("editor.image.dialog.placeholder"),required:!0,type:"url",value:l}),c.jsx(we,{type:"submit",children:t("editor.image.dialog.button.apply")})]})})})]})]})]})}const Dr={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function A1(e){var k,O,$;const[t,r]=w.useState({width:q.IMAGE_MAX_SIZE,height:q.IMAGE_MAX_SIZE}),[n,i]=w.useState({width:0,height:0}),[o]=w.useState([Dr.TOP_LEFT,Dr.TOP_RIGHT,Dr.BOTTOM_LEFT,Dr.BOTTOM_RIGHT]),[a,s]=w.useState(!1),[l,u]=w.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f,inline:d}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,h=d&&(f==="left"||f==="right"),p=w.useMemo(()=>{var Le;const{src:C,alt:A,width:P,height:D,flipX:U,flipY:H}=(Le=e==null?void 0:e.node)==null?void 0:Le.attrs,K=Kr(P)?`${P}px`:P,te=Kr(D)?`${D}px`:D,ne=[];U&&ne.push("rotateX(180deg)"),H&&ne.push("rotateY(180deg)");const ve=ne.join(" ");return{src:C||void 0,alt:A||void 0,style:{width:K||void 0,height:te||void 0,transform:ve||"none",...h?{float:f}:{}}}},[(O=e==null?void 0:e.node)==null?void 0:O.attrs]),m=w.useMemo(()=>{const{style:{width:C}}=p;return{width:C==="100%"?C:void 0}},[p]);function x(C){i({width:C.target.width,height:C.target.height})}function g(){const{editor:C,getPos:A}=e;C.commands.setNodeSelection(A())}const y=w.useCallback(Bt(()=>{const{editor:C}=e,{width:A}=getComputedStyle(C.view.dom);r(P=>({...P,width:Number.parseInt(A,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(C,A){C.preventDefault(),C.stopPropagation();const P=n.width,D=n.height,U=P/D;let H=Number(e.node.attrs.width),K=Number(e.node.attrs.height);const te=t.width;H&&!K?(H=H>te?te:H,K=Math.round(H/U)):K&&!H?(H=Math.round(K*U),H=H>te?te:H):!H&&!K?(H=P>te?te:P,K=Math.round(H/U)):H=H>te?te:H,s(!0),u({x:C.clientX,y:C.clientY,w:H,h:K,dir:A})}const E=w.useCallback(Bt(C=>{if(C.preventDefault(),C.stopPropagation(),!a)return;const{x:A,w:P,dir:D}=l,U=(C.clientX-A)*(/l/.test(D)?-1:1),H=Tu(P+U,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:H,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),T=w.useCallback(C=>{C.preventDefault(),C.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),g())},[a,g]),j=w.useCallback(()=>{document==null||document.addEventListener("mousemove",E,!0),document==null||document.addEventListener("mouseup",T,!0)},[E,T]),M=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",E,!0),document==null||document.removeEventListener("mouseup",T,!0)},[E,T]);w.useEffect(()=>(a?j():M(),()=>{M()}),[a,j,M]);const L=w.useMemo(()=>new ResizeObserver(()=>y()),[y]);return w.useEffect(()=>(L.observe(e.editor.view.dom),()=>{L.disconnect()}),[e.editor.view.dom,L]),c.jsx(pe.NodeViewWrapper,{as:d?"span":"div",className:"image-view",style:{float:h?f:void 0,margin:h?f==="left"?"1em 1em 1em 0":"1em 0 1em 1em":void 0,display:d?"inline":"block",textAlign:h?void 0:f,width:(($=p.style)==null?void 0:$.width)??"auto",...h?{}:m},children:c.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:m,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${a?"image-view__body--resizing":""}`,children:[c.jsx("img",{alt:p.alt,className:"image-view__body__image block",height:"auto",onClick:g,onLoad:x,src:p.src,style:p.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||a)&&c.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(C=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${C}`,onMouseDown:A=>S(A,C)},`image-dir-${C}`))})]})})}const Dt=new B.PluginKey("upload-image");function C1(){return new B.Plugin({key:Dt,state:{init(){return B.DecorationSet.empty},apply(e,t){t=t.map(e.mapping,e.doc);const r=e.getMeta(Dt);if(r!=null&&r.add)for(const{id:n,pos:i,src:o}of r.add){const a=j1(o),s=B.Decoration.widget(i,a,{id:n});t=t.add(e.doc,[s])}else if(r!=null&&r.remove)for(const n of r.remove)t=t.remove(t.find(void 0,void 0,i=>i.id===n));return t}},props:{decorations(e){return this.getState(e)}}})}function j1(e){const t=document.createElement("div"),r=document.createElement("img");return r.setAttribute("class","opacity-50"),r.src=e,r.addEventListener("load",()=>{t.setAttribute("class","img-placeholder")}),t.append(r),t}function E1(e,t){var i;const n=Dt.getState(e).find(void 0,void 0,o=>o.id===t);return n.length>0?(i=n[0])==null?void 0:i.from:null}function T1({validateFn:e,onUpload:t,postUpload:r,defaultInline:n=!1}){return(i,o,a)=>{for(const s of i){if(e&&!e(s))continue;const l=Date.now().toString(),u=o.state.tr;u.selection.empty||u.deleteSelection();const f=URL.createObjectURL(s);u.setMeta(Dt,{add:[{id:l,pos:a,src:f}]}),o.dispatch(u),t(s).then(async d=>{var S;r&&typeof d=="string"&&(d=await r(d));const{schema:h}=o.state;let p=E1(o.state,l);if(p===null)return;const m=typeof d=="object"?f:d,x=(S=h.nodes.image)==null?void 0:S.create({src:m,inline:n});if(!x)return;const{doc:g}=o.state;p>g.content.size&&(p=g.content.size-1);const y=o.state.tr.replaceWith(p,p,x).setMeta(Dt,{remove:[l]});o.dispatch(y)},()=>{const d=o.state.tr.delete(a,a).setMeta(Dt,{remove:[l]});o.dispatch(d)})}}}function I1(e,t,r){var i;const n=[...((i=t.clipboardData)==null?void 0:i.files)||[]];if(n.length>0){t.preventDefault();const o=e.state.selection.from;return r(n,e,o+1),!0}return!1}function R1(e,t,r,n){var o;const i=[...((o=t.dataTransfer)==null?void 0:o.files)||[]];if(!r&&i.length>0){t.preventDefault();const a=e.posAtCoords({left:t.clientX,top:t.clientY});if(a)return n(i,e,a.pos+1),!0}return!1}const P1={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5,multiple:!0,resourceImage:"both",defaultInline:!1,enableAlt:!0},Ht=Ba.extend({group:"inline",inline:!0,defining:!0,draggable:!0,selectable:!0,addOptions(){var e;return{...P1,...(e=this.parent)==null?void 0:e.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:t,extension:r,t:n})=>{var i,o;return{component:S1,componentProps:{action:()=>!0,upload:r.options.upload,disabled:!((o=(i=t.can()).setImage)!=null&&o.call(i,{})),icon:"ImageUp",tooltip:n("editor.image.tooltip"),editor:t}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),flipX:{default:!1},flipY:{default:!1},width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||null;return r?Number.parseInt(r,10):null},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})},inline:{default:!1,parseHTML:t=>!!t.getAttribute("inline"),renderHTML:t=>({inline:t.inline})},alt:{default:"",parseHTML:t=>t.getAttribute("alt"),renderHTML:t=>({alt:t.alt})}}},addNodeView(){return pe.ReactNodeViewRenderer(A1)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageInline:t=>({commands:r})=>r.insertContent({type:this.name,attrs:{...t,inline:t.inline??this.options.defaultInline}}),updateImage:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImage:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{flipX:t,flipY:r,align:n,inline:i}=e,o=i&&(n==="left"||n==="right"),a=t||r?`transform: rotateX(${t?"180":"0"}deg) rotateY(${r?"180":"0"}deg);`:"",s=o?"":`text-align: ${n};`,f=`${o?`float: ${n};`:""}${o?n==="left"?"margin: 1em 1em 1em 0;":"margin: 1em 0 1em 1em;":""}${a}`;return[i?"span":"div",{style:s,class:"image"},["img",B.mergeAttributes({height:"auto",style:f},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"span.image img",getAttrs:e=>{var o;const t=e==null?void 0:e.parentElement,r=e==null?void 0:e.getAttribute("width"),n=(e==null?void 0:e.getAttribute("flipx"))||!1,i=(e==null?void 0:e.getAttribute("flipy"))||!1;return{src:e==null?void 0:e.getAttribute("src"),alt:e==null?void 0:e.getAttribute("alt"),caption:e==null?void 0:e.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(e==null?void 0:e.getAttribute("align"))||((o=t==null?void 0:t.style)==null?void 0:o.textAlign)||null,inline:(e==null?void 0:e.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}},{tag:"div[class=image]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width"),n=(t==null?void 0:t.getAttribute("flipx"))||!1,i=(t==null?void 0:t.getAttribute("flipy"))||!1;return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),caption:t==null?void 0:t.getAttribute("caption"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null,inline:(t==null?void 0:t.getAttribute("inline"))||!1,flipX:n==="true",flipY:i==="true"}}}]},addProseMirrorPlugins(){const t=T1({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload,defaultInline:this.options.defaultInline});return[new B.Plugin({props:{handlePaste:(r,n)=>!n.clipboardData||[...n.clipboardData.files||[]].some(o=>o.type==="text/html")?!1:I1(r,n,t),handleDrop:(r,n,i,o)=>(!(n instanceof DragEvent)||!n.dataTransfer||R1(r,n,o,t),!1)}}),C1()]}});function O1({selectImage:e,giphyApiKey:t,children:r}){const[n,i]=w.useState([]),[o]=w.useState(15),a=w.useRef(null),s=(u,f="search")=>{if(!t)return;const h=`${f==="search"?`https://api.giphy.com/v1/gifs/search?q=${u}`:`https://api.giphy.com/v1/gifs/trending?q=${u}`}&limit=${o}&api_key=${t}`;fetch(h).then(p=>p.json()).then(p=>{i(p.data)}).catch(p=>{console.log(p)})};w.useEffect(()=>{s("","trend")},[]);const l=w.useCallback(Ar(u=>{if(!u.target.value){s("","trend");return}s(u.target.value)},350),[]);return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,children:r}),c.jsx(It,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:t?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"richtext-mb-[10px] richtext-w-full",children:c.jsx(Te,{onChange:l,placeholder:"Search GIF",ref:a,type:"text"})}),c.jsx("div",{className:"richtext-max-h-[280px] richtext-overflow-y-auto",children:c.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:n!=null&&n.length?n==null?void 0:n.map(u=>c.jsx("img",{alt:"giphy",className:"richtext-cursor-pointer richtext-text-center",height:u.images.fixed_width_downsampled.height,onClick:()=>e(u),src:u.images.fixed_width_downsampled.url,width:u.images.fixed_width_downsampled.width},`giphy-${u.id}`)):c.jsx("p",{children:"No GIFs found"})})})]}):c.jsx("div",{children:c.jsx("p",{children:"Missing Giphy API Key"})})})]})}function k1({editor:e,icon:t,giphyApiKey:r,...n}){const i=o=>{const{url:a}=o.images.original;e.chain().focus().setImageGif({src:a}).run()};return c.jsx(O1,{giphyApiKey:r,selectImage:i,children:c.jsx(W,{icon:t,tooltip:n==null?void 0:n.tooltip})})}const Br={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function N1(e){var M,L;const[t,r]=w.useState({width:q.IMAGE_MAX_SIZE,height:q.IMAGE_MAX_SIZE}),[n,i]=w.useState({width:0,height:0}),[o]=w.useState([Br.TOP_LEFT,Br.TOP_RIGHT,Br.BOTTOM_LEFT,Br.BOTTOM_RIGHT]),[a,s]=w.useState(!1),[l,u]=w.useState({x:0,y:0,w:0,h:0,dir:""}),{align:f}=(M=e==null?void 0:e.node)==null?void 0:M.attrs,d=w.useMemo(()=>{var D;const{src:k,alt:O,width:$,height:C}=(D=e==null?void 0:e.node)==null?void 0:D.attrs,A=Kr($)?`${$}px`:$,P=Kr(C)?`${C}px`:C;return{src:k||void 0,alt:O||void 0,style:{width:A||void 0,height:P||void 0}}},[(L=e==null?void 0:e.node)==null?void 0:L.attrs]),h=w.useMemo(()=>{const{style:{width:k}}=d;return{width:k==="100%"?k:void 0}},[d]);function p(k){i({width:k.target.width,height:k.target.height})}function m(){const{editor:k,getPos:O}=e;k.commands.setNodeSelection(O())}const x=w.useCallback(Bt(()=>{const{editor:k}=e,{width:O}=getComputedStyle(k.view.dom);r($=>({...$,width:Number.parseInt(O,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function g(k,O){k.preventDefault(),k.stopPropagation();const $=n.width,C=n.height,A=$/C;let P=Number(e.node.attrs.width),D=Number(e.node.attrs.height);const U=t.width;P&&!D?(P=P>U?U:P,D=Math.round(P/A)):D&&!P?(P=Math.round(D*A),P=P>U?U:P):!P&&!D?(P=$>U?U:$,D=Math.round(P/A)):P=P>U?U:P,s(!0),u({x:k.clientX,y:k.clientY,w:P,h:D,dir:O})}const y=w.useCallback(Bt(k=>{if(k.preventDefault(),k.stopPropagation(),!a)return;const{x:O,w:$,dir:C}=l,A=(k.clientX-O)*(/l/.test(C)?-1:1),P=Tu($+A,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:P,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),S=w.useCallback(k=>{k.preventDefault(),k.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),m())},[a,m]),E=w.useCallback(()=>{document==null||document.addEventListener("mousemove",y,!0),document==null||document.addEventListener("mouseup",S,!0)},[y,S]),T=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",y,!0),document==null||document.removeEventListener("mouseup",S,!0)},[y,S]);w.useEffect(()=>(a?E():T(),()=>{T()}),[a,E,T]);const j=w.useMemo(()=>new ResizeObserver(()=>x()),[x]);return w.useEffect(()=>(j.observe(e.editor.view.dom),()=>{j.disconnect()}),[e.editor.view.dom,j]),c.jsx(pe.NodeViewWrapper,{className:"image-view",style:{...h,width:"100%",textAlign:f},children:c.jsxs("div",{"data-drag-handle":!0,draggable:"true",style:h,className:`image-view__body ${e!=null&&e.selected?"image-view__body--focused":""} ${a?"image-view__body--resizing":""}`,children:[c.jsx("img",{alt:d.alt,className:"image-view__body__image block",height:"auto",onClick:m,onLoad:p,src:d.src,style:d.style}),(e==null?void 0:e.editor.view.editable)&&((e==null?void 0:e.selected)||a)&&c.jsx("div",{className:"image-resizer",children:o==null?void 0:o.map(k=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${k}`,onMouseDown:O=>g(O,k)},`image-dir-${k}`))})]})})}const za=Ba.extend({name:"imageGif",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),inline:!1,content:"",marks:"",group:"block",GIPHY_API_KEY:"",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:n})=>{var o;const i=((o=r==null?void 0:r.options)==null?void 0:o.GIPHY_API_KEY)||"";return{component:k1,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),giphyApiKey:i}}}}},addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),width:{default:null,parseHTML:t=>{const r=t.style.width||t.getAttribute("width")||"10";return r===void 0?null:Number.parseInt(`${r}`,10)},renderHTML:t=>({width:t.width})},align:{default:"center",parseHTML:t=>t.getAttribute("align"),renderHTML:t=>({align:t.align})}}},addNodeView(){return pe.ReactNodeViewRenderer(N1)},addCommands(){var e;return{...(e=this.parent)==null?void 0:e.call(this),setImageGif:t=>({commands:r})=>r.insertContent({type:this.name,attrs:t}),updateImageGif:t=>({commands:r})=>r.updateAttributes(this.name,t),setAlignImageGif:t=>({commands:r})=>r.updateAttributes(this.name,{align:t})}},renderHTML({HTMLAttributes:e}){const{align:t}=e;return["div",{style:t?`text-align: ${t};`:"",class:"imageGIf"},["img",B.mergeAttributes({height:"auto"},this.options.HTMLAttributes,e)]]},parseHTML(){return[{tag:"div[class=imageGIf]",getAttrs:e=>{const t=e.querySelector("img"),r=t==null?void 0:t.getAttribute("width");return{src:t==null?void 0:t.getAttribute("src"),alt:t==null?void 0:t.getAttribute("alt"),title:t==null?void 0:t.getAttribute("title"),width:r?Number.parseInt(r,10):null,align:(t==null?void 0:t.getAttribute("align"))||e.style.textAlign||null}}}]}});function M1(e,t){let r;try{r=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const i=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(r.hostname)}return r.hostname.includes(n)})}function L1(e){const{t}=q.useLocale(),[r,n]=w.useState(""),i=w.useRef(null),[o,a]=w.useState(""),[s,l]=w.useState(!1),u=m=>{l(m.detail)};w.useEffect(()=>{const m=xr(vt.UPLOAD_VIDEO(e.editor.id),u);return()=>{m()}},[]);const f=w.useMemo(()=>{var x;return(x=e.editor.extensionManager.extensions.find(g=>g.name===Ha.name))==null?void 0:x.options},[e.editor]);async function d(m){var S;const x=(S=m==null?void 0:m.target)==null?void 0:S.files;if(!e.editor||e.editor.isDestroyed||x.length===0)return;const g=x[0];let y="";f.upload?y=await f.upload(g):y=URL.createObjectURL(g),e.editor.chain().focus().setVideo({src:y,width:"100%"}).run(),l(!1)}function h(m){m.preventDefault(),m.stopPropagation(),r&&(e.editor.chain().focus().setVideo({src:r,width:"100%"}).run(),l(!1),n(""))}function p(m){var x;m.preventDefault(),(x=i.current)==null||x.click()}return c.jsxs(Cr,{onOpenChange:l,open:s,children:[c.jsx(jr,{asChild:!0,children:c.jsx(W,{action:()=>l(!0),icon:e.icon,tooltip:e.tooltip})}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:t("editor.video.dialog.title")}),c.jsxs(Sd,{activationMode:"manual",defaultValue:(f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload"?"upload":"link",children:[c.jsxs(Xa,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="upload")&&c.jsx(yr,{value:"upload",children:t("editor.video.dialog.tab.upload")}),((f==null?void 0:f.resourceVideo)==="both"||(f==null?void 0:f.resourceVideo)==="link")&&c.jsx(yr,{value:"link",children:t("editor.video.dialog.link")})]}),c.jsxs(br,{value:"upload",children:[c.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:c.jsx(we,{className:"richtext-mt-1 richtext-w-full",onClick:p,size:"sm",children:t("editor.video.dialog.tab.upload")})}),c.jsx("input",{accept:"video/*",multiple:!0,onChange:d,ref:i,type:"file",style:{display:"none"}})]}),c.jsxs(br,{value:"link",children:[c.jsx("div",{children:c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[c.jsx(Te,{autoFocus:!0,placeholder:t("editor.video.dialog.placeholder"),required:!0,type:"url",value:r,onChange:m=>{n(m.target.value)},onBlur:m=>{const x=m.target.value,g=f.videoProviders||["."];x&&!M1(x,g)?a("Invalid video URL"):a("")}}),c.jsx(we,{type:"button",onClick:h,children:t("editor.video.dialog.button.apply")})]})}),o&&c.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:o})]})]})]})]})}function $1(e,t,r){return e<t?t:e>r?r:e}const _1=e=>typeof e=="number",D1=e=>typeof e=="string",B1=e=>typeof e=="function";function z1(e,t="px"){if(!e)return e;const r=_1(e)?String(e):e,n=Number.parseFloat(r),i=r.match(/[%a-z]+$/i),o=i?i[0]:t;return Number.isNaN(n)?e:n+o}function gd(e,t){if(!e)return!1;const{extensions:r=[]}=(e==null?void 0:e.extensionManager)??{};return!!r.find(i=>i.name===t)}function H1(e){return e.map(t=>D1(t)?{value:t,name:t}:t)}function q1(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const r=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(r){const i=r[1],o=r[2];o?e=`https://player.vimeo.com/video/${i}?h=${o}`:e=`https://player.vimeo.com/video/${i}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const Ha=B.Node.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:q.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var r,n;return{component:L1,componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(r=e.can()).setVideo)!=null&&n.call(r,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?q1(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:z1(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:r="center"}=e??{},n={...e,width:"100%",height:"100%"},i=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,o=`flex: 1;padding-bottom: ${9/16*100}%;`,f=["div",{style:`display: flex; justify-content: ${r};`},["div",{style:i},["div",{style:o}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},f]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}}),qa={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function Fa({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?c.jsx(w.Fragment,{children:e.type==="divider"?c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}):c.jsx(n,{...e.componentProps,disabled:t||((i=e==null?void 0:e.componentProps)==null?void 0:i.disabled),editor:r})}):c.jsx(c.Fragment,{})}function F1(e){return e.type.name===Ht.name}function U1(e){return e.type.name===za.name}function W1(e){return e.type.name===Ha.name}function G1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(F1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:Yx(e.editor),[e.disabled,e.editor,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-${o}`))})}):c.jsx(c.Fragment,{})})})}function V1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(U1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:Jx(e.editor),[e.disabled,e.editor,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-image-gif-${o}`))})}):c.jsx(c.Fragment,{})})})}function K1(e){const{lang:t}=q.useLocale(),r=({editor:i})=>{const{selection:o}=i.view.state,{$from:a,to:s}=o;let l=!1;return i.view.state.doc.nodesBetween(a.pos,s,u=>{if(W1(u))return l=!0,!1}),l},n=w.useMemo(()=>e.disabled?[]:e0(e.editor),[e.editor,e.disabled,t]);return c.jsx(c.Fragment,{children:c.jsx(pe.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:r,tippyOptions:qa,children:n!=null&&n.length?c.jsx("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-h-[26px] richtext-flex-nowrap richtext-items-center richtext-justify-start richtext-whitespace-nowrap",children:n==null?void 0:n.map((i,o)=>c.jsx(Fa,{disabled:e.disabled,editor:e.editor,item:i},`bubbleMenu-video-${o}`))})}):c.jsx(c.Fragment,{})})})}function X1(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function Y1(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function J1(e,t,r=null){const n=Y1(e),i=[];for(let o=0;o<t;o+=1){const a=X1(n.column,o,r);a&&i.push(a)}return n.columns.createChecked({cols:t},i)}function ai({state:e,dispatch:t,type:r}){const n=B.findParentNode(o=>o.type.name===vr.name)(e.selection),i=B.findParentNode(o=>o.type.name===Ua.name)(e.selection);if(t&&n&&i){const o=n.node,a=i.node.attrs.index,s=o.toJSON();let l=a;r==="delete"?(l=a-1,s.content.splice(a,1)):(l=r==="addBefore"?a:a+1,s.content.splice(l,0,{type:"column",attrs:{index:a},content:[{type:"paragraph"}]})),s.attrs.cols=s.content.length,s.content.forEach((h,p)=>{h.attrs.index=p});const u=B.Node$1.fromJSON(e.schema,s);let f=n.pos;u.content.forEach((h,p,m)=>{m<l&&(f+=h.nodeSize)});const d=e.tr.setTime(Date.now());d.replaceWith(n.pos,n.pos+n.node.nodeSize,u).setSelection(B.TextSelection.near(d.doc.resolve(f))),t(d)}return!0}function sc({state:e,dispatch:t,type:r}){const n=B.findParentNode(o=>o.type.name===vr.name)(e.selection),i=B.findParentNode(o=>o.type.name===Ua.name)(e.selection);if(t&&n&&i){const o=n.node,a=i.node.attrs.index;let s=0;r==="before"?s=(a-1+o.attrs.cols)%o.attrs.cols:s=(a+1)%o.attrs.cols;let l=n.pos;o.content.forEach((f,d,h)=>{h<s&&(l+=f.nodeSize)});const u=e.tr.setTime(Date.now());return u.setSelection(B.TextSelection.near(u.doc.resolve(l))),t(u),!0}return!1}const Ua=B.Node.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",B.mergeAttributes(this.options.HTMLAttributes,e),0]}}),Z1=B.Extension.create({name:"columnActionButton",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({component:W,componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),xd=200,vr=B.Node.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:xd,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",B.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const i=J1(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(B.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>ai({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>sc({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>sc({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});function Wa(e,t){const{state:r}=t,n=r.selection.$anchor;let i=!1;if(n.depth)for(let o=n.depth;o>0;o--)n.node(o).type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(n.before(o),n.after(o)).scrollIntoView()),i=!0);else{const o=r.selection.node;o&&o.type.name===e&&(t.chain().deleteSelection().run(),i=!0)}if(!i){const o=n.pos;if(o){const a=r.tr.doc.nodeAt(o);a&&a.type.name===e&&(t.dispatchTransaction&&t.dispatchTransaction(r.tr.delete(o,o+a.nodeSize)),i=!0)}}return i}function Q1({editor:e}){const{t}=q.useLocale(),r=w.useCallback(()=>e.isActive(vr.name),[e]),n=w.useCallback(()=>Wa(vr.name,e),[e]),i=w.useCallback(()=>e.chain().focus().addColBefore().run(),[e]),o=w.useCallback(()=>e.chain().focus().addColAfter().run(),[e]),a=w.useCallback(()=>e.chain().focus().deleteCol().run(),[e]);return c.jsx(pe.BubbleMenu,{editor:e,pluginKey:"columns-bubble-menu",shouldShow:r,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:c.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[c.jsx(W,{action:i,icon:"ColumnAddLeft",tooltip:t("editor.table.menu.insertColumnBefore")}),c.jsx(W,{action:o,icon:"ColumnAddRight",tooltip:t("editor.table.menu.insertColumnAfter")}),c.jsx(W,{action:a,icon:"DeleteColumn",tooltip:t("editor.table.menu.deleteColumn")}),c.jsx(W,{action:n,icon:"Trash2",tooltip:t("editor.table.menu.delete_column")})]})})}const vd=fe.Root,yd=fe.Trigger,cc=fe.Portal,lc=fe.Sub,pa=oe.forwardRef(({className:e,inset:t,children:r,...n},i)=>c.jsxs(fe.SubTrigger,{ref:i,className:re("richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none focus:richtext-bg-accent data-[state=open]:richtext-bg-accent",t&&"richtext-pl-8",e),...n,children:[r,c.jsx(N.ChevronRight,{className:"richtext-ml-auto richtext-h-4 richtext-w-4"})]}));pa.displayName=fe.SubTrigger.displayName;const ma=oe.forwardRef(({className:e,...t},r)=>c.jsx(fe.SubContent,{ref:r,className:re("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-lg data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...t}));ma.displayName=fe.SubContent.displayName;const Ga=oe.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(fe.Portal,{children:c.jsx(fe.Content,{ref:n,sideOffset:t,className:re("richtext-z-50 richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r})}));Ga.displayName=fe.Content.displayName;const ze=oe.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(fe.Item,{ref:n,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",t&&"richtext-pl-8",e),...r}));ze.displayName=fe.Item.displayName;const bd=oe.forwardRef(({className:e,children:t,checked:r,...n},i)=>c.jsxs(fe.CheckboxItem,{ref:i,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),checked:r,...n,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:c.jsx(fe.ItemIndicator,{children:c.jsx(N.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));bd.displayName=fe.CheckboxItem.displayName;const ev=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fe.RadioItem,{ref:n,className:re("richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none richtext-transition-colors focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",e),...r,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center",children:c.jsx(fe.ItemIndicator,{children:c.jsx(N.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));ev.displayName=fe.RadioItem.displayName;const tv=oe.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(fe.Label,{ref:n,className:re("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...r}));tv.displayName=fe.Label.displayName;const Va=oe.forwardRef(({className:e,...t},r)=>c.jsx(fe.Separator,{ref:r,className:re("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",e),...t}));Va.displayName=fe.Separator.displayName;function wd({className:e,...t}){return c.jsx("span",{className:re("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}wd.displayName="DropdownMenuShortcut";const Te=oe.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:re("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),ref:n,...r}));Te.displayName="Input";const rv=Rn("richtext-text-sm richtext-font-medium richtext-leading-none peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),Ue=oe.forwardRef(({className:e,...t},r)=>c.jsx(ou.Root,{ref:r,className:re(rv(),e),...t}));Ue.displayName=ou.Root.displayName;const Wt=dr.Root,Gt=dr.Trigger,It=oe.forwardRef(({className:e,align:t="center",sideOffset:r=4,...n},i)=>c.jsx(dr.Portal,{children:c.jsx(dr.Content,{ref:i,align:t,sideOffset:r,className:re("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...n})}));It.displayName=dr.Content.displayName;const Be=oe.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},i)=>c.jsx(nu.Root,{ref:i,decorative:r,orientation:t,className:re("richtext-shrink-0 richtext-bg-border",t==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...n}));Be.displayName=nu.Root.displayName;const Ka=oe.forwardRef(({className:e,...t},r)=>c.jsx(Vo.Root,{className:re("richtext-peer richtext-inline-flex richtext-h-6 richtext-w-11 richtext-shrink-0 richtext-cursor-pointer richtext-items-center richtext-rounded-full richtext-border-2 richtext-border-transparent richtext-transition-colors focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 focus-visible:richtext-ring-offset-background disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 data-[state=checked]:richtext-bg-primary data-[state=unchecked]:richtext-bg-input",e),...t,ref:r,children:c.jsx(Vo.Thumb,{className:re("richtext-pointer-events-none richtext-block richtext-h-5 richtext-w-5 richtext-rounded-full richtext-bg-background richtext-shadow-lg richtext-ring-0 richtext-transition-transform data-[state=checked]:richtext-translate-x-5 data-[state=unchecked]:richtext-translate-x-0")})}));Ka.displayName=Vo.Root.displayName;const Sd=jt.Root,Xa=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.List,{ref:r,className:re("richtext-inline-flex richtext-h-10 richtext-items-center richtext-justify-center richtext-rounded-md richtext-bg-muted richtext-p-1 richtext-text-muted-foreground",e),...t}));Xa.displayName=jt.List.displayName;const yr=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.Trigger,{ref:r,className:re("richtext-inline-flex richtext-items-center richtext-justify-center richtext-whitespace-nowrap richtext-rounded-sm richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-all focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=active]:richtext-bg-background data-[state=active]:richtext-text-foreground data-[state=active]:richtext-shadow-sm",e),...t}));yr.displayName=jt.Trigger.displayName;const br=oe.forwardRef(({className:e,...t},r)=>c.jsx(jt.Content,{ref:r,className:re("richtext-mt-2 richtext-ring-offset-background focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2",e),...t}));br.displayName=jt.Content.displayName;const nv=Re.Provider,Ad=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Viewport,{ref:r,className:re("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",e),...t}));Ad.displayName=Re.Viewport.displayName;const iv=Rn("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Cd=oe.forwardRef(({className:e,variant:t,...r},n)=>c.jsx(Re.Root,{ref:n,className:re(iv({variant:t}),e),...r}));Cd.displayName=Re.Root.displayName;const ov=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Action,{ref:r,className:re("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",e),...t}));ov.displayName=Re.Action.displayName;const jd=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Close,{ref:r,className:re("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(N.X,{className:"richtext-h-4 richtext-w-4"})}));jd.displayName=Re.Close.displayName;const Ed=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Title,{ref:r,className:re("richtext-text-sm richtext-font-semibold",e),...t}));Ed.displayName=Re.Title.displayName;const Td=oe.forwardRef(({className:e,...t},r)=>c.jsx(Re.Description,{ref:r,className:re("richtext-text-sm richtext-opacity-90",e),...t}));Td.displayName=Re.Description.displayName;const av=Rn("richtext-inline-flex richtext-items-center richtext-justify-center richtext-rounded-md richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-muted hover:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-2 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 data-[state=on]:richtext-bg-accent data-[state=on]:richtext-text-accent-foreground",{variants:{variant:{default:"richtext-bg-transparent",outline:"richtext-border richtext-border-input richtext-bg-transparent hover:richtext-bg-accent hover:richtext-text-accent-foreground"},size:{default:"richtext-h-10 richtext-px-3",sm:"richtext-h-9 richtext-px-2",lg:"richtext-h-11 richtext-px-5"}},defaultVariants:{variant:"default",size:"default"}}),Ya=oe.forwardRef(({className:e,variant:t,size:r,...n},i)=>c.jsx(iu.Root,{ref:i,className:re(av({variant:t,size:r,className:e})),...n}));Ya.displayName=iu.Root.displayName;const sv=Sr.Provider,Ja=Sr.Root,Za=Sr.Trigger,kn=oe.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(Sr.Content,{ref:n,sideOffset:t,className:re("richtext-z-50 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-bg-popover richtext-px-3 richtext-py-1.5 richtext-text-sm richtext-text-popover-foreground richtext-shadow-md richtext-animate-in richtext-fade-in-0 richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",e),...r}));kn.displayName=Sr.Content.displayName;const cv=1,lv=1e6;let si=0;function uv(){return si=(si+1)%Number.MAX_SAFE_INTEGER,si.toString()}const ci=new Map;function uc(e){if(ci.has(e))return;const t=setTimeout(()=>{ci.delete(e),ur({type:"REMOVE_TOAST",toastId:e})},lv);ci.set(e,t)}function dv(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,cv)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?uc(r):e.toasts.forEach(n=>{uc(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}}const Ur=[];let Wr={toasts:[]};function ur(e){Wr=dv(Wr,e),Ur.forEach(t=>{t(Wr)})}function fv({...e}){const t=uv(),r=i=>ur({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>ur({type:"DISMISS_TOAST",toastId:t});return ur({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Nn(){const[e,t]=oe.useState(Wr);return oe.useEffect(()=>(Ur.push(t),()=>{const r=Ur.indexOf(t);r>-1&&Ur.splice(r,1)}),[e]),{...e,toast:fv,dismiss:r=>ur({type:"DISMISS_TOAST",toastId:r})}}const Id=oe.forwardRef(({className:e,...t},r)=>c.jsx(Go.Root,{ref:r,className:re("!richtext-peer !richtext-h-4 !richtext-w-4 !richtext-p-0 !richtext-shrink-0 !richtext-rounded-sm !richtext-border !richtext-border-primary !richtext-ring-offset-background focus-visible:!richtext-outline-none focus-visible:!richtext-ring-2 focus-visible:!richtext-ring-ring focus-visible:!richtext-ring-offset-2 disabled:!richtext-cursor-not-allowed disabled:!richtext-opacity-50 data-[state=checked]:!richtext-bg-primary data-[state=checked]:!richtext-text-primary-foreground",e),...t,children:c.jsx(Go.Indicator,{className:re("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:c.jsx(N.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Id.displayName=Go.Root.displayName;const hv={padding:"0 12px 12px"},Rd=({width:e,maxWidth:t,height:r,onOk:n,children:i})=>{const{t:o}=q.useLocale(),[a,s]=w.useState({width:"",height:"",maxWidth:""});w.useEffect(()=>{s({width:e,height:r,maxWidth:t})},[r,t,e]);function l(u){u.preventDefault(),u.stopPropagation(),n(a)}return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,children:i}),c.jsx(It,{children:c.jsx("div",{style:hv,children:c.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:l,children:[c.jsx(Ue,{className:"mb-[6px]",children:"Width"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.width,required:!0,onChange:u=>s({...a,width:u.target.value})})})}),c.jsx(Ue,{className:"mb-[6px]",children:"Max Width"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.maxWidth,required:!0,onChange:u=>s({...a,maxWidth:u.target.value})})})}),c.jsx(Ue,{className:"mb-[6px]",children:"Height"}),c.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:c.jsx("div",{className:"richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm",children:c.jsx(Te,{type:"number",value:a.height,required:!0,onChange:u=>s({...a,height:u.target.value})})})}),c.jsx(we,{type:"submit",className:"richtext-self-end richtext-mt-2",children:o("editor.link.dialog.button.apply")})]})})})]})},Vt={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function pv(e){const t=Vt.youtube,r=e.matchedUrl;e.validLink=!0;const n=r.split("="),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}/${o}`,e.validId=!0}return e}function mv(e){const t=Vt.youku,r=e.matchedUrl,n=t.idRule,i=new RegExp(n),o=r.match(i);if(o&&o.length>0){const a=o[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${a}`}else e.validId=!1;return e}function gv(e){const t=Vt.bilibili,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function xv(e){const t=Vt.qqvideo,n=e.matchedUrl.split("/"),i=n.length;if(i>0){const o=n[i-1];e.src=`${t.srcPrefix}=${o}`,e.validId=!0}return e}function vv(e,t){return t.src=e,t.validId=!0,t}function yv(e,t){return t.src=e,t.validId=!0,t}function bv(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function wv(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Sv(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Av(e){const t=Vt.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function Cv(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function jv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Ev(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function Tv(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function Iv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Rv(e,t,r){if(e==="googlemaps")return r.validLink=!0,r.matchedUrl=t,r;const i=Vt[e].linkRule;for(const o of i){const a=new RegExp(o),s=t.match(a);if(s&&s.length>0)return r.validLink=!0,r.matchedUrl=e==="youtube"?s[1]:s[0],r}return r}function Pv(e){var r,n;let t="iframe";return((r=e.includes)!=null&&r.call(e,"youtube")||(n=e.includes)!=null&&n.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function Pd(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const r=Pv(e);if(t=Rv(r,e,t),!t.validLink)return t;switch(r){case"youtube":return pv(t);case"youku":return mv(t);case"bilibili":return gv(t);case"qqvideo":return xv(t);case"amap":return vv(e,t);case"baidu_map":return yv(e,t);case"googlemaps":return bv(e,t);case"modao":return wv(t);case"lanhu":return Sv(t);case"figma":return Av(t);case"canva":return Cv(e,t);case"processon":return jv(e,t);case"codepen":return Ev(t);case"jinshuju":return Tv(e,t);case"iframe":return Iv(e,t);default:return e}}function Od(){const[e]=hd(t=>t.value);return e}const Ov={setDisable:(e,t)=>{On(vt.EDIT(e),t)}},kv="_wrap_5y04w_1",Nv="_innerWrap_5y04w_15",dc={wrap:kv,innerWrap:Nv};function Mv({editor:e,node:t,updateAttributes:r}){const n=Od(),{src:i,width:o,height:a}=t.attrs,[s,l]=w.useState("");function u(){if(!s)return;const d=Pd(s);e.chain().updateAttributes(St.name,{src:(d==null?void 0:d.src)||s}).setNodeSelection(e.state.selection.from).focus().run()}const f=w.useCallback(d=>{r({width:d.width,height:d.height})},[r]);return c.jsxs(pe.NodeViewWrapper,{children:[!i&&c.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]",children:[c.jsx(Te,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>l(d.target.value),placeholder:"Enter link",type:"url",value:s}),c.jsx(we,{className:"richtext-w-[60px]",onClick:u,children:"OK"})]}),i&&c.jsx(Af.Resizable,{size:{width:Number.parseInt(o),height:Number.parseInt(a)},onResizeStop:(d,h,p,m)=>{f({width:Number.parseInt(o)+m.width,height:Number.parseInt(a)+m.height})},children:c.jsx("div",{className:pe.clsx(dc.wrap,"render-wrapper"),children:c.jsx("div",{className:dc.innerWrap,style:{pointerEvents:n?"none":"auto"},children:c.jsx("iframe",{className:"richtext-my-[12px] ",src:i})})})})]})}const St=B.Node.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:r,t:n})=>({component:W,componentProps:{action:i=>t.commands.setIframe(i),upload:r.options.upload,disabled:!t.can().setIframe({}),icon:"Iframe",tooltip:n("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:pe.getDatasetAttribute("width")},height:{default:300,parseHTML:pe.getDatasetAttribute("height")},src:{default:null,parseHTML:pe.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",B.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:r,chain:n})=>{var o,a,s;if(((s=(a=(o=t.selection)==null?void 0:o.node)==null?void 0:a.type)==null?void 0:s.name)==this.name)return r.updateAttributes(this.name,e);const i=e||{url:""};return n().insertContent({type:this.name,attrs:i}).run()}}},addInputRules(){return[B.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return pe.ReactNodeViewRenderer(Mv)}});var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nd(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var li,fc;function Md(){if(fc)return li;fc=1;var e=Object.prototype.toString;return li=function(r){var n=e.call(r),i=n==="[object Arguments]";return i||(i=n!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&e.call(r.callee)==="[object Function]"),i},li}var ui,hc;function Lv(){if(hc)return ui;hc=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Md(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(h){var p=h.constructor;return p&&p.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&t.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{l(window[h])}catch{return!0}}catch{return!0}return!1}(),d=function(h){if(typeof window>"u"||!f)return l(h);try{return l(h)}catch{return!1}};e=function(p){var m=p!==null&&typeof p=="object",x=r.call(p)==="[object Function]",g=n(p),y=m&&r.call(p)==="[object String]",S=[];if(!m&&!x&&!g)throw new TypeError("Object.keys called on a non-object");var E=a&&x;if(y&&p.length>0&&!t.call(p,0))for(var T=0;T<p.length;++T)S.push(String(T));if(g&&p.length>0)for(var j=0;j<p.length;++j)S.push(String(j));else for(var M in p)!(E&&M==="prototype")&&t.call(p,M)&&S.push(String(M));if(o)for(var L=d(p),k=0;k<s.length;++k)!(L&&s[k]==="constructor")&&t.call(p,s[k])&&S.push(s[k]);return S}}return ui=e,ui}var di,pc;function Qa(){if(pc)return di;pc=1;var e=Array.prototype.slice,t=Md(),r=Object.keys,n=r?function(a){return r(a)}:Lv(),i=Object.keys;return n.shim=function(){if(Object.keys){var a=function(){var s=Object.keys(arguments);return s&&s.length===arguments.length}(1,2);a||(Object.keys=function(l){return t(l)?i(e.call(l)):i(l)})}else Object.keys=n;return Object.keys||n},di=n,di}var fi,mc;function Mn(){if(mc)return fi;mc=1;var e=Object.defineProperty||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return fi=e,fi}var hi,gc;function es(){return gc||(gc=1,hi=SyntaxError),hi}var pi,xc;function Me(){return xc||(xc=1,pi=TypeError),pi}var mi,vc;function $v(){return vc||(vc=1,mi=Object.getOwnPropertyDescriptor),mi}var gi,yc;function Rt(){if(yc)return gi;yc=1;var e=$v();if(e)try{e([],"length")}catch{e=null}return gi=e,gi}var xi,bc;function ts(){if(bc)return xi;bc=1;var e=Mn(),t=es(),r=Me(),n=Rt();return xi=function(o,a,s){if(!o||typeof o!="object"&&typeof o!="function")throw new r("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,h=!!n&&n(o,a);if(e)e(o,a,{configurable:f===null&&h?h.configurable:!f,enumerable:l===null&&h?h.enumerable:!l,value:s,writable:u===null&&h?h.writable:!u});else if(d||!l&&!u&&!f)o[a]=s;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},xi}var vi,wc;function rs(){if(wc)return vi;wc=1;var e=Mn(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},vi=t,vi}var yi,Sc;function Pt(){if(Sc)return yi;Sc=1;var e=Qa(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",r=Object.prototype.toString,n=Array.prototype.concat,i=ts(),o=function(u){return typeof u=="function"&&r.call(u)==="[object Function]"},a=rs()(),s=function(u,f,d,h){if(f in u){if(h===!0){if(u[f]===d)return}else if(!o(h)||!h())return}a?i(u,f,d,!0):i(u,f,d)},l=function(u,f){var d=arguments.length>2?arguments[2]:{},h=e(f);t&&(h=n.call(h,Object.getOwnPropertySymbols(f)));for(var p=0;p<h.length;p+=1)s(u,h[p],f[h[p]],d[h[p]])};return l.supportsDescriptors=!!a,yi=l,yi}var bi={exports:{}},wi,Ac;function ns(){return Ac||(Ac=1,wi=Object),wi}var Si,Cc;function Ld(){return Cc||(Cc=1,Si=Error),Si}var Ai,jc;function _v(){return jc||(jc=1,Ai=EvalError),Ai}var Ci,Ec;function Dv(){return Ec||(Ec=1,Ci=RangeError),Ci}var ji,Tc;function Bv(){return Tc||(Tc=1,ji=ReferenceError),ji}var Ei,Ic;function zv(){return Ic||(Ic=1,Ei=URIError),Ei}var Ti,Rc;function Hv(){return Rc||(Rc=1,Ti=Math.abs),Ti}var Ii,Pc;function qv(){return Pc||(Pc=1,Ii=Math.floor),Ii}var Ri,Oc;function Fv(){return Oc||(Oc=1,Ri=Math.max),Ri}var Pi,kc;function Uv(){return kc||(kc=1,Pi=Math.min),Pi}var Oi,Nc;function Wv(){return Nc||(Nc=1,Oi=Math.pow),Oi}var ki,Mc;function Gv(){return Mc||(Mc=1,ki=Math.round),ki}var Ni,Lc;function Vv(){return Lc||(Lc=1,Ni=Number.isNaN||function(t){return t!==t}),Ni}var Mi,$c;function Kv(){if($c)return Mi;$c=1;var e=Vv();return Mi=function(r){return e(r)||r===0?r:r<0?-1:1},Mi}var Li,_c;function Ln(){return _c||(_c=1,Li=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),Li}var $i,Dc;function is(){if(Dc)return $i;Dc=1;var e=typeof Symbol<"u"&&Symbol,t=Ln();return $i=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},$i}var _i,Bc;function $d(){return Bc||(Bc=1,_i=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),_i}var Di,zc;function _d(){if(zc)return Di;zc=1;var e=ns();return Di=e.getPrototypeOf||null,Di}var Bi,Hc;function Xv(){if(Hc)return Bi;Hc=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(l,u){for(var f=[],d=0;d<l.length;d+=1)f[d]=l[d];for(var h=0;h<u.length;h+=1)f[h+l.length]=u[h];return f},o=function(l,u){for(var f=[],d=u,h=0;d<l.length;d+=1,h+=1)f[h]=l[d];return f},a=function(s,l){for(var u="",f=0;f<s.length;f+=1)u+=s[f],f+1<s.length&&(u+=l);return u};return Bi=function(l){var u=this;if(typeof u!="function"||t.apply(u)!==n)throw new TypeError(e+u);for(var f=o(arguments,1),d,h=function(){if(this instanceof d){var y=u.apply(this,i(f,arguments));return Object(y)===y?y:this}return u.apply(l,i(f,arguments))},p=r(0,u.length-f.length),m=[],x=0;x<p;x++)m[x]="$"+x;if(d=Function("binder","return function ("+a(m,",")+"){ return binder.apply(this,arguments); }")(h),u.prototype){var g=function(){};g.prototype=u.prototype,d.prototype=new g,g.prototype=null}return d},Bi}var zi,qc;function Er(){if(qc)return zi;qc=1;var e=Xv();return zi=Function.prototype.bind||e,zi}var Hi,Fc;function os(){return Fc||(Fc=1,Hi=Function.prototype.call),Hi}var qi,Uc;function as(){return Uc||(Uc=1,qi=Function.prototype.apply),qi}var Fi,Wc;function Yv(){return Wc||(Wc=1,Fi=typeof Reflect<"u"&&Reflect&&Reflect.apply),Fi}var Ui,Gc;function Dd(){if(Gc)return Ui;Gc=1;var e=Er(),t=as(),r=os(),n=Yv();return Ui=n||e.call(r,t),Ui}var Wi,Vc;function ss(){if(Vc)return Wi;Vc=1;var e=Er(),t=Me(),r=os(),n=Dd();return Wi=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return n(e,r,o)},Wi}var Gi,Kc;function Jv(){if(Kc)return Gi;Kc=1;var e=ss(),t=Rt(),r;try{r=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return Gi=n&&typeof n.get=="function"?e([n.get]):typeof o=="function"?function(s){return o(s==null?s:i(s))}:!1,Gi}var Vi,Xc;function Bd(){if(Xc)return Vi;Xc=1;var e=$d(),t=_d(),r=Jv();return Vi=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,Vi}var Ki,Yc;function cs(){if(Yc)return Ki;Yc=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Er();return Ki=r.call(e,t),Ki}var Xi,Jc;function at(){if(Jc)return Xi;Jc=1;var e,t=ns(),r=Ld(),n=_v(),i=Dv(),o=Bv(),a=es(),s=Me(),l=zv(),u=Hv(),f=qv(),d=Fv(),h=Uv(),p=Wv(),m=Gv(),x=Kv(),g=Function,y=function(ie){try{return g('"use strict"; return ('+ie+").constructor;")()}catch{}},S=Rt(),E=Mn(),T=function(){throw new s},j=S?function(){try{return arguments.callee,T}catch{try{return S(arguments,"callee").get}catch{return T}}}():T,M=is()(),L=Bd(),k=_d(),O=$d(),$=as(),C=os(),A={},P=typeof Uint8Array>"u"||!L?e:L(Uint8Array),D={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":M&&L?L([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":M&&L?L(L([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!M||!L?e:L(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!M||!L?e:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":M&&L?L(""[Symbol.iterator]()):e,"%Symbol%":M?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet,"%Function.prototype.call%":C,"%Function.prototype.apply%":$,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":k,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":m,"%Math.sign%":x,"%Reflect.getPrototypeOf%":O};if(L)try{null.error}catch(ie){var U=L(L(ie));D["%Error.prototype%"]=U}var H=function ie(F){var G;if(F==="%AsyncFunction%")G=y("async function () {}");else if(F==="%GeneratorFunction%")G=y("function* () {}");else if(F==="%AsyncGeneratorFunction%")G=y("async function* () {}");else if(F==="%AsyncGenerator%"){var z=ie("%AsyncGeneratorFunction%");z&&(G=z.prototype)}else if(F==="%AsyncIteratorPrototype%"){var J=ie("%AsyncGenerator%");J&&L&&(G=L(J.prototype))}return D[F]=G,G},K={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},te=Er(),ne=cs(),ve=te.call(C,Array.prototype.concat),ge=te.call($,Array.prototype.splice),Le=te.call(C,String.prototype.replace),$e=te.call(C,String.prototype.slice),I=te.call(C,RegExp.prototype.exec),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/g,V=function(F){var G=$e(F,0,1),z=$e(F,-1);if(G==="%"&&z!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&G!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var J=[];return Le(F,_,function(xe,ye,be,Se){J[J.length]=be?Le(Se,X,"$1"):ye||xe}),J},ee=function(F,G){var z=F,J;if(ne(K,z)&&(J=K[z],z="%"+J[0]+"%"),ne(D,z)){var xe=D[z];if(xe===A&&(xe=H(z)),typeof xe>"u"&&!G)throw new s("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:J,name:z,value:xe}}throw new a("intrinsic "+F+" does not exist!")};return Xi=function(F,G){if(typeof F!="string"||F.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new s('"allowMissing" argument must be a boolean');if(I(/^%?[^%]*%?$/,F)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=V(F),J=z.length>0?z[0]:"",xe=ee("%"+J+"%",G),ye=xe.name,be=xe.value,Se=!1,Ce=xe.alias;Ce&&(J=Ce[0],ge(z,ve([0,1],Ce)));for(var Ke=1,_e=!0;Ke<z.length;Ke+=1){var je=z[Ke],Xe=$e(je,0,1),Ye=$e(je,-1);if((Xe==='"'||Xe==="'"||Xe==="`"||Ye==='"'||Ye==="'"||Ye==="`")&&Xe!==Ye)throw new a("property names with quotes must have matching quotes");if((je==="constructor"||!_e)&&(Se=!0),J+="."+je,ye="%"+J+"%",ne(D,ye))be=D[ye];else if(be!=null){if(!(je in be)){if(!G)throw new s("base intrinsic for "+F+" exists, but the property is not available.");return}if(S&&Ke+1>=z.length){var Je=S(be,je);_e=!!Je,_e&&"get"in Je&&!("originalValue"in Je.get)?be=Je.get:be=be[je]}else _e=ne(be,je),be=be[je];_e&&!Se&&(D[ye]=be)}}return be},Xi}var Yi,Zc;function Zv(){if(Zc)return Yi;Zc=1;var e=at(),t=ts(),r=rs()(),n=Rt(),i=Me(),o=e("%Math.floor%");return Yi=function(s,l){if(typeof s!="function")throw new i("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||o(l)!==l)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,d=!0;if("length"in s&&n){var h=n(s,"length");h&&!h.configurable&&(f=!1),h&&!h.writable&&(d=!1)}return(f||d||!u)&&(r?t(s,"length",l,!0,!0):t(s,"length",l)),s},Yi}var Ji,Qc;function Qv(){if(Qc)return Ji;Qc=1;var e=Er(),t=as(),r=Dd();return Ji=function(){return r(e,t,arguments)},Ji}var el;function Kt(){return el||(el=1,function(e){var t=Zv(),r=Mn(),n=ss(),i=Qv();e.exports=function(a){var s=n(arguments),l=a.length-(arguments.length-1);return t(s,1+(l>0?l:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(bi)),bi.exports}var Zi,tl;function Ae(){if(tl)return Zi;tl=1;var e=at(),t=ss(),r=t([e("%String.prototype.indexOf%")]);return Zi=function(i,o){var a=e(i,!!o);return typeof a=="function"&&r(i,".prototype.")>-1?t([a]):a},Zi}var Qi,rl;function zd(){if(rl)return Qi;rl=1;var e=Qa(),t=Ln()(),r=Ae(),n=ns(),i=r("Array.prototype.push"),o=r("Object.prototype.propertyIsEnumerable"),a=t?n.getOwnPropertySymbols:null;return Qi=function(l,u){if(l==null)throw new TypeError("target must be an object");var f=n(l);if(arguments.length===1)return f;for(var d=1;d<arguments.length;++d){var h=n(arguments[d]),p=e(h),m=t&&(n.getOwnPropertySymbols||a);if(m)for(var x=m(h),g=0;g<x.length;++g){var y=x[g];o(h,y)&&i(p,y)}for(var S=0;S<p.length;++S){var E=p[S];if(o(h,E)){var T=h[E];f[E]=T}}}return f},Qi}var eo,nl;function Hd(){if(nl)return eo;nl=1;var e=zd(),t=function(){if(!Object.assign)return!1;for(var n="abcdefghijklmnopqrst",i=n.split(""),o={},a=0;a<i.length;++a)o[i[a]]=i[a];var s=Object.assign({},o),l="";for(var u in s)l+=u;return n!==l},r=function(){if(!Object.assign||!Object.preventExtensions)return!1;var n=Object.preventExtensions({1:2});try{Object.assign(n,"xy")}catch{return n[1]==="y"}return!1};return eo=function(){return!Object.assign||t()||r()?e:Object.assign},eo}var to,il;function ey(){if(il)return to;il=1;var e=Pt(),t=Hd();return to=function(){var n=t();return e(Object,{assign:n},{assign:function(){return Object.assign!==n}}),n},to}var ro,ol;function ty(){if(ol)return ro;ol=1;var e=Pt(),t=Kt(),r=zd(),n=Hd(),i=ey(),o=t.apply(n()),a=function(l,u){return o(Object,arguments)};return e(a,{getPolyfill:n,implementation:r,shim:i}),ro=a,ro}var no,al;function qd(){if(al)return no;al=1;var e=at(),t=Kt(),r=t(e("String.prototype.indexOf"));return no=function(i,o){var a=e(i,!!o);return typeof a=="function"&&r(i,".prototype.")>-1?t(a):a},no}var io,sl;function ry(){if(sl)return io;sl=1;var e=function(){return typeof(function(){}).name=="string"},t=Object.getOwnPropertyDescriptor;if(t)try{t([],"length")}catch{t=null}e.functionsHaveConfigurableNames=function(){if(!e()||!t)return!1;var i=t(function(){},"name");return!!i&&!!i.configurable};var r=Function.prototype.bind;return e.boundFunctionsHaveNames=function(){return e()&&typeof r=="function"&&(function(){}).bind().name!==""},io=e,io}var oo,cl;function ny(){if(cl)return oo;cl=1;var e=ts(),t=rs()(),r=ry().functionsHaveConfigurableNames(),n=Me();return oo=function(o,a){if(typeof o!="function")throw new n("`fn` is not a function");var s=arguments.length>2&&!!arguments[2];return(!s||r)&&(t?e(o,"name",a,!0,!0):e(o,"name",a)),o},oo}var ao,ll;function Fd(){if(ll)return ao;ll=1;var e=ny(),t=Me(),r=Object;return ao=e(function(){if(this==null||this!==r(this))throw new t("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),ao}var so,ul;function Ud(){if(ul)return so;ul=1;var e=Fd(),t=Pt().supportsDescriptors,r=Object.getOwnPropertyDescriptor;return so=function(){if(t&&/a/mig.flags==="gim"){var i=r(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var o="",a={};if(Object.defineProperty(a,"hasIndices",{get:function(){o+="d"}}),Object.defineProperty(a,"sticky",{get:function(){o+="y"}}),i.get.call(a),o==="dy")return i.get}}return e},so}var co,dl;function iy(){if(dl)return co;dl=1;var e=Pt().supportsDescriptors,t=Ud(),r=Rt(),n=Object.defineProperty,i=Ld(),o=Bd(),a=/a/;return co=function(){if(!e||!o)throw new i("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=t(),u=o(a),f=r(u,"flags");return(!f||f.get!==l)&&n(u,"flags",{configurable:!0,enumerable:!1,get:l}),l},co}var lo,fl;function oy(){if(fl)return lo;fl=1;var e=Pt(),t=Kt(),r=Fd(),n=Ud(),i=iy(),o=t(n());return e(o,{getPolyfill:n,implementation:r,shim:i}),lo=o,lo}var tr={exports:{}},uo,hl;function Ot(){if(hl)return uo;hl=1;var e=Ln();return uo=function(){return e()&&!!Symbol.toStringTag},uo}var fo,pl;function Wd(){if(pl)return fo;pl=1;var e=Ot()(),t=Ae(),r=t("Object.prototype.toString"),n=function(s){return e&&s&&typeof s=="object"&&Symbol.toStringTag in s?!1:r(s)==="[object Arguments]"},i=function(s){return n(s)?!0:s!==null&&typeof s=="object"&&"length"in s&&typeof s.length=="number"&&s.length>=0&&r(s)!=="[object Array]"&&"callee"in s&&r(s.callee)==="[object Function]"},o=function(){return n(arguments)}();return n.isLegacyArguments=i,fo=o?n:i,fo}const ay={},sy=Object.freeze(Object.defineProperty({__proto__:null,default:ay},Symbol.toStringTag,{value:"Module"})),cy=Nd(sy);var ho,ml;function $n(){if(ml)return ho;ml=1;var e=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&typeof t.get=="function"?t.get:null,n=e&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,s=i&&Set.prototype.forEach,l=typeof WeakMap=="function"&&WeakMap.prototype,u=l?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,d=f?WeakSet.prototype.has:null,h=typeof WeakRef=="function"&&WeakRef.prototype,p=h?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,x=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,S=String.prototype.slice,E=String.prototype.replace,T=String.prototype.toUpperCase,j=String.prototype.toLowerCase,M=RegExp.prototype.test,L=Array.prototype.concat,k=Array.prototype.join,O=Array.prototype.slice,$=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,D=typeof Symbol=="function"&&typeof Symbol.iterator=="object",U=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===D||!0)?Symbol.toStringTag:null,H=Object.prototype.propertyIsEnumerable,K=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(v){return v.__proto__}:null);function te(v,b){if(v===1/0||v===-1/0||v!==v||v&&v>-1e3&&v<1e3||M.call(/e/,b))return b;var ae=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof v=="number"){var se=v<0?-$(-v):$(v);if(se!==v){var ce=String(se),Q=S.call(b,ce.length+1);return E.call(ce,ae,"$&_")+"."+E.call(E.call(Q,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(b,ae,"$&_")}var ne=cy,ve=ne.custom,ge=xe(ve)?ve:null,Le={__proto__:null,double:'"',single:"'"},$e={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ho=function v(b,ae,se,ce){var Q=ae||{};if(Se(Q,"quoteStyle")&&!Se(Le,Q.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(Q,"maxStringLength")&&(typeof Q.maxStringLength=="number"?Q.maxStringLength<0&&Q.maxStringLength!==1/0:Q.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var lt=Se(Q,"customInspect")?Q.customInspect:!0;if(typeof lt!="boolean"&&lt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Se(Q,"indent")&&Q.indent!==null&&Q.indent!==" "&&!(parseInt(Q.indent,10)===Q.indent&&Q.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Se(Q,"numericSeparator")&&typeof Q.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var bt=Q.numericSeparator;if(typeof b>"u")return"undefined";if(b===null)return"null";if(typeof b=="boolean")return b?"true":"false";if(typeof b=="string")return kt(b,Q);if(typeof b=="number"){if(b===0)return 1/0/b>0?"0":"-0";var Ie=String(b);return bt?te(b,Ie):Ie}if(typeof b=="bigint"){var ut=String(b)+"n";return bt?te(b,ut):ut}var Bn=typeof Q.depth>"u"?5:Q.depth;if(typeof se>"u"&&(se=0),se>=Bn&&Bn>0&&typeof b=="object")return V(b)?"[Array]":"[Object]";var Nt=df(Q,se);if(typeof ce>"u")ce=[];else if(_e(ce,b)>=0)return"[Circular]";function De(Mt,Pr,hf){if(Pr&&(ce=O.call(ce),ce.push(Pr)),hf){var vs={depth:Q.depth};return Se(Q,"quoteStyle")&&(vs.quoteStyle=Q.quoteStyle),v(Mt,vs,se+1,ce)}return v(Mt,Q,se+1,ce)}if(typeof b=="function"&&!ie(b)){var ds=Ke(b),fs=Ir(b,De);return"[Function"+(ds?": "+ds:" (anonymous)")+"]"+(fs.length>0?" { "+k.call(fs,", ")+" }":"")}if(xe(b)){var hs=D?E.call(String(b),/^(Symbol\(.*\))_[^)]*$/,"$1"):P.call(b);return typeof b=="object"&&!D?ct(hs):hs}if(st(b)){for(var Yt="<"+j.call(String(b.nodeName)),zn=b.attributes||[],Rr=0;Rr<zn.length;Rr++)Yt+=" "+zn[Rr].name+"="+I(_(zn[Rr].value),"double",Q);return Yt+=">",b.childNodes&&b.childNodes.length&&(Yt+="..."),Yt+="</"+j.call(String(b.nodeName))+">",Yt}if(V(b)){if(b.length===0)return"[]";var Hn=Ir(b,De);return Nt&&!uf(Hn)?"["+Dn(Hn,Nt)+"]":"[ "+k.call(Hn,", ")+" ]"}if(F(b)){var qn=Ir(b,De);return!("cause"in Error.prototype)&&"cause"in b&&!H.call(b,"cause")?"{ ["+String(b)+"] "+k.call(L.call("[cause]: "+De(b.cause),qn),", ")+" }":qn.length===0?"["+String(b)+"]":"{ ["+String(b)+"] "+k.call(qn,", ")+" }"}if(typeof b=="object"&&lt){if(ge&&typeof b[ge]=="function"&&ne)return ne(b,{depth:Bn-se});if(lt!=="symbol"&&typeof b.inspect=="function")return b.inspect()}if(je(b)){var ps=[];return n&&n.call(b,function(Mt,Pr){ps.push(De(Pr,b,!0)+" => "+De(Mt,b))}),us("Map",r.call(b),ps,Nt)}if(Je(b)){var ms=[];return s&&s.call(b,function(Mt){ms.push(De(Mt,b))}),us("Set",a.call(b),ms,Nt)}if(Xe(b))return _n("WeakMap");if(Tr(b))return _n("WeakSet");if(Ye(b))return _n("WeakRef");if(z(b))return ct(De(Number(b)));if(ye(b))return ct(De(C.call(b)));if(J(b))return ct(m.call(b));if(G(b))return ct(De(String(b)));if(typeof window<"u"&&b===window)return"{ [object Window] }";if(typeof globalThis<"u"&&b===globalThis||typeof wr<"u"&&b===wr)return"{ [object globalThis] }";if(!ee(b)&&!ie(b)){var Fn=Ir(b,De),gs=K?K(b)===Object.prototype:b instanceof Object||b.constructor===Object,Un=b instanceof Object?"":"null prototype",xs=!gs&&U&&Object(b)===b&&U in b?S.call(Ce(b),8,-1):Un?"Object":"",ff=gs||typeof b.constructor!="function"?"":b.constructor.name?b.constructor.name+" ":"",Wn=ff+(xs||Un?"["+k.call(L.call([],xs||[],Un||[]),": ")+"] ":"");return Fn.length===0?Wn+"{}":Nt?Wn+"{"+Dn(Fn,Nt)+"}":Wn+"{ "+k.call(Fn,", ")+" }"}return String(b)};function I(v,b,ae){var se=ae.quoteStyle||b,ce=Le[se];return ce+v+ce}function _(v){return E.call(String(v),/"/g,"&quot;")}function X(v){return!U||!(typeof v=="object"&&(U in v||typeof v[U]<"u"))}function V(v){return Ce(v)==="[object Array]"&&X(v)}function ee(v){return Ce(v)==="[object Date]"&&X(v)}function ie(v){return Ce(v)==="[object RegExp]"&&X(v)}function F(v){return Ce(v)==="[object Error]"&&X(v)}function G(v){return Ce(v)==="[object String]"&&X(v)}function z(v){return Ce(v)==="[object Number]"&&X(v)}function J(v){return Ce(v)==="[object Boolean]"&&X(v)}function xe(v){if(D)return v&&typeof v=="object"&&v instanceof Symbol;if(typeof v=="symbol")return!0;if(!v||typeof v!="object"||!P)return!1;try{return P.call(v),!0}catch{}return!1}function ye(v){if(!v||typeof v!="object"||!C)return!1;try{return C.call(v),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function(v){return v in this};function Se(v,b){return be.call(v,b)}function Ce(v){return x.call(v)}function Ke(v){if(v.name)return v.name;var b=y.call(g.call(v),/^function\s*([\w$]+)/);return b?b[1]:null}function _e(v,b){if(v.indexOf)return v.indexOf(b);for(var ae=0,se=v.length;ae<se;ae++)if(v[ae]===b)return ae;return-1}function je(v){if(!r||!v||typeof v!="object")return!1;try{r.call(v);try{a.call(v)}catch{return!0}return v instanceof Map}catch{}return!1}function Xe(v){if(!u||!v||typeof v!="object")return!1;try{u.call(v,u);try{d.call(v,d)}catch{return!0}return v instanceof WeakMap}catch{}return!1}function Ye(v){if(!p||!v||typeof v!="object")return!1;try{return p.call(v),!0}catch{}return!1}function Je(v){if(!a||!v||typeof v!="object")return!1;try{a.call(v);try{r.call(v)}catch{return!0}return v instanceof Set}catch{}return!1}function Tr(v){if(!d||!v||typeof v!="object")return!1;try{d.call(v,d);try{u.call(v,u)}catch{return!0}return v instanceof WeakSet}catch{}return!1}function st(v){return!v||typeof v!="object"?!1:typeof HTMLElement<"u"&&v instanceof HTMLElement?!0:typeof v.nodeName=="string"&&typeof v.getAttribute=="function"}function kt(v,b){if(v.length>b.maxStringLength){var ae=v.length-b.maxStringLength,se="... "+ae+" more character"+(ae>1?"s":"");return kt(S.call(v,0,b.maxStringLength),b)+se}var ce=$e[b.quoteStyle||"single"];ce.lastIndex=0;var Q=E.call(E.call(v,ce,"\\$1"),/[\x00-\x1f]/g,Xt);return I(Q,"single",b)}function Xt(v){var b=v.charCodeAt(0),ae={8:"b",9:"t",10:"n",12:"f",13:"r"}[b];return ae?"\\"+ae:"\\x"+(b<16?"0":"")+T.call(b.toString(16))}function ct(v){return"Object("+v+")"}function _n(v){return v+" { ? }"}function us(v,b,ae,se){var ce=se?Dn(ae,se):k.call(ae,", ");return v+" ("+b+") {"+ce+"}"}function uf(v){for(var b=0;b<v.length;b++)if(_e(v[b],`
6
6
  `)>=0)return!1;return!0}function df(v,b){var ae;if(v.indent===" ")ae=" ";else if(typeof v.indent=="number"&&v.indent>0)ae=k.call(Array(v.indent+1)," ");else return null;return{base:ae,prev:k.call(Array(b+1),ae)}}function Dn(v,b){if(v.length===0)return"";var ae=`
7
7
  `+b.prev+b.base;return ae+k.call(v,","+ae)+`
8
8
  `+b.prev}function Ir(v,b){var ae=V(v),se=[];if(ae){se.length=v.length;for(var ce=0;ce<v.length;ce++)se[ce]=Se(v,ce)?b(v[ce],v):""}var Q=typeof A=="function"?A(v):[],lt;if(D){lt={};for(var bt=0;bt<Q.length;bt++)lt["$"+Q[bt]]=Q[bt]}for(var Ie in v)Se(v,Ie)&&(ae&&String(Number(Ie))===Ie&&Ie<v.length||D&&lt["$"+Ie]instanceof Symbol||(M.call(/[^\w$]/,Ie)?se.push(b(Ie,v)+": "+b(v[Ie],v)):se.push(Ie+": "+b(v[Ie],v))));if(typeof A=="function")for(var ut=0;ut<Q.length;ut++)H.call(v,Q[ut])&&se.push("["+b(Q[ut])+"]: "+b(v[Q[ut]],v));return se}return ho}var po,gl;function ly(){if(gl)return po;gl=1;var e=$n(),t=Me(),r=function(s,l,u){for(var f=s,d;(d=f.next)!=null;f=d)if(d.key===l)return f.next=d.next,u||(d.next=s.next,s.next=d),d},n=function(s,l){if(s){var u=r(s,l);return u&&u.value}},i=function(s,l,u){var f=r(s,l);f?f.value=u:s.next={key:l,next:s.next,value:u}},o=function(s,l){return s?!!r(s,l):!1},a=function(s,l){if(s)return r(s,l,!0)};return po=function(){var l,u={assert:function(f){if(!u.has(f))throw new t("Side channel does not contain "+e(f))},delete:function(f){var d=l&&l.next,h=a(l,f);return h&&d&&d===h&&(l=void 0),!!h},get:function(f){return n(l,f)},has:function(f){return o(l,f)},set:function(f,d){l||(l={next:void 0}),i(l,f,d)}};return u},po}var mo,xl;function Gd(){if(xl)return mo;xl=1;var e=at(),t=Ae(),r=$n(),n=Me(),i=e("%Map%",!0),o=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),s=t("Map.prototype.has",!0),l=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return mo=!!i&&function(){var d,h={assert:function(p){if(!h.has(p))throw new n("Side channel does not contain "+r(p))},delete:function(p){if(d){var m=l(d,p);return u(d)===0&&(d=void 0),m}return!1},get:function(p){if(d)return o(d,p)},has:function(p){return d?s(d,p):!1},set:function(p,m){d||(d=new i),a(d,p,m)}};return h},mo}var go,vl;function uy(){if(vl)return go;vl=1;var e=at(),t=Ae(),r=$n(),n=Gd(),i=Me(),o=e("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return go=o?function(){var d,h,p={assert:function(m){if(!p.has(m))throw new i("Side channel does not contain "+r(m))},delete:function(m){if(o&&m&&(typeof m=="object"||typeof m=="function")){if(d)return u(d,m)}else if(n&&h)return h.delete(m);return!1},get:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?a(d,m):h&&h.get(m)},has:function(m){return o&&m&&(typeof m=="object"||typeof m=="function")&&d?l(d,m):!!h&&h.has(m)},set:function(m,x){o&&m&&(typeof m=="object"||typeof m=="function")?(d||(d=new o),s(d,m,x)):n&&(h||(h=n()),h.set(m,x))}};return p}:n,go}var xo,yl;function Vd(){if(yl)return xo;yl=1;var e=Me(),t=$n(),r=ly(),n=Gd(),i=uy(),o=i||n||r;return xo=function(){var s,l={assert:function(u){if(!l.has(u))throw new e("Side channel does not contain "+t(u))},delete:function(u){return!!s&&s.delete(u)},get:function(u){return s&&s.get(u)},has:function(u){return!!s&&s.has(u)},set:function(u,f){s||(s=o()),s.set(u,f)}};return l},xo}var vo,bl;function dy(){if(bl)return vo;bl=1;var e=cs(),t=Vd()(),r=Me(),n={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");if(t.assert(i),!n.has(i,o))throw new r("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var a=t.get(i);return a&&a["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var a=t.get(i);return!!a&&e(a,"$"+o)},set:function(i,o,a){if(!i||typeof i!="object"&&typeof i!="function")throw new r("`O` is not an object");if(typeof o!="string")throw new r("`slot` must be a string");var s=t.get(i);s||(s={},t.set(i,s)),s["$"+o]=a}};return Object.freeze&&Object.freeze(n),vo=n,vo}var yo,wl;function fy(){if(wl)return yo;wl=1;var e=dy(),t=es(),r=typeof StopIteration=="object"?StopIteration:null;return yo=function(i){if(!r)throw new t("this environment lacks StopIteration");e.set(i,"[[Done]]",!1);var o={next:function(){var s=e.get(this,"[[Iterator]]"),l=!!e.get(s,"[[Done]]");try{return{done:l,value:l?void 0:s.next()}}catch(u){if(e.set(s,"[[Done]]",!0),u!==r)throw u;return{done:!0,value:void 0}}}};return e.set(o,"[[Iterator]]",i),o},yo}var bo,Sl;function Kd(){if(Sl)return bo;Sl=1;var e={}.toString;return bo=Array.isArray||function(t){return e.call(t)=="[object Array]"},bo}var wo,Al;function Xd(){if(Al)return wo;Al=1;var e=Ae(),t=e("String.prototype.valueOf"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object String]",o=Ot()();return wo=function(s){return typeof s=="string"?!0:!s||typeof s!="object"?!1:o?r(s):n(s)===i},wo}var So,Cl;function Yd(){if(Cl)return So;Cl=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;e||(r=function(a){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!n&&(r=function(a){return!1}),So=r||function(a){if(!a||typeof a!="object")return!1;try{if(n.call(a),i)try{i.call(a)}catch{return!0}return a instanceof e}catch{}return!1},So}var Ao,jl;function Jd(){if(jl)return Ao;jl=1;var e=typeof Map=="function"&&Map.prototype?Map:null,t=typeof Set=="function"&&Set.prototype?Set:null,r;t||(r=function(a){return!1});var n=e?Map.prototype.has:null,i=t?Set.prototype.has:null;return!r&&!i&&(r=function(a){return!1}),Ao=r||function(a){if(!a||typeof a!="object")return!1;try{if(i.call(a),n)try{n.call(a)}catch{return!0}return a instanceof t}catch{}return!1},Ao}var El;function hy(){if(El)return tr.exports;El=1;var e=Wd(),t=fy();if(is()()||Ln()()){var r=Symbol.iterator;tr.exports=function(O){if(O!=null&&typeof O[r]<"u")return O[r]();if(e(O))return Array.prototype[r].call(O)}}else{var n=Kd(),i=Xd(),o=at(),a=o("%Map%",!0),s=o("%Set%",!0),l=qd(),u=l("Array.prototype.push"),f=l("String.prototype.charCodeAt"),d=l("String.prototype.slice"),h=function(O,$){var C=O.length;if($+1>=C)return $+1;var A=f(O,$);if(A<55296||A>56319)return $+1;var P=f(O,$+1);return P<56320||P>57343?$+1:$+2},p=function(O){var $=0;return{next:function(){var A=$>=O.length,P;return A||(P=O[$],$+=1),{done:A,value:P}}}},m=function(O,$){if(n(O)||e(O))return p(O);if(i(O)){var C=0;return{next:function(){var P=h(O,C),D=d(O,C,P);return C=P,{done:P>O.length,value:D}}}}if($&&typeof O["_es6-shim iterator_"]<"u")return O["_es6-shim iterator_"]()};if(!a&&!s)tr.exports=function(O){if(O!=null)return m(O,!0)};else{var x=Yd(),g=Jd(),y=l("Map.prototype.forEach",!0),S=l("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var E=l("Map.prototype.iterator",!0),T=l("Set.prototype.iterator",!0);var j=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),M=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),L=function(O){if(x(O)){if(E)return t(E(O));if(j)return j(O);if(y){var $=[];return y(O,function(A,P){u($,[P,A])}),p($)}}if(g(O)){if(T)return t(T(O));if(M)return M(O);if(S){var C=[];return S(O,function(A){u(C,A)}),p(C)}}};tr.exports=function(O){return L(O)||m(O)}}}return tr.exports}var Co,Tl;function Zd(){if(Tl)return Co;Tl=1;var e=function(t){return t!==t};return Co=function(r,n){return r===0&&n===0?1/r===1/n:!!(r===n||e(r)&&e(n))},Co}var jo,Il;function Qd(){if(Il)return jo;Il=1;var e=Zd();return jo=function(){return typeof Object.is=="function"?Object.is:e},jo}var Eo,Rl;function py(){if(Rl)return Eo;Rl=1;var e=Qd(),t=Pt();return Eo=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},Eo}var To,Pl;function my(){if(Pl)return To;Pl=1;var e=Pt(),t=Kt(),r=Zd(),n=Qd(),i=py(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),To=o,To}var Io,Ol;function ef(){if(Ol)return Io;Ol=1;var e=Kt(),t=Ae(),r=at(),n=r("%ArrayBuffer%",!0),i=t("ArrayBuffer.prototype.byteLength",!0),o=t("Object.prototype.toString"),a=!!n&&!i&&new n(0).slice,s=!!a&&e(a);return Io=i||s?function(u){if(!u||typeof u!="object")return!1;try{return i?i(u):s(u,0),!0}catch{return!1}}:n?function(u){return o(u)==="[object ArrayBuffer]"}:function(u){return!1},Io}var Ro,kl;function gy(){if(kl)return Ro;kl=1;var e=Ae(),t=e("Date.prototype.getDay"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Date]",o=Ot()();return Ro=function(s){return typeof s!="object"||s===null?!1:o?r(s):n(s)===i},Ro}var Po,Nl;function tf(){if(Nl)return Po;Nl=1;var e=Ae(),t=Ot()(),r=cs(),n=Rt(),i;if(t){var o=e("RegExp.prototype.exec"),a={},s=function(){throw a},l={toString:s,valueOf:s};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=s),i=function(h){if(!h||typeof h!="object")return!1;var p=n(h,"lastIndex"),m=p&&r(p,"value");if(!m)return!1;try{o(h,l)}catch(x){return x===a}}}else{var u=e("Object.prototype.toString"),f="[object RegExp]";i=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:u(h)===f}}return Po=i,Po}var Oo,Ml;function xy(){if(Ml)return Oo;Ml=1;var e=Ae(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return Oo=t?function(n){if(!n||typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}:function(n){return!1},Oo}var ko,Ll;function vy(){if(Ll)return ko;Ll=1;var e=Ae(),t=e("Number.prototype.toString"),r=function(s){try{return t(s),!0}catch{return!1}},n=e("Object.prototype.toString"),i="[object Number]",o=Ot()();return ko=function(s){return typeof s=="number"?!0:!s||typeof s!="object"?!1:o?r(s):n(s)===i},ko}var No,$l;function yy(){if($l)return No;$l=1;var e=Ae(),t=e("Boolean.prototype.toString"),r=e("Object.prototype.toString"),n=function(s){try{return t(s),!0}catch{return!1}},i="[object Boolean]",o=Ot()();return No=function(s){return typeof s=="boolean"?!0:s===null||typeof s!="object"?!1:o?n(s):r(s)===i},No}var zr={exports:{}},Mo,_l;function by(){if(_l)return Mo;_l=1;var e=Ae(),t=tf(),r=e("RegExp.prototype.exec"),n=Me();return Mo=function(o){if(!t(o))throw new n("`regex` must be a RegExp");return function(s){return r(o,s)!==null}},Mo}var Dl;function wy(){if(Dl)return zr.exports;Dl=1;var e=Ae(),t=e("Object.prototype.toString"),r=is()(),n=by();if(r){var i=e("Symbol.prototype.toString"),o=n(/^Symbol\(.*\)$/),a=function(l){return typeof l.valueOf()!="symbol"?!1:o(i(l))};zr.exports=function(l){if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||t(l)!=="[object Symbol]")return!1;try{return a(l)}catch{return!1}}}else zr.exports=function(l){return!1};return zr.exports}var Hr={exports:{}},Lo,Bl;function Sy(){if(Bl)return Lo;Bl=1;var e=typeof BigInt<"u"&&BigInt;return Lo=function(){return typeof e=="function"&&typeof BigInt=="function"&&typeof e(42)=="bigint"&&typeof BigInt(42)=="bigint"},Lo}var zl;function Ay(){if(zl)return Hr.exports;zl=1;var e=Sy()();if(e){var t=BigInt.prototype.valueOf,r=function(i){try{return t.call(i),!0}catch{}return!1};Hr.exports=function(i){return i===null||typeof i>"u"||typeof i=="boolean"||typeof i=="string"||typeof i=="number"||typeof i=="symbol"||typeof i=="function"?!1:typeof i=="bigint"?!0:r(i)}}else Hr.exports=function(i){return!1};return Hr.exports}var $o,Hl;function Cy(){if(Hl)return $o;Hl=1;var e=Xd(),t=vy(),r=yy(),n=wy(),i=Ay();return $o=function(a){if(a==null||typeof a!="object"&&typeof a!="function")return null;if(e(a))return"String";if(t(a))return"Number";if(r(a))return"Boolean";if(n(a))return"Symbol";if(i(a))return"BigInt"},$o}var _o,ql;function jy(){if(ql)return _o;ql=1;var e=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,t=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,r;e||(r=function(a){return!1});var n=e?e.prototype.has:null,i=t?t.prototype.has:null;return!r&&!n&&(r=function(a){return!1}),_o=r||function(a){if(!a||typeof a!="object")return!1;try{if(n.call(a,n),i)try{i.call(a,i)}catch{return!0}return a instanceof e}catch{}return!1},_o}var qr={exports:{}},Fl;function Ey(){if(Fl)return qr.exports;Fl=1;var e=at(),t=Ae(),r=e("%WeakSet%",!0),n=t("WeakSet.prototype.has",!0);if(n){var i=t("WeakMap.prototype.has",!0);qr.exports=function(a){if(!a||typeof a!="object")return!1;try{if(n(a,n),i)try{i(a,i)}catch{return!0}return a instanceof r}catch{}return!1}}else qr.exports=function(a){return!1};return qr.exports}var Do,Ul;function Ty(){if(Ul)return Do;Ul=1;var e=Yd(),t=Jd(),r=jy(),n=Ey();return Do=function(o){if(o&&typeof o=="object"){if(e(o))return"Map";if(t(o))return"Set";if(r(o))return"WeakMap";if(n(o))return"WeakSet"}return!1},Do}var Bo,Wl;function Iy(){if(Wl)return Bo;Wl=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(S){S!==n&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(E){try{var T=e.call(E);return i.test(T)}catch{return!1}},a=function(E){try{return o(E)?!1:(e.call(E),!0)}catch{return!1}},s=Object.prototype.toString,l="[object Object]",u="[object Function]",f="[object GeneratorFunction]",d="[object HTMLAllCollection]",h="[object HTML document.all class]",p="[object HTMLCollection]",m=typeof Symbol=="function"&&!!Symbol.toStringTag,x=!(0 in[,]),g=function(){return!1};if(typeof document=="object"){var y=document.all;s.call(y)===s.call(document.all)&&(g=function(E){if((x||!E)&&(typeof E>"u"||typeof E=="object"))try{var T=s.call(E);return(T===d||T===h||T===p||T===l)&&E("")==null}catch{}return!1})}return Bo=t?function(E){if(g(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{t(E,null,r)}catch(T){if(T!==n)return!1}return!o(E)&&a(E)}:function(E){if(g(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(m)return a(E);if(o(E))return!1;var T=s.call(E);return T!==u&&T!==f&&!/^\[object HTML/.test(T)?!1:a(E)},Bo}var zo,Gl;function Ry(){if(Gl)return zo;Gl=1;var e=Iy(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(l,u,f){for(var d=0,h=l.length;d<h;d++)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))},i=function(l,u,f){for(var d=0,h=l.length;d<h;d++)f==null?u(l.charAt(d),d,l):u.call(f,l.charAt(d),d,l)},o=function(l,u,f){for(var d in l)r.call(l,d)&&(f==null?u(l[d],d,l):u.call(f,l[d],d,l))};function a(s){return t.call(s)==="[object Array]"}return zo=function(l,u,f){if(!e(u))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=f),a(l)?n(l,u,d):typeof l=="string"?i(l,u,d):o(l,u,d)},zo}var Ho,Vl;function Py(){return Vl||(Vl=1,Ho=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ho}var qo,Kl;function Oy(){if(Kl)return qo;Kl=1;var e=Py(),t=typeof globalThis>"u"?wr:globalThis;return qo=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},qo}var Fo,Xl;function ky(){if(Xl)return Fo;Xl=1;var e=Ry(),t=Oy(),r=Kt(),n=Ae(),i=Rt(),o=n("Object.prototype.toString"),a=Ot()(),s=typeof globalThis>"u"?wr:globalThis,l=t(),u=n("String.prototype.slice"),f=Object.getPrototypeOf,d=n("Array.prototype.indexOf",!0)||function(g,y){for(var S=0;S<g.length;S+=1)if(g[S]===y)return S;return-1},h={__proto__:null};a&&i&&f?e(l,function(x){var g=new s[x];if(Symbol.toStringTag in g){var y=f(g),S=i(y,Symbol.toStringTag);if(!S){var E=f(y);S=i(E,Symbol.toStringTag)}h["$"+x]=r(S.get)}}):e(l,function(x){var g=new s[x],y=g.slice||g.set;y&&(h["$"+x]=r(y))});var p=function(g){var y=!1;return e(h,function(S,E){if(!y)try{"$"+S(g)===E&&(y=u(E,1))}catch{}}),y},m=function(g){var y=!1;return e(h,function(S,E){if(!y)try{S(g),y=u(E,1)}catch{}}),y};return Fo=function(g){if(!g||typeof g!="object")return!1;if(!a){var y=u(o(g),8,-1);return d(l,y)>-1?y:y!=="Object"?!1:m(g)}return i?p(g):null},Fo}var Uo,Yl;function Ny(){if(Yl)return Uo;Yl=1;var e=Ae(),t=e("ArrayBuffer.prototype.byteLength",!0),r=ef();return Uo=function(i){return r(i)?t?t(i):i.byteLength:NaN},Uo}var Wo,Jl;function My(){if(Jl)return Wo;Jl=1;var e=ty(),t=qd(),r=oy(),n=at(),i=hy(),o=Vd(),a=my(),s=Wd(),l=Kd(),u=ef(),f=gy(),d=tf(),h=xy(),p=Qa(),m=Cy(),x=Ty(),g=ky(),y=Ny(),S=t("SharedArrayBuffer.prototype.byteLength",!0),E=t("Date.prototype.getTime"),T=Object.getPrototypeOf,j=t("Object.prototype.toString"),M=n("%Set%",!0),L=t("Map.prototype.has",!0),k=t("Map.prototype.get",!0),O=t("Map.prototype.size",!0),$=t("Set.prototype.add",!0),C=t("Set.prototype.delete",!0),A=t("Set.prototype.has",!0),P=t("Set.prototype.size",!0);function D(I,_,X,V){for(var ee=i(I),ie;(ie=ee.next())&&!ie.done;)if(ne(_,ie.value,X,V))return C(I,ie.value),!0;return!1}function U(I){if(typeof I>"u")return null;if(typeof I!="object")return typeof I=="symbol"?!1:typeof I=="string"||typeof I=="number"?+I==+I:!0}function H(I,_,X,V,ee,ie){var F=U(X);if(F!=null)return F;var G=k(_,F),z=e({},ee,{strict:!1});return typeof G>"u"&&!L(_,F)||!ne(V,G,z,ie)?!1:!L(I,F)&&ne(V,G,z,ie)}function K(I,_,X){var V=U(X);return V??(A(_,V)&&!A(I,V))}function te(I,_,X,V,ee,ie){for(var F=i(I),G,z;(G=F.next())&&!G.done;)if(z=G.value,ne(X,z,ee,ie)&&ne(V,k(_,z),ee,ie))return C(I,z),!0;return!1}function ne(I,_,X,V){var ee=X||{};if(ee.strict?a(I,_):I===_)return!0;var ie=m(I),F=m(_);if(ie!==F)return!1;if(!I||!_||typeof I!="object"&&typeof _!="object")return ee.strict?a(I,_):I==_;var G=V.has(I),z=V.has(_),J;if(G&&z){if(V.get(I)===V.get(_))return!0}else J={};return G||V.set(I,J),z||V.set(_,J),$e(I,_,ee,V)}function ve(I){return!I||typeof I!="object"||typeof I.length!="number"||typeof I.copy!="function"||typeof I.slice!="function"||I.length>0&&typeof I[0]!="number"?!1:!!(I.constructor&&I.constructor.isBuffer&&I.constructor.isBuffer(I))}function ge(I,_,X,V){if(P(I)!==P(_))return!1;for(var ee=i(I),ie=i(_),F,G,z;(F=ee.next())&&!F.done;)if(F.value&&typeof F.value=="object")z||(z=new M),$(z,F.value);else if(!A(_,F.value)){if(X.strict||!K(I,_,F.value))return!1;z||(z=new M),$(z,F.value)}if(z){for(;(G=ie.next())&&!G.done;)if(G.value&&typeof G.value=="object"){if(!D(z,G.value,X.strict,V))return!1}else if(!X.strict&&!A(I,G.value)&&!D(z,G.value,X.strict,V))return!1;return P(z)===0}return!0}function Le(I,_,X,V){if(O(I)!==O(_))return!1;for(var ee=i(I),ie=i(_),F,G,z,J,xe,ye;(F=ee.next())&&!F.done;)if(J=F.value[0],xe=F.value[1],J&&typeof J=="object")z||(z=new M),$(z,J);else if(ye=k(_,J),typeof ye>"u"&&!L(_,J)||!ne(xe,ye,X,V)){if(X.strict||!H(I,_,J,xe,X,V))return!1;z||(z=new M),$(z,J)}if(z){for(;(G=ie.next())&&!G.done;)if(J=G.value[0],ye=G.value[1],J&&typeof J=="object"){if(!te(z,I,J,ye,X,V))return!1}else if(!X.strict&&(!I.has(J)||!ne(k(I,J),ye,X,V))&&!te(z,I,J,ye,e({},X,{strict:!1}),V))return!1;return P(z)===0}return!0}function $e(I,_,X,V){var ee,ie;if(typeof I!=typeof _||I==null||_==null||j(I)!==j(_)||s(I)!==s(_))return!1;var F=l(I),G=l(_);if(F!==G)return!1;var z=I instanceof Error,J=_ instanceof Error;if(z!==J||(z||J)&&(I.name!==_.name||I.message!==_.message))return!1;var xe=d(I),ye=d(_);if(xe!==ye||(xe||ye)&&(I.source!==_.source||r(I)!==r(_)))return!1;var be=f(I),Se=f(_);if(be!==Se||(be||Se)&&E(I)!==E(_)||X.strict&&T&&T(I)!==T(_))return!1;var Ce=g(I),Ke=g(_);if(Ce!==Ke)return!1;if(Ce||Ke){if(I.length!==_.length)return!1;for(ee=0;ee<I.length;ee++)if(I[ee]!==_[ee])return!1;return!0}var _e=ve(I),je=ve(_);if(_e!==je)return!1;if(_e||je){if(I.length!==_.length)return!1;for(ee=0;ee<I.length;ee++)if(I[ee]!==_[ee])return!1;return!0}var Xe=u(I),Ye=u(_);if(Xe!==Ye)return!1;if(Xe||Ye)return y(I)!==y(_)?!1:typeof Uint8Array=="function"&&ne(new Uint8Array(I),new Uint8Array(_),X,V);var Je=h(I),Tr=h(_);if(Je!==Tr)return!1;if(Je||Tr)return S(I)!==S(_)?!1:typeof Uint8Array=="function"&&ne(new Uint8Array(I),new Uint8Array(_),X,V);if(typeof I!=typeof _)return!1;var st=p(I),kt=p(_);if(st.length!==kt.length)return!1;for(st.sort(),kt.sort(),ee=st.length-1;ee>=0;ee--)if(st[ee]!=kt[ee])return!1;for(ee=st.length-1;ee>=0;ee--)if(ie=st[ee],!ne(I[ie],_[ie],X,V))return!1;var Xt=x(I),ct=x(_);return Xt!==ct?!1:Xt==="Set"||ct==="Set"?ge(I,_,X,V):Xt==="Map"?Le(I,_,X,V):!0}return Wo=function(_,X,V){return ne(_,X,V,o())},Wo}var Ly=My();const rf=kd(Ly);function $y(e){return e}function nf(e,t,r,n){const i=$y,[o,a]=w.useState(i(r)),s=w.useRef(o);return w.useEffect(()=>{const l=()=>{const u={...r,...e.getAttributes(t)};Object.keys(u).forEach(d=>{(u[d]===null||u[d]===void 0)&&(u[d]=r?r[d]:null)});const f=i(u);rf(s.current,f)||(a(f),s.current=f)};return e.on("selectionUpdate",l),e.on("transaction",l),()=>{e.off("selectionUpdate",l),e.off("transaction",l)}},[e,r,t,i]),o}function _y({editor:e}){const{t}=q.useLocale(),{width:r,height:n,src:i}=nf(e,St.name,{width:0,height:0,src:"",defaultShowPicker:!1}),[o,a]=w.useState(!1),[s,l]=w.useState(""),u=w.useCallback(()=>{a(!1)},[a]);w.useEffect(()=>{o&&l(i)},[o,i]);const f=w.useCallback(()=>{const g=Pd(s);e.chain().updateAttributes(St.name,{src:(g==null?void 0:g.src)||s}).setNodeSelection(e.state.selection.from).focus().run(),a(!1)},[e,s,a]),d=w.useCallback(()=>{window.open(i,"_blank")},[i]),h=w.useCallback(()=>{a(!0)},[a]),p=w.useCallback(g=>{e.chain().updateAttributes(St.name,g).setNodeSelection(e.state.selection.from).focus().run()},[e]),m=w.useCallback(()=>e.isActive(St.name)&&!i,[e,i]),x=w.useCallback(()=>Wa(St.name,e),[e]);return c.jsxs(c.Fragment,{children:[c.jsx(pe.BubbleMenu,{className:"bubble-menu",editor:e,pluginKey:"iframe-bubble-menu",shouldShow:m,tippyOptions:{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},placement:"bottom-start",offset:[-2,16],zIndex:9999},children:c.jsxs("div",{className:"richtext-pointer-events-auto richtext-w-auto richtext-select-none richtext-rounded-sm !richtext-border richtext-border-neutral-200 richtext-bg-background richtext-px-3 richtext-py-2 richtext-shadow-sm richtext-transition-all dark:richtext-border-neutral-800",children:[c.jsx(W,{action:d,icon:"Eye",tooltip:"Visit Link"}),c.jsx(W,{action:h,icon:"Pencil",tooltip:"Open Edit Link"}),c.jsx(Rd,{height:n,onOk:p,width:r,children:c.jsx(W,{icon:"Settings",tooltip:t("editor.settings")})}),c.jsx(W,{action:x,icon:"Trash2",tooltip:t("editor.delete")})]})}),c.jsxs(Cr,{onOpenChange:a,open:o,children:[c.jsx(jr,{}),c.jsxs(Ft,{children:[c.jsx(ud,{children:c.jsx(Ut,{children:"Edit Link Iframe"})}),c.jsx(Te,{autoFocus:!0,onInput:g=>l(g.target.value),placeholder:"Enter link",type:"url",value:s}),c.jsxs(In,{children:[c.jsx(we,{onClick:u,children:"Cancel"}),c.jsx(we,{onClick:f,children:"OK"})]})]})]})]})}function Dy({editor:e,disabled:t,bubbleMenu:r}){const n=e.extensionManager.extensions.map(o=>o.name),i=()=>{var o,a,s,l,u,f,d,h,p,m;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?c.jsx(Q1,{editor:e},"columns"):null,n.includes("table")&&!((a=r==null?void 0:r.tableConfig)!=null&&a.hidden)?c.jsx(M0,{actions:(s=r==null?void 0:r.tableConfig)==null?void 0:s.actions,editor:e},"table"):null,n.includes("link")&&!((l=r==null?void 0:r.linkConfig)!=null&&l.hidden)?c.jsx(c1,{disabled:t,editor:e},"link"):null,n.includes(Ht.name)&&!((u=r==null?void 0:r.imageConfig)!=null&&u.hidden)?c.jsx(G1,{disabled:t,editor:e},"image"):null,n.includes(za.name)&&!((f=r==null?void 0:r.imageGifConfig)!=null&&f.hidden)?c.jsx(V1,{disabled:t,editor:e},"imageGif"):null,n.includes("video")&&!((d=r==null?void 0:r.videoConfig)!=null&&d.hidden)?c.jsx(K1,{disabled:t,editor:e},"video"):null,n.includes("iframe")&&!((h=r==null?void 0:r.iframeConfig)!=null&&h.hidden)?c.jsx(_y,{disabled:t,editor:e},"iframe"):null,(p=r==null?void 0:r.floatingMenuConfig)!=null&&p.hidden?null:c.jsx(l0,{disabled:t,editor:e},"content"),(m=r==null?void 0:r.textConfig)!=null&&m.hidden?null:c.jsx(f0,{disabled:t,editor:e},"text")]};return r!=null&&r.render?r.render({editor:e,disabled:t||!1,extensionsNames:n,bubbleMenu:r},i()):i().filter(Boolean)}function Zl(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}function of(e){const{t}=q.useLocale(),{highlight:r=!1,disabled:n=!1,selectedColor:i,setSelectedColor:o,onChange:a,colors:s=q.COLORS_LIST}=e,l=w.useMemo(()=>{const p=s,m=[];for(let x=0;x<p.length;x+=10)m.push(p.slice(x,x+10));return m},[s]),[u,f]=w.useState([]),d=p=>{const m=[...u],x=m.indexOf(p);x!==-1&&m.splice(x,1),m.unshift(p),m.length>10&&m.pop(),f(m)};function h(p){if(p===void 0){o==null||o(p),a==null||a(p);return}/^#([\da-f]{3}){1,2}$/i.test(p)&&(o==null||o(p),a==null||a(p),d(p))}return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,className:"!richtext-p-0",disabled:n,children:e==null?void 0:e.children}),c.jsx(It,{align:"start",className:"richtext-size-full richtext-p-2",hideWhenDetached:!0,side:"bottom",children:c.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[r?c.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>h(void 0),children:[c.jsx(Zl,{}),c.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.nofill")})]}):c.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{h(void 0)},children:[c.jsx(Zl,{}),c.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:t("editor.default")})]}),l.map((p,m)=>c.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:p.map((x,g)=>c.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(x),children:c.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:x},children:x===i?c.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):c.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${g}`))},m)),c.jsxs("div",{children:[c.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),c.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:u==null?void 0:u.map((p,m)=>c.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>h(p),children:c.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:p},children:c.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:c.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${m}`))})]}),c.jsx(By,{setColor:h})]})})]})}function By({setColor:e}){const[t,r]=w.useState("#000000"),[n,i]=w.useState(!1),{t:o}=q.useLocale();return w.useEffect(()=>()=>{i(!1)},[]),c.jsxs(Wt,{open:n,children:[c.jsx(Gt,{asChild:!0,children:c.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",onClick:a=>{a.preventDefault(),i(!0)},children:[o("editor.color.more"),"..."]})}),c.jsxs(It,{children:[c.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[c.jsx(Tf.HexColorPicker,{color:t,onChange:r}),c.jsx(Te,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:t.slice(1),onChange:a=>{a.preventDefault(),r(`#${a.target.value}`)}})]}),c.jsx(Be,{className:"richtext-my-[10px]"}),c.jsx(we,{className:"richtext-w-full",onClick:a=>{a.preventDefault(),e(t),i(!1)},children:c.jsx(N.Plus,{size:16})})]})]})}function zy({editor:e,disabled:t,toolbar:r}){const{t:n,lang:i}=q.useLocale(),o=w.useMemo(()=>{const u=[...e.extensionManager.extensions].sort((d,h)=>{const p=d.options.sort??-1,m=h.options.sort??-1;return p-m});let f=[];for(const d of u){const{button:h,divider:p=!1,spacer:m=!1,toolbar:x=!0}=d.options;if(!h||!B1(h)||!x)continue;const g=h({editor:e,extension:d,t:n});if(Array.isArray(g)){const y=g.map((S,E)=>({button:S,divider:E===g.length-1?p:!1,spacer:E===0?m:!1,type:d.type,name:d.name}));f=[...f,...y];continue}f.push({button:g,divider:p,spacer:m,type:d.type,name:d.name})}return f},[e,n,i]),a=l=>c.jsx("div",{className:"richtext-px-1 richtext-py-2 !richtext-border-b",style:{pointerEvents:t?"none":"auto",opacity:t?.5:1},children:c.jsx("div",{className:"richtext-relative richtext-flex richtext-flex-wrap richtext-h-auto richtext-gap-y-1 richtext-gap-x-1",children:l})}),s=o.map((l,u)=>{var d,h;const f=l.button.component;return c.jsxs("div",{className:"richtext-flex richtext-items-center",children:[(l==null?void 0:l.spacer)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-[16px] !richtext-mx-[10px]"}),c.jsx(f,{...l.button.componentProps,disabled:t||((h=(d=l==null?void 0:l.button)==null?void 0:d.componentProps)==null?void 0:h.disabled)}),(l==null?void 0:l.divider)&&c.jsx(Be,{orientation:"vertical",className:"!richtext-h-auto !richtext-mx-2"})]},`toolbar-item-${u}`)});return r&&(r!=null&&r.render)?r.render({editor:e,disabled:t||!1},o,s,a):a(s)}function Hy({editor:e,extensions:t}){const{t:r}=q.useLocale(),n=w.useMemo(()=>{var i,o,a;return(a=(o=(i=t==null?void 0:t.find(s=>s.name==="base-kit"))==null?void 0:i.options)==null?void 0:o.characterCount)==null?void 0:a.limit},[t]);return n?c.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:c.jsx("div",{className:"richtext-flex richtext-flex-col",children:c.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:c.jsxs("span",{children:[e.storage.characterCount.characters(),"/",n," ",r("editor.characters")]})})})}):c.jsx("div",{className:"richtext-flex richtext-items-center richtext-justify-between richtext-p-3 richtext-border-t",children:c.jsx("div",{className:"richtext-flex richtext-flex-col",children:c.jsx("div",{className:"richtext-flex richtext-justify-end richtext-gap-3 richtext-text-sm",children:c.jsxs("span",{children:[e.storage.characterCount.characters()," ",r("editor.characters")]})})})})}function qy(){const{toasts:e}=Nn();return c.jsxs(nv,{children:[e.map(({id:t,title:r,description:n,action:i,...o})=>c.jsxs(Cd,{...o,children:[c.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[r&&c.jsx(Ed,{children:r}),n&&c.jsx(Td,{children:n})]}),i,c.jsx(jd,{})]},t)),c.jsx(Ad,{})]})}const Fy=`
9
9
  .reactjs-tiptap-editor,
10
10
  .richtext-dialog-content {
11
+ color: hsl(var(--richtext-foreground));
12
+
11
13
  button,
12
14
  input:where([type=button]),
13
15
  input:where([type=reset]),
@@ -50,7 +52,6 @@
50
52
  border-color: hsl(var(--richtext-border));
51
53
  }
52
54
 
53
- color: hsl(var(--richtext-foreground));
54
55
 
55
56
  hr {
56
57
  height: 0;
@@ -118,8 +119,10 @@
118
119
  }
119
120
  }
120
121
 
121
- .reactjs-tiptap-editor div[data-radix-popper-content-wrapper],
122
+ div[data-radix-popper-content-wrapper],
122
123
  div[data-tippy-root] {
124
+ color: hsl(var(--richtext-foreground));
125
+
123
126
  *,
124
127
  ::before,
125
128
  ::after {