reactjs-tiptap-editor 0.3.30 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +8 -2
  2. package/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
  3. package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-DKRF6oa0.js} +5 -5
  4. package/lib/Attachment.cjs +2 -2
  5. package/lib/Attachment.d.cts +47 -51
  6. package/lib/Attachment.d.ts +47 -51
  7. package/lib/Attachment.js +7 -6
  8. package/lib/BaseKit.cjs +3 -0
  9. package/lib/BaseKit.d.cts +481 -0
  10. package/lib/BaseKit.d.ts +481 -0
  11. package/lib/BaseKit.js +132 -0
  12. package/lib/Blockquote.cjs +5 -1
  13. package/lib/Blockquote.d.cts +47 -51
  14. package/lib/Blockquote.d.ts +47 -51
  15. package/lib/Blockquote.js +33 -17
  16. package/lib/Bold.cjs +1 -1
  17. package/lib/Bold.d.cts +47 -51
  18. package/lib/Bold.d.ts +47 -51
  19. package/lib/Bold.js +23 -16
  20. package/lib/BulletList.cjs +1 -1
  21. package/lib/BulletList.d.cts +48 -52
  22. package/lib/BulletList.d.ts +48 -52
  23. package/lib/BulletList.js +11 -57
  24. package/lib/Clear.cjs +1 -1
  25. package/lib/Clear.d.cts +47 -51
  26. package/lib/Clear.d.ts +47 -51
  27. package/lib/Clear.js +4 -2
  28. package/lib/Code.cjs +1 -1
  29. package/lib/Code.d.cts +47 -51
  30. package/lib/Code.d.ts +47 -51
  31. package/lib/Code.js +29 -25
  32. package/lib/CodeBlock.cjs +2 -2
  33. package/lib/CodeBlock.d.cts +47 -51
  34. package/lib/CodeBlock.d.ts +47 -51
  35. package/lib/CodeBlock.js +5 -4
  36. package/lib/CodeView.cjs +1 -1
  37. package/lib/CodeView.d.cts +47 -51
  38. package/lib/CodeView.d.ts +47 -51
  39. package/lib/CodeView.js +3 -2
  40. package/lib/Color.cjs +1 -1
  41. package/lib/Color.d.cts +48 -52
  42. package/lib/Color.d.ts +48 -52
  43. package/lib/Color.js +42 -74
  44. package/lib/Document.cjs +1 -1
  45. package/lib/Document.d.cts +47 -51
  46. package/lib/Document.d.ts +47 -51
  47. package/lib/Document.js +4 -8
  48. package/lib/{Drawer-BKTU9CpU.js → Drawer-CaAfmqNo.js} +268 -265
  49. package/lib/Drawer-CdvCMSzN.cjs +1 -0
  50. package/lib/Drawer.cjs +1 -1
  51. package/lib/Drawer.d.cts +47 -51
  52. package/lib/Drawer.d.ts +47 -51
  53. package/lib/Drawer.js +4 -4
  54. package/lib/Emoji.cjs +1 -1
  55. package/lib/Emoji.d.cts +50 -52
  56. package/lib/Emoji.d.ts +50 -52
  57. package/lib/Emoji.js +19790 -178
  58. package/lib/Excalidraw-BbMQhNvs.cjs +1 -0
  59. package/lib/Excalidraw-CVWz2Vyn.js +290 -0
  60. package/lib/Excalidraw.cjs +1 -1
  61. package/lib/Excalidraw.d.cts +47 -51
  62. package/lib/Excalidraw.d.ts +47 -51
  63. package/lib/Excalidraw.js +3 -3
  64. package/lib/ExportPdf.cjs +1 -1
  65. package/lib/ExportPdf.d.cts +47 -51
  66. package/lib/ExportPdf.d.ts +47 -51
  67. package/lib/ExportPdf.js +4 -2
  68. package/lib/ExportWord.cjs +1 -1
  69. package/lib/ExportWord.d.cts +47 -51
  70. package/lib/ExportWord.d.ts +47 -51
  71. package/lib/ExportWord.js +22 -51
  72. package/lib/FontFamily.cjs +1 -1
  73. package/lib/FontFamily.d.cts +48 -52
  74. package/lib/FontFamily.d.ts +48 -52
  75. package/lib/FontFamily.js +46 -74
  76. package/lib/FontSize.cjs +1 -1
  77. package/lib/FontSize.d.cts +47 -51
  78. package/lib/FontSize.d.ts +47 -51
  79. package/lib/FontSize.js +11 -8
  80. package/lib/FormatPainter.cjs +1 -1
  81. package/lib/FormatPainter.d.cts +47 -51
  82. package/lib/FormatPainter.d.ts +47 -51
  83. package/lib/FormatPainter.js +4 -2
  84. package/lib/Heading.cjs +1 -1
  85. package/lib/Heading.d.cts +47 -51
  86. package/lib/Heading.d.ts +47 -51
  87. package/lib/Heading.js +77 -65
  88. package/lib/Highlight.cjs +1 -1
  89. package/lib/Highlight.d.cts +47 -51
  90. package/lib/Highlight.d.ts +47 -51
  91. package/lib/Highlight.js +5 -4
  92. package/lib/History.cjs +1 -1
  93. package/lib/History.d.cts +49 -53
  94. package/lib/History.d.ts +49 -53
  95. package/lib/History.js +39 -403
  96. package/lib/HorizontalRule.cjs +1 -1
  97. package/lib/HorizontalRule.d.cts +47 -51
  98. package/lib/HorizontalRule.d.ts +47 -51
  99. package/lib/HorizontalRule.js +16 -65
  100. package/lib/Iframe.cjs +1 -1
  101. package/lib/Iframe.d.cts +47 -51
  102. package/lib/Iframe.d.ts +47 -51
  103. package/lib/Iframe.js +4 -4
  104. package/lib/Image.cjs +1 -1
  105. package/lib/Image.d.cts +47 -51
  106. package/lib/Image.d.ts +47 -51
  107. package/lib/Image.js +3 -3
  108. package/lib/ImageGif.cjs +1 -1
  109. package/lib/ImageGif.d.cts +47 -51
  110. package/lib/ImageGif.d.ts +47 -51
  111. package/lib/ImageGif.js +5 -5
  112. package/lib/ImportWord.cjs +72 -72
  113. package/lib/ImportWord.d.cts +47 -51
  114. package/lib/ImportWord.d.ts +47 -51
  115. package/lib/ImportWord.js +5654 -5616
  116. package/lib/Indent.cjs +1 -1
  117. package/lib/Indent.d.cts +47 -51
  118. package/lib/Indent.d.ts +47 -51
  119. package/lib/Indent.js +4 -2
  120. package/lib/Italic.cjs +1 -1
  121. package/lib/Italic.d.cts +47 -51
  122. package/lib/Italic.d.ts +47 -51
  123. package/lib/Italic.js +20 -14
  124. package/lib/Katex.cjs +1 -1
  125. package/lib/Katex.d.cts +47 -51
  126. package/lib/Katex.d.ts +47 -51
  127. package/lib/Katex.js +49 -48
  128. package/lib/LineHeight.cjs +1 -1
  129. package/lib/LineHeight.d.cts +47 -51
  130. package/lib/LineHeight.d.ts +47 -51
  131. package/lib/LineHeight.js +21 -18
  132. package/lib/Link.cjs +1 -1
  133. package/lib/Link.d.cts +47 -51
  134. package/lib/Link.d.ts +47 -51
  135. package/lib/Link.js +4 -4
  136. package/lib/ListItem.cjs +1 -1
  137. package/lib/ListItem.d.cts +52 -52
  138. package/lib/ListItem.d.ts +52 -52
  139. package/lib/ListItem.js +4 -30
  140. package/lib/Mention.cjs +1 -1
  141. package/lib/Mention.d.cts +47 -51
  142. package/lib/Mention.d.ts +47 -51
  143. package/lib/Mention.js +161 -132
  144. package/lib/Mermaid.cjs +2 -2
  145. package/lib/Mermaid.d.cts +47 -51
  146. package/lib/Mermaid.d.ts +47 -51
  147. package/lib/Mermaid.js +150 -147
  148. package/lib/MoreMark.cjs +1 -1
  149. package/lib/MoreMark.d.cts +47 -51
  150. package/lib/MoreMark.d.ts +47 -51
  151. package/lib/MoreMark.js +5 -3
  152. package/lib/MultiColumn.cjs +1 -1
  153. package/lib/MultiColumn.d.cts +47 -51
  154. package/lib/MultiColumn.d.ts +47 -51
  155. package/lib/MultiColumn.js +2 -2
  156. package/lib/OrderedList.cjs +1 -1
  157. package/lib/OrderedList.d.cts +48 -52
  158. package/lib/OrderedList.d.ts +48 -52
  159. package/lib/OrderedList.js +11 -75
  160. package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
  161. package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
  162. package/lib/SearchAndReplace.cjs +1 -1
  163. package/lib/SearchAndReplace.d.cts +60 -134
  164. package/lib/SearchAndReplace.d.ts +60 -134
  165. package/lib/SearchAndReplace.js +207 -194
  166. package/lib/Selection.cjs +1 -1
  167. package/lib/Selection.d.cts +47 -51
  168. package/lib/Selection.d.ts +47 -51
  169. package/lib/Selection.js +1 -1
  170. package/lib/SlashCommand.cjs +1 -1
  171. package/lib/SlashCommand.d.cts +47 -51
  172. package/lib/SlashCommand.d.ts +47 -51
  173. package/lib/SlashCommand.js +177 -222
  174. package/lib/Strike.cjs +1 -1
  175. package/lib/Strike.d.cts +47 -51
  176. package/lib/Strike.d.ts +47 -51
  177. package/lib/Strike.js +20 -14
  178. package/lib/SubAndSuperScript.cjs +1 -1
  179. package/lib/SubAndSuperScript.d.cts +47 -51
  180. package/lib/SubAndSuperScript.d.ts +47 -51
  181. package/lib/SubAndSuperScript.js +5 -3
  182. package/lib/Table.cjs +8 -10
  183. package/lib/Table.d.cts +50 -54
  184. package/lib/Table.d.ts +50 -54
  185. package/lib/Table.js +382 -2021
  186. package/lib/TableOfContent.cjs +1 -1
  187. package/lib/TableOfContent.d.cts +47 -51
  188. package/lib/TableOfContent.d.ts +47 -51
  189. package/lib/TableOfContent.js +53 -52
  190. package/lib/TaskList.cjs +1 -1
  191. package/lib/TaskList.d.cts +49 -53
  192. package/lib/TaskList.d.ts +49 -53
  193. package/lib/TaskList.js +12 -154
  194. package/lib/TextAlign.cjs +1 -1
  195. package/lib/TextAlign.d.cts +47 -51
  196. package/lib/TextAlign.d.ts +47 -51
  197. package/lib/TextAlign.js +11 -8
  198. package/lib/TextBubble.cjs +1 -1
  199. package/lib/TextBubble.d.cts +47 -51
  200. package/lib/TextBubble.d.ts +47 -51
  201. package/lib/TextBubble.js +5 -3
  202. package/lib/TextDirection.cjs +1 -1
  203. package/lib/TextDirection.d.cts +47 -51
  204. package/lib/TextDirection.d.ts +47 -51
  205. package/lib/TextDirection.js +15 -15
  206. package/lib/TextUnderline.cjs +1 -1
  207. package/lib/TextUnderline.d.cts +47 -51
  208. package/lib/TextUnderline.d.ts +47 -51
  209. package/lib/TextUnderline.js +40 -12
  210. package/lib/TrailingNode.cjs +1 -1
  211. package/lib/TrailingNode.d.cts +47 -51
  212. package/lib/TrailingNode.d.ts +47 -51
  213. package/lib/TrailingNode.js +1 -1
  214. package/lib/Twitter-BFULyqdR.js +1628 -0
  215. package/lib/Twitter-Cutpkh3h.cjs +1 -0
  216. package/lib/Twitter.cjs +1 -1
  217. package/lib/Twitter.d.cts +47 -51
  218. package/lib/Twitter.d.ts +47 -51
  219. package/lib/Twitter.js +3 -3
  220. package/lib/Video.cjs +1 -1
  221. package/lib/Video.d.cts +47 -51
  222. package/lib/Video.d.ts +47 -51
  223. package/lib/Video.js +3 -3
  224. package/lib/bubble-extra.cjs +2 -2
  225. package/lib/bubble-extra.d.cts +47 -51
  226. package/lib/bubble-extra.d.ts +47 -51
  227. package/lib/bubble-extra.js +200 -192
  228. package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
  229. package/lib/dom-dataset-lYeH6gfI.js +2361 -0
  230. package/lib/index-5iBZLua9.cjs +12 -0
  231. package/lib/index-6D1J-A-o.cjs +1 -0
  232. package/lib/index-B96Cclrj.cjs +3 -0
  233. package/lib/index-BBz7Nmv9.js +55 -0
  234. package/lib/index-BeCTd5v2.cjs +1 -0
  235. package/lib/index-ByurDDMv.js +237 -0
  236. package/lib/index-CUogRI7j.cjs +1 -0
  237. package/lib/index-Ch6dBBad.js +709 -0
  238. package/lib/index-DF2Lp4HZ.cjs +100 -0
  239. package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
  240. package/lib/index-Dbvi-Bvh.cjs +1 -0
  241. package/lib/index-DpCrt7xs.cjs +1 -0
  242. package/lib/index-DsAX1Vq8.cjs +1 -0
  243. package/lib/index-Dy4DlW9o.js +12 -0
  244. package/lib/index-J3jHHZ4d.js +200 -0
  245. package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
  246. package/lib/index-VvXaaKe3.js +898 -0
  247. package/lib/index-kbO3iWqL.js +13432 -0
  248. package/lib/index.cjs +1 -2
  249. package/lib/index.d.cts +49 -251
  250. package/lib/index.d.ts +49 -251
  251. package/lib/index.js +2 -588
  252. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  253. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  254. package/lib/locale-bundle.cjs +1 -1
  255. package/lib/locale-bundle.d.cts +47 -51
  256. package/lib/locale-bundle.d.ts +47 -51
  257. package/lib/locale-bundle.js +1 -1
  258. package/lib/style.css +1 -1
  259. package/lib/{textarea-D5WVZMgt.cjs → textarea-DFo_aXnj.cjs} +1 -1
  260. package/lib/{textarea-BglwYF6b.js → textarea-aPtytkDx.js} +1 -1
  261. package/package.json +76 -70
  262. package/lib/Drawer-CmoEF-Zg.cjs +0 -1
  263. package/lib/Excalidraw-CM74U5tG.js +0 -289
  264. package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
  265. package/lib/RichTextEditor-BQN2eLD_.js +0 -12775
  266. package/lib/RichTextEditor-C8Sm1E6J.cjs +0 -140
  267. package/lib/Twitter-CL2pu4QM.cjs +0 -17
  268. package/lib/Twitter-Dg6WWauX.js +0 -1743
  269. package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
  270. package/lib/dom-dataset-Di3tIRrR.js +0 -1031
  271. package/lib/index-BI-IcZcN.cjs +0 -1
  272. package/lib/index-ByRfqzMr.cjs +0 -89
  273. package/lib/index-C1fzuXpN.js +0 -46
  274. package/lib/index-CbQQFj2T.js +0 -133
  275. package/lib/index-DI9T3iLd.js +0 -12354
  276. package/lib/index-D_A0TBRA.cjs +0 -1
  277. package/lib/index-DclQSrIx.cjs +0 -1
  278. package/lib/index-Z4b9rzn-.cjs +0 -1
@@ -1,140 +0,0 @@
1
- "use strict";var pf=Object.defineProperty;var mf=(e,t,r)=>t in e?pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Pr=(e,t,r)=>mf(e,typeof t!="symbol"?t+"":t,r);const c=require("react/jsx-runtime"),w=require("react"),me=require("./dom-dataset-Byuf1YmW.cjs"),tu=require("@radix-ui/react-slot"),q=require("./index-D_A0TBRA.cjs"),gf=require("@radix-ui/react-separator"),xf=require("@radix-ui/react-toast"),M=require("lucide-react"),vf=require("@radix-ui/react-tooltip"),yf=require("@radix-ui/react-toggle"),kr=require("@radix-ui/react-icons"),bf=require("@radix-ui/react-popover"),wf=require("@radix-ui/react-label"),Sf=require("@radix-ui/react-dialog"),B=require("./index-ByRfqzMr.cjs"),Af=require("re-resizable"),Cf=require("react-image-crop"),jf=require("@radix-ui/react-tabs"),Tf=require("@radix-ui/react-checkbox"),ru=require("tippy.js"),Ef=require("react-colorful"),If=require("@radix-ui/react-switch"),Rf=require("@radix-ui/react-dropdown-menu");function Me(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const oe=Me(w),nu=Me(gf),Oe=Me(xf),Sr=Me(vf),iu=Me(yf),dr=Me(bf),ou=Me(wf),Ne=Me(Sf),jt=Me(jf),Go=Me(Tf),Vo=Me(If),fe=Me(Rf);var au=typeof global=="object"&&global&&global.Object===Object&&global,Of=typeof self=="object"&&self&&self.Object===Object&&self,Ve=au||Of||Function("return this")(),We=Ve.Symbol,su=Object.prototype,Pf=su.hasOwnProperty,kf=su.toString,Jt=We?We.toStringTag:void 0;function Nf(e){var t=Pf.call(e,Jt),r=e[Jt];try{e[Jt]=void 0;var n=!0}catch{}var i=kf.call(e);return n&&(t?e[Jt]=r:delete e[Jt]),i}var Mf=Object.prototype,Lf=Mf.toString;function $f(e){return Lf.call(e)}var _f="[object Null]",Df="[object Undefined]",ys=We?We.toStringTag:void 0;function yt(e){return e==null?e===void 0?Df:_f:ys&&ys in Object(e)?Nf(e):$f(e)}function nt(e){return e!=null&&typeof e=="object"}var Bf="[object Symbol]";function An(e){return typeof e=="symbol"||nt(e)&&yt(e)==Bf}function cu(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Ge=Array.isArray,bs=We?We.prototype:void 0,ws=bs?bs.toString:void 0;function Gr(e){if(typeof e=="string")return e;if(Ge(e))return cu(e,Gr)+"";if(An(e))return ws?ws.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var zf=/\s/;function Hf(e){for(var t=e.length;t--&&zf.test(e.charAt(t)););return t}var qf=/^\s+/;function Ff(e){return e&&e.slice(0,Hf(e)+1).replace(qf,"")}function xt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ss=NaN,Uf=/^[-+]0x[0-9a-f]+$/i,Wf=/^0b[01]+$/i,Gf=/^0o[0-7]+$/i,Vf=parseInt;function $t(e){if(typeof e=="number")return e;if(An(e))return Ss;if(xt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ff(e);var r=Wf.test(e);return r||Gf.test(e)?Vf(e.slice(2),r?2:8):Uf.test(e)?Ss:+e}var As=1/0,Kf=17976931348623157e292;function Xf(e){if(!e)return e===0?e:0;if(e=$t(e),e===As||e===-As){var t=e<0?-1:1;return t*Kf}return e===e?e:0}function Yf(e){var t=Xf(e),r=t%1;return t===t?r?t-r:t:0}function xa(e){return e}var Jf="[object AsyncFunction]",Zf="[object Function]",Qf="[object GeneratorFunction]",eh="[object Proxy]";function lu(e){if(!xt(e))return!1;var t=yt(e);return t==Zf||t==Qf||t==Jf||t==eh}var Gn=Ve["__core-js_shared__"],Cs=function(){var e=/[^.]+$/.exec(Gn&&Gn.keys&&Gn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function th(e){return!!Cs&&Cs in e}var rh=Function.prototype,nh=rh.toString;function Tt(e){if(e!=null){try{return nh.call(e)}catch{}try{return e+""}catch{}}return""}var ih=/[\\^$.*+?()[\]{}|]/g,oh=/^\[object .+?Constructor\]$/,ah=Function.prototype,sh=Object.prototype,ch=ah.toString,lh=sh.hasOwnProperty,uh=RegExp("^"+ch.call(lh).replace(ih,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dh(e){if(!xt(e)||th(e))return!1;var t=lu(e)?uh:oh;return t.test(Tt(e))}function fh(e,t){return e==null?void 0:e[t]}function Et(e,t){var r=fh(e,t);return dh(r)?r:void 0}var Ko=Et(Ve,"WeakMap");function hh(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var ph=800,mh=16,gh=Date.now;function xh(e){var t=0,r=0;return function(){var n=gh(),i=mh-(n-r);if(r=n,i>0){if(++t>=ph)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function vh(e){return function(){return e}}var js=function(){try{var e=Et(Object,"defineProperty");return e({},"",{}),e}catch{}}(),yh=js?function(e,t){return js(e,"toString",{configurable:!0,enumerable:!1,value:vh(t),writable:!0})}:xa,bh=xh(yh);function wh(e,t,r,n){for(var i=e.length,o=r+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function Sh(e){return e!==e}function Ah(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function Ch(e,t,r){return t===t?Ah(e,t,r):wh(e,Sh,r)}function jh(e,t){var r=e==null?0:e.length;return!!r&&Ch(e,t,0)>-1}var Th=9007199254740991,Eh=/^(?:0|[1-9]\d*)$/;function uu(e,t){var r=typeof e;return t=t??Th,!!t&&(r=="number"||r!="symbol"&&Eh.test(e))&&e>-1&&e%1==0&&e<t}function du(e,t){return e===t||e!==e&&t!==t}var Ts=Math.max;function Ih(e,t,r){return t=Ts(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=Ts(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),hh(e,this,s)}}function Rh(e,t){return bh(Ih(e,t,xa),e+"")}var Oh=9007199254740991;function va(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Oh}function fu(e){return e!=null&&va(e.length)&&!lu(e)}var Ph=Object.prototype;function kh(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ph;return e===r}function Nh(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Mh="[object Arguments]";function Es(e){return nt(e)&&yt(e)==Mh}var hu=Object.prototype,Lh=hu.hasOwnProperty,$h=hu.propertyIsEnumerable,ya=Es(function(){return arguments}())?Es:function(e){return nt(e)&&Lh.call(e,"callee")&&!$h.call(e,"callee")};function _h(){return!1}var pu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Is=pu&&typeof module=="object"&&module&&!module.nodeType&&module,Dh=Is&&Is.exports===pu,Rs=Dh?Ve.Buffer:void 0,Bh=Rs?Rs.isBuffer:void 0,Xo=Bh||_h,zh="[object Arguments]",Hh="[object Array]",qh="[object Boolean]",Fh="[object Date]",Uh="[object Error]",Wh="[object Function]",Gh="[object Map]",Vh="[object Number]",Kh="[object Object]",Xh="[object RegExp]",Yh="[object Set]",Jh="[object String]",Zh="[object WeakMap]",Qh="[object ArrayBuffer]",ep="[object DataView]",tp="[object Float32Array]",rp="[object Float64Array]",np="[object Int8Array]",ip="[object Int16Array]",op="[object Int32Array]",ap="[object Uint8Array]",sp="[object Uint8ClampedArray]",cp="[object Uint16Array]",lp="[object Uint32Array]",ue={};ue[tp]=ue[rp]=ue[np]=ue[ip]=ue[op]=ue[ap]=ue[sp]=ue[cp]=ue[lp]=!0;ue[zh]=ue[Hh]=ue[Qh]=ue[qh]=ue[ep]=ue[Fh]=ue[Uh]=ue[Wh]=ue[Gh]=ue[Vh]=ue[Kh]=ue[Xh]=ue[Yh]=ue[Jh]=ue[Zh]=!1;function up(e){return nt(e)&&va(e.length)&&!!ue[yt(e)]}function ba(e){return function(t){return e(t)}}var mu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,nr=mu&&typeof module=="object"&&module&&!module.nodeType&&module,dp=nr&&nr.exports===mu,Vn=dp&&au.process,Vr=function(){try{var e=nr&&nr.require&&nr.require("util").types;return e||Vn&&Vn.binding&&Vn.binding("util")}catch{}}(),Os=Vr&&Vr.isTypedArray,gu=Os?ba(Os):up,fp=Object.prototype,hp=fp.hasOwnProperty;function pp(e,t){var r=Ge(e),n=!r&&ya(e),i=!r&&!n&&Xo(e),o=!r&&!n&&!i&&gu(e),a=r||n||i||o,s=a?Nh(e.length,String):[],l=s.length;for(var u in e)hp.call(e,u)&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||uu(u,l)))&&s.push(u);return s}function mp(e,t){return function(r){return e(t(r))}}var gp=mp(Object.keys,Object),xp=Object.prototype,vp=xp.hasOwnProperty;function yp(e){if(!kh(e))return gp(e);var t=[];for(var r in Object(e))vp.call(e,r)&&r!="constructor"&&t.push(r);return t}function xu(e){return fu(e)?pp(e):yp(e)}var bp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wp=/^\w*$/;function wa(e,t){if(Ge(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||An(e)?!0:wp.test(e)||!bp.test(e)||t!=null&&e in Object(t)}var fr=Et(Object,"create");function Sp(){this.__data__=fr?fr(null):{},this.size=0}function Ap(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Cp="__lodash_hash_undefined__",jp=Object.prototype,Tp=jp.hasOwnProperty;function Ep(e){var t=this.__data__;if(fr){var r=t[e];return r===Cp?void 0:r}return Tp.call(t,e)?t[e]:void 0}var Ip=Object.prototype,Rp=Ip.hasOwnProperty;function Op(e){var t=this.__data__;return fr?t[e]!==void 0:Rp.call(t,e)}var Pp="__lodash_hash_undefined__";function kp(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=fr&&t===void 0?Pp:t,this}function Ct(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ct.prototype.clear=Sp;Ct.prototype.delete=Ap;Ct.prototype.get=Ep;Ct.prototype.has=Op;Ct.prototype.set=kp;function Np(){this.__data__=[],this.size=0}function Cn(e,t){for(var r=e.length;r--;)if(du(e[r][0],t))return r;return-1}var Mp=Array.prototype,Lp=Mp.splice;function $p(e){var t=this.__data__,r=Cn(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Lp.call(t,r,1),--this.size,!0}function _p(e){var t=this.__data__,r=Cn(t,e);return r<0?void 0:t[r][1]}function Dp(e){return Cn(this.__data__,e)>-1}function Bp(e,t){var r=this.__data__,n=Cn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function it(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}it.prototype.clear=Np;it.prototype.delete=$p;it.prototype.get=_p;it.prototype.has=Dp;it.prototype.set=Bp;var hr=Et(Ve,"Map");function zp(){this.size=0,this.__data__={hash:new Ct,map:new(hr||it),string:new Ct}}function Hp(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function jn(e,t){var r=e.__data__;return Hp(t)?r[typeof t=="string"?"string":"hash"]:r.map}function qp(e){var t=jn(this,e).delete(e);return this.size-=t?1:0,t}function Fp(e){return jn(this,e).get(e)}function Up(e){return jn(this,e).has(e)}function Wp(e,t){var r=jn(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function ot(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ot.prototype.clear=zp;ot.prototype.delete=qp;ot.prototype.get=Fp;ot.prototype.has=Up;ot.prototype.set=Wp;var Gp="Expected a function";function Sa(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Gp);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Sa.Cache||ot),r}Sa.Cache=ot;var Vp=500;function Kp(e){var t=Sa(e,function(n){return r.size===Vp&&r.clear(),n}),r=t.cache;return t}var Xp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yp=/\\(\\)?/g,Jp=Kp(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Xp,function(r,n,i,o){t.push(i?o.replace(Yp,"$1"):n||r)}),t});function Yo(e){return e==null?"":Gr(e)}function vu(e,t){return Ge(e)?e:wa(e,t)?[e]:Jp(Yo(e))}function Tn(e){if(typeof e=="string"||An(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function yu(e,t){t=vu(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Tn(t[r++])];return r&&r==n?e:void 0}function Zp(e,t,r){var n=e==null?void 0:yu(e,t);return n===void 0?r:n}function bu(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Ps=We?We.isConcatSpreadable:void 0;function Qp(e){return Ge(e)||ya(e)||!!(Ps&&e&&e[Ps])}function em(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=Qp),i||(i=[]);++o<a;){var s=e[o];r(s)&&bu(i,s)}return i}function tm(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function rm(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:tm(e,t,r)}var nm="\\ud800-\\udfff",im="\\u0300-\\u036f",om="\\ufe20-\\ufe2f",am="\\u20d0-\\u20ff",sm=im+om+am,cm="\\ufe0e\\ufe0f",lm="\\u200d",um=RegExp("["+lm+nm+sm+cm+"]");function Aa(e){return um.test(e)}function dm(e){return e.split("")}var wu="\\ud800-\\udfff",fm="\\u0300-\\u036f",hm="\\ufe20-\\ufe2f",pm="\\u20d0-\\u20ff",mm=fm+hm+pm,gm="\\ufe0e\\ufe0f",xm="["+wu+"]",Jo="["+mm+"]",Zo="\\ud83c[\\udffb-\\udfff]",vm="(?:"+Jo+"|"+Zo+")",Su="[^"+wu+"]",Au="(?:\\ud83c[\\udde6-\\uddff]){2}",Cu="[\\ud800-\\udbff][\\udc00-\\udfff]",ym="\\u200d",ju=vm+"?",Tu="["+gm+"]?",bm="(?:"+ym+"(?:"+[Su,Au,Cu].join("|")+")"+Tu+ju+")*",wm=Tu+ju+bm,Sm="(?:"+[Su+Jo+"?",Jo,Au,Cu,xm].join("|")+")",Am=RegExp(Zo+"(?="+Zo+")|"+Sm+wm,"g");function Cm(e){return e.match(Am)||[]}function jm(e){return Aa(e)?Cm(e):dm(e)}function Tm(e,t,r){return e===e&&(r!==void 0&&(e=e<=r?e:r),t!==void 0&&(e=e>=t?e:t)),e}function Eu(e,t,r){return r===void 0&&(r=t,t=void 0),r!==void 0&&(r=$t(r),r=r===r?r:0),t!==void 0&&(t=$t(t),t=t===t?t:0),Tm($t(e),t,r)}function Em(){this.__data__=new it,this.size=0}function Im(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function Rm(e){return this.__data__.get(e)}function Om(e){return this.__data__.has(e)}var Pm=200;function km(e,t){var r=this.__data__;if(r instanceof it){var n=r.__data__;if(!hr||n.length<Pm-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ot(n)}return r.set(e,t),this.size=r.size,this}function rt(e){var t=this.__data__=new it(e);this.size=t.size}rt.prototype.clear=Em;rt.prototype.delete=Im;rt.prototype.get=Rm;rt.prototype.has=Om;rt.prototype.set=km;function Nm(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Mm(){return[]}var Lm=Object.prototype,$m=Lm.propertyIsEnumerable,ks=Object.getOwnPropertySymbols,_m=ks?function(e){return e==null?[]:(e=Object(e),Nm(ks(e),function(t){return $m.call(e,t)}))}:Mm;function Dm(e,t,r){var n=t(e);return Ge(e)?n:bu(n,r(e))}function Ns(e){return Dm(e,xu,_m)}var Qo=Et(Ve,"DataView"),ea=Et(Ve,"Promise"),ta=Et(Ve,"Set"),Ms="[object Map]",Bm="[object Object]",Ls="[object Promise]",$s="[object Set]",_s="[object WeakMap]",Ds="[object DataView]",zm=Tt(Qo),Hm=Tt(hr),qm=Tt(ea),Fm=Tt(ta),Um=Tt(Ko),pt=yt;(Qo&&pt(new Qo(new ArrayBuffer(1)))!=Ds||hr&&pt(new hr)!=Ms||ea&&pt(ea.resolve())!=Ls||ta&&pt(new ta)!=$s||Ko&&pt(new Ko)!=_s)&&(pt=function(e){var t=yt(e),r=t==Bm?e.constructor:void 0,n=r?Tt(r):"";if(n)switch(n){case zm:return Ds;case Hm:return Ms;case qm:return Ls;case Fm:return $s;case Um:return _s}return t});var Bs=Ve.Uint8Array,Wm="__lodash_hash_undefined__";function Gm(e){return this.__data__.set(e,Wm),this}function Vm(e){return this.__data__.has(e)}function pr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new ot;++t<r;)this.add(e[t])}pr.prototype.add=pr.prototype.push=Gm;pr.prototype.has=Vm;function Km(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function Iu(e,t){return e.has(t)}var Xm=1,Ym=2;function Ru(e,t,r,n,i,o){var a=r&Xm,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&Ym?new pr:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var m=e[d],x=t[d];if(n)var g=a?n(x,m,d,t,e,o):n(m,x,d,e,t,o);if(g!==void 0){if(g)continue;h=!1;break}if(p){if(!Km(t,function(v,S){if(!Iu(p,S)&&(m===v||i(m,v,r,n,o)))return p.push(S)})){h=!1;break}}else if(!(m===x||i(m,x,r,n,o))){h=!1;break}}return o.delete(e),o.delete(t),h}function Jm(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function Zm(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Qm=1,eg=2,tg="[object Boolean]",rg="[object Date]",ng="[object Error]",ig="[object Map]",og="[object Number]",ag="[object RegExp]",sg="[object Set]",cg="[object String]",lg="[object Symbol]",ug="[object ArrayBuffer]",dg="[object DataView]",zs=We?We.prototype:void 0,Kn=zs?zs.valueOf:void 0;function fg(e,t,r,n,i,o,a){switch(r){case dg:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ug:return!(e.byteLength!=t.byteLength||!o(new Bs(e),new Bs(t)));case tg:case rg:case og:return du(+e,+t);case ng:return e.name==t.name&&e.message==t.message;case ag:case cg:return e==t+"";case ig:var s=Jm;case sg:var l=n&Qm;if(s||(s=Zm),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;n|=eg,a.set(e,t);var f=Ru(s(e),s(t),n,i,o,a);return a.delete(e),f;case lg:if(Kn)return Kn.call(e)==Kn.call(t)}return!1}var hg=1,pg=Object.prototype,mg=pg.hasOwnProperty;function gg(e,t,r,n,i,o){var a=r&hg,s=Ns(e),l=s.length,u=Ns(t),f=u.length;if(l!=f&&!a)return!1;for(var d=l;d--;){var h=s[d];if(!(a?h in t:mg.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var x=!0;o.set(e,t),o.set(t,e);for(var g=a;++d<l;){h=s[d];var v=e[h],S=t[h];if(n)var j=a?n(S,v,h,t,e,o):n(v,S,h,e,t,o);if(!(j===void 0?v===S||i(v,S,r,n,o):j)){x=!1;break}g||(g=h=="constructor")}if(x&&!g){var E=e.constructor,C=t.constructor;E!=C&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof C=="function"&&C instanceof C)&&(x=!1)}return o.delete(e),o.delete(t),x}var xg=1,Hs="[object Arguments]",qs="[object Array]",Nr="[object Object]",vg=Object.prototype,Fs=vg.hasOwnProperty;function yg(e,t,r,n,i,o){var a=Ge(e),s=Ge(t),l=a?qs:pt(e),u=s?qs:pt(t);l=l==Hs?Nr:l,u=u==Hs?Nr:u;var f=l==Nr,d=u==Nr,h=l==u;if(h&&Xo(e)){if(!Xo(t))return!1;a=!0,f=!1}if(h&&!f)return o||(o=new rt),a||gu(e)?Ru(e,t,r,n,i,o):fg(e,t,l,r,n,i,o);if(!(r&xg)){var p=f&&Fs.call(e,"__wrapped__"),m=d&&Fs.call(t,"__wrapped__");if(p||m){var x=p?e.value():e,g=m?t.value():t;return o||(o=new rt),i(x,g,r,n,o)}}return h?(o||(o=new rt),gg(e,t,r,n,i,o)):!1}function Ca(e,t,r,n,i){return e===t?!0:e==null||t==null||!nt(e)&&!nt(t)?e!==e&&t!==t:yg(e,t,r,n,Ca,i)}var bg=1,wg=2;function Sg(e,t,r,n){var i=r.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var s=a[0],l=e[s],u=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var f=new rt,d;if(!(d===void 0?Ca(u,l,bg|wg,n,f):d))return!1}}return!0}function Ou(e){return e===e&&!xt(e)}function Ag(e){for(var t=xu(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ou(i)]}return t}function Pu(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Cg(e){var t=Ag(e);return t.length==1&&t[0][2]?Pu(t[0][0],t[0][1]):function(r){return r===e||Sg(r,e,t)}}function jg(e,t){return e!=null&&t in Object(e)}function Tg(e,t,r){t=vu(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var a=Tn(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&va(i)&&uu(a,i)&&(Ge(e)||ya(e)))}function Eg(e,t){return e!=null&&Tg(e,t,jg)}var Ig=1,Rg=2;function Og(e,t){return wa(e)&&Ou(t)?Pu(Tn(e),t):function(r){var n=Zp(r,e);return n===void 0&&n===t?Eg(r,e):Ca(t,n,Ig|Rg)}}function ku(e){return function(t){return t==null?void 0:t[e]}}function Pg(e){return function(t){return yu(t,e)}}function kg(e){return wa(e)?ku(Tn(e)):Pg(e)}function Ng(e){return typeof e=="function"?e:e==null?xa:typeof e=="object"?Ge(e)?Og(e[0],e[1]):Cg(e):kg(e)}var Xn=function(){return Ve.Date.now()},Mg="Expected a function",Lg=Math.max,$g=Math.min;function Ar(e,t,r){var n,i,o,a,s,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(Mg);t=$t(t)||0,xt(r)&&(f=!!r.leading,d="maxWait"in r,o=d?Lg($t(r.maxWait)||0,t):o,h="trailing"in r?!!r.trailing:h);function p(k){var L=n,N=i;return n=i=void 0,u=k,a=e.apply(N,L),a}function m(k){return u=k,s=setTimeout(v,t),f?p(k):a}function x(k){var L=k-l,N=k-u,P=t-L;return d?$g(P,o-N):P}function g(k){var L=k-l,N=k-u;return l===void 0||L>=t||L<0||d&&N>=o}function v(){var k=Xn();if(g(k))return S(k);s=setTimeout(v,x(k))}function S(k){return s=void 0,h&&n?p(k):(n=i=void 0,a)}function j(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function E(){return s===void 0?a:S(Xn())}function C(){var k=Xn(),L=g(k);if(n=arguments,i=this,l=k,L){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(v,t),p(l)}return s===void 0&&(s=setTimeout(v,t)),a}return C.cancel=j,C.flush=E,C}function Yn(e){return nt(e)&&fu(e)}var _g=200;function Dg(e,t,r,n){var i=-1,o=jh,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;r&&(t=cu(t,ba(r))),t.length>=_g&&(o=Iu,a=!1,t=new pr(t));e:for(;++i<s;){var f=e[i],d=r==null?f:r(f);if(f=f!==0?f:0,a&&d===d){for(var h=u;h--;)if(t[h]===d)continue e;l.push(f)}else o(t,d,n)||l.push(f)}return l}function Bg(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var zg=Rh(function(e,t){var r=Bg(t);return Yn(r)&&(r=void 0),Yn(e)?Dg(e,em(t,1,Yn),Ng(r)):[]}),Hg="[object Number]";function Kr(e){return typeof e=="number"||nt(e)&&yt(e)==Hg}var qg="[object RegExp]";function Fg(e){return nt(e)&&yt(e)==qg}var Us=Vr&&Vr.isRegExp,Ug=Us?ba(Us):Fg,Wg=ku("length"),Nu="\\ud800-\\udfff",Gg="\\u0300-\\u036f",Vg="\\ufe20-\\ufe2f",Kg="\\u20d0-\\u20ff",Xg=Gg+Vg+Kg,Yg="\\ufe0e\\ufe0f",Jg="["+Nu+"]",ra="["+Xg+"]",na="\\ud83c[\\udffb-\\udfff]",Zg="(?:"+ra+"|"+na+")",Mu="[^"+Nu+"]",Lu="(?:\\ud83c[\\udde6-\\uddff]){2}",$u="[\\ud800-\\udbff][\\udc00-\\udfff]",Qg="\\u200d",_u=Zg+"?",Du="["+Yg+"]?",ex="(?:"+Qg+"(?:"+[Mu,Lu,$u].join("|")+")"+Du+_u+")*",tx=Du+_u+ex,rx="(?:"+[Mu+ra+"?",ra,Lu,$u,Jg].join("|")+")",Ws=RegExp(na+"(?="+na+")|"+rx+tx,"g");function nx(e){for(var t=Ws.lastIndex=0;Ws.test(e);)++t;return t}function ix(e){return Aa(e)?nx(e):Wg(e)}var ox="Expected a function";function Bt(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(ox);return xt(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ar(e,t,{leading:n,maxWait:t,trailing:i})}var ax=30,sx="...",cx=/\w*$/;function lx(e,t){var r=ax,n=sx;if(xt(t)){var i="separator"in t?t.separator:i;r="length"in t?Yf(t.length):r,n="omission"in t?Gr(t.omission):n}e=Yo(e);var o=e.length;if(Aa(e)){var a=jm(e);o=a.length}if(r>=o)return e;var s=r-ix(n);if(s<1)return n;var l=a?rm(a,0,s).join(""):e.slice(0,s);if(i===void 0)return l+n;if(a&&(s+=l.length-s),Ug(i)){if(e.slice(s).search(i)){var u,f=l;for(i.global||(i=RegExp(i.source,Yo(cx.exec(i))+"g")),i.lastIndex=0;u=i.exec(f);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(e.indexOf(Gr(i),s)!=s){var h=l.lastIndexOf(i);h>-1&&(l=l.slice(0,h))}return l+n}const ja="-",ux=e=>{const t=fx(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const s=a.split(ja);return s[0]===""&&s.length!==1&&s.shift(),Bu(s,t)||dx(a)},getConflictingClassGroupIds:(a,s)=>{const l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},Bu=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?Bu(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(ja);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},Gs=/^\[(.+)\]$/,dx=e=>{if(Gs.test(e)){const t=Gs.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fx=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return px(Object.entries(e.classGroups),r).forEach(([o,a])=>{ia(a,n,o,t)}),n},ia=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:Vs(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(hx(i)){ia(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,a])=>{ia(a,Vs(t,o),r,n)})})},Vs=(e,t)=>{let r=e;return t.split(ja).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},hx=e=>e.isThemeGetter,px=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[r,i]}):e,mx=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return i(o,a),a},set(o,a){r.has(o)?r.set(o,a):i(o,a)}}},zu="!",gx=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let u=0,f=0,d;for(let g=0;g<s.length;g++){let v=s[g];if(u===0){if(v===i&&(n||s.slice(g,g+o)===t)){l.push(s.slice(f,g)),f=g+o;continue}if(v==="/"){d=g;continue}}v==="["?u++:v==="]"&&u--}const h=l.length===0?s:s.substring(f),p=h.startsWith(zu),m=p?h.substring(1):h,x=d&&d>f?d-f:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:x}};return r?s=>r({className:s,parseClassName:a}):a},xx=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},vx=e=>({cache:mx(e.cacheSize),parseClassName:gx(e),...ux(e)}),yx=/\s+/,bx=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(yx);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:f,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let m=!!p,x=n(m?h.substring(0,p):h);if(!x){if(!m){s=u+(s.length>0?" "+s:s);continue}if(x=n(h),!x){s=u+(s.length>0?" "+s:s);continue}m=!1}const g=xx(f).join(":"),v=d?g+zu:g,S=v+x;if(o.includes(S))continue;o.push(S);const j=i(x,m);for(let E=0;E<j.length;++E){const C=j[E];o.push(v+C)}s=u+(s.length>0?" "+s:s)}return s};function wx(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Hu(t))&&(n&&(n+=" "),n+=r);return n}const Hu=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Hu(e[n]))&&(r&&(r+=" "),r+=t);return r};function Sx(e,...t){let r,n,i,o=a;function a(l){const u=t.reduce((f,d)=>d(f),e());return r=vx(u),n=r.cache.get,i=r.cache.set,o=s,s(l)}function s(l){const u=n(l);if(u)return u;const f=bx(l,r);return i(l,f),f}return function(){return o(wx.apply(null,arguments))}}const le=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},qu=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ax=/^\d+\/\d+$/,Cx=new Set(["px","full","screen"]),jx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Ex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Ix=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Rx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ze=e=>_t(e)||Cx.has(e)||Ax.test(e),dt=e=>qt(e,"length",_x),_t=e=>!!e&&!Number.isNaN(Number(e)),Jn=e=>qt(e,"number",_t),Zt=e=>!!e&&Number.isInteger(Number(e)),Ox=e=>e.endsWith("%")&&_t(e.slice(0,-1)),Y=e=>qu.test(e),ft=e=>jx.test(e),Px=new Set(["length","size","percentage"]),kx=e=>qt(e,Px,Fu),Nx=e=>qt(e,"position",Fu),Mx=new Set(["image","url"]),Lx=e=>qt(e,Mx,Bx),$x=e=>qt(e,"",Dx),Qt=()=>!0,qt=(e,t,r)=>{const n=qu.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},_x=e=>Tx.test(e)&&!Ex.test(e),Fu=()=>!1,Dx=e=>Ix.test(e),Bx=e=>Rx.test(e),zx=()=>{const e=le("colors"),t=le("spacing"),r=le("blur"),n=le("brightness"),i=le("borderColor"),o=le("borderRadius"),a=le("borderSpacing"),s=le("borderWidth"),l=le("contrast"),u=le("grayscale"),f=le("hueRotate"),d=le("invert"),h=le("gap"),p=le("gradientColorStops"),m=le("gradientColorStopPositions"),x=le("inset"),g=le("margin"),v=le("opacity"),S=le("padding"),j=le("saturate"),E=le("scale"),C=le("sepia"),k=le("skew"),L=le("space"),N=le("translate"),P=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",Y,t],A=()=>[Y,t],O=()=>["",Ze,dt],D=()=>["auto",_t,Y],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",Y],he=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ge=()=>[_t,Y];return{cacheSize:500,separator:":",theme:{colors:[Qt],spacing:[Ze,dt],blur:["none","",ft,Y],brightness:ge(),borderColor:[e],borderRadius:["none","","full",ft,Y],borderSpacing:A(),borderWidth:O(),contrast:ge(),grayscale:ie(),hueRotate:ge(),invert:ie(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[Ox,dt],inset:T(),margin:T(),opacity:ge(),padding:A(),saturate:ge(),scale:ge(),sepia:ie(),skew:ge(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",Y]}],container:["container"],columns:[{columns:[ft]}],"break-after":[{"break-after":he()}],"break-before":[{"break-before":he()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),Y]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[x]}],"inset-x":[{"inset-x":[x]}],"inset-y":[{"inset-y":[x]}],start:[{start:[x]}],end:[{end:[x]}],top:[{top:[x]}],right:[{right:[x]}],bottom:[{bottom:[x]}],left:[{left:[x]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zt,Y]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Y]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",Zt,Y]}],"grid-cols":[{"grid-cols":[Qt]}],"col-start-end":[{col:["auto",{span:["full",Zt,Y]},Y]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[Qt]}],"row-start-end":[{row:["auto",{span:[Zt,Y]},Y]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Y]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Y]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...re()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...re(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...re(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Y,t]}],"min-w":[{"min-w":[Y,t,"min","max","fit"]}],"max-w":[{"max-w":[Y,t,"none","full","min","max","fit","prose",{screen:[ft]},ft]}],h:[{h:[Y,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Y,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Y,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ft,dt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jn]}],"font-family":[{font:[Qt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Y]}],"line-clamp":[{"line-clamp":["none",_t,Jn]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ze,Y]}],"list-image":[{"list-image":["none",Y]}],"list-style-type":[{list:["none","disc","decimal",Y]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ze,dt]}],"underline-offset":[{"underline-offset":["auto",Ze,Y]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),Nx]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kx]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Lx]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Ze,Y]}],"outline-w":[{outline:[Ze,dt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:O()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Ze,dt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ft,$x]}],"shadow-color":[{shadow:[Qt]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ft,Y]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[j]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Y]}],duration:[{duration:ge()}],ease:[{ease:["linear","in","out","in-out",Y]}],delay:[{delay:ge()}],animate:[{animate:["none","spin","ping","pulse","bounce",Y]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Zt,Y]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Y]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ze,dt,Jn]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Hx=Sx(zx);function te(...e){return Hx(me.clsx(e))}let Zn;function Qn(){return Zn===void 0&&(Zn=navigator.platform.includes("Mac")),Zn}function Uu(e){return`${e}`.toLowerCase()==="mod"?Qn()?"⌘":"Ctrl":`${e}`.toLowerCase()==="alt"?Qn()?"⌥":"Alt":`${e}`.toLowerCase()==="shift"?Qn()?"⇧":"Shift":e}function Wu(e){return e.map(Uu).join(" ")}const W=w.forwardRef((e,t)=>{const{icon:r=void 0,tooltip:n=void 0,disabled:i=!1,customClass:o="",loading:a=void 0,shortcutKeys:s=void 0,tooltipOptions:l={},action:u=void 0,isActive:f=void 0,children:d,asChild:h=!1,upload:p=!1,initialDisplayedColor:m=void 0,...x}=e,g=Ia[r],v=h?tu.Slot:Ya;return c.jsxs(Ja,{children:[c.jsx(Za,{asChild:!0,children:c.jsxs(v,{"data-state":f!=null&&f()?"on":"off",onClick:u,ref:t,size:"sm",className:te("richtext-w-[32px] richtext-h-[32px]",o),disabled:i,...x,children:[g&&c.jsx(g,{className:"richtext-size-4"}),d]})}),n&&c.jsx(kn,{...l,children:c.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[c.jsx("div",{children:n}),!!(s!=null&&s.length)&&c.jsx("span",{children:Wu(s)})]})})]})});function qx(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImage({width:q.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:q.IMAGE_SIZE[n]})}}))}function Fx(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateImageGif({width:q.IMAGE_SIZE[n]}),isActive:()=>e.isActive("image",{width:q.IMAGE_SIZE[n]})}}))}function Ux(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImage)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Wx(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageGif)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Gx(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageMermaid)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Vx(e){const t=["left","center","right"],r={left:"AlignLeft",center:"AlignCenter",right:"AlignRight"};return t.map(n=>({type:`image-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.textalign.${n}.tooltip`),icon:r[n],action:()=>{var i,o;return(o=(i=e.commands)==null?void 0:i.setAlignImageDrawer)==null?void 0:o.call(i,n)},isActive:()=>e.isActive({align:n})||!1,disabled:!1}}))}function Kx(e){return[{type:"flex-start",icon:"AlignLeft",tooltip:"Align left"},{type:"center",icon:"AlignCenter",tooltip:"Align center"},{type:"flex-end",icon:"AlignRight",tooltip:"Align right"}].map(r=>({type:`video-align-${r.type}`,component:W,componentProps:{tooltip:r.tooltip,icon:r.icon,action:()=>e.commands.updateVideo({align:r.type}),isActive:()=>e.getAttributes("video").align===r.type}}))}function Xx(e){const t=["size-small","size-medium","size-large"],r=["SizeS","SizeM","SizeL"];return t.map((n,i)=>({type:`video-${n}`,component:W,componentProps:{tooltip:q.localeActions.t(`editor.${n.replace("-",".")}.tooltip`),icon:r[i],action:()=>e.commands.updateVideo({width:q.VIDEO_SIZE[n]}),isActive:()=>e.isActive("video",{width:q.VIDEO_SIZE[n]})}}))}function Yx(e){return[{type:"flipX",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.tooltip.flipX"),icon:"FlipX",action:()=>{const t=e.getAttributes("image"),{flipX:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipX:!r}).run()}}},{type:"flipY",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.tooltip.flipY"),icon:"FlipY",action:()=>{const t=e.getAttributes("image"),{flipY:r}=t;e.chain().focus(void 0,{scrollIntoView:!1}).updateImage({flipY:!r}).run()}}},...qx(e),...Ux(e),{type:"remove",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;B.deleteSelection(t,r)}}}]}function Jx(e){return[...Fx(e),...Wx(e),{type:"remove",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;B.deleteSelection(t,r)}}}]}function Zx(e){return[...Gx(e),{type:"edit",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.edit"),icon:"Pencil",action:()=>!0}},{type:"remove",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;B.deleteSelection(t,r)}}}]}function Qx(e){return[...Vx(e),{type:"edit",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.edit"),icon:"Pencil",action:()=>(console.log("AAA"),!0)}},{type:"remove",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;B.deleteSelection(t,r)}}}]}function e0(e){return[...Xx(e),...Kx(e),{type:"remove",component:W,componentProps:{editor:e,tooltip:q.localeActions.t("editor.remove"),icon:"Trash2",action:()=>{const{state:t,dispatch:r}=e.view;B.deleteSelection(t,r)}}}]}function t0(e,t){return q.BUBBLE_TEXT_LIST.reduce((r,n)=>{if(n==="divider"&&r.length>0)return[...r,{type:"divider",component:void 0,componentProps:{}}];const i=e.extensionManager.extensions.find(o=>o.name===n);return i?[...r,i.configure().options.button({editor:e,t,extension:i})]:r},[])}function Ta(e,t,r){const n=[],i=e.node(0);r=typeof r=="number"&&r>=0?r:e.sameParent(t)?Math.max(0,e.sharedDepth(t.pos)-1):e.sharedDepth(t.pos);const o=new B.NodeRange(e,t,r),a=o.depth===0?0:i.resolve(o.start).posAtIndex(0);return o.parent.forEach((s,l)=>{const u=a+l,f=u+s.nodeSize;if(u<o.start||u>=o.end)return;const d=new B.SelectionRange(i.resolve(u),i.resolve(f));n.push(d)}),n}class Ea{constructor(t,r){Pr(this,"anchor");Pr(this,"head");this.anchor=t,this.head=r}map(t){return new Ea(t.map(this.anchor),t.map(this.head))}resolve(t){const r=t.resolve(this.anchor),n=t.resolve(this.head);return new Fe(r,n)}}class Fe extends B.Selection{constructor(r,n,i,o=1){const{doc:a}=r,s=r===n,l=r.pos===a.content.size&&n.pos===a.content.size,u=s&&!l?a.resolve(n.pos+(o>0?1:-1)):n,f=s&&l?a.resolve(r.pos-(o>0?1:-1)):r,d=Ta(f.min(u),f.max(u),i);super(u.pos>=r.pos?d[0].$from:d[d.length-1].$to,u.pos>=r.pos?d[d.length-1].$to:d[0].$from,d);Pr(this,"depth");this.depth=i}get $to(){return this.ranges[this.ranges.length-1].$to}eq(r){return r instanceof Fe&&r.$from.pos===this.$from.pos&&r.$to.pos===this.$to.pos}map(r,n){const i=r.resolve(n.map(this.anchor)),o=r.resolve(n.map(this.head));return new Fe(i,o)}toJSON(){return{type:"nodeRange",anchor:this.anchor,head:this.head}}get isForwards(){return this.head>=this.anchor}get isBackwards(){return!this.isForwards}extendBackwards(){const{doc:r}=this.$from;if(this.isForwards&&this.ranges.length>1){const o=this.ranges.slice(0,-1),a=o[0].$from,s=o[o.length-1].$to;return new Fe(a,s,this.depth)}const n=this.ranges[0],i=r.resolve(Math.max(0,n.$from.pos-1));return new Fe(this.$anchor,i,this.depth)}extendForwards(){const{doc:r}=this.$from;if(this.isBackwards&&this.ranges.length>1){const o=this.ranges.slice(1),a=o[0].$from,s=o[o.length-1].$to;return new Fe(s,a,this.depth)}const n=this.ranges[this.ranges.length-1],i=r.resolve(Math.min(r.content.size,n.$to.pos+1));return new Fe(this.$anchor,i,this.depth)}static fromJSON(r,n){return new Fe(r.resolve(n.anchor),r.resolve(n.head))}static create(r,n,i,o,a=1){return new this(r.resolve(n),r.resolve(i),o,a)}getBookmark(){return new Ea(this.anchor,this.head)}}function r0(e){const t=e.cloneNode(!0),r=[e,...Array.from(e.getElementsByTagName("*"))],n=[t,...Array.from(t.getElementsByTagName("*"))];return r.forEach((i,o)=>{n[o].style.cssText=function(a){let s="";const l=getComputedStyle(a);for(let u=0;u<l.length;u+=1)s+=`${l[u]}:${l.getPropertyValue(l[u])};`;return s}(i)}),t}function Mr(e,t){return window.getComputedStyle(e)[t]}function n0(e=0,t=0,r=0){return Math.min(Math.max(e,t),r)}function Ks(e){e.parentNode!==null&&e.parentNode!==void 0&&e.parentNode.removeChild(e)}function Gu(e){const{x:t,y:r,direction:n,editor:i}=e;let o=null,a=null,s=null,l=t;for(;a===null&&l<window.innerWidth&&l>0;){const u=document.elementsFromPoint(l,r),f=u.findIndex(h=>h.classList.contains("ProseMirror")),d=u.slice(0,f);if(d.length>0){const h=d[0];if(o=h,s=i.view.posAtDOM(h,0),s>=0){a=i.state.doc.nodeAt(Math.max(s-1,0)),(a===null||a.isText)&&(a=i.state.doc.nodeAt(Math.max(s-1,0))),a||(a=i.state.doc.nodeAt(Math.max(s,0)));break}}n==="left"?l-=1:l+=1}return{resultElement:o,resultNode:a,pos:s!==null?s:null}}function i0(e,t){const{doc:r}=t.view.state,n=Gu({editor:t,x:e.clientX,y:e.clientY,direction:"right"});if(!n.resultNode||n.pos===null)return[];const i=e.clientX,o=function(f,d,h){const p=Number.parseInt(Mr(f.dom,"paddingLeft"),10),m=Number.parseInt(Mr(f.dom,"paddingRight"),10),x=Number.parseInt(Mr(f.dom,"borderLeftWidth"),10),g=Number.parseInt(Mr(f.dom,"borderLeftWidth"),10),v=f.dom.getBoundingClientRect();return{left:n0(d,v.left+p+x,v.right-m-g),top:h}}(t.view,i,e.clientY),a=t.view.posAtCoords(o);if(!a)return[];const{pos:s}=a;if(!r.resolve(s).parent)return[];const l=r.resolve(n.pos),u=r.resolve(n.pos+1);return Ta(l,u,0)}function Xs(e,t){const r=e.resolve(t),{depth:n}=r;return n===0?t:r.pos-r.parentOffset-1}function Ys(e,t){const r=e.nodeAt(t),n=e.resolve(t);let{depth:i}=n,o=r;for(;i>0;){const a=n.node(i);i-=1,i===0&&(o=a)}return o}function Js(e,t){let r=t;for(;r&&r.parentNode&&r.parentNode!==e.dom;)r=r.parentNode;return r}const Vu=new B.PluginKey("dragHandle");function o0({pluginKey:e=Vu,element:t,editor:r,tippyOptions:n,onNodeChange:i}){const o=document.createElement("div");let a=null,s=!1,l=null,u=-1;return t.addEventListener("dragstart",f=>{const{view:d}=r;if(!f.dataTransfer)return;const{empty:h,$from:p,$to:m}=d.state.selection,x=i0(f,r),g=Ta(p,m,0),v=g.some(P=>x.find(_=>_.$from===P.$from&&_.$to===P.$to)),S=h||!v?x:g;if(S.length===0)return;const{tr:j}=d.state,E=document.createElement("div"),C=S[0].$from.pos,k=S[S.length-1].$to.pos,L=Fe.create(d.state.doc,C,k),N=L.content();S.forEach(P=>{const _=r0(d.nodeDOM(P.$from.pos));E.append(_)}),E.style.position="absolute",E.style.top="-10000px",document.body.append(E),f.dataTransfer.clearData(),f.dataTransfer.setDragImage(E,0,0),d.dragging={slice:N,move:!0},j.setSelection(L),d.dispatch(j),document.addEventListener("drop",()=>Ks(E),{once:!0}),setTimeout(()=>{t&&(t.style.pointerEvents="none")},0)}),t.addEventListener("dragend",()=>{t&&(t.style.pointerEvents="auto")}),new B.Plugin({key:typeof e=="string"?new B.PluginKey(e):e,state:{init:()=>({locked:!1}),apply(f,d){const h=f.getMeta("lockDragHandle"),p=f.getMeta("hideDragHandle");if(h!==void 0&&(s=h),p&&a)return a.hide(),s=!1,l=null,u=-1,i==null||i({editor:r,node:null,pos:-1}),d;if(f.docChanged&&u!==-1&&t&&a){const m=f.mapping.map(u);m!==u&&(u=m)}return d}},view:f=>{return d(),h(r.view.dom),a=ru(f.dom,{...p(),...n}),{update(E,C){if(!m(t,a)||(t.draggable=!s,!x(E,C)))return;const k=g(E);k&&v(E,k)},destroy(){j()}};function d(){t.draggable=!0,t.style.pointerEvents="auto"}function h(E){var C;(C=E.parentElement)==null||C.appendChild(o),o.appendChild(t),Object.assign(o.style,{pointerEvents:"none",position:"absolute",top:"0",left:"0"})}function p(){return{getReferenceClientRect:null,interactive:!0,trigger:"manual",placement:"left-start",hideOnClick:!1,duration:100,zIndex:10,appendTo:o,content:t,popperOptions:{modifiers:[{name:"flip",enabled:!1},{name:"preventOverflow",options:{rootBoundary:"document",mainAxis:!1}}]}}}function m(E,C){return E&&C}function x(E,C){return!E.state.doc.eq(C.doc)&&u!==-1}function g(E){let C=E.nodeDOM(u);return C=Js(E,C),C===E.dom||(C==null?void 0:C.nodeType)!==1?null:C}function v(E,C){const k=E.posAtDOM(C,0),L=Ys(r.state.doc,k);if(L===l)return;const N=Xs(r.state.doc,k);l=L,u=N,i==null||i({editor:r,node:l,pos:u}),S(C)}function S(E){a.setProps({getReferenceClientRect:()=>E.getBoundingClientRect()}),a.show()}function j(){a==null||a.destroy(),t&&Ks(o)}},props:{handleDOMEvents:{mouseleave:(f,d)=>{if(s||!h(d))return!1;return p(),m(),!1;function h(x){return x.target&&!o.contains(x.relatedTarget)}function p(){a==null||a.hide()}function m(){l=null,u=-1,i==null||i({editor:r,node:null,pos:-1})}},mousemove:Ar((f,d)=>{if(!t||!a||s)return!1;const h=Gu({x:d.clientX,y:d.clientY,direction:"right",editor:r});if(!h.resultElement||h.resultElement===f.dom)return!1;const p=Js(f,h.resultElement);if(p===f.dom||(p==null?void 0:p.nodeType)!==1)return!1;const m=f.posAtDOM(p,0),x=Ys(r.state.doc,m);if(x===l)return!1;const g=Xs(r.state.doc,m);return l=x,u=g,i==null||i({editor:r,node:l,pos:u}),a.setProps({getReferenceClientRect:()=>p.getBoundingClientRect()}),a.show(),!1},100)}}})}var Xr=(e=>(e[e.max=7]="max",e[e.min=0]="min",e[e.more=1]="more",e[e.less=-1]="less",e))(Xr||{});function a0(e,t,r){return e<t?t:e>r?r:e}function s0(e,t,r,n){const{doc:i,selection:o}=e;if(!i||!o||!(o instanceof B.TextSelection||o instanceof B.AllSelection))return e;const{from:a,to:s}=o;return i.nodesBetween(a,s,(l,u)=>{const f=l.type;return r.includes(f.name)?(e=oa(e,u,t),!1):!B.isList(l.type.name,n.extensionManager.extensions)}),e}function oa(e,t,r){if(!e.doc)return e;const n=e.doc.nodeAt(t);if(!n)return e;const a=a0((n.attrs.indent||0)+r,0,7);if(a===n.attrs.indent)return e;const s={...n.attrs,indent:a};return e.setNodeMarkup(t,n.type,s,n.marks)}function c0({delta:e,types:t}){return({state:r,dispatch:n,editor:i})=>{const{selection:o}=r;let{tr:a}=r;return a=a.setSelection(o),a=s0(a,e,t,i),a.docChanged?(n&&n(a),!0):!1}}function l0(e){var N,P,_;const{pluginKey:t=Vu}=e,{t:r}=q.useLocale(),[n,i]=w.useState(null),[o,a]=w.useState(-1),s=w.useRef(null),l=w.useRef(null),[u,f]=w.useState(!1),d=e.editor.extensionManager.extensions.some(T=>T.name==="textAlign"),h=e.editor.extensionManager.extensions.some(T=>T.name==="indent"),p=e.editor.extensionManager.extensions.some(T=>T.name==="clear");w.useEffect(()=>{s.current&&!e.editor.isDestroyed&&(l.current=o0({editor:e.editor,element:s.current,pluginKey:"ContentItemMenu",tippyOptions:{offset:[-2,16],zIndex:99,moveTransition:"transform 0.15s ease-out"},onNodeChange:C}),e.editor.registerPlugin(l.current))},[e.editor,s]);function m(){const T=e.editor.chain();T.setNodeSelection(o).unsetAllMarks(),(n==null?void 0:n.type.name)!=="paragraph"&&T.setParagraph(),T.run()}function x(){e.editor.chain().focus().setNodeSelection(o).run(),document.execCommand("copy")}function g(){e.editor.commands.setNodeSelection(o);const{$anchor:T}=e.editor.state.selection,A=T.node(1)||e.editor.state.selection.node;e.editor.chain().setMeta("hideDragHandle",!0).insertContentAt(o+((n==null?void 0:n.nodeSize)||0),A.toJSON()).run()}function v(T){e.editor.commands.setTextAlign(T)}function S(){const T=oa(e.editor.state.tr,o,1);T.setMeta("hideDragHandle",!0),e.editor.view.dispatch&&e.editor.view.dispatch(T)}function j(){const T=oa(e.editor.state.tr,o,-1);e.editor.view.dispatch&&e.editor.view.dispatch(T)}function E(){e.editor.chain().setMeta("hideDragHandle",!0).setNodeSelection(o).deleteSelection().run()}function C(T){T.node&&i(T.node),a(T.pos)}function k(){var T;if(o!==-1){const A=(n==null?void 0:n.nodeSize)||0,O=o+A,D=(n==null?void 0:n.type.name)==="paragraph"&&((T=n==null?void 0:n.content)==null?void 0:T.size)===0,U=D?o+2:O+2;e.editor.chain().command(({dispatch:H,tr:K,state:re})=>H?(D?K.insertText("/",o,o+1):K.insert(O,re.schema.nodes.paragraph.create(null,[re.schema.text("/")])),H(K)):!0).focus(U).run()}}w.useEffect(()=>(u?e.editor.commands.setMeta("lockDragHandle",!0):e.editor.commands.setMeta("lockDragHandle",!1),()=>{e.editor.commands.setMeta("lockDragHandle",!1)}),[u]),w.useEffect(()=>()=>{l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[]),w.useEffect(()=>{var T;(T=e.editor)!=null&&T.isDestroyed&&l.current&&(e.editor.unregisterPlugin(t),l.current=null)},[(N=e.editor)==null?void 0:N.isDestroyed]);const L=T=>{e!=null&&e.disabled||f(T)};return c.jsx("div",{ref:s,className:`drag-handle richtext-duration-200 richtext-ease-in-out [transition-property:top,_left] ${e==null?void 0:e.className}`,style:{opacity:e!=null&&e.disabled?0:1},children:c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-0.5 richtext-duration-200 richtext-ease-in-out [transition-property:top,_left]",children:[c.jsx(we,{className:"!richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,onClick:k,size:"icon",type:"button",variant:"ghost",children:c.jsx(xe,{className:"richtext-text-lg richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Plus"})}),c.jsxs(vd,{onOpenChange:L,open:u,children:[c.jsxs("div",{className:"richtext-relative richtext-flex richtext-flex-col",children:[c.jsxs(Ja,{children:[c.jsx(Za,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(we,{className:"richtext-relative richtext-z-[1] !richtext-size-7 richtext-cursor-grab",disabled:e==null?void 0:e.disabled,size:"icon",type:"button",variant:"ghost",onMouseUp:T=>{T.preventDefault(),!(e!=null&&e.disabled)&&f(!0)},children:c.jsx(xe,{className:"richtext-text-sm richtext-text-neutral-600 dark:richtext-text-neutral-200",name:"Grip"})})}),c.jsx(kn,{children:r("editor.draghandle.tooltip")})]}),c.jsx(yd,{className:"richtext-absolute richtext-left-0 richtext-top-0 richtext-z-0 richtext-size-[28px]"})]}),c.jsxs(Ga,{align:"start",className:"richtext-w-48",side:"bottom",sideOffset:0,children:[c.jsxs(ze,{className:"richtext-flex richtext-gap-3 richtext-bg-opacity-10 hover:richtext-bg-red-400 hover:richtext-bg-opacity-20 focus:richtext-bg-red-400 focus:richtext-bg-opacity-30 focus:richtext-text-red-500 dark:hover:richtext-bg-opacity-20 dark:hover:richtext-text-red-500",onClick:E,children:[c.jsx(xe,{name:"Trash2"}),c.jsx("span",{children:r("editor.remove")})]}),p?c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:m,children:[c.jsx(xe,{name:"PaintRoller"}),c.jsx("span",{children:r("editor.clear.tooltip")})]}):null,c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:x,children:[c.jsx(xe,{name:"Clipboard"}),c.jsx("span",{children:r("editor.copyToClipboard")})]}),c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:g,children:[c.jsx(xe,{name:"Copy"}),c.jsx("span",{children:r("editor.copy")})]}),d||h?c.jsx(Va,{}):null,d?c.jsxs(lc,{children:[c.jsxs(pa,{className:"richtext-flex richtext-gap-3",children:[c.jsx(xe,{name:"AlignCenter"}),c.jsx("span",{children:r("editor.textalign.tooltip")})]}),c.jsx(cc,{children:c.jsxs(ma,{children:[c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:()=>v("left"),children:[c.jsx(xe,{name:"AlignLeft"}),c.jsx("span",{children:r("editor.textalign.left.tooltip")})]}),c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:()=>v("center"),children:[c.jsx(xe,{name:"AlignCenter"}),c.jsx("span",{children:r("editor.textalign.center.tooltip")})]}),c.jsxs(ze,{className:"richtext-flex richtext-gap-3",onClick:()=>v("right"),children:[c.jsx(xe,{name:"AlignRight"}),c.jsx("span",{children:r("editor.textalign.right.tooltip")})]})]})})]}):null,h?c.jsxs(lc,{children:[c.jsxs(pa,{className:"richtext-flex richtext-gap-3",children:[c.jsx(xe,{name:"IndentIncrease"}),c.jsx("span",{children:r("editor.indent")})]}),c.jsx(cc,{children:c.jsxs(ma,{children:[c.jsxs(ze,{className:"richtext-flex richtext-gap-3",disabled:((P=n==null?void 0:n.attrs)==null?void 0:P.indent)>=Xr.max,onClick:S,children:[c.jsx(xe,{name:"IndentIncrease"}),c.jsx("span",{children:r("editor.indent.tooltip")})]}),c.jsxs(ze,{className:"richtext-flex richtext-gap-3",disabled:((_=n==null?void 0:n.attrs)==null?void 0:_.indent)<=Xr.min,onClick:j,children:[c.jsx(xe,{name:"IndentDecrease"}),c.jsx("span",{children:r("editor.outdent.tooltip")})]})]})})]}):null]})]})]})})}const u0={maxWidth:"auto",zIndex:20,appendTo:"parent",moveTransition:"transform 0.1s ease-out"};function d0({item:e,disabled:t,editor:r}){var i;const n=e.component;return n?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 f0(e){const{t,lang:r}=q.useLocale(),n=({editor:o})=>{const{selection:a}=o.view.state,{$from:s,to:l}=a;return s.pos===l?!1:a instanceof B.TextSelection},i=w.useMemo(()=>e.disabled||!(e!=null&&e.editor)?[]:t0(e.editor,t),[e.disabled,e.editor,r,t]);return c.jsx(me.BubbleMenu,{editor:e==null?void 0:e.editor,shouldShow:n,tippyOptions:u0,children:i!=null&&i.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-gap-[4px] richtext-whitespace-nowrap",children:i==null?void 0:i.map((o,a)=>(o==null?void 0:o.type)==="divider"?c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"},`bubbleMenu-divider-${a}`):c.jsx(d0,{disabled:e.disabled,editor:e.editor,item:o},`bubbleMenu-text-${a}`))})}):c.jsx(c.Fragment,{})})}function h0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H3V5h18z"})})}function p0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 15h15m0 4H6m9-8h6m0-4h-6M9 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2M3 9h1a1 1 0 1 1-1 1V7.5a2 2 0 0 1 2-2"})})}function m0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5.5 3c1.404 0 2.107 0 2.611.38c.219.164.406.375.552.62C9 4.568 9 5.358 9 6.938v10.125c0 1.58 0 2.37-.337 2.937a2.1 2.1 0 0 1-.552.621c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C2 19.432 2 18.642 2 17.062V6.938c0-1.58 0-2.37.337-2.938a2.1 2.1 0 0 1 .552-.62C3.393 3 4.096 3 5.5 3M20 11.938v5.124c0 1.58 0 2.37-.337 2.938a2.1 2.1 0 0 1-.552.62c-.504.38-1.207.38-2.611.38s-2.107 0-2.611-.38a2.1 2.1 0 0 1-.552-.62C13 19.433 13 18.642 13 17.063V6.938c0-1.58 0-2.37.337-2.938M22 9l-6-6m6 0l-6 6",color:"currentColor"})})}function g0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",className:"richtext-w-4 richtext-h-4",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M21 18.5c0 1.404 0 2.107-.38 2.611a2.1 2.1 0 0 1-.62.552c-.567.337-1.358.337-2.937.337H6.938c-1.58 0-2.37 0-2.938-.337a2.1 2.1 0 0 1-.62-.552C3 20.607 3 19.904 3 18.5s0-2.107.38-2.611c.163-.218.374-.406.62-.552C4.567 15 5.357 15 6.938 15h10.125c1.58 0 2.37 0 2.937.337c.246.146.457.334.62.552c.38.504.38 1.207.38 2.611M12.063 4H6.937C5.358 4 4.568 4 4 4.337a2.1 2.1 0 0 0-.62.552C3 5.393 3 6.096 3 7.5s0 2.107.38 2.611c.163.218.374.406.62.552C4.567 11 5.357 11 6.938 11h10.125c1.58 0 2.37 0 2.937-.337M21 8l-6-6m6 0l-6 6",color:"currentColor"})})}function x0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}function xe(e){const t=Ia[e.name];return t?c.jsx(t,{onClick:e==null?void 0:e.onClick,className:`richtext-w-4 richtext-h-4 ${(e==null?void 0:e.className)||""}`}):null}function v0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M21 22H3v-2h18zm0-18H3V2h18zm-11 9.7h4l-2-5.4zM11.2 6h1.7l4.7 12h-2l-.9-2.6H9.4L8.5 18h-2z"})})}function Ku(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 48 48",...e,children:c.jsx("path",{fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:4,d:"M36 19L24 31L12 19z"})})}function y0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M9 7v10h6v-2h-4V7z"})})}function b0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M9 7c-1.1 0-2 .9-2 2v8h2V9h2v7h2V9h2v8h2V9a2 2 0 0 0-2-2z"})})}function w0(e){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",...e,children:c.jsx("path",{fill:"currentColor",d:"M11 7c-1.1 0-2 .9-2 2v2a2 2 0 0 0 2 2h2v2H9v2h4c1.11 0 2-.89 2-2v-2a2 2 0 0 0-2-2h-2V9h4V7z"})})}function S0(){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:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6l1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6l-1.4-1.4z"})})}function A0(){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:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M14 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m-9 8h4m-2-2v4"})})}function C0(){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:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1m9 8h4m-2-2v4"})})}function j0(){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:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 21v-4m0-4V9m0-4V3m-2 18h4M8 5v4h11l2-2l-2-2zm6 8v4H6l-2-2l2-2z"})})}function T0(){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:"M23.943 19.806a.2.2 0 0 0-.168-.034c-1.26-1.855-2.873-3.61-4.419-5.315l-.252-.284c-.001-.073-.067-.12-.134-.15l-.084-.084c-.05-.1-.169-.167-.286-.1c-.47.234-.907.585-1.327.919c-.554.434-1.109.87-1.63 1.354a5 5 0 0 0-.588.618c-.084.117-.017.217.084.267c-.37.368-.74.736-1.109 1.12a.2.2 0 0 0-.05.134c0 .05.033.1.067.117l.655.502v.016c.924.92 2.554 2.173 4.285 3.527c.251.201.52.402.773.602c.117.134.234.285.335.418c.05.066.169.084.236.033c.033.034.084.067.118.1a.24.24 0 0 0 .1.034a.15.15 0 0 0 .135-.066a.24.24 0 0 0 .033-.1c.017 0 .017.016.034.016a.2.2 0 0 0 .134-.05l3.058-3.327c.12-.116.014-.267 0-.267m-7.628-.134l-1.546-1.17l-.15-.1c-.035-.017-.068-.05-.102-.067l-.117-.1c.66-.66 1.33-1.308 2-1.956c-.488.484-1.463 1.906-1.261 2.373c.002 0 .018.042.067.084zm4.1 3.126l-1.277-.97a27 27 0 0 0-1.58-1.504c.69.518 1.277.97 1.361 1.053c.673.585.638.485 1.093.87l.554.4c-.074.103-.151.148-.151.151m.336.25l-.034-.016a1 1 0 0 0 .152-.117zM.588 3.476c.033.217.084.435.117.636c.201 1.103.403 2.106.772 2.858l.152.568c.05.217.134.485.219.552a67 67 0 0 0 3.578 2.942a.18.18 0 0 0 .219 0s0 .016.016.016a.15.15 0 0 0 .118.05a.2.2 0 0 0 .134-.05c1.798-1.989 3.142-3.627 4.1-4.998c.068-.066.084-.167.084-.25c.067-.067.118-.151.185-.201c.067-.067.067-.184 0-.235l-.017-.016c0-.033-.017-.084-.05-.1c-.42-.401-.722-.685-1.042-.986a94 94 0 0 1-2.352-2.273c-.017-.017-.034-.034-.067-.034c-.336-.117-1.025-.234-1.882-.385c-1.277-.216-3.008-.517-4.57-.986c0 0-.101 0-.118.017l-.05.05C.05.714.022.707 0 .718c.017.1.017.167.05.284c0 .033.068.301.068.334zm7.19 4.78l-.033.034a.036.036 0 0 1 .033-.034M6.553 2.238c.101.1.521.502.622.585c-.437-.2-1.529-.702-2.034-.869c.505.1 1.194.201 1.412.284M.79 1.403c.252.434.454 1.939.655 3.41c-.118-.469-.201-.936-.302-1.372C.992 2.673.84 1.988.638 1.386c.124 0 .152.021.152.017m-.286-.369c0-.016 0-.033-.017-.033c.085 0 .135.017.202.05c0 .006-.145-.017-.185-.017m23.17-.217c.017-.066-.336-.367-.219-.384c.253-.017.253-.401 0-.401c-.335.017-.688.1-1.008.15c-.587.117-1.192.234-1.78.367a80 80 0 0 0-3.949.937c-.403.117-.857.2-1.243.401c-.135.067-.118.2-.05.284c-.034.017-.051.017-.085.034c-.117.017-.218.034-.335.05c-.102.017-.152.1-.135.2c0 .017.017.05.017.067c-.706.936-1.496 1.923-2.353 2.976c-.84.969-1.73 1.989-2.62 3.042c-2.84 3.31-6.05 7.07-9.594 10.38a.16.16 0 0 0 0 .234c.016.016.033.033.05.033c-.05.05-.101.085-.152.134q-.05.05-.05.1a.4.4 0 0 0-.067.084c-.067.067-.067.184.017.234c.067.066.185.066.235-.017c.017-.017.017-.033.033-.033a.265.265 0 0 1 .37 0c.202.217.404.435.588.618l-.42-.35c-.067-.067-.184-.05-.234.016c-.068.066-.051.184.016.234l4.469 3.727c.034.034.067.034.118.034a.15.15 0 0 0 .117-.05l.101-.1c.017.016.05.016.067.016c.05 0 .084-.016.118-.05c6.049-6.05 10.922-10.614 16.5-14.693c.05-.033.067-.1.067-.15c.067 0 .118-.05.15-.117c1.026-3.125 1.228-5.9 1.295-7.27c0-.059.016-.038.016-.068c.017-.033.017-.05.017-.05a.98.98 0 0 0-.067-.619m-10.82 4.915c.268-.301.537-.619.806-.903c-1.73 2.273-4.603 5.767-8.67 9.929c2.773-3.059 5.562-6.218 7.864-9.026M5.14 23.466c-.016-.017-.016-.017 0-.017zm2.504-2.156c.135-.15.27-.284.42-.434c0 0 0 .016.017.016c-.224.198-.433.418-.437.418m.69-.668c.099-.1.14-.173.284-.318c.992-1.02 2.017-2.04 3.059-3.076l.016-.016c.252-.2.555-.418.824-.619a228 228 0 0 0-4.184 4.029M14.852 3.91c-.554.719-1.176 1.671-1.697 2.423c-1.646 2.374-6.94 8.174-7.057 8.274a1190 1190 0 0 1-4.839 4.597l-.1.1c-.085-.1-.085-.25.016-.334C8.652 11.966 13.19 6.133 15.021 3.576c-.05.116-.084.216-.168.334zm2.906 3.427c-.671-.386-.99-.987-.806-1.572l.05-.2a.8.8 0 0 1 .085-.167a1.9 1.9 0 0 1 .756-.703c.016 0 .033 0 .05-.016c-.017-.034-.017-.084-.017-.134c.017-.1.085-.167.202-.167c.202 0 .824.184 1.059.384c.067.05.134.117.202.184c.084.1.218.268.285.401c.034.017.067.184.118.268c.033.134.067.284.05.418c-.017.016 0 .116-.017.116a1.6 1.6 0 0 1-.218.619c-.03.03.006.012-.05.067a1.2 1.2 0 0 1-.32.334a1.49 1.49 0 0 1-1.26.234a2 2 0 0 0-.169-.066m4.37 1.403c0 .017-.017.05 0 .067c-.034 0-.05.017-.085.034a110 110 0 0 0-3.915 3.025c1.11-.986 2.218-1.989 3.378-2.975c.336-.301.571-.686.638-1.12l.168-1.003v-.033c.085-.201.404-.118.353.1c-.004-.001-.173.795-.537 1.905"})})}function Xu(){return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",children:[c.jsx("path",{fill:"currentColor",d:"M30 18v-2h-6v10h2v-4h3v-2h-3v-2zm-11 8h-4V16h4a3.003 3.003 0 0 1 3 3v4a3.003 3.003 0 0 1-3 3m-2-2h2a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1h-2zm-6-8H6v10h2v-3h3a2.003 2.003 0 0 0 2-2v-3a2 2 0 0 0-2-2m-3 5v-3h3l.001 3z"}),c.jsx("path",{fill:"currentColor",d:"M22 14v-4a.91.91 0 0 0-.3-.7l-7-7A.9.9 0 0 0 14 2H4a2.006 2.006 0 0 0-2 2v24a2 2 0 0 0 2 2h16v-2H4V4h8v6a2.006 2.006 0 0 0 2 2h6v2Zm-8-4V4.4l5.6 5.6Z"})]})}function Yu(){return c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",className:"icon",viewBox:"0 0 1024 1024",children:[c.jsx("path",{fill:"currentColor",d:"M679.253 402.364 618.77 561.015l-60.348-158.651a30.04 30.04 0 0 0-30.447-18.637 29.76 29.76 0 0 0-30.447 18.637l-60.416 158.651-60.416-158.651a30.515 30.515 0 0 0-38.843-17.272 28.945 28.945 0 0 0-17.954 37.547l88.815 233.267c4.369 11.469 15.7 19.115 28.398 19.115a30.31 30.31 0 0 0 28.468-19.115l62.395-163.908 62.396 163.84c4.437 11.605 15.701 19.183 28.4 19.183a30.31 30.31 0 0 0 28.466-19.115l88.747-233.267a28.945 28.945 0 0 0-17.886-37.547 30.447 30.447 0 0 0-38.912 17.272zm219.478 395.605-51.883-29.218c-28.672-16.18-52.224-3.072-52.224 29.082v.273H643.209a29.833 29.833 0 0 0-30.31 29.354c0 16.18 13.584 29.218 30.31 29.218h151.825c1.092 30.516 24.03 43.077 52.224 27.648l51.063-27.989c29.013-15.906 29.15-42.189.41-58.368"}),c.jsx("path",{fill:"currentColor",d:"m810.667 913.135-.478.068H201.796c-19.865 0-36.727-11.673-36.727-25.6v-618.36h154.965c51.268 0 92.911-39.39 92.911-87.858v-87.86H810.19c19.797 0 36.522 11.742 36.522 25.669V739.26h61.987V119.262c0-46.421-44.169-84.241-98.51-84.241H328.364l-225.28 194.56v658.09c0 46.285 44.236 84.105 98.713 84.105H810.19c43.759 0 80.554-24.713 93.32-58.573h-92.842zM350.89 94.89v86.562c0 16.11-13.858 29.286-30.925 29.286H216.815L350.959 94.891z"})]})}function E0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",color:"currentColor",children:[c.jsx("path",{d:"M14.86 22h-4.312c-3.291 0-4.937 0-6.08-.798a4.2 4.2 0 0 1-.863-.805c-.855-1.066-.855-2.6-.855-5.67v-2.545c0-2.963 0-4.445.473-5.628c.761-1.903 2.37-3.403 4.41-4.113C8.9 2 10.49 2 13.667 2c1.816 0 2.723 0 3.448.252c1.166.406 2.085 1.263 2.52 2.35c.27.676.27 1.523.27 3.216V10"}),c.jsx("path",{d:"M2.75 12c0-1.84 1.506-3.333 3.364-3.333c.672 0 1.464.116 2.117-.057a1.67 1.67 0 0 0 1.19-1.179c.174-.647.057-1.432.057-2.098C9.478 3.493 10.984 2 12.84 2m.002 16h2.523m-4.949-4.15c-.126-.8-.281-.801-1.61-.85h-1.01c-.557 0-1.009.448-1.009 1v3c0 .552.452 1 1.01 1h1.816c.39 0 .803-.313.803-.7v-1.1c0-.11-.113-.304-.224-.304H9.068M12.842 13h1.261m0 0h1.262m-1.262 0v4.875M21.251 13h-2.523c-.557 0-1.009.448-1.009 1v1.5m0 0V18m0-2.5h2.523"})]})})}function I0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:c.jsx("path",{fill:"currentColor",d:"M6.5 3a.75.75 0 0 1 .697.471l3 7.5a.75.75 0 0 1-1.393.557L7.992 9.5H5.008l-.811 2.028a.75.75 0 0 1-1.393-.556l3-7.5A.75.75 0 0 1 6.5 3m0 2.77L5.608 8h1.784zm8.28-1.55a.75.75 0 1 0-1.06 1.06l.72.72h-3.69a.75.75 0 0 0 0 1.5h3.69l-.72.72a.75.75 0 0 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06zm0 7.5a.75.75 0 1 0-1.06 1.06l.72.72H3.75a.75.75 0 0 0 0 1.5h10.69l-.72.72a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06z"})})}function R0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 48 48",children:c.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"4",children:[c.jsx("circle",{cx:"10",cy:"24",r:"4"}),c.jsx("circle",{cx:"38",cy:"10",r:"4"}),c.jsx("circle",{cx:"38",cy:"24",r:"4"}),c.jsx("circle",{cx:"38",cy:"38",r:"4"}),c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M34 38H22V10h12M14 24h20"})]})})}function O0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",children:c.jsx("path",{fill:"currentColor",d:"M13.5 3a.75.75 0 0 0-.697.471l-3 7.5a.75.75 0 0 0 1.393.557l.812-2.028h2.984l.811 2.028a.75.75 0 0 0 1.393-.556l-3-7.5A.75.75 0 0 0 13.5 3m0 2.77L14.392 8h-1.784zM5.22 4.22a.75.75 0 0 1 1.06 1.06L5.56 6h3.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 0 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06zm0 7.5a.75.75 0 0 1 1.06 1.06l-.72.72h10.69a.75.75 0 0 1 0 1.5H5.56l.72.72a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06z"})})}function P0(){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:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"m3 21l7.548-7.548M21 3l-7.548 7.548m0 0L8 3H3l7.548 10.452m2.904-2.904L21 21h-5l-5.452-7.548",color:"currentColor"})})}function k0(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":"true",role:"img",width:"1em",height:"1em",viewBox:"0 0 24 24",children:c.jsx("path",{fill:"currentColor",d:"M14 2H6a2 2 0 0 0-2 2v16c0 1.11.89 2 2 2h12c1.11 0 2-.89 2-2V8zm4 18H6V4h7v5h5zm-.65-10l-2.1 9h-1.4l-1.8-6.79l-1.8 6.79h-1.4l-2.2-9h1.5l1.4 6.81l1.8-6.81h1.3l1.8 6.81l1.4-6.81z"})})}const Ia={Bold:M.Bold,LoaderCircle:M.LoaderCircle,Italic:M.Italic,Underline:M.Underline,Quote:M.Quote,TextQuote:p0,Strikethrough:M.Strikethrough,Minus:M.Minus,Eraser:M.Eraser,PaintRoller:M.PaintRoller,Redo2:M.Redo2,Undo2:M.Undo2,AlignCenter:kr.TextAlignCenterIcon,AlignJustify:kr.TextAlignJustifyIcon,AlignLeft:kr.TextAlignLeftIcon,AlignRight:kr.TextAlignRightIcon,ChevronDown:M.ChevronDown,Subscript:M.Subscript,Superscript:M.Superscript,Code:M.Code,Code2:M.CodeXml,Type:M.Type,IndentIncrease:M.IndentIncrease,IndentDecrease:M.IndentDecrease,List:M.List,ListOrdered:M.ListOrdered,ListTodo:M.ListTodo,Link:M.Link,ImageUp:M.ImageUp,Video:M.Video,Maximize:M.Maximize,Minimize:M.Minimize,Table:M.Table,Sparkles:M.Sparkles,Pencil:M.Pencil,Unlink:M.Unlink,BetweenHorizonalEnd:M.BetweenHorizonalEnd,BetweenHorizonalStart:M.BetweenHorizonalStart,BetweenVerticalStart:M.BetweenVerticalStart,BetweenVerticalEnd:M.BetweenVerticalEnd,TableCellsMerge:M.TableCellsMerge,TableCellsSplit:M.TableCellsSplit,Trash2:M.Trash2,Trash:M.Trash,Replace:M.Replace,ChevronsUpDown:M.ChevronsUpDown,LineHeight:v0,Word:x0,Heading1:M.Heading1,Heading2:M.Heading2,Heading3:M.Heading3,Heading4:M.Heading4,Heading5:M.Heading5,Heading6:M.Heading6,Columns2:M.Columns2,Columns3:M.Columns3,Columns4:M.Columns4,Plus:M.Plus,Grip:M.GripVertical,Copy:M.Copy,Clipboard:M.Clipboard,PanelLeft:M.PanelLeft,PanelRight:M.PanelRight,Columns:M.Columns2,Iframe:M.Frame,MenuDown:Ku,SizeS:w0,SizeM:b0,SizeL:y0,AspectRatio:h0,Emoji:M.SmilePlus,DeleteColumn:m0,DeleteRow:g0,SearchAndReplace:M.Replace,EmojiIcon:M.SmilePlusIcon,KatexIcon:M.Sigma,ExportPdf:Xu,ExportWord:Yu,ImportWord:k0,ColumnAddLeft:A0,ColumnAddRight:C0,BookMarked:M.BookMarked,Excalidraw:T0,ZoomIn:M.ZoomIn,ZoomOut:M.ZoomOut,Settings:M.Settings,Eye:M.Eye,TextDirection:j0,LeftToRight:I0,RightToLeft:O0,Attachment:M.Paperclip,GifIcon:E0,ChevronUp:M.ChevronUp,Crop:M.CropIcon,Mermaid:R0,Twitter:P0,CodeView:S0,FlipX:M.FlipVertical,FlipY:M.FlipHorizontal,PencilRuler:M.PencilRuler,WrapText:M.WrapText,Loader:M.Loader2};function N0({fill:e}){return c.jsx("svg",{width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("g",{id:"icon/填充色",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:c.jsxs("g",{id:"icon/背景颜色",children:[c.jsx("g",{id:"编组",fill:"currentColor",children:c.jsxs("g",{transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)",id:"矩形",children:[c.jsx("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z",fillRule:"nonzero"}),c.jsx("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z",fillRule:"evenodd"}),c.jsx("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z",fillRule:"nonzero"})]})}),c.jsx("path",{d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",id:"矩形",fill:e||"none"})]})})})}function Ju(e){const[t,r]=w.useState(e==null?void 0:e.defaultColor);function n(a){var s;(s=e.action)==null||s.call(e,a)}function i(){var a;(a=e.action)==null||a.call(e,t)}const o=w.useCallback(Ar(a=>{r(a)},350),[]);return c.jsxs("div",{className:"richtext-flex richtext-items-center richtext-h-[32px]",children:[c.jsx(W,{tooltip:e==null?void 0:e.tooltip,disabled:e==null?void 0:e.disabled,action:i,tooltipOptions:e==null?void 0:e.tooltipOptions,shortcutKeys:e==null?void 0:e.shortcutKeys,children:c.jsx("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-text-sm",children:c.jsx(N0,{fill:t})})}),c.jsx(of,{selectedColor:t,setSelectedColor:o,onChange:n,highlight:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(we,{variant:"ghost",size:"icon",className:"!richtext-w-3 !richtext-h-[32px]",disabled:e==null?void 0:e.disabled,children:c.jsx(xe,{className:"!richtext-w-3 !richtext-h-3 richtext-text-zinc-500",name:"MenuDown"})})})]})}function M0({editor:e,disabled:t,actions:r,hiddenActions:n=[]}){var S,j,E,C,k,L,N,P,_,T,A,O,D,U,H,K,re,ie;const i=({editor:he})=>B.isActive(he.view.state,"table"),{t:o}=q.useLocale(),a=he=>n.includes(he);function s(){e.chain().focus().addColumnBefore().run()}function l(){e.chain().focus().addColumnAfter().run()}function u(){e.chain().focus().deleteColumn().run()}function f(){e.chain().focus().addRowBefore().run()}function d(){e.chain().focus().addRowAfter().run()}function h(){e.chain().focus().deleteRow().run()}function p(){e.chain().focus().mergeCells().run()}function m(){e==null||e.chain().focus().splitCell().run()}function x(){e.chain().focus().deleteTable().run()}function g(he){e.chain().focus().setTableCellBackground(he).run()}const v=()=>{var $;const{view:he,state:{selection:{from:ge}}}=e,Se=he.domAtPos(ge).node;if(!Se)return new DOMRect(-1e3,-1e3,0,0);const $e=($=Se==null?void 0:Se.closest)==null?void 0:$.call(Se,".tableWrapper");return $e?$e.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return c.jsx(me.BubbleMenu,{editor:e,pluginKey:"table",shouldShow:i,updateDelay:0,tippyOptions:{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},maxWidth:"auto",getReferenceClientRect:v,plugins:[ru.sticky],sticky:"popper"},children:t?c.jsx(c.Fragment,{}):c.jsxs("div",{className:"richtext-flex richtext-size-full richtext-min-w-32 richtext-flex-row richtext-items-center richtext-gap-0.5 richtext-rounded-lg !richtext-border richtext-border-border richtext-bg-background richtext-p-2 richtext-leading-none richtext-shadow-sm",children:[!a("addColumnBefore")&&c.jsx(W,{action:s,disabled:!((j=(S=e==null?void 0:e.can())==null?void 0:S.addColumnBefore)!=null&&j.call(S)),icon:"BetweenHorizonalEnd",tooltip:o("editor.table.menu.insertColumnBefore"),"tooltip-options":{sideOffset:15}}),!a("addColumnAfter")&&c.jsx(W,{action:l,disabled:!((C=(E=e==null?void 0:e.can())==null?void 0:E.addColumnAfter)!=null&&C.call(E)),icon:"BetweenHorizonalStart",tooltip:o("editor.table.menu.insertColumnAfter"),"tooltip-options":{sideOffset:15}}),!a("deleteColumn")&&c.jsx(W,{action:u,disabled:!((L=e==null?void 0:(k=e.can()).deleteColumn)!=null&&L.call(k)),icon:"DeleteColumn",tooltip:o("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15}}),c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),!a("addRowAbove")&&c.jsx(W,{action:f,disabled:!((P=e==null?void 0:(N=e.can()).addRowBefore)!=null&&P.call(N)),icon:"BetweenVerticalEnd",tooltip:o("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15}}),!a("addRowBelow")&&c.jsx(W,{action:d,disabled:!((T=(_=e==null?void 0:e.can())==null?void 0:_.addRowAfter)!=null&&T.call(_)),icon:"BetweenVerticalStart",tooltip:o("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15}}),!a("deleteRow")&&c.jsx(W,{action:h,disabled:!((O=(A=e==null?void 0:e.can())==null?void 0:A.deleteRow)!=null&&O.call(A)),icon:"DeleteRow",tooltip:o("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15}}),c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),!a("mergeCells")&&c.jsx(W,{action:p,disabled:!((U=(D=e==null?void 0:e.can())==null?void 0:D.mergeCells)!=null&&U.call(D)),icon:"TableCellsMerge",tooltip:o("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15}}),!a("splitCells")&&c.jsx(W,{action:m,disabled:!((K=(H=e==null?void 0:e.can())==null?void 0:H.splitCell)!=null&&K.call(H)),icon:"TableCellsSplit",tooltip:o("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15}}),c.jsx(Be,{className:"!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",orientation:"vertical"}),!a("setCellBackground")&&c.jsx(Ju,{action:g,editor:e,tooltip:o("editor.table.menu.setCellsBgColor"),tooltipOptions:{sideOffset:15}}),!a("deleteTable")&&c.jsx(W,{action:x,disabled:!((ie=(re=e==null?void 0:e.can())==null?void 0:re.deleteTable)!=null&&ie.call(re)),icon:"Trash2",tooltip:o("editor.table.menu.deleteTable"),"tooltip-options":{sideOffset:15}}),r&&r.map((he,ge)=>c.jsx(W,{...he},ge))]})})}const L0="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",$0="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",zt=(e,t)=>{for(const r in t)e[r]=t[r];return e},aa="numeric",sa="ascii",ca="alpha",ir="asciinumeric",rr="alphanumeric",la="domain",Zu="emoji",_0="scheme",D0="slashscheme",ei="whitespace";function B0(e,t){return e in t||(t[e]=[]),t[e]}function At(e,t,r){t[aa]&&(t[ir]=!0,t[rr]=!0),t[sa]&&(t[ir]=!0,t[ca]=!0),t[ir]&&(t[rr]=!0),t[ca]&&(t[rr]=!0),t[rr]&&(t[la]=!0),t[Zu]&&(t[la]=!0);for(const n in t){const i=B0(n,r);i.indexOf(e)<0&&i.push(e)}}function z0(e,t){const r={};for(const n in t)t[n].indexOf(e)>=0&&(r[n]=!0);return r}function Ee(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Ee.groups={};Ee.prototype={accepts(){return!!this.t},go(e){const t=this,r=t.j[e];if(r)return r;for(let n=0;n<t.jr.length;n++){const i=t.jr[n][0],o=t.jr[n][1];if(o&&i.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,r,n){for(let i=0;i<e.length;i++)this.tt(e[i],t,r,n)},tr(e,t,r,n){n=n||Ee.groups;let i;return t&&t.j?i=t:(i=new Ee(t),r&&n&&At(t,r,n)),this.jr.push([e,i]),i},ts(e,t,r,n){let i=this;const o=e.length;if(!o)return i;for(let a=0;a<o-1;a++)i=i.tt(e[a]);return i.tt(e[o-1],t,r,n)},tt(e,t,r,n){n=n||Ee.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const o=t;let a,s=i.go(e);if(s?(a=new Ee,zt(a.j,s.j),a.jr.push.apply(a.jr,s.jr),a.jd=s.jd,a.t=s.t):a=new Ee,o){if(n)if(a.t&&typeof a.t=="string"){const l=zt(z0(a.t,n),r);At(o,l,n)}else r&&At(o,r,n);a.t=o}return i.j[e]=a,a}};const Z=(e,t,r,n,i)=>e.ta(t,r,n,i),pe=(e,t,r,n,i)=>e.tr(t,r,n,i),Zs=(e,t,r,n,i)=>e.ts(t,r,n,i),R=(e,t,r,n,i)=>e.tt(t,r,n,i),tt="WORD",ua="UWORD",Qu="ASCIINUMERICAL",ed="ALPHANUMERICAL",mr="LOCALHOST",da="TLD",fa="UTLD",Fr="SCHEME",Lt="SLASH_SCHEME",Ra="NUM",ha="WS",Oa="NL",or="OPENBRACE",ar="CLOSEBRACE",Yr="OPENBRACKET",Jr="CLOSEBRACKET",Zr="OPENPAREN",Qr="CLOSEPAREN",en="OPENANGLEBRACKET",tn="CLOSEANGLEBRACKET",rn="FULLWIDTHLEFTPAREN",nn="FULLWIDTHRIGHTPAREN",on="LEFTCORNERBRACKET",an="RIGHTCORNERBRACKET",sn="LEFTWHITECORNERBRACKET",cn="RIGHTWHITECORNERBRACKET",ln="FULLWIDTHLESSTHAN",un="FULLWIDTHGREATERTHAN",dn="AMPERSAND",Pa="APOSTROPHE",fn="ASTERISK",mt="AT",hn="BACKSLASH",pn="BACKTICK",mn="CARET",gt="COLON",ka="COMMA",gn="DOLLAR",He="DOT",xn="EQUALS",Na="EXCLAMATION",ke="HYPHEN",sr="PERCENT",vn="PIPE",yn="PLUS",bn="POUND",cr="QUERY",Ma="QUOTE",td="FULLWIDTHMIDDLEDOT",La="SEMI",qe="SLASH",lr="TILDE",wn="UNDERSCORE",rd="EMOJI",Sn="SYM";var nd=Object.freeze({__proto__:null,WORD:tt,UWORD:ua,ASCIINUMERICAL:Qu,ALPHANUMERICAL:ed,LOCALHOST:mr,TLD:da,UTLD:fa,SCHEME:Fr,SLASH_SCHEME:Lt,NUM:Ra,WS:ha,NL:Oa,OPENBRACE:or,CLOSEBRACE:ar,OPENBRACKET:Yr,CLOSEBRACKET:Jr,OPENPAREN:Zr,CLOSEPAREN:Qr,OPENANGLEBRACKET:en,CLOSEANGLEBRACKET:tn,FULLWIDTHLEFTPAREN:rn,FULLWIDTHRIGHTPAREN:nn,LEFTCORNERBRACKET:on,RIGHTCORNERBRACKET:an,LEFTWHITECORNERBRACKET:sn,RIGHTWHITECORNERBRACKET:cn,FULLWIDTHLESSTHAN:ln,FULLWIDTHGREATERTHAN:un,AMPERSAND:dn,APOSTROPHE:Pa,ASTERISK:fn,AT:mt,BACKSLASH:hn,BACKTICK:pn,CARET:mn,COLON:gt,COMMA:ka,DOLLAR:gn,DOT:He,EQUALS:xn,EXCLAMATION:Na,HYPHEN:ke,PERCENT:sr,PIPE:vn,PLUS:yn,POUND:bn,QUERY:cr,QUOTE:Ma,FULLWIDTHMIDDLEDOT:td,SEMI:La,SLASH:qe,TILDE:lr,UNDERSCORE:wn,EMOJI:rd,SYM:Sn});const Qe=/[a-z]/,er=new RegExp("\\p{L}","u"),ti=new RegExp("\\p{Emoji}","u"),et=/\d/,ri=/\s/,Qs="\r",ni=`
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,"'",Pa),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,"-",ke),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=pe(r,et,Ra,{[aa]:!0});pe(n,et,n);const i=pe(n,Qe,Qu,{[ir]:!0}),o=pe(n,er,ed,{[rr]:!0}),a=pe(r,Qe,tt,{[sa]:!0});pe(a,et,i),pe(a,Qe,a),pe(i,et,i),pe(i,Qe,i);const s=pe(r,er,ua,{[ca]:!0});pe(s,Qe),pe(s,et,o),pe(s,er,s),pe(o,et,o),pe(o,Qe),pe(o,er,o);const l=R(r,ni,Oa,{[ei]:!0}),u=R(r,Qs,ha,{[ei]:!0}),f=pe(r,ri,ha,{[ei]:!0});R(r,ii,f),R(u,ni,l),R(u,ii,f),pe(u,ri,f),R(f,Qs),R(f,ni),pe(f,ri,f),R(f,ii,f);const d=pe(r,ti,rd,{[Zu]:!0});R(d,"#"),pe(d,ti,d),R(d,H0,d);const h=R(d,q0);R(h,"#"),pe(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 En(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=En("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),nc=En("text"),W0=En("nl"),_r=En("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,ke,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,Pa,fn,hn,pn,mn,gn,xn,ke,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,ke);R(m,ke,m),Z(m,e.domain,d),Z(p,e.domain,d),R(p,He,h),R(p,ke,m);const x=R(p,gt);Z(x,e.numeric,rc);const g=R(a,ke),v=R(a,He);R(g,ke,g),Z(g,e.domain,a),Z(v,n,o),Z(v,e.domain,a);const S=Pe(_r);Z(v,e.tld,S),Z(v,e.utld,S),Z(S,e.domain,a),Z(S,n,o),R(S,He,v),R(S,ke,g),R(S,mt,u);const j=R(S,gt),E=Pe(_r);Z(j,e.numeric,E);const C=Pe(_r),k=Pe();Z(C,t,C),Z(C,r,k),Z(k,t,C),Z(k,r,k),R(S,qe,C),R(E,qe,C);const L=R(s,gt),N=R(l,gt),P=R(N,qe),_=R(P,qe);Z(s,e.domain,a),R(s,He,v),R(s,ke,g),Z(l,e.domain,a),R(l,He,v),R(l,ke,g),Z(L,e.domain,C),R(L,qe,C),R(L,cr,C),Z(_,e.domain,C),Z(_,t,C),R(_,qe,C);const T=[[or,ar],[Yr,Jr],[Zr,Qr],[en,tn],[rn,nn],[on,an],[sn,cn],[ln,un]];for(let A=0;A<T.length;A++){const[O,D]=T[A],U=R(C,O);R(k,O,U),R(U,D,C);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,C),R(K,D,C)}return R(i,mr,S),R(i,Oa,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
- 1. Must only contain digits, lowercase ASCII letters or "-"
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(v=>v.toObject(e.defaultProtocol));if(!t1(g))return!1;g.filter(v=>v.isLink).map(v=>({...v,from:x+v.start+1,to:x+v.end+1})).filter(v=>n.schema.marks.code?!n.doc.rangeHasMark(v.from,v.to,n.schema.marks.code):!0).filter(v=>e.validate(v.value)).filter(v=>e.shouldAutoLink(v.value)).forEach(v=>{B.getMarksBetween(v.from,v.to,n.doc).some(S=>S.mark.type===e.type)||a.addMark(v.from,v.to,e.type.create({href:v.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(xe,{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,open:t,target:e.target})})]})}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 r,n;const e=((r=this.parent)==null?void 0:r.call(this))||{},t=(n=e.HTMLAttributes)==null?void 0:n.target;return{...e,openOnClick:!0,button:({editor:i,t:o})=>({component:a1,componentProps:{editor:i,action:a=>{const{link:s,text:l,openInNewTab:u}=a;if(!s){i.chain().extendMarkRange("link").unsetLink().run();return}i.isActive("link")&&i.chain().extendMarkRange("link").run();const{from:f}=i.state.selection,d=l.length;i.chain().insertContent({type:"text",text:l,marks:[{type:"link",attrs:{href:s.match(/^https?:\/\//i)?s:`http://${s}`,target:t??(u?"_blank":"")}}]}).setLink({href:s}).setTextSelection({from:f,to:f+d}).focus().run()},id:"linkk",isActive:()=>i.isActive("link")||!1,disabled:!i.can().setLink({href:""}),icon:"Link",tooltip:o("editor.link.tooltip"),target:t}})}},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;let a=null;if(n.nodesBetween(o.from,o.to,f=>(a=f.marks.find(d=>d.type===r.marks.link),!a)),this.options.openOnClick&&(a!=null&&a.attrs.href)&&t!==o.to)return window.open(a.attrs.href,a.attrs.target||"_self"),!0;const s=n.resolve(o.from),l=n.resolve(o.to),u=i.setSelection(new B.TextSelection(s,l));e.dispatch(u)}}})]}});function cd(e){const{t}=q.useLocale(),[r,n]=w.useState({text:"",link:""}),[i,o]=w.useState(!1),a=w.useRef(null),s=w.useRef(null);w.useEffect(()=>{const u=()=>{var S,j,E,C;const{from:f,to:d,empty:h}=e.editor.state.selection,p=(S=e.editor.extensionManager.extensions.find(k=>k.name===sd.name))==null?void 0:S.options;let m="",x="",g=(j=p==null?void 0:p.HTMLAttributes)==null?void 0:j.target;const v=e.editor.state.doc.nodeAt(f);if(v){const k=v.marks.find(L=>L.type.name==="link");k?(x=k.attrs.href||"",g=k.attrs.target,h?m=v.text||"":m=e.editor.state.doc.textBetween(f,d," ")):m=e.editor.state.doc.textBetween(f,d," ")}v||(m=e.editor.state.doc.textBetween(f,d," ")),n({link:x,text:m}),o(e.target?e.target==="_blank":g==="_blank"),e.open&&(m===""?(E=a.current)==null||E.focus():(C=s.current)==null||C.focus())};return u(),e.editor.on("selectionUpdate",u),()=>{e.editor.off("selectionUpdate",u)}},[e.editor,e.open]);function l(u){u.preventDefault(),u.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(Ie,{ref:a,className:"richtext-w-80",onChange:u=>n({...r,text:u.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(Ie,{ref:s,className:"richtext-pl-10",onChange:u=>n({...r,link:u.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(xe,{className:"richtext-size-5 richtext-text-muted-foreground",name:"Link"})})]})}),!e.target&&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:u=>{o(u)}})]}),c.jsx(we,{className:"richtext-mt-2 richtext-self-end",onClick:l,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(me.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=Ne.Root,jr=Ne.Trigger,u1=Ne.Portal,ld=oe.forwardRef(({className:e,...t},r)=>c.jsx(Ne.Overlay,{ref:r,className:te("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=Ne.Overlay.displayName;const Ft=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(u1,{children:[c.jsx(ld,{}),c.jsxs(Ne.Content,{ref:n,className:te("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(Ne.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(M.X,{className:"richtext-h-4 richtext-w-4"}),c.jsx("span",{className:"richtext-sr-only",children:"Close"})]})]})]}));Ft.displayName=Ne.Content.displayName;function ud({className:e,...t}){return c.jsx("div",{className:te("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:te("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(Ne.Title,{ref:r,className:te("richtext-text-lg richtext-font-semibold richtext-leading-none richtext-tracking-tight",e),...t}));Ut.displayName=Ne.Title.displayName;const d1=oe.forwardRef(({className:e,...t},r)=>c.jsx(Ne.Description,{ref:r,className:te("richtext-text-sm richtext-text-muted-foreground",e),...t}));d1.displayName=Ne.Description.displayName;const oc=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ac=me.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:te(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 _,T;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),[v,S]=w.useState({src:"",file:null}),j=w.useMemo(()=>{var A;return(A=e.extensionManager.extensions.find(O=>O.name===Ht.name))==null?void 0:A.options},[e]);function E(A){if(d.current&&A.width&&A.height){const O=C(d.current,A);x(O)}}function C(A,O){const D=document.createElement("canvas"),U=A.naturalWidth/A.width,H=A.naturalHeight/A.height;D.width=O.width*U,D.height=O.height*H;const K=D.getContext("2d");return K&&(K.imageSmoothingEnabled=!1,K.drawImage(A,O.x*U,O.y*H,O.width*U,O.height*H,0,0,O.width*U,O.height*H)),D.toDataURL("image/png",1)}const k=w.useCallback(async()=>{var A;if(!u){f(!0);try{const O=dd(m,((A=v==null?void 0:v.file)==null?void 0:A.name)||"image.png");let D="";j.upload?D=await j.upload(O):D=URL.createObjectURL(O),e.chain().focus().setImageInline({src:D,inline:t,alt:i}).run(),l(!1),S({src:"",file:null}),P(),r()}catch(O){console.log("Error cropping image",O)}finally{f(!1)}}},[m,e,t,u,r,(_=v==null?void 0:v.file)==null?void 0:_.name,j]);function L(A){var O;A.preventDefault(),(O=g.current)==null||O.click()}const N=async A=>{var K;const O=(K=A==null?void 0:A.target)==null?void 0:K.files;if(!e||e.isDestroyed||O.length===0){A.target.value="";return}const D=fd(O,{acceptMimes:j==null?void 0:j.acceptMimes,maxSize:j==null?void 0:j.maxSize,t:o,toast:a,onError:j.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})},P=()=>{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}),P())},children:[c.jsx(jr,{}),c.jsxs(Ft,{children:[c.jsx(Ut,{children:o("editor.image.dialog.tab.uploadCrop")}),c.jsx("div",{children:v.src&&c.jsx(Cf,{className:"richtext-w-full",crop:h,onChange:A=>p(A),onComplete:A=>E(A),children:c.jsx("img",{alt:"Crop me",ref:d,src:v.src})})}),c.jsxs(In,{children:[c.jsxs(we,{disabled:u,onClick:()=>{l(!1),S({src:"",file:null}),P()},children:[o("editor.imageUpload.cancel"),c.jsx(xe,{className:"richtext-ml-1",name:"Trash2"})]}),c.jsx(we,{className:"richtext-w-fit",disabled:u||!h,onClick:k,children:u?c.jsxs(c.Fragment,{children:[o("editor.imageUpload.uploading"),c.jsx(xe,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):c.jsxs(c.Fragment,{children:[o("editor.imageUpload.crop"),c.jsx(xe,{className:"richtext-ml-1",name:"Crop"})]})})]})]})]}),c.jsx("input",{accept:((T=j==null?void 0:j.acceptMimes)==null?void 0:T.join(","))||"image/*",multiple:!1,onChange:N,ref:g,style:{display:"none"},type:"file"})]})}function On(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}}On({value:!1});On({value:!1});const{Provider:b1,useStore:hd}=On({value:!1}),{Provider:w1,useStore:pd}=On({value:"light"});q.d("0");function xr(e,t){return window.addEventListener(e,t),()=>{window.removeEventListener(e,t)}}function Pn(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)=>{Pn(vt.UPLOAD_IMAGE(e),t)}};function S1(e){var E;const{t}=q.useLocale(),{toast:r}=Nn(),[n,i]=w.useState(!1),[o,a]=w.useState(!1),s=C=>{i(C.detail)},[l,u]=w.useState(""),[f,d]=w.useState(""),h=w.useRef(null),p=((E=e.editor.extensionManager.extensions.find(C=>C.name===Ht.name))==null?void 0:E.options.defaultInline)||!1,[m,x]=w.useState(p),g=w.useMemo(()=>{var k;return(k=e.editor.extensionManager.extensions.find(L=>L.name===Ht.name))==null?void 0:k.options},[e.editor]);w.useEffect(()=>{const C=xr(vt.UPLOAD_IMAGE(e.editor.id),s);return()=>{C()}},[]);async function v(C){var N;const k=(N=C==null?void 0:C.target)==null?void 0:N.files;if(!e.editor||e.editor.isDestroyed||k.length===0||o){C.target.value="";return}const L=fd(k,{acceptMimes:g==null?void 0:g.acceptMimes,maxSize:g==null?void 0:g.maxSize,t,toast:r,onError:g.onError});if(L.length<=0){C.target.value="";return}a(!0);try{if(g!=null&&g.multiple){const P=L.map(async T=>{let A="";return g.upload?A=await g.upload(T):A=URL.createObjectURL(T),A});(await Promise.all(P)).forEach(T=>{e.editor.chain().focus().setImageInline({src:T,inline:m,alt:f}).run()})}else{const P=L[0];let _="";g.upload?_=await g.upload(P):_=URL.createObjectURL(P),e.editor.chain().focus().setImageInline({src:_,inline:m,alt:f}).run()}i(!1),d(""),x(p)}catch(P){console.error("Error uploading image",P),g.onError?g.onError({type:"upload",message:t("editor.upload.error")}):r({variant:"destructive",title:t("editor.upload.error")})}finally{a(!1),C.target.value=""}}function S(C){C.preventDefault(),C.stopPropagation(),e.editor.chain().focus().setImageInline({src:l,inline:m,alt:f}).run(),i(!1),x(p),u(""),d("")}function j(C){var k;C.preventDefault(),(k=h.current)==null||k.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:[g.resourceImage==="both"&&c.jsxs(Xa,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[c.jsx(yr,{value:"upload",children:t("editor.image.dialog.tab.upload")}),c.jsx(yr,{value:"link",children:t("editor.image.dialog.tab.url")})]}),c.jsxs("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[c.jsx(Id,{checked:m,onCheckedChange:C=>{x(C)}}),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(Ie,{onChange:C=>d(C.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:j,size:"sm",children:o?c.jsxs(c.Fragment,{children:[t("editor.imageUpload.uploading"),c.jsx(xe,{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:v,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(Ie,{autoFocus:!0,onChange:C=>u(C.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 N,P,_;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}=(N=e==null?void 0:e.node)==null?void 0:N.attrs,h=d&&(f==="left"||f==="right"),p=w.useMemo(()=>{var Se;const{src:T,alt:A,width:O,height:D,flipX:U,flipY:H}=(Se=e==null?void 0:e.node)==null?void 0:Se.attrs,K=Kr(O)?`${O}px`:O,re=Kr(D)?`${D}px`:D,ie=[];U&&ie.push("rotateX(180deg)"),H&&ie.push("rotateY(180deg)");const he=ie.join(" ");return{src:T||void 0,alt:A||void 0,style:{width:K||void 0,height:re||void 0,transform:he||"none",...h?{float:f}:{}}}},[(P=e==null?void 0:e.node)==null?void 0:P.attrs]),m=w.useMemo(()=>{const{style:{width:T}}=p;return{width:T==="100%"?T:void 0}},[p]);function x(T){i({width:T.target.width,height:T.target.height})}function g(){const{editor:T,getPos:A}=e;T.commands.setNodeSelection(A())}const v=w.useCallback(Bt(()=>{const{editor:T}=e,{width:A}=getComputedStyle(T.view.dom);r(O=>({...O,width:Number.parseInt(A,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function S(T,A){T.preventDefault(),T.stopPropagation();const O=n.width,D=n.height,U=O/D;let H=Number(e.node.attrs.width),K=Number(e.node.attrs.height);const re=t.width;H&&!K?(H=H>re?re:H,K=Math.round(H/U)):K&&!H?(H=Math.round(K*U),H=H>re?re:H):!H&&!K?(H=O>re?re:O,K=Math.round(H/U)):H=H>re?re:H,s(!0),u({x:T.clientX,y:T.clientY,w:H,h:K,dir:A})}const j=w.useCallback(Bt(T=>{if(T.preventDefault(),T.stopPropagation(),!a)return;const{x:A,w:O,dir:D}=l,U=(T.clientX-A)*(/l/.test(D)?-1:1),H=Eu(O+U,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:H,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),E=w.useCallback(T=>{T.preventDefault(),T.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),g())},[a,g]),C=w.useCallback(()=>{document==null||document.addEventListener("mousemove",j,!0),document==null||document.addEventListener("mouseup",E,!0)},[j,E]),k=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",j,!0),document==null||document.removeEventListener("mouseup",E,!0)},[j,E]);w.useEffect(()=>(a?C():k(),()=>{k()}),[a,C,k]);const L=w.useMemo(()=>new ResizeObserver(()=>v()),[v]);return w.useEffect(()=>(L.observe(e.editor.view.dom),()=>{L.disconnect()}),[e.editor.view.dom,L]),c.jsx(me.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(T=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${T}`,onMouseDown:A=>S(A,T)},`image-dir-${T}`))})]})})}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 T1(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 E1({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=T1(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 v=o.state.tr.replaceWith(p,p,x).setMeta(Dt,{remove:[l]});o.dispatch(v)},()=>{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 O1={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{...O1,...(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 me.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"}}},{tag:'img[src]:not([src^="data:"])'}]},addProseMirrorPlugins(){const t=E1({validateFn:r=>!(!this.options.acceptMimes.includes(r.type)||r.size>this.options.maxSize),onUpload:this.options.upload,defaultInline:this.options.defaultInline});return[C1(),new B.Plugin({key:new B.PluginKey("image"),props:{handlePaste:(r,n)=>{var a;if(!(n.clipboardData&&n.clipboardData.files&&((a=n.clipboardData.files)==null?void 0:a.length)))return;if([...n.clipboardData.files||[]].some(s=>s.type==="text/html"))return!1;if(n.clipboardData.items.length==2){n.clipboardData.items[0].getAsString(s=>{let l="";if(s.replace(/src\s*=\s*"(.*)"/,(u,f)=>l=f),l&&typeof l=="string"){const u=r.state.schema.nodes.image.create({src:l}),f=r.state.tr.replaceSelectionWith(u);r.dispatch(f)}});return}return I1(r,n,t)},handleDrop:(r,n,i,o)=>{if(!(n instanceof DragEvent)||!n.dataTransfer)return!1;if(n.dataTransfer.items.length==2){n.dataTransfer.items[0].getAsString(a=>{let s="";if(a.replace(/src\s*=\s*"(.*)"/,(l,u)=>s=u),s&&typeof s=="string"){const l=r.state.schema.nodes.image.create({src:s}),u=r.state.tr.replaceSelectionWith(l);r.dispatch(u)}});return}return R1(r,n,o,t),!1}}})]}});async function P1(e){var n;const r=await(await fetch(`https://api.giphy.com/v1/gifs/trending?q=&limit=15&api_key=${e}`)).json();return(n=r==null?void 0:r.data)==null?void 0:n.map(i=>{var o,a,s;return{id:i==null?void 0:i.id,src:(o=i==null?void 0:i.images.original)==null?void 0:o.url,width:+((a=i==null?void 0:i.images.original)==null?void 0:a.width),height:+((s=i==null?void 0:i.images.original)==null?void 0:s.width)}})}async function k1(e,t){var i;const n=await(await fetch(`https://api.giphy.com/v1/gifs/search?q=${e}&limit=15&api_key=${t}`)).json();return(i=n==null?void 0:n.data)==null?void 0:i.map(o=>{var a,s,l;return{id:o==null?void 0:o.id,src:(a=o==null?void 0:o.images.original)==null?void 0:a.url,width:+((s=o==null?void 0:o.images.original)==null?void 0:s.width),height:+((l=o==null?void 0:o.images.original)==null?void 0:l.width)}})}async function N1(e){var o,a;const t=await fetch(`https://tenor.googleapis.com/v2/trending_terms?key=${e}&limit=10`),r=await(t==null?void 0:t.json()),i=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${e}&q=${(o=r==null?void 0:r.results)==null?void 0:o[0]}&limit=15`)).json();return(a=i==null?void 0:i.results)==null?void 0:a.map(s=>{var l,u,f,d,h,p,m,x;return{id:s==null?void 0:s.id,src:(u=(l=s==null?void 0:s.media_formats)==null?void 0:l.gif)==null?void 0:u.url,width:(h=(d=(f=s==null?void 0:s.media_formats)==null?void 0:f.gif)==null?void 0:d.dims)==null?void 0:h[0],height:(x=(m=(p=s==null?void 0:s.media_formats)==null?void 0:p.gif)==null?void 0:m.dims)==null?void 0:x[1]}})}async function M1(e,t){var i;const n=await(await fetch(`https://tenor.googleapis.com/v2/search?key=${t}&q=${e}&limit=15`)).json();return(i=n==null?void 0:n.results)==null?void 0:i.map(o=>{var a,s,l,u,f,d,h,p;return{id:o==null?void 0:o.id,src:(s=(a=o==null?void 0:o.media_formats)==null?void 0:a.gif)==null?void 0:s.url,width:(f=(u=(l=o==null?void 0:o.media_formats)==null?void 0:l.gif)==null?void 0:u.dims)==null?void 0:f[0],height:(p=(h=(d=o==null?void 0:o.media_formats)==null?void 0:d.gif)==null?void 0:h.dims)==null?void 0:p[1]}})}function L1(e,t){return{searchTrending:async()=>t?e==="giphy"?P1(t):e==="tenor"?N1(t):[]:[],searchWord:async i=>t?e==="giphy"?k1(i,t):e==="tenor"?M1(i,t):[]:[]}}function $1({selectImage:e,apiKey:t,provider:r,children:n}){const[i,o]=w.useState([]),a=w.useRef(null),{searchTrending:s,searchWord:l}=L1(r,t);w.useEffect(()=>{(async()=>{const f=await s();o(f)})()},[]);const u=w.useCallback(Ar(async f=>{if(!f.target.value){const h=await s();o(h);return}const d=await l(f.target.value);o(d)},350),[]);return c.jsxs(Wt,{modal:!0,children:[c.jsx(Gt,{asChild:!0,children:n}),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(Ie,{onChange:u,placeholder:"Search GIF",ref:a,type:"text"})}),c.jsx("div",{className:"richtext-max-h-[280px] !richtext-max-w-[400px] richtext-overflow-y-auto",children:c.jsx("div",{className:"richtext-grid richtext-grid-cols-2 richtext-gap-1 ",children:i!=null&&i.length?i==null?void 0:i.map(f=>c.jsx("img",{alt:"",className:"richtext-cursor-pointer richtext-object-contain richtext-text-center",onClick:()=>e(f.src),src:f.src},f.id)):c.jsx("p",{children:"No GIFs found"})})})]}):c.jsx("div",{children:c.jsx("p",{children:"Missing Giphy API Key"})})})]})}function _1({editor:e,icon:t,provider:r,apiKey:n,...i}){const o=a=>{e.chain().focus().setImageGif({src:a}).run()};return c.jsx($1,{apiKey:n,provider:r,selectImage:o,children:c.jsx(W,{icon:t,tooltip:i==null?void 0:i.tooltip})})}const Br={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"};function D1(e){var k,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}=(k=e==null?void 0:e.node)==null?void 0:k.attrs,d=w.useMemo(()=>{var D;const{src:N,alt:P,width:_,height:T}=(D=e==null?void 0:e.node)==null?void 0:D.attrs,A=Kr(_)?`${_}px`:_,O=Kr(T)?`${T}px`:T;return{src:N||void 0,alt:P||void 0,style:{width:A||void 0,height:O||void 0}}},[(L=e==null?void 0:e.node)==null?void 0:L.attrs]),h=w.useMemo(()=>{const{style:{width:N}}=d;return{width:N==="100%"?N:void 0}},[d]);function p(N){i({width:N.target.width,height:N.target.height})}function m(){const{editor:N,getPos:P}=e;N.commands.setNodeSelection(P())}const x=w.useCallback(Bt(()=>{const{editor:N}=e,{width:P}=getComputedStyle(N.view.dom);r(_=>({..._,width:Number.parseInt(P,10)}))},q.IMAGE_THROTTLE_WAIT_TIME),[e==null?void 0:e.editor]);function g(N,P){N.preventDefault(),N.stopPropagation();const _=n.width,T=n.height,A=_/T;let O=Number(e.node.attrs.width),D=Number(e.node.attrs.height);const U=t.width;O&&!D?(O=O>U?U:O,D=Math.round(O/A)):D&&!O?(O=Math.round(D*A),O=O>U?U:O):!O&&!D?(O=_>U?U:_,D=Math.round(O/A)):O=O>U?U:O,s(!0),u({x:N.clientX,y:N.clientY,w:O,h:D,dir:P})}const v=w.useCallback(Bt(N=>{if(N.preventDefault(),N.stopPropagation(),!a)return;const{x:P,w:_,dir:T}=l,A=(N.clientX-P)*(/l/.test(T)?-1:1),O=Eu(_+A,q.IMAGE_MIN_SIZE,t.width);e.updateAttributes({width:O,height:null})},q.IMAGE_THROTTLE_WAIT_TIME),[a,l,t,e.updateAttributes]),S=w.useCallback(N=>{N.preventDefault(),N.stopPropagation(),a&&(u({x:0,y:0,w:0,h:0,dir:""}),s(!1),m())},[a,m]),j=w.useCallback(()=>{document==null||document.addEventListener("mousemove",v,!0),document==null||document.addEventListener("mouseup",S,!0)},[v,S]),E=w.useCallback(()=>{document==null||document.removeEventListener("mousemove",v,!0),document==null||document.removeEventListener("mouseup",S,!0)},[v,S]);w.useEffect(()=>(a?j():E(),()=>{E()}),[a,j,E]);const C=w.useMemo(()=>new ResizeObserver(()=>x()),[x]);return w.useEffect(()=>(C.observe(e.editor.view.dom),()=>{C.disconnect()}),[e.editor.view.dom,C]),c.jsx(me.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(N=>c.jsx("span",{className:`image-resizer__handler image-resizer__handler--${N}`,onMouseDown:P=>g(P,N)},`image-dir-${N}`))})]})})}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",API_KEY:"",provider:"giphy",draggable:!1,selectable:!0,atom:!0,button:({editor:t,extension:r,t:n})=>{var a,s;const i=((a=r==null?void 0:r.options)==null?void 0:a.provider)||"",o=((s=r==null?void 0:r.options)==null?void 0:s.API_KEY)||"";return{component:_1,componentProps:{editor:t,action:()=>{},isActive:()=>!1,disabled:!1,icon:"GifIcon",tooltip:n("editor.imageGif.tooltip"),apiKey:o,provider: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 me.ReactNodeViewRenderer(D1)},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 B1(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 z1(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 v="";f.upload?v=await f.upload(g):v=URL.createObjectURL(g),e.editor.chain().focus().setVideo({src:v,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(Ie,{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&&!B1(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 H1(e,t,r){return e<t?t:e>r?r:e}const q1=e=>typeof e=="number",F1=e=>typeof e=="string",U1=e=>typeof e=="function";function W1(e,t="px"){if(!e)return e;const r=q1(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 G1(e){return e.map(t=>F1(t)?{value:t,name:t}:t)}function V1(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:z1,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?V1(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:W1(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 K1(e){return e.type.name===Ht.name}function X1(e){return e.type.name===za.name}function Y1(e){return e.type.name===Ha.name}function J1(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(K1(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(me.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 Z1(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(X1(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(me.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 Q1(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(Y1(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(me.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 ev(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function tv(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 rv(e,t,r=null){const n=tv(e),i=[];for(let o=0;o<t;o+=1){const a=ev(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]}}),nv=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=rv(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 iv({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(me.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:te("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(M.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:te("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:te("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:te("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:te("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(M.Check,{className:"richtext-h-4 richtext-w-4"})})}),t]}));bd.displayName=fe.CheckboxItem.displayName;const ov=oe.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(fe.RadioItem,{ref:n,className:te("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(M.Circle,{className:"richtext-h-2 richtext-w-2 richtext-fill-current"})})}),t]}));ov.displayName=fe.RadioItem.displayName;const av=oe.forwardRef(({className:e,inset:t,...r},n)=>c.jsx(fe.Label,{ref:n,className:te("richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-font-semibold",t&&"richtext-pl-8",e),...r}));av.displayName=fe.Label.displayName;const Va=oe.forwardRef(({className:e,...t},r)=>c.jsx(fe.Separator,{ref:r,className:te("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:te("richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60",e),...t})}wd.displayName="DropdownMenuShortcut";const Ie=oe.forwardRef(({className:e,type:t,...r},n)=>c.jsx("input",{type:t,className:te("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}));Ie.displayName="Input";const sv=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:te(sv(),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:te("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:te("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:te("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:te("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:te("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:te("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:te("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 cv=Oe.Provider,Ad=oe.forwardRef(({className:e,...t},r)=>c.jsx(Oe.Viewport,{ref:r,className:te("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=Oe.Viewport.displayName;const lv=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(Oe.Root,{ref:n,className:te(lv({variant:t}),e),...r}));Cd.displayName=Oe.Root.displayName;const uv=oe.forwardRef(({className:e,...t},r)=>c.jsx(Oe.Action,{ref:r,className:te("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}));uv.displayName=Oe.Action.displayName;const jd=oe.forwardRef(({className:e,...t},r)=>c.jsx(Oe.Close,{ref:r,className:te("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(M.X,{className:"richtext-h-4 richtext-w-4"})}));jd.displayName=Oe.Close.displayName;const Td=oe.forwardRef(({className:e,...t},r)=>c.jsx(Oe.Title,{ref:r,className:te("richtext-text-sm richtext-font-semibold",e),...t}));Td.displayName=Oe.Title.displayName;const Ed=oe.forwardRef(({className:e,...t},r)=>c.jsx(Oe.Description,{ref:r,className:te("richtext-text-sm richtext-opacity-90",e),...t}));Ed.displayName=Oe.Description.displayName;const dv=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:te(dv({variant:t,size:r,className:e})),...n}));Ya.displayName=iu.Root.displayName;const fv=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:te("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 hv=1,pv=1e6;let si=0;function mv(){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})},pv);ci.set(e,t)}function gv(e,t){switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,hv)};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=gv(Wr,e),Ur.forEach(t=>{t(Wr)})}function xv({...e}){const t=mv(),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:xv,dismiss:r=>ur({type:"DISMISS_TOAST",toastId:r})}}const Id=oe.forwardRef(({className:e,...t},r)=>c.jsx(Go.Root,{ref:r,className:te("!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:te("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),children:c.jsx(M.Check,{className:"!richtext-h-4 !richtext-w-4"})})}));Id.displayName=Go.Root.displayName;const vv={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:vv,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(Ie,{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(Ie,{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(Ie,{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 yv(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 bv(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 wv(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 Sv(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 Av(e,t){return t.src=e,t.validId=!0,t}function Cv(e,t){return t.src=e,t.validId=!0,t}function jv(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function Tv(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Ev(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function Iv(e){const t=Vt.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function Rv(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function Ov(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Pv(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function kv(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function Nv(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function Mv(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 Lv(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 Od(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const r=Lv(e);if(t=Mv(r,e,t),!t.validLink)return t;switch(r){case"youtube":return yv(t);case"youku":return bv(t);case"bilibili":return wv(t);case"qqvideo":return Sv(t);case"amap":return Av(e,t);case"baidu_map":return Cv(e,t);case"googlemaps":return jv(e,t);case"modao":return Tv(t);case"lanhu":return Ev(t);case"figma":return Iv(t);case"canva":return Rv(e,t);case"processon":return Ov(e,t);case"codepen":return Pv(t);case"jinshuju":return kv(e,t);case"iframe":return Nv(e,t);default:return e}}function Pd(){const[e]=hd(t=>t.value);return e}const $v={setDisable:(e,t)=>{Pn(vt.EDIT(e),t)}},_v="_wrap_5y04w_1",Dv="_innerWrap_5y04w_15",dc={wrap:_v,innerWrap:Dv};function Bv({editor:e,node:t,updateAttributes:r}){const n=Pd(),{src:i,width:o,height:a}=t.attrs,[s,l]=w.useState("");function u(){if(!s)return;const d=Od(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(me.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(Ie,{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:me.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:me.getDatasetAttribute("width")},height:{default:300,parseHTML:me.getDatasetAttribute("height")},src:{default:null,parseHTML:me.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 me.ReactNodeViewRenderer(Bv)}});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 zv(){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),v=m&&r.call(p)==="[object String]",S=[];if(!m&&!x&&!g)throw new TypeError("Object.keys called on a non-object");var j=a&&x;if(v&&p.length>0&&!t.call(p,0))for(var E=0;E<p.length;++E)S.push(String(E));if(g&&p.length>0)for(var C=0;C<p.length;++C)S.push(String(C));else for(var k in p)!(j&&k==="prototype")&&t.call(p,k)&&S.push(String(k));if(o)for(var L=d(p),N=0;N<s.length;++N)!(L&&s[N]==="constructor")&&t.call(p,s[N])&&S.push(s[N]);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)}:zv(),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 Le(){return xc||(xc=1,pi=TypeError),pi}var mi,vc;function Hv(){return vc||(vc=1,mi=Object.getOwnPropertyDescriptor),mi}var gi,yc;function Rt(){if(yc)return gi;yc=1;var e=Hv();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=Le(),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 Ot(){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 qv(){return jc||(jc=1,Ai=EvalError),Ai}var Ci,Tc;function Fv(){return Tc||(Tc=1,Ci=RangeError),Ci}var ji,Ec;function Uv(){return Ec||(Ec=1,ji=ReferenceError),ji}var Ti,Ic;function Wv(){return Ic||(Ic=1,Ti=URIError),Ti}var Ei,Rc;function Gv(){return Rc||(Rc=1,Ei=Math.abs),Ei}var Ii,Oc;function Vv(){return Oc||(Oc=1,Ii=Math.floor),Ii}var Ri,Pc;function Kv(){return Pc||(Pc=1,Ri=Math.max),Ri}var Oi,kc;function Xv(){return kc||(kc=1,Oi=Math.min),Oi}var Pi,Nc;function Yv(){return Nc||(Nc=1,Pi=Math.pow),Pi}var ki,Mc;function Jv(){return Mc||(Mc=1,ki=Math.round),ki}var Ni,Lc;function Zv(){return Lc||(Lc=1,Ni=Number.isNaN||function(t){return t!==t}),Ni}var Mi,$c;function Qv(){if($c)return Mi;$c=1;var e=Zv();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 ey(){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 v=u.apply(this,i(f,arguments));return Object(v)===v?v: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 Tr(){if(qc)return zi;qc=1;var e=ey();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 ty(){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=Tr(),t=as(),r=os(),n=ty();return Ui=n||e.call(r,t),Ui}var Wi,Vc;function ss(){if(Vc)return Wi;Vc=1;var e=Tr(),t=Le(),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 ry(){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=ry();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=Tr();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=qv(),i=Fv(),o=Uv(),a=es(),s=Le(),l=Wv(),u=Gv(),f=Vv(),d=Kv(),h=Xv(),p=Yv(),m=Jv(),x=Qv(),g=Function,v=function(ne){try{return g('"use strict"; return ('+ne+").constructor;")()}catch{}},S=Rt(),j=Mn(),E=function(){throw new s},C=S?function(){try{return arguments.callee,E}catch{try{return S(arguments,"callee").get}catch{return E}}}():E,k=is()(),L=Bd(),N=_d(),P=$d(),_=as(),T=os(),A={},O=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%":k&&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%":k&&L?L(L([][Symbol.iterator]())):e,"%JSON%":typeof JSON=="object"?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!k||!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"||!k||!L?e:L(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&L?L(""[Symbol.iterator]()):e,"%Symbol%":k?Symbol:e,"%SyntaxError%":a,"%ThrowTypeError%":C,"%TypedArray%":O,"%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%":T,"%Function.prototype.apply%":_,"%Object.defineProperty%":j,"%Object.getPrototypeOf%":N,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":d,"%Math.min%":h,"%Math.pow%":p,"%Math.round%":m,"%Math.sign%":x,"%Reflect.getPrototypeOf%":P};if(L)try{null.error}catch(ne){var U=L(L(ne));D["%Error.prototype%"]=U}var H=function ne(F){var G;if(F==="%AsyncFunction%")G=v("async function () {}");else if(F==="%GeneratorFunction%")G=v("function* () {}");else if(F==="%AsyncGeneratorFunction%")G=v("async function* () {}");else if(F==="%AsyncGenerator%"){var z=ne("%AsyncGeneratorFunction%");z&&(G=z.prototype)}else if(F==="%AsyncIteratorPrototype%"){var J=ne("%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"]},re=Tr(),ie=cs(),he=re.call(T,Array.prototype.concat),ge=re.call(_,Array.prototype.splice),Se=re.call(T,String.prototype.replace),$e=re.call(T,String.prototype.slice),I=re.call(T,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 Se(F,$,function(ve,ye,be,Ae){J[J.length]=be?Se(Ae,X,"$1"):ye||ve}),J},ee=function(F,G){var z=F,J;if(ie(K,z)&&(J=K[z],z="%"+J[0]+"%"),ie(D,z)){var ve=D[z];if(ve===A&&(ve=H(z)),typeof ve>"u"&&!G)throw new s("intrinsic "+F+" exists, but is not available. Please file an issue!");return{alias:J,name:z,value:ve}}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]:"",ve=ee("%"+J+"%",G),ye=ve.name,be=ve.value,Ae=!1,je=ve.alias;je&&(J=je[0],ge(z,he([0,1],je)));for(var Ke=1,_e=!0;Ke<z.length;Ke+=1){var Te=z[Ke],Xe=$e(Te,0,1),Ye=$e(Te,-1);if((Xe==='"'||Xe==="'"||Xe==="`"||Ye==='"'||Ye==="'"||Ye==="`")&&Xe!==Ye)throw new a("property names with quotes must have matching quotes");if((Te==="constructor"||!_e)&&(Ae=!0),J+="."+Te,ye="%"+J+"%",ie(D,ye))be=D[ye];else if(be!=null){if(!(Te 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,Te);_e=!!Je,_e&&"get"in Je&&!("originalValue"in Je.get)?be=Je.get:be=be[Te]}else _e=ie(be,Te),be=be[Te];_e&&!Ae&&(D[ye]=be)}}return be},Xi}var Yi,Zc;function ny(){if(Zc)return Yi;Zc=1;var e=at(),t=ts(),r=rs()(),n=Rt(),i=Le(),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 iy(){if(Qc)return Ji;Qc=1;var e=Tr(),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=ny(),r=Mn(),n=ss(),i=iy();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 Ce(){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=Ce(),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 v=x[g];o(h,v)&&i(p,v)}for(var S=0;S<p.length;++S){var j=p[S];if(o(h,j)){var E=h[j];f[j]=E}}}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 oy(){if(il)return to;il=1;var e=Ot(),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 ay(){if(ol)return ro;ol=1;var e=Ot(),t=Kt(),r=zd(),n=Hd(),i=oy(),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 sy(){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 cy(){if(cl)return oo;cl=1;var e=ts(),t=rs()(),r=sy().functionsHaveConfigurableNames(),n=Le();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=cy(),t=Le(),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=Ot().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 ly(){if(dl)return co;dl=1;var e=Ot().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 uy(){if(fl)return lo;fl=1;var e=Ot(),t=Kt(),r=Fd(),n=Ud(),i=ly(),o=t(n());return e(o,{getPolyfill:n,implementation:r,shim:i}),lo=o,lo}var tr={exports:{}},uo,hl;function Pt(){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=Pt()(),t=Ce(),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 dy={},fy=Object.freeze(Object.defineProperty({__proto__:null,default:dy},Symbol.toStringTag,{value:"Module"})),hy=Nd(fy);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,v=String.prototype.match,S=String.prototype.slice,j=String.prototype.replace,E=String.prototype.toUpperCase,C=String.prototype.toLowerCase,k=RegExp.prototype.test,L=Array.prototype.concat,N=Array.prototype.join,P=Array.prototype.slice,_=Math.floor,T=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,O=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(y){return y.__proto__}:null);function re(y,b){if(y===1/0||y===-1/0||y!==y||y&&y>-1e3&&y<1e3||k.call(/e/,b))return b;var ae=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof y=="number"){var se=y<0?-_(-y):_(y);if(se!==y){var ce=String(se),Q=S.call(b,ce.length+1);return j.call(ce,ae,"$&_")+"."+j.call(j.call(Q,/([0-9]{3})/g,"$&_"),/_$/,"")}}return j.call(b,ae,"$&_")}var ie=hy,he=ie.custom,ge=ve(he)?he:null,Se={__proto__:null,double:'"',single:"'"},$e={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};ho=function y(b,ae,se,ce){var Q=ae||{};if(Ae(Q,"quoteStyle")&&!Ae(Se,Q.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ae(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=Ae(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(Ae(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(Ae(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 Re=String(b);return bt?re(b,Re):Re}if(typeof b=="bigint"){var ut=String(b)+"n";return bt?re(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,Or,hf){if(Or&&(ce=P.call(ce),ce.push(Or)),hf){var vs={depth:Q.depth};return Ae(Q,"quoteStyle")&&(vs.quoteStyle=Q.quoteStyle),y(Mt,vs,se+1,ce)}return y(Mt,Q,se+1,ce)}if(typeof b=="function"&&!ne(b)){var ds=Ke(b),fs=Ir(b,De);return"[Function"+(ds?": "+ds:" (anonymous)")+"]"+(fs.length>0?" { "+N.call(fs,", ")+" }":"")}if(ve(b)){var hs=D?j.call(String(b),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(b);return typeof b=="object"&&!D?ct(hs):hs}if(st(b)){for(var Yt="<"+C.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+="</"+C.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)+"]":"[ "+N.call(Hn,", ")+" ]"}if(F(b)){var qn=Ir(b,De);return!("cause"in Error.prototype)&&"cause"in b&&!H.call(b,"cause")?"{ ["+String(b)+"] "+N.call(L.call("[cause]: "+De(b.cause),qn),", ")+" }":qn.length===0?"["+String(b)+"]":"{ ["+String(b)+"] "+N.call(qn,", ")+" }"}if(typeof b=="object"&&lt){if(ge&&typeof b[ge]=="function"&&ie)return ie(b,{depth:Bn-se});if(lt!=="symbol"&&typeof b.inspect=="function")return b.inspect()}if(Te(b)){var ps=[];return n&&n.call(b,function(Mt,Or){ps.push(De(Or,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(Er(b))return _n("WeakSet");if(Ye(b))return _n("WeakRef");if(z(b))return ct(De(Number(b)));if(ye(b))return ct(De(T.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)&&!ne(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(je(b),8,-1):Un?"Object":"",ff=gs||typeof b.constructor!="function"?"":b.constructor.name?b.constructor.name+" ":"",Wn=ff+(xs||Un?"["+N.call(L.call([],xs||[],Un||[]),": ")+"] ":"");return Fn.length===0?Wn+"{}":Nt?Wn+"{"+Dn(Fn,Nt)+"}":Wn+"{ "+N.call(Fn,", ")+" }"}return String(b)};function I(y,b,ae){var se=ae.quoteStyle||b,ce=Se[se];return ce+y+ce}function $(y){return j.call(String(y),/"/g,"&quot;")}function X(y){return!U||!(typeof y=="object"&&(U in y||typeof y[U]<"u"))}function V(y){return je(y)==="[object Array]"&&X(y)}function ee(y){return je(y)==="[object Date]"&&X(y)}function ne(y){return je(y)==="[object RegExp]"&&X(y)}function F(y){return je(y)==="[object Error]"&&X(y)}function G(y){return je(y)==="[object String]"&&X(y)}function z(y){return je(y)==="[object Number]"&&X(y)}function J(y){return je(y)==="[object Boolean]"&&X(y)}function ve(y){if(D)return y&&typeof y=="object"&&y instanceof Symbol;if(typeof y=="symbol")return!0;if(!y||typeof y!="object"||!O)return!1;try{return O.call(y),!0}catch{}return!1}function ye(y){if(!y||typeof y!="object"||!T)return!1;try{return T.call(y),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function(y){return y in this};function Ae(y,b){return be.call(y,b)}function je(y){return x.call(y)}function Ke(y){if(y.name)return y.name;var b=v.call(g.call(y),/^function\s*([\w$]+)/);return b?b[1]:null}function _e(y,b){if(y.indexOf)return y.indexOf(b);for(var ae=0,se=y.length;ae<se;ae++)if(y[ae]===b)return ae;return-1}function Te(y){if(!r||!y||typeof y!="object")return!1;try{r.call(y);try{a.call(y)}catch{return!0}return y instanceof Map}catch{}return!1}function Xe(y){if(!u||!y||typeof y!="object")return!1;try{u.call(y,u);try{d.call(y,d)}catch{return!0}return y instanceof WeakMap}catch{}return!1}function Ye(y){if(!p||!y||typeof y!="object")return!1;try{return p.call(y),!0}catch{}return!1}function Je(y){if(!a||!y||typeof y!="object")return!1;try{a.call(y);try{r.call(y)}catch{return!0}return y instanceof Set}catch{}return!1}function Er(y){if(!d||!y||typeof y!="object")return!1;try{d.call(y,d);try{u.call(y,u)}catch{return!0}return y instanceof WeakSet}catch{}return!1}function st(y){return!y||typeof y!="object"?!1:typeof HTMLElement<"u"&&y instanceof HTMLElement?!0:typeof y.nodeName=="string"&&typeof y.getAttribute=="function"}function kt(y,b){if(y.length>b.maxStringLength){var ae=y.length-b.maxStringLength,se="... "+ae+" more character"+(ae>1?"s":"");return kt(S.call(y,0,b.maxStringLength),b)+se}var ce=$e[b.quoteStyle||"single"];ce.lastIndex=0;var Q=j.call(j.call(y,ce,"\\$1"),/[\x00-\x1f]/g,Xt);return I(Q,"single",b)}function Xt(y){var b=y.charCodeAt(0),ae={8:"b",9:"t",10:"n",12:"f",13:"r"}[b];return ae?"\\"+ae:"\\x"+(b<16?"0":"")+E.call(b.toString(16))}function ct(y){return"Object("+y+")"}function _n(y){return y+" { ? }"}function us(y,b,ae,se){var ce=se?Dn(ae,se):N.call(ae,", ");return y+" ("+b+") {"+ce+"}"}function uf(y){for(var b=0;b<y.length;b++)if(_e(y[b],`
6
- `)>=0)return!1;return!0}function df(y,b){var ae;if(y.indent===" ")ae=" ";else if(typeof y.indent=="number"&&y.indent>0)ae=N.call(Array(y.indent+1)," ");else return null;return{base:ae,prev:N.call(Array(b+1),ae)}}function Dn(y,b){if(y.length===0)return"";var ae=`
7
- `+b.prev+b.base;return ae+N.call(y,","+ae)+`
8
- `+b.prev}function Ir(y,b){var ae=V(y),se=[];if(ae){se.length=y.length;for(var ce=0;ce<y.length;ce++)se[ce]=Ae(y,ce)?b(y[ce],y):""}var Q=typeof A=="function"?A(y):[],lt;if(D){lt={};for(var bt=0;bt<Q.length;bt++)lt["$"+Q[bt]]=Q[bt]}for(var Re in y)Ae(y,Re)&&(ae&&String(Number(Re))===Re&&Re<y.length||D&&lt["$"+Re]instanceof Symbol||(k.call(/[^\w$]/,Re)?se.push(b(Re,y)+": "+b(y[Re],y)):se.push(Re+": "+b(y[Re],y))));if(typeof A=="function")for(var ut=0;ut<Q.length;ut++)H.call(y,Q[ut])&&se.push("["+b(Q[ut])+"]: "+b(y[Q[ut]],y));return se}return ho}var po,gl;function py(){if(gl)return po;gl=1;var e=$n(),t=Le(),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=Ce(),r=$n(),n=Le(),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 my(){if(vl)return go;vl=1;var e=at(),t=Ce(),r=$n(),n=Gd(),i=Le(),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=Le(),t=$n(),r=py(),n=Gd(),i=my(),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 gy(){if(bl)return vo;bl=1;var e=cs(),t=Vd()(),r=Le(),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 xy(){if(wl)return yo;wl=1;var e=gy(),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=Ce(),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=Pt()();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 Tl;function vy(){if(Tl)return tr.exports;Tl=1;var e=Wd(),t=xy();if(is()()||Ln()()){var r=Symbol.iterator;tr.exports=function(P){if(P!=null&&typeof P[r]<"u")return P[r]();if(e(P))return Array.prototype[r].call(P)}}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(P,_){var T=P.length;if(_+1>=T)return _+1;var A=f(P,_);if(A<55296||A>56319)return _+1;var O=f(P,_+1);return O<56320||O>57343?_+1:_+2},p=function(P){var _=0;return{next:function(){var A=_>=P.length,O;return A||(O=P[_],_+=1),{done:A,value:O}}}},m=function(P,_){if(n(P)||e(P))return p(P);if(i(P)){var T=0;return{next:function(){var O=h(P,T),D=d(P,T,O);return T=O,{done:O>P.length,value:D}}}}if(_&&typeof P["_es6-shim iterator_"]<"u")return P["_es6-shim iterator_"]()};if(!a&&!s)tr.exports=function(P){if(P!=null)return m(P,!0)};else{var x=Yd(),g=Jd(),v=l("Map.prototype.forEach",!0),S=l("Set.prototype.forEach",!0);if(typeof process>"u"||!process.versions||!process.versions.node)var j=l("Map.prototype.iterator",!0),E=l("Set.prototype.iterator",!0);var C=l("Map.prototype.@@iterator",!0)||l("Map.prototype._es6-shim iterator_",!0),k=l("Set.prototype.@@iterator",!0)||l("Set.prototype._es6-shim iterator_",!0),L=function(P){if(x(P)){if(j)return t(j(P));if(C)return C(P);if(v){var _=[];return v(P,function(A,O){u(_,[O,A])}),p(_)}}if(g(P)){if(E)return t(E(P));if(k)return k(P);if(S){var T=[];return S(P,function(A){u(T,A)}),p(T)}}};tr.exports=function(P){return L(P)||m(P)}}}return tr.exports}var Co,El;function Zd(){if(El)return Co;El=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 To,Rl;function yy(){if(Rl)return To;Rl=1;var e=Qd(),t=Ot();return To=function(){var n=e();return t(Object,{is:n},{is:function(){return Object.is!==n}}),n},To}var Eo,Ol;function by(){if(Ol)return Eo;Ol=1;var e=Ot(),t=Kt(),r=Zd(),n=Qd(),i=yy(),o=t(n(),Object);return e(o,{getPolyfill:n,implementation:r,shim:i}),Eo=o,Eo}var Io,Pl;function ef(){if(Pl)return Io;Pl=1;var e=Kt(),t=Ce(),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 wy(){if(kl)return Ro;kl=1;var e=Ce(),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=Pt()();return Ro=function(s){return typeof s!="object"||s===null?!1:o?r(s):n(s)===i},Ro}var Oo,Nl;function tf(){if(Nl)return Oo;Nl=1;var e=Ce(),t=Pt()(),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 Oo=i,Oo}var Po,Ml;function Sy(){if(Ml)return Po;Ml=1;var e=Ce(),t=e("SharedArrayBuffer.prototype.byteLength",!0);return Po=t?function(n){if(!n||typeof n!="object")return!1;try{return t(n),!0}catch{return!1}}:function(n){return!1},Po}var ko,Ll;function Ay(){if(Ll)return ko;Ll=1;var e=Ce(),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=Pt()();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 Cy(){if($l)return No;$l=1;var e=Ce(),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=Pt()();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 jy(){if(_l)return Mo;_l=1;var e=Ce(),t=tf(),r=e("RegExp.prototype.exec"),n=Le();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 Ty(){if(Dl)return zr.exports;Dl=1;var e=Ce(),t=e("Object.prototype.toString"),r=is()(),n=jy();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 Ey(){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 Iy(){if(zl)return Hr.exports;zl=1;var e=Ey()();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 Ry(){if(Hl)return $o;Hl=1;var e=Xd(),t=Ay(),r=Cy(),n=Ty(),i=Iy();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 Oy(){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 Py(){if(Fl)return qr.exports;Fl=1;var e=at(),t=Ce(),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 ky(){if(Ul)return Do;Ul=1;var e=Yd(),t=Jd(),r=Oy(),n=Py();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 Ny(){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(j){try{var E=e.call(j);return i.test(E)}catch{return!1}},a=function(j){try{return o(j)?!1:(e.call(j),!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 v=document.all;s.call(v)===s.call(document.all)&&(g=function(j){if((x||!j)&&(typeof j>"u"||typeof j=="object"))try{var E=s.call(j);return(E===d||E===h||E===p||E===l)&&j("")==null}catch{}return!1})}return Bo=t?function(j){if(g(j))return!0;if(!j||typeof j!="function"&&typeof j!="object")return!1;try{t(j,null,r)}catch(E){if(E!==n)return!1}return!o(j)&&a(j)}:function(j){if(g(j))return!0;if(!j||typeof j!="function"&&typeof j!="object")return!1;if(m)return a(j);if(o(j))return!1;var E=s.call(j);return E!==u&&E!==f&&!/^\[object HTML/.test(E)?!1:a(j)},Bo}var zo,Gl;function My(){if(Gl)return zo;Gl=1;var e=Ny(),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 Ly(){return Vl||(Vl=1,Ho=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ho}var qo,Kl;function $y(){if(Kl)return qo;Kl=1;var e=Ly(),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 _y(){if(Xl)return Fo;Xl=1;var e=My(),t=$y(),r=Kt(),n=Ce(),i=Rt(),o=n("Object.prototype.toString"),a=Pt()(),s=typeof globalThis>"u"?wr:globalThis,l=t(),u=n("String.prototype.slice"),f=Object.getPrototypeOf,d=n("Array.prototype.indexOf",!0)||function(g,v){for(var S=0;S<g.length;S+=1)if(g[S]===v)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 v=f(g),S=i(v,Symbol.toStringTag);if(!S){var j=f(v);S=i(j,Symbol.toStringTag)}h["$"+x]=r(S.get)}}):e(l,function(x){var g=new s[x],v=g.slice||g.set;v&&(h["$"+x]=r(v))});var p=function(g){var v=!1;return e(h,function(S,j){if(!v)try{"$"+S(g)===j&&(v=u(j,1))}catch{}}),v},m=function(g){var v=!1;return e(h,function(S,j){if(!v)try{S(g),v=u(j,1)}catch{}}),v};return Fo=function(g){if(!g||typeof g!="object")return!1;if(!a){var v=u(o(g),8,-1);return d(l,v)>-1?v:v!=="Object"?!1:m(g)}return i?p(g):null},Fo}var Uo,Yl;function Dy(){if(Yl)return Uo;Yl=1;var e=Ce(),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 By(){if(Jl)return Wo;Jl=1;var e=ay(),t=qd(),r=uy(),n=at(),i=vy(),o=Vd(),a=by(),s=Wd(),l=Kd(),u=ef(),f=wy(),d=tf(),h=Sy(),p=Qa(),m=Ry(),x=ky(),g=_y(),v=Dy(),S=t("SharedArrayBuffer.prototype.byteLength",!0),j=t("Date.prototype.getTime"),E=Object.getPrototypeOf,C=t("Object.prototype.toString"),k=n("%Set%",!0),L=t("Map.prototype.has",!0),N=t("Map.prototype.get",!0),P=t("Map.prototype.size",!0),_=t("Set.prototype.add",!0),T=t("Set.prototype.delete",!0),A=t("Set.prototype.has",!0),O=t("Set.prototype.size",!0);function D(I,$,X,V){for(var ee=i(I),ne;(ne=ee.next())&&!ne.done;)if(ie($,ne.value,X,V))return T(I,ne.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,ne){var F=U(X);if(F!=null)return F;var G=N($,F),z=e({},ee,{strict:!1});return typeof G>"u"&&!L($,F)||!ie(V,G,z,ne)?!1:!L(I,F)&&ie(V,G,z,ne)}function K(I,$,X){var V=U(X);return V??(A($,V)&&!A(I,V))}function re(I,$,X,V,ee,ne){for(var F=i(I),G,z;(G=F.next())&&!G.done;)if(z=G.value,ie(X,z,ee,ne)&&ie(V,N($,z),ee,ne))return T(I,z),!0;return!1}function ie(I,$,X,V){var ee=X||{};if(ee.strict?a(I,$):I===$)return!0;var ne=m(I),F=m($);if(ne!==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 he(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(O(I)!==O($))return!1;for(var ee=i(I),ne=i($),F,G,z;(F=ee.next())&&!F.done;)if(F.value&&typeof F.value=="object")z||(z=new k),_(z,F.value);else if(!A($,F.value)){if(X.strict||!K(I,$,F.value))return!1;z||(z=new k),_(z,F.value)}if(z){for(;(G=ne.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 O(z)===0}return!0}function Se(I,$,X,V){if(P(I)!==P($))return!1;for(var ee=i(I),ne=i($),F,G,z,J,ve,ye;(F=ee.next())&&!F.done;)if(J=F.value[0],ve=F.value[1],J&&typeof J=="object")z||(z=new k),_(z,J);else if(ye=N($,J),typeof ye>"u"&&!L($,J)||!ie(ve,ye,X,V)){if(X.strict||!H(I,$,J,ve,X,V))return!1;z||(z=new k),_(z,J)}if(z){for(;(G=ne.next())&&!G.done;)if(J=G.value[0],ye=G.value[1],J&&typeof J=="object"){if(!re(z,I,J,ye,X,V))return!1}else if(!X.strict&&(!I.has(J)||!ie(N(I,J),ye,X,V))&&!re(z,I,J,ye,e({},X,{strict:!1}),V))return!1;return O(z)===0}return!0}function $e(I,$,X,V){var ee,ne;if(typeof I!=typeof $||I==null||$==null||C(I)!==C($)||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 ve=d(I),ye=d($);if(ve!==ye||(ve||ye)&&(I.source!==$.source||r(I)!==r($)))return!1;var be=f(I),Ae=f($);if(be!==Ae||(be||Ae)&&j(I)!==j($)||X.strict&&E&&E(I)!==E($))return!1;var je=g(I),Ke=g($);if(je!==Ke)return!1;if(je||Ke){if(I.length!==$.length)return!1;for(ee=0;ee<I.length;ee++)if(I[ee]!==$[ee])return!1;return!0}var _e=he(I),Te=he($);if(_e!==Te)return!1;if(_e||Te){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 v(I)!==v($)?!1:typeof Uint8Array=="function"&&ie(new Uint8Array(I),new Uint8Array($),X,V);var Je=h(I),Er=h($);if(Je!==Er)return!1;if(Je||Er)return S(I)!==S($)?!1:typeof Uint8Array=="function"&&ie(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(ne=st[ee],!ie(I[ne],$[ne],X,V))return!1;var Xt=x(I),ct=x($);return Xt!==ct?!1:Xt==="Set"||ct==="Set"?ge(I,$,X,V):Xt==="Map"?Se(I,$,X,V):!0}return Wo=function($,X,V){return ie($,X,V,o())},Wo}var zy=By();const rf=kd(zy);function Hy(e){return e}function nf(e,t,r,n){const i=Hy,[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 qy({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=Od(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(me.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(Ie,{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 Fy({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,x;return[n.includes("columns")&&!((o=r==null?void 0:r.columnConfig)!=null&&o.hidden)?c.jsx(iv,{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,hiddenActions:(l=r==null?void 0:r.tableConfig)==null?void 0:l.hiddenActions},"table"):null,n.includes("link")&&!((u=r==null?void 0:r.linkConfig)!=null&&u.hidden)?c.jsx(c1,{disabled:t,editor:e},"link"):null,n.includes(Ht.name)&&!((f=r==null?void 0:r.imageConfig)!=null&&f.hidden)?c.jsx(J1,{disabled:t,editor:e},"image"):null,n.includes(za.name)&&!((d=r==null?void 0:r.imageGifConfig)!=null&&d.hidden)?c.jsx(Z1,{disabled:t,editor:e},"imageGif"):null,n.includes("video")&&!((h=r==null?void 0:r.videoConfig)!=null&&h.hidden)?c.jsx(Q1,{disabled:t,editor:e},"video"):null,n.includes("iframe")&&!((p=r==null?void 0:r.iframeConfig)!=null&&p.hidden)?c.jsx(qy,{disabled:t,editor:e},"iframe"):null,(m=r==null?void 0:r.floatingMenuConfig)!=null&&m.hidden?null:c.jsx(l0,{disabled:t,editor:e},"content"),(x=r==null?void 0:r.textConfig)!=null&&x.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(Uy,{setColor:h})]})})]})}function Uy({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(Ef.HexColorPicker,{color:t,onChange:r}),c.jsx(Ie,{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(M.Plus,{size:16})})]})]})}function Wy({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||!U1(h)||!x)continue;const g=h({editor:e,extension:d,t:n});if(Array.isArray(g)){const v=g.map((S,j)=>({button:S,divider:j===g.length-1?p:!1,spacer:j===0?m:!1,type:d.type,name:d.name}));f=[...f,...v];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 Gy({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 Vy(){const{toasts:e}=Nn();return c.jsxs(cv,{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(Td,{children:r}),n&&c.jsx(Ed,{children:n})]}),i,c.jsx(jd,{})]},t)),c.jsx(Ad,{})]})}const Ky=`
9
- .reactjs-tiptap-editor,
10
- .richtext-dialog-content {
11
- color: hsl(var(--richtext-foreground));
12
-
13
- button,
14
- input:where([type=button]),
15
- input:where([type=reset]),
16
- input:where([type=submit]) {
17
- -webkit-appearance: button;
18
- background-color: transparent;
19
- background-image: none;
20
- }
21
-
22
- input,
23
- optgroup,
24
- select {
25
- font-family: inherit;
26
- font-feature-settings: inherit;
27
- font-variation-settings: inherit;
28
- font-size: 100%;
29
- font-weight: inherit;
30
- line-height: inherit;
31
- letter-spacing: inherit;
32
- color: inherit;
33
- }
34
-
35
- button {
36
- font-family: inherit;
37
- font-feature-settings: inherit;
38
- font-variation-settings: inherit;
39
- font-size: 100%;
40
- font-weight: inherit;
41
- line-height: inherit;
42
- letter-spacing: inherit;
43
- color: inherit;
44
- }
45
-
46
- *,
47
- ::before,
48
- ::after {
49
- box-sizing: border-box;
50
- border-width: 0;
51
- border-style: solid;
52
- border-color: hsl(var(--richtext-border));
53
- }
54
-
55
-
56
- hr {
57
- height: 0;
58
- color: inherit;
59
- border-top-width: 1px;
60
- }
61
-
62
- a {
63
- color: inherit;
64
- text-decoration: inherit;
65
- }
66
-
67
- b,
68
- strong {
69
- font-weight: bolder;
70
- }
71
-
72
- code,
73
- kbd,
74
- samp,
75
- pre {
76
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
77
- font-feature-settings: normal;
78
- font-variation-settings: normal;
79
- font-size: 1em;
80
- }
81
-
82
- table {
83
- text-indent: 0;
84
- border-color: inherit;
85
- border-collapse: collapse;
86
- }
87
-
88
- input {
89
- border-width: 1px;
90
- }
91
-
92
-
93
- input::placeholder {
94
- opacity: 1;
95
- color: #9ca3af;
96
- }
97
-
98
- button, input {
99
- cursor: pointer;
100
- color: inherit;
101
- }
102
-
103
- img,
104
- svg,
105
- video,
106
- canvas,
107
- audio,
108
- iframe,
109
- embed,
110
- object {
111
- display: block;
112
- vertical-align: middle;
113
- }
114
-
115
- img,
116
- video {
117
- max-width: 100%;
118
- height: auto;
119
- }
120
- }
121
-
122
- div[data-radix-popper-content-wrapper],
123
- div[data-tippy-root] {
124
- color: hsl(var(--richtext-foreground));
125
-
126
- *,
127
- ::before,
128
- ::after {
129
- box-sizing: border-box;
130
- border-width: 0;
131
- border-style: solid;
132
- border-color: hsl(var(--richtext-border));
133
- }
134
-
135
- button, input {
136
- cursor: pointer;
137
- color: inherit;
138
- }
139
- }
140
- `,Xy=w.memo(({children:e,id:t})=>{const[,r]=hd(a=>a.value),[,n]=pd(a=>a.value),i=a=>{r({value:a.detail})},o=a=>{n({value:a.detail})};return w.useEffect(()=>{const a=xr(vt.EDIT(t),i),s=xr(vt.UPDATE_THEME(t),o);return()=>{a(),s()}},[]),c.jsx(c.Fragment,{children:e})});function Yy({children:e,id:t}){return c.jsx(b1,{children:c.jsx(w1,{children:c.jsx(Xy,{id:t,children:e})})})}function Jy(){const[e]=pd(t=>t.value);return e}const Zy={setTheme:(e,t)=>{Pn(vt.UPDATE_THEME(e),t)}},Ql="data-rc-order",eu="data-rc-priority",Qy="rc-util-key",ga=new Map;function eb(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let r=t;for(;r;){if(r===e)return!0;r=r.parentNode}return!1}function af({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Qy}function ls(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function tb(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function sf(e){return[...(ga.get(e)||e).children].filter(t=>t.tagName==="STYLE")}function cf(e,t={}){const{csp:r,prepend:n,priority:i=0}=t,o=tb(n),a=o==="prependQueue",s=document.createElement("style");s.setAttribute(Ql,o),a&&i&&s.setAttribute(eu,`${i}`),r!=null&&r.nonce&&(s.nonce=r==null?void 0:r.nonce),s.innerHTML=e;const l=ls(t),{firstChild:u}=l;if(n){if(a){const f=sf(l).filter(d=>{if(!["prepend","prependQueue"].includes(d.getAttribute(Ql)))return!1;const h=Number(d.getAttribute(eu)||0);return i>=h});if(f.length>0)return l.insertBefore(s,f.at(-1).nextSibling),s}u.before(s)}else l.append(s);return s}function lf(e,t={}){const r=ls(t);return sf(r).find(n=>n.getAttribute(af(t))===e)}function rb(e,t={}){const r=lf(e,t);r&&r.remove()}function nb(e,t){const r=ga.get(e);if(!r||!eb(document,r)){const n=cf("",t),{parentNode:i}=n;ga.set(e,i),n.remove()}}function ib(e,t,r={}){var a,s,l;const n=ls(r);nb(n,r);const i=lf(t,r);if(i)return(a=r.csp)!=null&&a.nonce&&i.nonce!==((s=r.csp)==null?void 0:s.nonce)&&(i.nonce=(l=r.csp)==null?void 0:l.nonce),i.innerHTML!==e&&(i.innerHTML=e),i;const o=cf(e,r);return o.setAttribute(af(r),t),o}function ob(e,t){const{content:r,extensions:n,useEditorOptions:i={}}=e,o=w.useId(),a=w.useMemo(()=>{const d=zg(n,n,"name");return[...n.map(p=>{const m=n.find(x=>x.name===p.name);return m?p.configure(m.options):p}),...d].map((p,m)=>p.configure({sort:m}))},[n]),s=Bt(d=>{var p;const h=u(d,e.output);(p=e==null?void 0:e.onChangeContent)==null||p.call(e,h)},q.EDITOR_UPDATE_WATCH_THROTTLE_WAIT_TIME),l=me.useEditor({extensions:a,content:r,immediatelyRender:(e==null?void 0:e.immediatelyRender)||!1,onUpdate:({editor:d})=>{s&&s(d)},...i});w.useImperativeHandle(t,()=>({editor:l})),w.useEffect(()=>{document.documentElement.classList.toggle("dark",e.dark),Zy.setTheme(o,e.dark?"dark":"light")},[e.dark]),w.useEffect(()=>{l==null||l.setEditable(!(e!=null&&e.disabled)),$v.setDisable(o,!(e!=null&&e.disabled))},[l,e==null?void 0:e.disabled]),w.useEffect(()=>((e==null?void 0:e.resetCSS)!==!1&&ib(Ky,"react-tiptap-reset"),()=>{rb("react-tiptap-reset")}),[e==null?void 0:e.resetCSS]);function u(d,h){return e!=null&&e.removeDefaultWrapper?h==="html"?d.isEmpty?"":d.getHTML():h==="json"?d.isEmpty?{}:d.getJSON():h==="text"?d.isEmpty?"":d.getText():"":h==="html"?d.getHTML():h==="json"?d.getJSON():h==="text"?d.getText():""}w.useLayoutEffect(()=>{l&&(l.id=o)},[o,l]),w.useEffect(()=>()=>{var d;(d=l==null?void 0:l.destroy)==null||d.call(l)},[]);const f=gd(l,"characterCount");return l?c.jsxs("div",{className:"reactjs-tiptap-editor",children:[c.jsx(Yy,{id:o,children:c.jsx(fv,{delayDuration:0,disableHoverableContent:!0,children:c.jsx("div",{className:"richtext-overflow-hidden richtext-rounded-[0.5rem] richtext-bg-background richtext-shadow richtext-outline richtext-outline-1",children:c.jsxs("div",{className:"richtext-flex richtext-max-h-full richtext-w-full richtext-flex-col",children:[!(e!=null&&e.hideToolbar)&&c.jsx(Wy,{disabled:!!(e!=null&&e.disabled),editor:l,toolbar:e.toolbar}),c.jsx(me.EditorContent,{className:`richtext-relative ${(e==null?void 0:e.contentClass)||""}`,editor:l}),f&&c.jsx(Gy,{editor:l,extensions:n}),!(e!=null&&e.hideBubble)&&c.jsx(Fy,{bubbleMenu:e==null?void 0:e.bubbleMenu,disabled:e==null?void 0:e.disabled,editor:l})]})})})}),c.jsx(Vy,{})]}):c.jsx(c.Fragment,{})}const ab=w.forwardRef(ob);exports.ActionButton=W;exports.Button=we;exports.ColorPicker=of;exports.Column=Ua;exports.ColumnActionButton=nv;exports.Dialog=Cr;exports.DialogContent=Ft;exports.DialogFooter=In;exports.DialogTitle=Ut;exports.DialogTrigger=jr;exports.DropdownMenu=vd;exports.DropdownMenuCheckboxItem=bd;exports.DropdownMenuContent=Ga;exports.DropdownMenuSeparator=Va;exports.DropdownMenuShortcut=wd;exports.DropdownMenuTrigger=yd;exports.EVENTS=vt;exports.EXTENSION_PRIORITY_HIGHEST=xd;exports.ExportPdf=Xu;exports.ExportWord=Yu;exports.HighlightActionButton=Ju;exports.IconComponent=xe;exports.Iframe=St;exports.Image=Ba;exports.Image$1=Ht;exports.ImageGif=za;exports.IndentProps=Xr;exports.Input=Ie;exports.Label=Ue;exports.Link=sd;exports.MenuDown=Ku;exports.MultiColumn=vr;exports.Popover=Wt;exports.PopoverContent=It;exports.PopoverTrigger=Gt;exports.RichTextEditor=ab;exports.Separator=Be;exports.SizeSetter=Rd;exports.Switch=Ka;exports.Toggle=Ya;exports.Tooltip=Ja;exports.TooltipContent=kn;exports.TooltipTrigger=Za;exports.Video=Ha;exports.actionDialogImage=md;exports.clamp=H1;exports.cn=te;exports.commonjsGlobal=wr;exports.createIndentCommand=c0;exports.dataURLtoFile=dd;exports.debounce=Ar;exports.deepEqual=rf;exports.deleteNode=Wa;exports.dispatchEvent=Pn;exports.ensureNameValueOptions=G1;exports.extractFileExtension=p1;exports.extractFilename=h1;exports.getAugmentedNamespace=Nd;exports.getBubbleDrawer=Qx;exports.getBubbleMermaid=Zx;exports.getDefaultExportFromCjs=kd;exports.getShortcutKey=Uu;exports.getShortcutKeys=Wu;exports.hasExtension=gd;exports.icons=Ia;exports.listenEvent=xr;exports.normalizeFileSize=m1;exports.normalizeFileType=g1;exports.throttle=Bt;exports.useAttributes=nf;exports.useEditableEditor=Pd;exports.useTheme=Jy;exports.useToast=Nn;