reactjs-tiptap-editor 1.0.25 → 1.0.28

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 (296) hide show
  1. package/lib/{ActionMenuButton-8cTG45Ft.js → ActionMenuButton-BhiGvRJ7.js} +1 -1
  2. package/lib/{ActionMenuButton-CXeFhner.cjs → ActionMenuButton-qUxkZlQg.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +14 -14
  5. package/lib/Blockquote.cjs +5 -5
  6. package/lib/Blockquote.js +1497 -53
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +3 -3
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/{Callout-ZlPQrMEt.js → Callout-B9uXfbP3.js} +20 -20
  12. package/lib/{Callout-DWOMZPiP.cjs → Callout-C_TXsss3.cjs} +1 -1
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +4 -4
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +2 -2
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +56 -39
  19. package/lib/CodeBlock.cjs +1 -1
  20. package/lib/CodeBlock.js +8 -4
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +2 -2
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +3 -3
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +2 -2
  27. package/lib/{Drawer-TJY4NuHx.cjs → Drawer-D3B4lQJF.cjs} +1 -1
  28. package/lib/{Drawer-C-EO1uoK.js → Drawer-h401Yy6Y.js} +4 -4
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +4 -4
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +1797 -268
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +10 -10
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +2 -2
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +2 -2
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +5 -5
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +5 -5
  43. package/lib/FormatPainter.cjs +1 -0
  44. package/lib/FormatPainter.js +133 -0
  45. package/lib/Heading.cjs +1 -1
  46. package/lib/Heading.js +15 -11
  47. package/lib/Highlight.cjs +1 -1
  48. package/lib/Highlight.js +3 -3
  49. package/lib/History.cjs +7 -1
  50. package/lib/History.js +663 -569
  51. package/lib/HorizontalRule.cjs +1 -1
  52. package/lib/HorizontalRule.js +2 -2
  53. package/lib/{Iframe-CGb6-2LD.js → Iframe-Dhn40BXx.js} +7 -7
  54. package/lib/{Iframe-5zx43DL4.cjs → Iframe-bvGuzYwC.cjs} +1 -1
  55. package/lib/Iframe.cjs +1 -1
  56. package/lib/Iframe.js +3 -3
  57. package/lib/Image.cjs +1 -1
  58. package/lib/Image.js +9 -6
  59. package/lib/ImageGif.cjs +1 -1
  60. package/lib/ImageGif.js +33 -33
  61. package/lib/ImportWord.cjs +1 -1
  62. package/lib/ImportWord.js +5 -5
  63. package/lib/{Indent-CdMYsDNS.js → Indent-BK9DvCL7.js} +2 -2
  64. package/lib/{Indent-DuwV8s1t.cjs → Indent-IOByomps.cjs} +1 -1
  65. package/lib/Indent.cjs +1 -1
  66. package/lib/Indent.js +2 -2
  67. package/lib/Italic.cjs +1 -1
  68. package/lib/Italic.js +2 -2
  69. package/lib/{Katex-CCP_ZQz2.js → Katex-C_Ah9G9w.js} +5 -5
  70. package/lib/{Katex-D9FP7EUE.cjs → Katex-oLGrtLTf.cjs} +1 -1
  71. package/lib/Katex.cjs +1 -1
  72. package/lib/Katex.js +3 -3
  73. package/lib/LineHeight.cjs +1 -1
  74. package/lib/LineHeight.js +4 -4
  75. package/lib/Link.cjs +1 -1
  76. package/lib/Link.js +2 -2
  77. package/lib/{LinkEditBlock-DQ8-iufJ.cjs → LinkEditBlock-BojxdGTm.cjs} +2 -2
  78. package/lib/{LinkEditBlock-B1m-TVMu.js → LinkEditBlock-DRdKXffy.js} +88 -57
  79. package/lib/MarkdownPaste.cjs +1 -1
  80. package/lib/MarkdownPaste.js +1 -1
  81. package/lib/Mention.cjs +1 -1
  82. package/lib/Mention.js +9 -5
  83. package/lib/Mermaid.cjs +1 -1
  84. package/lib/Mermaid.js +14 -14
  85. package/lib/MoreMark.cjs +1 -1
  86. package/lib/MoreMark.js +3 -3
  87. package/lib/OrderedList.cjs +1 -1
  88. package/lib/OrderedList.js +2 -2
  89. package/lib/SearchAndReplace.cjs +1 -1
  90. package/lib/SearchAndReplace.js +10 -10
  91. package/lib/SlashCommand.cjs +1 -1
  92. package/lib/SlashCommand.js +7 -7
  93. package/lib/{SlashCommandNodeView-DNixmQGa.cjs → SlashCommandNodeView-Dai-O3aD.cjs} +1 -1
  94. package/lib/{SlashCommandNodeView-Dt6n1SP9.js → SlashCommandNodeView-qwW9cuYt.js} +10 -10
  95. package/lib/Strike.cjs +1 -1
  96. package/lib/Strike.js +2 -2
  97. package/lib/{Table-DdEgaUwa.js → Table-BKM8SvVj.js} +115 -97
  98. package/lib/{Table-C5JxBXef.cjs → Table-CWI7tKme.cjs} +5 -5
  99. package/lib/Table.cjs +1 -1
  100. package/lib/Table.js +1 -1
  101. package/lib/TaskList.cjs +1 -1
  102. package/lib/TaskList.js +2 -2
  103. package/lib/TextAlign.cjs +1 -1
  104. package/lib/TextAlign.js +11 -11
  105. package/lib/TextDirection.cjs +1 -1
  106. package/lib/TextDirection.js +3 -3
  107. package/lib/TextUnderline.cjs +1 -1
  108. package/lib/TextUnderline.js +2 -2
  109. package/lib/Twitter-BfsPzA8_.cjs +1 -0
  110. package/lib/{Twitter-Dnz9qyW0.js → Twitter-CofLQ-zj.js} +191 -191
  111. package/lib/Twitter.cjs +1 -1
  112. package/lib/Twitter.js +3 -3
  113. package/lib/Video.cjs +1 -1
  114. package/lib/Video.js +3 -3
  115. package/lib/bubble.cjs +6 -6
  116. package/lib/bubble.js +2504 -2152
  117. package/lib/{clsx-D6gYQn3o.cjs → clsx-DJURdKPs.cjs} +2 -2
  118. package/lib/{clsx-0OU6n9va.js → clsx-b_2OwHLk.js} +28 -18
  119. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -1
  120. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -1
  121. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -1
  122. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -1
  123. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -1
  124. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -1
  125. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +2 -1
  126. package/lib/components/Bubble/RichTextBubbleLink.d.ts +1 -1
  127. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +3 -3
  128. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +2 -1
  129. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -1
  130. package/lib/components/Bubble/RichTextBubbleTable.d.ts +1 -1
  131. package/lib/components/Bubble/RichTextBubbleText.d.ts +1 -1
  132. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -1
  133. package/lib/components/ColorPicker.d.ts +1 -1
  134. package/lib/components/ReactBus.d.ts +1 -1
  135. package/lib/components/RichTextProvider.d.ts +1 -1
  136. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -1
  137. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -1
  138. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +2 -1
  139. package/lib/components/icons/Activity.d.ts +2 -1
  140. package/lib/components/icons/Animas.d.ts +2 -1
  141. package/lib/components/icons/AspectRatio.d.ts +1 -1
  142. package/lib/components/icons/Blockquote.d.ts +1 -1
  143. package/lib/components/icons/CodeView.d.ts +1 -1
  144. package/lib/components/icons/ColumnAddLeft.d.ts +1 -1
  145. package/lib/components/icons/ColumnAddRight.d.ts +1 -1
  146. package/lib/components/icons/DeleteColumn.d.ts +1 -1
  147. package/lib/components/icons/DeleteRow.d.ts +1 -1
  148. package/lib/components/icons/Direction.d.ts +1 -1
  149. package/lib/components/icons/Excalidraw.d.ts +1 -1
  150. package/lib/components/icons/ExportPdf.d.ts +1 -1
  151. package/lib/components/icons/ExportWord.d.ts +2 -1
  152. package/lib/components/icons/FileWordOutline.d.ts +1 -1
  153. package/lib/components/icons/Flag.d.ts +2 -1
  154. package/lib/components/icons/Food.d.ts +2 -1
  155. package/lib/components/icons/GIfIcon.d.ts +1 -1
  156. package/lib/components/icons/Html.d.ts +1 -1
  157. package/lib/components/icons/Icon.d.ts +1 -1
  158. package/lib/components/icons/IconColorFill.d.ts +1 -1
  159. package/lib/components/icons/IconHighlightFill.d.ts +1 -1
  160. package/lib/components/icons/ImportWord.d.ts +2 -1
  161. package/lib/components/icons/LeftToRight.d.ts +1 -1
  162. package/lib/components/icons/LineHeight.d.ts +1 -1
  163. package/lib/components/icons/MenuDown.d.ts +1 -1
  164. package/lib/components/icons/Mermaid.d.ts +1 -1
  165. package/lib/components/icons/NoFill.d.ts +1 -1
  166. package/lib/components/icons/Object.d.ts +2 -1
  167. package/lib/components/icons/RightToLeft.d.ts +1 -1
  168. package/lib/components/icons/SizeL.d.ts +1 -1
  169. package/lib/components/icons/SizeM.d.ts +1 -1
  170. package/lib/components/icons/SizeS.d.ts +1 -1
  171. package/lib/components/icons/Symbol.d.ts +2 -1
  172. package/lib/components/icons/Travel.d.ts +2 -1
  173. package/lib/components/icons/Twitter.d.ts +1 -1
  174. package/lib/components/ui/dialog.d.ts +2 -2
  175. package/lib/components/ui/dropdown-menu.d.ts +1 -1
  176. package/lib/components/ui/emoji-picker.d.ts +4 -4
  177. package/lib/components/ui/toaster.d.ts +1 -1
  178. package/lib/{dropdown-menu-yQ-sQ1k4.cjs → dropdown-menu-CEMxzgnU.cjs} +1 -1
  179. package/lib/{dropdown-menu-ROihzXsP.js → dropdown-menu-CKAKsyqu.js} +1 -1
  180. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -1
  181. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -1
  182. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -1
  183. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -1
  184. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -1
  185. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -1
  186. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -1
  187. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -1
  188. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -1
  189. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -1
  190. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +2 -1
  191. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -1
  192. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -1
  193. package/lib/extensions/Column/Column.d.ts +10 -2
  194. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -1
  195. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -1
  196. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +27 -27
  197. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -1
  198. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +2 -1
  199. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -1
  200. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +2 -1
  201. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -1
  202. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -1
  203. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -1
  204. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -1
  205. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +1 -1
  206. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +1 -1
  207. package/lib/extensions/FormatPainter/FormatPainter.d.ts +17 -0
  208. package/lib/extensions/FormatPainter/components/RichTextFormatPainter.d.ts +1 -0
  209. package/lib/extensions/FormatPainter/index.d.ts +1 -0
  210. package/lib/extensions/Heading/components/RichTextHeading.d.ts +1 -1
  211. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +2 -1
  212. package/lib/extensions/History/components/RichTextHistory.d.ts +3 -2
  213. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -1
  214. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +1 -1
  215. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -1
  216. package/lib/extensions/Image/Image.d.ts +13 -1
  217. package/lib/extensions/Image/components/ImageCropper.d.ts +2 -1
  218. package/lib/extensions/Image/components/ImageView.d.ts +2 -1
  219. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -1
  220. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -1
  221. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +2 -1
  222. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -1
  223. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -1
  224. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -1
  225. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -1
  226. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -1
  227. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -1
  228. package/lib/extensions/Link/components/LinkEditBlock.d.ts +1 -1
  229. package/lib/extensions/Link/components/LinkViewBlock.d.ts +2 -1
  230. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -1
  231. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +2 -1
  232. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -1
  233. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +1 -1
  234. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -1
  235. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -1
  236. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +1 -1
  237. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -1
  238. package/lib/extensions/Table/components/CreateTablePopover.d.ts +2 -1
  239. package/lib/extensions/Table/components/RichTextTable.d.ts +2 -1
  240. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -1
  241. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +1 -1
  242. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +1 -1
  243. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -1
  244. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +1 -1
  245. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +1 -1
  246. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -1
  247. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -1
  248. package/lib/index-BJQ1G8B1.js +311 -0
  249. package/lib/index-BO82_0q8.cjs +1 -0
  250. package/lib/{index-D-Ouz0vF.js → index-Bn_WPziX.js} +1 -1
  251. package/lib/index-CwbGrQFa.cjs +1 -0
  252. package/lib/{index-oj858lQO.js → index-DKruDABV.js} +209 -209
  253. package/lib/{index-BAb_UADw.cjs → index-DN-IR-K0.cjs} +1 -1
  254. package/lib/{index-X6WZUM9O.js → index-DRcwHivm.js} +1702 -1486
  255. package/lib/index-DUeBQoIA.cjs +1 -0
  256. package/lib/index-DeoYYWEA.js +1756 -0
  257. package/lib/{index-CUvjYuRp.cjs → index-Dgs2thVL.cjs} +1 -1
  258. package/lib/index-DjB2kNdz.js +1120 -0
  259. package/lib/{index-zw-Kd38i.js → index-DuWMq-Qs.js} +1 -1
  260. package/lib/index-EoGU7W4e.cjs +26 -0
  261. package/lib/index-MDz4NZcT.cjs +12 -0
  262. package/lib/{index-BblvcbTH.js → index-n4kM0Ll-.js} +1527 -1406
  263. package/lib/index-qZURFC5Q.cjs +2 -0
  264. package/lib/index.cjs +1 -1
  265. package/lib/index.js +2 -2
  266. package/lib/{jsx-runtime-CT7Pcg-t.js → jsx-runtime-DE8oVoME.js} +3 -1
  267. package/lib/locale-bundle.cjs +1 -1
  268. package/lib/locale-bundle.js +1 -1
  269. package/lib/locales/index.d.ts +1 -1
  270. package/lib/{popover-BfWFqCIs.js → popover-Beieacfy.js} +1 -1
  271. package/lib/{popover-BPzkMuyi.cjs → popover-Bl1kxRJX.cjs} +1 -1
  272. package/lib/{renderNodeView-D--fDFov.cjs → renderNodeView-BIgT6Ghg.cjs} +1 -1
  273. package/lib/{renderNodeView-CfWJK4rG.js → renderNodeView-Bi58v3DZ.js} +2 -2
  274. package/lib/{separator-DpaS43Gt.cjs → separator-DMLtkcoo.cjs} +1 -1
  275. package/lib/{separator-CBPrZizK.js → separator-DfvK668q.js} +11 -11
  276. package/lib/store/EditorEditableReactive.d.ts +1 -1
  277. package/lib/store/ThemeColorReactive.d.ts +1 -1
  278. package/lib/style.css +1 -1
  279. package/lib/{textarea-wvARZKyA.cjs → textarea-DV9Fw3y1.cjs} +1 -1
  280. package/lib/{textarea-Bl64keav.js → textarea-GXaWJbm9.js} +1 -1
  281. package/lib/theme.cjs +1 -1
  282. package/lib/theme.js +1 -1
  283. package/lib/types.d.ts +2 -2
  284. package/lib/{updatePosition-BwzAsiY0.js → updatePosition-DY1jI7qb.js} +2 -2
  285. package/lib/{updatePosition-DGPtRfWN.cjs → updatePosition-D_D-TbEu.cjs} +1 -1
  286. package/package.json +86 -72
  287. package/lib/Twitter--tfifMt1.cjs +0 -1
  288. package/lib/index-BF3EVCB1.cjs +0 -2
  289. package/lib/index-BG0kQamI.js +0 -285
  290. package/lib/index-Bcj8cyOO.cjs +0 -24
  291. package/lib/index-CGjT-a9h.js +0 -1377
  292. package/lib/index-CPTpXLfX.cjs +0 -11
  293. package/lib/index-CWw4s87s.cjs +0 -1
  294. package/lib/index-Cal5SPfB.js +0 -779
  295. package/lib/index-Gi752TMk.cjs +0 -1
  296. package/lib/index-NsYff_Ni.cjs +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactjs-tiptap-editor",
3
- "version": "1.0.25",
3
+ "version": "1.0.28",
4
4
  "description": "A modern WYSIWYG rich text editor based on tiptap and shadcn ui for React",
5
5
  "keywords": [
6
6
  "editor",
@@ -99,6 +99,9 @@
99
99
  "./fontsize": [
100
100
  "./lib/extensions/FontSize/index.d.ts"
101
101
  ],
102
+ "./formatpainter": [
103
+ "./lib/extensions/FormatPainter/index.d.ts"
104
+ ],
102
105
  "./heading": [
103
106
  "./lib/extensions/Heading/index.d.ts"
104
107
  ],
@@ -399,6 +402,16 @@
399
402
  "default": "./lib/FontSize.js"
400
403
  }
401
404
  },
405
+ "./formatpainter": {
406
+ "require": {
407
+ "types": "./lib/extensions/FormatPainter/index.d.ts",
408
+ "default": "./lib/FormatPainter.cjs"
409
+ },
410
+ "import": {
411
+ "types": "./lib/extensions/FormatPainter/index.d.ts",
412
+ "default": "./lib/FormatPainter.js"
413
+ }
414
+ },
402
415
  "./heading": {
403
416
  "require": {
404
417
  "types": "./lib/extensions/Heading/index.d.ts",
@@ -725,64 +738,64 @@
725
738
  "@excalidraw/excalidraw": "^0.18.1",
726
739
  "@floating-ui/dom": "^1.7.6",
727
740
  "@hocuspocus/provider": "^3.4.4",
728
- "@radix-ui/react-checkbox": "^1.3.3",
729
- "@radix-ui/react-dialog": "^1.1.15",
730
- "@radix-ui/react-dropdown-menu": "^2.1.16",
741
+ "@radix-ui/react-checkbox": "^1.3.7",
742
+ "@radix-ui/react-dialog": "^1.1.19",
743
+ "@radix-ui/react-dropdown-menu": "^2.1.20",
731
744
  "@radix-ui/react-icons": "^1.3.2",
732
- "@radix-ui/react-label": "^2.1.8",
733
- "@radix-ui/react-popover": "^1.1.15",
734
- "@radix-ui/react-select": "^2.2.6",
735
- "@radix-ui/react-separator": "^1.1.8",
736
- "@radix-ui/react-slot": "^1.2.4",
737
- "@radix-ui/react-switch": "^1.2.6",
738
- "@radix-ui/react-tabs": "^1.1.13",
739
- "@radix-ui/react-toast": "^1.2.15",
740
- "@radix-ui/react-toggle": "^1.1.10",
741
- "@radix-ui/react-tooltip": "^1.2.8",
742
- "@tiptap/core": "^3.23.6",
743
- "@tiptap/extension-blockquote": "^3.23.6",
744
- "@tiptap/extension-bold": "^3.23.6",
745
- "@tiptap/extension-bullet-list": "^3.23.6",
746
- "@tiptap/extension-code": "^3.23.6",
747
- "@tiptap/extension-code-block-lowlight": "^3.23.6",
748
- "@tiptap/extension-collaboration": "^3.23.6",
749
- "@tiptap/extension-collaboration-caret": "^3.23.6",
750
- "@tiptap/extension-document": "^3.23.6",
751
- "@tiptap/extension-drag-handle": "^3.23.6",
752
- "@tiptap/extension-drag-handle-react": "^3.23.6",
753
- "@tiptap/extension-emoji": "^3.23.6",
754
- "@tiptap/extension-hard-break": "^3.23.6",
755
- "@tiptap/extension-heading": "^3.23.6",
756
- "@tiptap/extension-highlight": "^3.23.6",
757
- "@tiptap/extension-horizontal-rule": "^3.23.6",
758
- "@tiptap/extension-image": "^3.23.6",
759
- "@tiptap/extension-italic": "^3.23.6",
760
- "@tiptap/extension-link": "^3.23.6",
761
- "@tiptap/extension-list": "^3.23.6",
762
- "@tiptap/extension-list-item": "^3.23.6",
763
- "@tiptap/extension-mention": "^3.23.6",
764
- "@tiptap/extension-node-range": "^3.23.6",
765
- "@tiptap/extension-ordered-list": "^3.23.6",
766
- "@tiptap/extension-paragraph": "^3.23.6",
767
- "@tiptap/extension-strike": "^3.23.6",
768
- "@tiptap/extension-subscript": "^3.23.6",
769
- "@tiptap/extension-superscript": "^3.23.6",
770
- "@tiptap/extension-table": "^3.23.6",
771
- "@tiptap/extension-task-item": "^3.23.6",
772
- "@tiptap/extension-task-list": "^3.23.6",
773
- "@tiptap/extension-text": "^3.23.6",
774
- "@tiptap/extension-text-align": "^3.23.6",
775
- "@tiptap/extension-text-style": "^3.23.6",
776
- "@tiptap/extension-underline": "^3.23.6",
777
- "@tiptap/extensions": "^3.23.6",
778
- "@tiptap/pm": "^3.23.6",
779
- "@tiptap/react": "^3.23.6",
780
- "@tiptap/suggestion": "^3.23.6",
781
- "@tiptap/y-tiptap": "^3.0.3",
745
+ "@radix-ui/react-label": "^2.1.11",
746
+ "@radix-ui/react-popover": "^1.1.19",
747
+ "@radix-ui/react-select": "^2.3.3",
748
+ "@radix-ui/react-separator": "^1.1.11",
749
+ "@radix-ui/react-slot": "^1.3.0",
750
+ "@radix-ui/react-switch": "^1.3.3",
751
+ "@radix-ui/react-tabs": "^1.1.17",
752
+ "@radix-ui/react-toast": "^1.2.19",
753
+ "@radix-ui/react-toggle": "^1.1.14",
754
+ "@radix-ui/react-tooltip": "^1.2.12",
755
+ "@tiptap/core": "^3.27.3",
756
+ "@tiptap/extension-blockquote": "^3.27.3",
757
+ "@tiptap/extension-bold": "^3.27.3",
758
+ "@tiptap/extension-bullet-list": "^3.27.3",
759
+ "@tiptap/extension-code": "^3.27.3",
760
+ "@tiptap/extension-code-block-lowlight": "^3.27.3",
761
+ "@tiptap/extension-collaboration": "^3.27.3",
762
+ "@tiptap/extension-collaboration-caret": "^3.27.3",
763
+ "@tiptap/extension-document": "^3.27.3",
764
+ "@tiptap/extension-drag-handle": "^3.27.3",
765
+ "@tiptap/extension-drag-handle-react": "^3.27.3",
766
+ "@tiptap/extension-emoji": "^3.27.3",
767
+ "@tiptap/extension-hard-break": "^3.27.3",
768
+ "@tiptap/extension-heading": "^3.27.3",
769
+ "@tiptap/extension-highlight": "^3.27.3",
770
+ "@tiptap/extension-horizontal-rule": "^3.27.3",
771
+ "@tiptap/extension-image": "^3.27.3",
772
+ "@tiptap/extension-italic": "^3.27.3",
773
+ "@tiptap/extension-link": "^3.27.3",
774
+ "@tiptap/extension-list": "^3.27.3",
775
+ "@tiptap/extension-list-item": "^3.27.3",
776
+ "@tiptap/extension-mention": "^3.27.3",
777
+ "@tiptap/extension-node-range": "^3.27.3",
778
+ "@tiptap/extension-ordered-list": "^3.27.3",
779
+ "@tiptap/extension-paragraph": "^3.27.3",
780
+ "@tiptap/extension-strike": "^3.27.3",
781
+ "@tiptap/extension-subscript": "^3.27.3",
782
+ "@tiptap/extension-superscript": "^3.27.3",
783
+ "@tiptap/extension-table": "^3.27.3",
784
+ "@tiptap/extension-task-item": "^3.27.3",
785
+ "@tiptap/extension-task-list": "^3.27.3",
786
+ "@tiptap/extension-text": "^3.27.3",
787
+ "@tiptap/extension-text-align": "^3.27.3",
788
+ "@tiptap/extension-text-style": "^3.27.3",
789
+ "@tiptap/extension-underline": "^3.27.3",
790
+ "@tiptap/extensions": "^3.27.3",
791
+ "@tiptap/pm": "^3.27.3",
792
+ "@tiptap/react": "^3.27.3",
793
+ "@tiptap/suggestion": "^3.27.3",
794
+ "@tiptap/y-tiptap": "^3.0.6",
782
795
  "class-variance-authority": "^0.7.1",
783
796
  "clsx": "^2.1.1",
784
797
  "deep-equal": "^2.2.3",
785
- "docx": "^9.6.1",
798
+ "docx": "^9.7.1",
786
799
  "easydrawer": "^0.0.15",
787
800
  "frimousse": "^0.3.0",
788
801
  "highlight.js": "^11.11.1",
@@ -791,27 +804,28 @@
791
804
  "lowlight": "^3.3.0",
792
805
  "lucide-react": "^0.427.0",
793
806
  "marked": "^15.0.12",
794
- "mermaid": "^11.15.0",
807
+ "mermaid": "^11.16.0",
795
808
  "prosemirror-docx": "^0.2.1",
796
809
  "re-resizable": "^6.11.2",
797
810
  "react-colorful": "^5.7.0",
798
- "react-image-crop": "^11.0.10",
799
- "react-tweet": "^3.3.0",
800
- "reactjs-signal": "^2.0.4",
811
+ "react-image-crop": "^11.1.2",
812
+ "react-tweet": "^3.3.1",
813
+ "reactjs-signal": "^2.0.6",
801
814
  "scroll-into-view-if-needed": "^3.1.0",
802
815
  "svg64": "^2.0.0",
803
816
  "y-protocols": "^1.0.7",
804
- "yjs": "^13.6.30"
817
+ "yjs": "^13.6.31"
805
818
  },
806
819
  "devDependencies": {
807
820
  "@types/deep-equal": "^1.0.4",
808
821
  "@types/katex": "^0.16.8",
809
822
  "@types/lodash-es": "^4.17.12",
810
- "@types/node": "^24.12.4",
811
- "@types/react": "^19.2.15",
823
+ "@types/node": "^24.13.3",
824
+ "@types/react": "^19.2.17",
812
825
  "@types/react-dom": "^19.2.3",
826
+ "@typescript/typescript6": "^6.0.2",
813
827
  "@vitejs/plugin-react": "^5.2.0",
814
- "autoprefixer": "^10.5.0",
828
+ "autoprefixer": "^10.5.2",
815
829
  "bumpp": "^10.4.1",
816
830
  "contributorkit": "^0.0.4",
817
831
  "esno": "^4.8.0",
@@ -820,20 +834,20 @@
820
834
  "globby": "^14.1.0",
821
835
  "mammoth": "^1.12.0",
822
836
  "md5": "^2.3.0",
823
- "oxfmt": "^0.26.0",
824
- "oxlint": "^1.66.0",
825
- "postcss": "^8.5.15",
837
+ "oxfmt": "^0.55.0",
838
+ "oxlint": "^1.73.0",
839
+ "postcss": "^8.5.16",
826
840
  "postcss-replace": "^2.0.1",
827
841
  "postcss-scss": "^4.0.9",
828
- "react": "^19.2.6",
829
- "react-dom": "^19.2.6",
830
- "sass": "^1.100.0",
842
+ "react": "^19.2.7",
843
+ "react-dom": "^19.2.7",
844
+ "sass": "^1.101.0",
831
845
  "tailwind-merge": "^2.6.1",
832
846
  "tailwindcss": "^3.4.19",
833
- "typescript": "^5.9.3",
834
- "unplugin-dts": "1.0.0-beta.6",
847
+ "typescript": "^7.0.2",
848
+ "unplugin-dts": "1.0.3",
835
849
  "verify-commit-msg": "^0.1.0",
836
- "vite": "^6.4.2"
850
+ "vite": "^6.4.3"
837
851
  },
838
852
  "browserslist": [
839
853
  ">0.3%",
@@ -1 +0,0 @@
1
- "use strict";const Te=require("./index-Bcj8cyOO.cjs"),E=require("./clsx-D6gYQn3o.cjs"),t=require("react/jsx-runtime"),h=require("react"),z=require("./index-Gi752TMk.cjs");require("./theme.cjs");const Dt=require("./index-CWw4s87s.cjs"),Re=require("./popover-BPzkMuyi.cjs"),At="_verified_lvyh0_1",Ue={verified:At},Mt=()=>t.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:Ue.verified,children:t.jsx("g",{children:t.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Vt=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Ue.verified,children:t.jsxs("g",{children:[t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[t.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),t.jsx("stop",{offset:".539",stopColor:"#cd8105"}),t.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),t.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),t.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),t.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[t.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),t.jsx("stop",{offset:".406",stopColor:"#e2b719"}),t.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),t.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[t.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),t.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),t.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Wt=()=>t.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Ue.verified,children:t.jsx("g",{children:t.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),Bt="_root_98iqw_1",Ft="_article_98iqw_21",nt={root:Bt,article:Ft},ze=({className:e,children:n})=>t.jsx("div",{className:E.clsx("react-tweet-theme",nt.root,e),children:t.jsx("article",{className:nt.article,children:n})}),mt=e=>t.jsx("img",{...e}),Pt="_verifiedOld_lcna5_1",Ut="_verifiedBlue_lcna5_4",zt="_verifiedGovernment_lcna5_7",Ne={verifiedOld:Pt,verifiedBlue:Ut,verifiedGovernment:zt},pt=({user:e,className:n})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=t.jsx(Mt,{}),o=Ne.verifiedBlue;if(r)switch(e.is_blue_verified||(o=Ne.verifiedOld),e.verified_type){case"Government":s=t.jsx(Wt,{}),o=Ne.verifiedGovernment;break;case"Business":s=t.jsx(Vt,{}),o=null;break}return r?t.jsx("div",{className:E.clsx(n,o),children:s}):null},Ht="_label_36ucz_1",Gt={label:Ht},xt=({user:e,className:n})=>{var r;const s=e.highlighted_label;if(!s)return null;const o=(r=s.badge)==null?void 0:r.url;return o?t.jsx("div",{className:E.clsx(Gt.label,n),children:t.jsx("img",{src:o,alt:s.description})}):null},Xt="_header_nqq4j_1",Kt="_avatar_nqq4j_11",Qt="_avatarOverflow_nqq4j_16",Jt="_avatarSquare_nqq4j_23",Yt="_avatarShadow_nqq4j_26",Zt="_author_nqq4j_37",en="_authorLink_nqq4j_44",tn="_authorVerified_nqq4j_53",nn="_authorLinkText_nqq4j_56",rn="_authorMeta_nqq4j_63",sn="_authorFollow_nqq4j_66",on="_username_nqq4j_69",an="_follow_nqq4j_74",cn="_separator_nqq4j_82",ln="_brand_nqq4j_86",dn="_twitterIcon_nqq4j_90",T={header:Xt,avatar:Kt,avatarOverflow:Qt,avatarSquare:Jt,avatarShadow:Yt,author:Zt,authorLink:en,authorVerified:tn,authorLinkText:nn,authorMeta:rn,authorFollow:sn,username:on,follow:an,separator:cn,brand:ln,twitterIcon:dn},un=({tweet:e,components:n})=>{var r;const s=(r=n==null?void 0:n.AvatarImg)!=null?r:mt,{user:o}=e;return t.jsxs("div",{className:T.header,children:[t.jsxs("a",{href:e.url,className:T.avatar,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:E.clsx(T.avatarOverflow,o.profile_image_shape==="Square"&&T.avatarSquare),children:t.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),t.jsx("div",{className:T.avatarOverflow,children:t.jsx("div",{className:T.avatarShadow})})]}),t.jsxs("div",{className:T.author,children:[t.jsxs("a",{href:e.url,className:T.authorLink,target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:T.authorLinkText,children:t.jsx("span",{title:o.name,children:o.name})}),t.jsx(pt,{user:o,className:T.authorVerified}),t.jsx(xt,{user:o})]}),t.jsxs("div",{className:T.authorMeta,children:[t.jsx("a",{href:e.url,className:T.username,target:"_blank",rel:"noopener noreferrer",children:t.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),t.jsxs("div",{className:T.authorFollow,children:[t.jsx("span",{className:T.separator,children:"·"}),t.jsx("a",{href:o.follow_url,className:T.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),t.jsx("a",{href:e.url,className:T.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:T.twitterIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},fn="_root_1ec15_1",hn={root:fn},_n=({tweet:e})=>t.jsxs("a",{href:e.in_reply_to_url,className:hn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),mn="_root_eihfa_1",pn={root:mn},vt=({href:e,children:n})=>t.jsx("a",{href:e,className:pn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:n}),xn="_root_1xq52_1",vn={root:xn},gn=({tweet:e})=>t.jsxs("p",{className:vn.root,lang:e.lang,dir:"auto",children:[e.entities.map((n,r)=>{switch(n.type){case"hashtag":case"mention":case"url":case"symbol":return t.jsx(vt,{href:n.href,children:n.text},r);case"media":return;default:return t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r)}}),e.note_tweet?t.jsx(jn,{tweet:e}):null]});function jn({tweet:e}){return t.jsxs(vt,{href:e.url,children:[t.jsx("span",{children:" "}),"Show more"]})}const wn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},yn=new Intl.DateTimeFormat("en-US",wn),bn=e=>{const n={};for(const r of e)n[r.type]=r.value;return n},Tn=e=>{const n=bn(yn.formatToParts(e)),r=`${n.hour}:${n.minute} ${n.dayPeriod}`,s=`${n.month} ${n.day}, ${n.year}`;return`${r} · ${s}`},rt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,gt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,Rn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,Nn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,Sn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,In=e=>`https://x.com/hashtag/${e.text}`,kn=e=>`https://x.com/search?q=%24${e.text}`,En=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,jt=(e,n)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",n),r.toString()):e.media_url_https},Cn=e=>{const{variants:n}=e.video_info;return n.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},On=e=>{const n=Cn(e);return n.length>1?n[1]:n[0]},$e=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function st(e){const n=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return fe(r,"hashtag",e.entities.hashtags),fe(r,"mention",e.entities.user_mentions),fe(r,"url",e.entities.urls),fe(r,"symbol",e.entities.symbols),e.entities.media&&fe(r,"media",e.entities.media),Ln(e,r),r.map(s=>{const o=n.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:In(s),text:o});case"mention":return Object.assign(s,{href:gt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:kn(s),text:o});default:return Object.assign(s,{text:o})}})}function fe(e,n,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:n}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function Ln(e,n){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=n.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const qn=e=>({...e,url:rt(e),user:{...e.user,url:gt(e),follow_url:Sn(e)},like_url:Rn(e),reply_url:Nn(e),in_reply_to_url:e.in_reply_to_screen_name?En(e):void 0,entities:st(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:rt(e.quoted_tweet),entities:st(e.quoted_tweet)}:void 0}),$n="_root_g9tkv_1",Dn="_rounded_g9tkv_6",An="_mediaWrapper_g9tkv_10",Mn="_grid2Columns_g9tkv_17",Vn="_grid3_g9tkv_20",Wn="_grid2x2_g9tkv_23",Bn="_mediaContainer_g9tkv_26",Fn="_mediaLink_g9tkv_34",Pn="_skeleton_g9tkv_38",Un="_image_g9tkv_43",k={root:$n,rounded:Dn,mediaWrapper:An,grid2Columns:Mn,grid3:Vn,grid2x2:Wn,mediaContainer:Bn,mediaLink:Fn,skeleton:Pn,image:Un},zn="_anchor_fp31d_1",Hn="_videoButton_fp31d_17",Gn="_videoButtonIcon_fp31d_35",Xn="_watchOnTwitter_fp31d_44",Kn="_viewReplies_fp31d_60",oe={anchor:zn,videoButton:Hn,videoButtonIcon:Gn,watchOnTwitter:Xn,viewReplies:Kn},Qn=({tweet:e,media:n})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=On(n);let u=0;return t.jsxs(t.Fragment,{children:[t.jsx("video",{className:k.image,poster:jt(n,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{u&&window.clearTimeout(u),o||a(!0),i&&c(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{o&&a(!1),u=0},100)},onEnded:()=>{c(!0)},children:t.jsx("source",{src:f.url,type:f.content_type})}),r&&t.jsx("button",{type:"button",className:oe.videoButton,"aria-label":"View video on X",onClick:x=>{const m=x.currentTarget.previousSibling;x.preventDefault(),s(!1),m.load(),m.play().then(()=>{a(!0),m.focus()}).catch(y=>{console.error("Error playing video:",y),s(!0),a(!1)})},children:t.jsx("svg",{viewBox:"0 0 24 24",className:oe.videoButtonIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&t.jsx("div",{className:oe.watchOnTwitter,children:t.jsx("a",{href:e.url,className:oe.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),i&&t.jsx("a",{href:e.url,className:E.clsx(oe.anchor,oe.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Jn=e=>t.jsx("img",{...e}),ot=(e,n)=>{let r=56.25;return n===1&&(r=100/e.original_info.width*e.original_info.height),n===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},wt=({tweet:e,components:n,quoted:r})=>{var s,o,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=n==null?void 0:n.MediaImg)!=null?c:Jn;return t.jsx("div",{className:E.clsx(k.root,!r&&k.rounded),children:t.jsx("div",{className:E.clsx(k.mediaWrapper,i>1&&k.grid2Columns,i===3&&k.grid3,i>4&&k.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(u=>t.jsx(h.Fragment,{children:u.type==="photo"?t.jsxs("a",{href:e.url,className:E.clsx(k.mediaContainer,k.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[t.jsx("div",{className:k.skeleton,style:ot(u,i)}),t.jsx(f,{src:jt(u,"small"),alt:u.ext_alt_text||"Image",className:k.image,draggable:!0})]},u.media_url_https):t.jsxs("div",{className:k.mediaContainer,children:[t.jsx("div",{className:k.skeleton,style:ot(u,i)}),t.jsx(Qn,{tweet:e,media:u})]},u.media_url_https)},u.media_url_https))})})},Yn="_root_i24yn_1",Zn={root:Yn},er=({tweet:e})=>{const n=new Date(e.created_at),r=Tn(n);return t.jsx("a",{className:Zn.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:t.jsx("time",{dateTime:n.toISOString(),children:r})})},tr="_info_19qcj_1",nr="_infoLink_19qcj_10",rr="_infoIcon_19qcj_30",Se={info:tr,infoLink:nr,infoIcon:rr},sr=({tweet:e})=>t.jsxs("div",{className:Se.info,children:[t.jsx(er,{tweet:e}),t.jsx("a",{className:Se.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:Se.infoIcon,children:t.jsx("g",{children:t.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),or="_actions_n2anf_1",ir="_like_n2anf_13",ar="_reply_n2anf_14",cr="_copy_n2anf_15",lr="_likeIconWrapper_n2anf_27",dr="_likeCount_n2anf_30",ur="_replyIconWrapper_n2anf_35",fr="_copyIconWrapper_n2anf_36",hr="_likeIcon_n2anf_27",_r="_replyIcon_n2anf_35",mr="_copyIcon_n2anf_36",pr="_replyText_n2anf_56",xr="_copyText_n2anf_57",S={actions:or,like:ir,reply:ar,copy:cr,likeIconWrapper:lr,likeCount:dr,replyIconWrapper:ur,copyIconWrapper:fr,likeIcon:hr,replyIcon:_r,copyIcon:mr,replyText:pr,copyText:xr},vr=({tweet:e})=>{const[n,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(n){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[n]),t.jsxs("button",{type:"button",className:S.copy,"aria-label":"Copy link",onClick:s,children:[t.jsx("div",{className:S.copyIconWrapper,children:n?t.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):t.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),t.jsx("span",{className:S.copyText,children:n?"Copied!":"Copy link"})]})},gr=({tweet:e})=>{const n=$e(e.favorite_count);return t.jsxs("div",{className:S.actions,children:[t.jsxs("a",{className:S.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${n} likes`,children:[t.jsx("div",{className:S.likeIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:S.likeIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),t.jsx("span",{className:S.likeCount,children:n})]}),t.jsxs("a",{className:S.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[t.jsx("div",{className:S.replyIconWrapper,children:t.jsx("svg",{viewBox:"0 0 24 24",className:S.replyIcon,"aria-hidden":"true",children:t.jsx("g",{children:t.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),t.jsx("span",{className:S.replyText,children:"Reply"})]}),t.jsx(vr,{tweet:e})]})},jr="_replies_1cutb_1",wr="_link_1cutb_4",yr="_text_1cutb_23",Ie={replies:jr,link:wr,text:yr},br=({tweet:e})=>t.jsx("div",{className:Ie.replies,children:t.jsx("a",{className:Ie.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:t.jsx("span",{className:Ie.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${$e(e.conversation_count)} reply`:`Read ${$e(e.conversation_count)} replies`})})}),Tr="_root_q5799_1",Rr="_article_q5799_16",it={root:Tr,article:Rr},Nr=({tweet:e,children:n})=>t.jsx("div",{className:it.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:t.jsx("article",{className:it.article,children:n})}),Sr="_header_f00ab_1",Ir="_avatar_f00ab_11",kr="_avatarOverflow_f00ab_16",Er="_avatarSquare_f00ab_23",Cr="_author_f00ab_27",Or="_authorText_f00ab_33",Lr="_username_f00ab_40",Q={header:Sr,avatar:Ir,avatarOverflow:kr,avatarSquare:Er,author:Cr,authorText:Or,username:Lr},qr=({tweet:e,components:n})=>{const{user:r}=e;var s;const o=(s=n==null?void 0:n.AvatarImg)!=null?s:mt;return t.jsxs("div",{className:Q.header,children:[t.jsx("a",{href:e.url,className:Q.avatar,target:"_blank",rel:"noopener noreferrer",children:t.jsx("div",{className:E.clsx(Q.avatarOverflow,r.profile_image_shape==="Square"&&Q.avatarSquare),children:t.jsx(o,{src:r.profile_image_url_https,alt:r.name,width:20,height:20})})}),t.jsxs("div",{className:Q.author,children:[t.jsx("div",{className:Q.authorText,children:t.jsx("span",{title:r.name,children:r.name})}),t.jsx(pt,{user:r}),t.jsx(xt,{user:r}),t.jsx("div",{className:Q.username,children:t.jsxs("span",{title:`@${r.screen_name}`,children:["@",r.screen_name]})})]})]})},$r="_root_175ot_1",Dr={root:$r},Ar=({tweet:e})=>t.jsx("p",{className:Dr.root,lang:e.lang,dir:"auto",children:e.entities.map((n,r)=>t.jsx("span",{dangerouslySetInnerHTML:{__html:n.text}},r))}),Mr=({tweet:e,components:n})=>{var r;return t.jsxs(Nr,{tweet:e,children:[t.jsx(qr,{tweet:e,components:n}),t.jsx(Ar,{tweet:e}),(r=e.mediaDetails)!=null&&r.length?t.jsx(wt,{quoted:!0,tweet:e}):null]})},Vr=({tweet:e,components:n})=>{var r;const s=h.useMemo(()=>qn(e),[e]);return t.jsxs(ze,{children:[t.jsx(un,{tweet:s,components:n}),s.in_reply_to_status_id_str&&t.jsx(_n,{tweet:s}),t.jsx(gn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?t.jsx(wt,{tweet:s,components:n}):null,s.quoted_tweet&&t.jsx(Mr,{tweet:s.quoted_tweet,components:n}),t.jsx(sr,{tweet:s}),t.jsx(gr,{tweet:s}),t.jsx(br,{tweet:s})]})},Wr="_root_16yxa_1",Br={root:Wr},Fr=e=>t.jsx(ze,{children:t.jsxs("div",{className:Br.root,children:[t.jsx("h3",{children:"Tweet not found"}),t.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Pr="_skeleton_oi7hr_1",Ur={skeleton:Pr},xe=({style:e})=>t.jsx("span",{className:Ur.skeleton,style:e}),zr="_root_17qqv_1",Hr={root:zr},Gr=()=>t.jsxs(ze,{className:Hr.root,children:[t.jsx(xe,{style:{height:"3rem",marginBottom:"0.75rem"}}),t.jsx(xe,{style:{height:"6rem",margin:"0.5rem 0"}}),t.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),t.jsx(xe,{style:{height:"2rem"}}),t.jsx(xe,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),yt=0,bt=1,Tt=2,at=3;var ct=Object.prototype.hasOwnProperty;function De(e,n){var r,s;if(e===n)return!0;if(e&&n&&(r=e.constructor)===n.constructor){if(r===Date)return e.getTime()===n.getTime();if(r===RegExp)return e.toString()===n.toString();if(r===Array){if((s=e.length)===n.length)for(;s--&&De(e[s],n[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(ct.call(e,r)&&++s&&!ct.call(n,r)||!(r in n)||!De(e[r],n[r]))return!1;return Object.keys(n).length===s}}return e!==e&&n!==n}const P=new WeakMap,U=()=>{},N=U(),Ae=Object,d=e=>e===N,B=e=>typeof e=="function",H=(e,n)=>({...e,...n}),Rt=e=>B(e.then),ke={},ve={},He="undefined",he=typeof window!=He,Me=typeof document!=He,Xr=he&&"Deno"in window,Kr=()=>he&&typeof window.requestAnimationFrame!=He,Nt=(e,n)=>{const r=P.get(e);return[()=>!d(n)&&e.get(n)||ke,s=>{if(!d(n)){const o=e.get(n);n in ve||(ve[n]=o),r[5](n,H(o,s),o||ke)}},r[6],()=>!d(n)&&n in ve?ve[n]:!d(n)&&e.get(n)||ke]};let Ve=!0;const Qr=()=>Ve,[We,Be]=he&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[U,U],Jr=()=>{const e=Me&&document.visibilityState;return d(e)||e!=="hidden"},Yr=e=>(Me&&document.addEventListener("visibilitychange",e),We("focus",e),()=>{Me&&document.removeEventListener("visibilitychange",e),Be("focus",e)}),Zr=e=>{const n=()=>{Ve=!0,e()},r=()=>{Ve=!1};return We("online",n),We("offline",r),()=>{Be("online",n),Be("offline",r)}},es={isOnline:Qr,isVisible:Jr},ts={initFocus:Yr,initReconnect:Zr},lt=!h.useId,ie=!he||Xr,ns=e=>Kr()?window.requestAnimationFrame(e):setTimeout(e,1),Ee=ie?h.useEffect:h.useLayoutEffect,Ce=typeof navigator<"u"&&navigator.connection,dt=!ie&&Ce&&(["slow-2g","2g"].includes(Ce.effectiveType)||Ce.saveData),ge=new WeakMap,rs=e=>Ae.prototype.toString.call(e),Oe=(e,n)=>e===`[object ${n}]`;let ss=0;const Fe=e=>{const n=typeof e,r=rs(e),s=Oe(r,"Date"),o=Oe(r,"RegExp"),a=Oe(r,"Object");let i,c;if(Ae(e)===e&&!s&&!o){if(i=ge.get(e),i)return i;if(i=++ss+"~",ge.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Fe(e[c])+",";ge.set(e,i)}if(a){i="#";const f=Ae.keys(e).sort();for(;!d(c=f.pop());)d(e[c])||(i+=c+":"+Fe(e[c])+",");ge.set(e,i)}}else i=s?e.toJSON():n=="symbol"?e.toString():n=="string"?JSON.stringify(e):""+e;return i},Ge=e=>{if(B(e))try{e=e()}catch{e=""}const n=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Fe(e):"",[e,n]};let os=0;const Pe=()=>++os;async function St(...e){const[n,r,s,o]=e,a=H({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const u=y=>typeof c=="function"?c(y):c!==!1,x=a.throwOnError;if(B(r)){const y=r,R=[],I=n.keys();for(const L of I)!/^\$(inf|sub)\$/.test(L)&&y(n.get(L)._k)&&R.push(L);return Promise.all(R.map(m))}return m(r);async function m(y){const[R]=Ge(y);if(!R)return;const[I,L]=Nt(n,R),[D,ae,l,_e]=P.get(n),J=()=>{const q=D[R];return(B(a.revalidate)?a.revalidate(I().data,y):a.revalidate!==!1)&&(delete l[R],delete _e[R],q&&q[0])?q[0](Tt).then(()=>I().data):I().data};if(e.length<3)return J();let b=s,A,M=!1;const Y=Pe();ae[R]=[Y,0];const p=!d(f),Z=I(),V=Z.data,ee=Z._c,G=d(ee)?V:ee;if(p&&(f=B(f)?f(G,V):f,L({data:f,_c:G})),B(b))try{b=b(G)}catch(q){A=q,M=!0}if(b&&Rt(b))if(b=await b.catch(q=>{A=q,M=!0}),Y!==ae[R][0]){if(M)throw A;return b}else M&&p&&u(A)&&(i=!0,L({data:G,_c:N}));if(i&&!M)if(B(i)){const q=i(b,G);L({data:q,error:N,_c:N})}else L({data:b,error:N,_c:N});if(ae[R][1]=Pe(),Promise.resolve(J()).then(()=>{L({_c:N})}),M){if(x)throw A;return}return b}}const ut=(e,n)=>{for(const r in e)e[r][0]&&e[r][0](n)},is=(e,n)=>{if(!P.has(e)){const r=H(ts,n),s=Object.create(null),o=St.bind(N,e);let a=U;const i=Object.create(null),c=(x,m)=>{const y=i[x]||[];return i[x]=y,y.push(m),()=>y.splice(y.indexOf(m),1)},f=(x,m,y)=>{e.set(x,m);const R=i[x];if(R)for(const I of R)I(m,y)},u=()=>{if(!P.has(e)&&(P.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!ie)){const x=r.initFocus(setTimeout.bind(N,ut.bind(N,s,yt))),m=r.initReconnect(setTimeout.bind(N,ut.bind(N,s,bt)));a=()=>{x&&x(),m&&m(),P.delete(e)}}};return u(),[e,o,u,a]}return[e,P.get(e)[4]]},as=(e,n,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!d(a)&&i>a||setTimeout(s,c,o)},cs=De,[It,ls]=is(new Map),ds=H({onLoadingSlow:U,onSuccess:U,onError:U,onErrorRetry:as,onDiscarded:U,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:cs,isPaused:()=>!1,cache:It,mutate:ls,fallback:{}},es),us=(e,n)=>{const r=H(e,n);if(n){const{use:s,fallback:o}=e,{use:a,fallback:i}=n;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=H(o,i))}return r},fs=h.createContext({}),hs="$inf$",kt=he&&window.__SWR_DEVTOOLS_USE__,_s=kt?window.__SWR_DEVTOOLS_USE__:[],ms=()=>{kt&&(window.__SWR_DEVTOOLS_REACT__=h)},ps=e=>B(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],xs=()=>{const e=h.useContext(fs);return h.useMemo(()=>H(ds,e),[e])},vs=e=>(n,r,s)=>e(n,r&&((...a)=>{const[i]=Ge(n),[,,,c]=P.get(It);if(i.startsWith(hs))return r(...a);const f=c[i];return d(f)?r(...a):(delete c[i],f)}),s),gs=_s.concat(vs),js=e=>function(...r){const s=xs(),[o,a,i]=ps(r),c=us(s,i);let f=e;const{use:u}=c,x=(u||[]).concat(gs);for(let m=x.length;m--;)f=x[m](f);return f(o,a||c.fetcher||null,c)},ws=(e,n,r)=>{const s=n[e]||(n[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};ms();const Le=h.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(n=>{e.status="fulfilled",e.value=n},n=>{e.status="rejected",e.reason=n}),e}}),qe={dedupe:!0},ft=Promise.resolve(N),ys=()=>U,bs=(e,n,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:u,refreshWhenHidden:x,refreshWhenOffline:m,keepPreviousData:y,strictServerPrefetchWarning:R}=r,[I,L,D,ae]=P.get(s),[l,_e]=Ge(e),J=h.useRef(!1),b=h.useRef(!1),A=h.useRef(l),M=h.useRef(n),Y=h.useRef(r),p=()=>Y.current,Z=()=>p().isVisible()&&p().isOnline(),[V,ee,G,q]=Nt(s,l),te=h.useRef({}).current,ne=d(i)?d(r.fallback)?N:r.fallback[l]:i,Ke=(_,v)=>{for(const g in te){const j=g;if(j==="data"){if(!o(_[j],v[j])&&(!d(_[j])||!o(pe,v[j])))return!1}else if(v[j]!==_[j])return!1}return!0},je=!J.current,Qe=h.useMemo(()=>{const _=V(),v=q(),g=w=>{const $=H(w);return delete $._k,(()=>{if(!l||!n||p().isPaused())return!1;if(je&&!d(c))return c;const ue=d(ne)?$.data:ne;return d(ue)||f})()?{isValidating:!0,isLoading:!0,...$}:$},j=g(_),W=_===v?j:g(v);let C=j;return[()=>{const w=g(V());return Ke(w,C)?(C.data=w.data,C.isLoading=w.isLoading,C.isValidating=w.isValidating,C.error=w.error,C):(C=w,w)},()=>W]},[s,l]),re=E.shimExports.useSyncExternalStore(h.useCallback(_=>G(l,(v,g)=>{Ke(g,v)||_()}),[s,l]),Qe[0],Qe[1]),Ct=I[l]&&I[l].length>0,se=re.data,X=d(se)?ne&&Rt(ne)?Le(ne):ne:se,me=re.error,we=h.useRef(X),pe=y?d(se)?d(we.current)?X:we.current:se:X,K=l&&d(X),ce=h.useRef(null);!ie&&E.shimExports.useSyncExternalStore(ys,()=>(ce.current=!1,ce),()=>(ce.current=!0,ce));const Ot=ce.current;R&&Ot&&!a&&K&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Je=!l||!n||p().isPaused()||Ct&&!d(me)?!1:je&&!d(c)?c:a?d(X)?!1:f:d(X)||f,Ye=je&&Je,Lt=d(re.isValidating)?Ye:re.isValidating,qt=d(re.isLoading)?Ye:re.isLoading,le=h.useCallback(async _=>{const v=M.current;if(!l||!v||b.current||p().isPaused())return!1;let g,j,W=!0;const C=_||{},w=!D[l]||!C.dedupe,$=()=>lt?!b.current&&l===A.current&&J.current:l===A.current,de={isValidating:!1,isLoading:!1},ue=()=>{ee(de)},et=()=>{const O=D[l];O&&O[1]===j&&delete D[l]},tt={isValidating:!0};d(V().data)&&(tt.isLoading=!0);try{if(w&&(ee(tt),r.loadingTimeout&&d(V().data)&&setTimeout(()=>{W&&$()&&p().onLoadingSlow(l,r)},r.loadingTimeout),D[l]=[v(_e),Pe()]),[g,j]=D[l],g=await g,w&&setTimeout(et,r.dedupingInterval),!D[l]||D[l][1]!==j)return w&&$()&&p().onDiscarded(l),!1;de.error=N;const O=L[l];if(!d(O)&&(j<=O[0]||j<=O[1]||O[1]===0))return ue(),w&&$()&&p().onDiscarded(l),!1;const F=V().data;de.data=o(F,g)?F:g,w&&$()&&p().onSuccess(g,l,r)}catch(O){et();const F=p(),{shouldRetryOnError:ye}=F;F.isPaused()||(de.error=O,w&&$()&&(F.onError(O,l,F),(ye===!0||B(ye)&&ye(O))&&(!p().revalidateOnFocus||!p().revalidateOnReconnect||Z())&&F.onErrorRetry(O,l,F,$t=>{const be=I[l];be&&be[0]&&be[0](at,$t)},{retryCount:(C.retryCount||0)+1,dedupe:!0})))}return W=!1,ue(),!0},[l,s]),Ze=h.useCallback((..._)=>St(s,A.current,..._),[]);if(Ee(()=>{M.current=n,Y.current=r,d(se)||(we.current=se)}),Ee(()=>{if(!l)return;const _=le.bind(N,qe);let v=0;p().revalidateOnFocus&&(v=Date.now()+p().focusThrottleInterval);const j=ws(l,I,(W,C={})=>{if(W==yt){const w=Date.now();p().revalidateOnFocus&&w>v&&Z()&&(v=w+p().focusThrottleInterval,_())}else if(W==bt)p().revalidateOnReconnect&&Z()&&_();else{if(W==Tt)return le();if(W==at)return le(C)}});return b.current=!1,A.current=l,J.current=!0,ee({_k:_e}),Je&&(D[l]||(d(X)||ie?_():ns(_))),()=>{b.current=!0,j()}},[l]),Ee(()=>{let _;function v(){const j=B(u)?u(V().data):u;j&&_!==-1&&(_=setTimeout(g,j))}function g(){!V().error&&(x||p().isVisible())&&(m||p().isOnline())?le(qe).then(v):v()}return v(),()=>{_&&(clearTimeout(_),_=-1)}},[u,x,m,l]),h.useDebugValue(pe),a){if(!lt&&ie&&K)throw new Error("Fallback data is required when using Suspense in SSR.");K&&(M.current=n,Y.current=r,b.current=!1);const _=ae[l],v=!d(_)&&K?Ze(_):ft;if(Le(v),!d(me)&&K)throw me;const g=K?le(qe):ft;!d(pe)&&K&&(g.status="fulfilled",g.value=!0),Le(g)}return{mutate:Ze,get data(){return te.data=!0,pe},get error(){return te.error=!0,me},get isValidating(){return te.isValidating=!0,Lt},get isLoading(){return te.isLoading=!0,qt}}},ht=js(bs);class Ts extends Error{constructor({message:n,status:r,data:s}){super(n),this.name="TwitterApiError",this.status=r,this.data=s}}const Rs=ht.default||ht,Ns="https://react-tweet.vercel.app";async function Ss([e,n]){const r=await fetch(e,n),s=await r.json();if(r.ok)return s.data||null;throw new Ts({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Is=(e,n,r)=>{const{isLoading:s,data:o,error:a}=Rs(()=>n||e?[n||e&&`${Ns}/api/tweet/${e}`,r]:null,Ss,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},ks=({id:e,apiUrl:n,fallback:r=t.jsx(Gr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Is(e,n,o);if(f)return r;if(c||!i){const u=(s==null?void 0:s.TweetNotFound)||Fr;return t.jsx(u,{error:a?a(c):c})}return t.jsx(Vr,{tweet:i,components:s})};function Es({node:e}){var s;const n=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=n==null?void 0:n.split("/").pop();return r?t.jsx(E.NodeViewWrapper,{children:t.jsx("div",{"data-twitter":"",children:t.jsx(ks,{id:r})})}):null}function Et(e){const{t:n}=Dt.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(Xe.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return t.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[t.jsx(z.Label,{className:"mb-[6px]",children:n("editor.link.dialog.text")}),t.jsx("div",{className:"richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:t.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:t.jsx(z.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),t.jsx(z.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:n("editor.link.dialog.button.apply")})]})}function Cs(){const[e,n]=h.useState(!1),r=z.useEditorInstance(),s=z.useButtonProps(Xe.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:u}=z.useToggleActive(f);function x(m){u||c&&(c(m),n(!1))}return t.jsxs(Re.Popover,{modal:!0,onOpenChange:n,open:e,children:[t.jsx(Re.PopoverTrigger,{asChild:!0,children:t.jsx(z.ActionButton,{disabled:u,isActive:f,tooltip:a,tooltipOptions:i,children:t.jsx(z.IconComponent,{name:o})})}),t.jsx(Re.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:t.jsx(Et,{editor:r,onSetLink:x})})]})}const Os=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function _t(e){return e.match(Ls)}const Xe=Te.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t:n})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:n("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return E.ReactNodeViewRenderer(Es,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:n})=>_t(e.src)?n.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:n})=>_t(e.src)?n.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[Te.nodePasteRule({find:Os,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",Te.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=Et;exports.RichTextTwitter=Cs;exports.Twitter=Xe;
@@ -1,2 +0,0 @@
1
- "use strict";const qt=require("@tiptap/pm/state"),Et=require("@tiptap/pm/view"),ee=require("./index-Bcj8cyOO.cjs"),It=["top","right","bottom","left"],Dt=["start","end"],Tt=It.reduce((t,e)=>t.concat(e,e+"-"+Dt[0],e+"-"+Dt[1]),[]),Y=Math.min,_=Math.max,lt=Math.round,j=t=>({x:t,y:t}),ne={left:"right",right:"left",bottom:"top",top:"bottom"};function yt(t,e,o){return _(t,Y(e,o))}function z(t,e){return typeof t=="function"?t(e):t}function F(t){return t.split("-")[0]}function I(t){return t.split("-")[1]}function Ht(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}function X(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Rt(t){return Ht(X(t))}function Vt(t,e,o){o===void 0&&(o=!1);const n=I(t),i=Rt(t),s=bt(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=ft(r)),[r,ft(r)]}function oe(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Lt=["left","right"],$t=["right","left"],ie=["top","bottom"],se=["bottom","top"];function re(t,e,o){switch(t){case"top":case"bottom":return o?e?$t:Lt:e?Lt:$t;case"left":case"right":return e?ie:se;default:return[]}}function ce(t,e,o,n){const i=I(t);let s=re(F(t),o==="start",n);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(at)))),s}function ft(t){const e=F(t);return ne[e]+t.slice(e.length)}function le(t){return{top:0,right:0,bottom:0,left:0,...t}}function St(t){return typeof t!="number"?le(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function Mt(t,e,o){let{reference:n,floating:i}=t;const s=X(e),r=Rt(e),c=bt(r),f=F(e),m=s==="y",u=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,h=n[c]/2-i[c]/2;let d;switch(f){case"top":d={x:u,y:n.y-i.height};break;case"bottom":d={x:u,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:l};break;case"left":d={x:n.x-i.width,y:l};break;default:d={x:n.x,y:n.y}}switch(I(e)){case"start":d[r]-=h*(o&&m?-1:1);break;case"end":d[r]+=h*(o&&m?-1:1);break}return d}async function ae(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:r,elements:c,strategy:f}=t,{boundary:m="clippingAncestors",rootBoundary:u="viewport",elementContext:l="floating",altBoundary:h=!1,padding:d=0}=z(e,t),p=St(d),w=c[h?l==="floating"?"reference":"floating":l],S=tt(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:m,rootBoundary:u,strategy:f})),R=l==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,g=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),A=await(s.isElement==null?void 0:s.isElement(g))?await(s.getScale==null?void 0:s.getScale(g))||{x:1,y:1}:{x:1,y:1},T=tt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:g,strategy:f}):R);return{top:(S.top-T.top+p.top)/A.y,bottom:(T.bottom-S.bottom+p.bottom)/A.y,left:(S.left-T.left+p.left)/A.x,right:(T.right-S.right+p.right)/A.x}}const fe=50,ue=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:r}=o,c=r.detectOverflow?r:{...r,detectOverflow:ae},f=await(r.isRTL==null?void 0:r.isRTL(e));let m=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:l}=Mt(m,n,f),h=n,d=0;const p={};for(let v=0;v<s.length;v++){const w=s[v];if(!w)continue;const{name:S,fn:R}=w,{x:g,y:A,data:T,reset:E}=await R({x:u,y:l,initialPlacement:n,placement:h,strategy:i,middlewareData:p,rects:m,platform:c,elements:{reference:t,floating:e}});u=g??u,l=A??l,p[S]={...p[S],...T},E&&d<fe&&(d++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(m=E.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:u,y:l}=Mt(m,h,f)),v=-1)}return{x:u,y:l,placement:h,strategy:i,middlewareData:p}},de=t=>({name:"arrow",options:t,async fn(e){const{x:o,y:n,placement:i,rects:s,platform:r,elements:c,middlewareData:f}=e,{element:m,padding:u=0}=z(t,e)||{};if(m==null)return{};const l=St(u),h={x:o,y:n},d=Rt(i),p=bt(d),v=await r.getDimensions(m),w=d==="y",S=w?"top":"left",R=w?"bottom":"right",g=w?"clientHeight":"clientWidth",A=s.reference[p]+s.reference[d]-h[d]-s.floating[p],T=h[d]-s.reference[d],E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(m));let M=E?E[g]:0;(!M||!await(r.isElement==null?void 0:r.isElement(E)))&&(M=c.floating[g]||s.floating[p]);const B=A/2-T/2,$=M/2-v[p]/2-1,a=Y(l[S],$),x=Y(l[R],$),O=a,C=M-v[p]-x,b=M/2-v[p]/2+B,P=yt(O,b,C),D=!f.arrow&&I(i)!=null&&b!==P&&s.reference[p]/2-(b<O?a:x)-v[p]/2<0,L=D?b<O?b-O:b-C:0;return{[d]:h[d]+L,data:{[d]:P,centerOffset:b-P-L,...D&&{alignmentOffset:L}},reset:D}}});function me(t,e,o){return(t?[...o.filter(i=>I(i)===t),...o.filter(i=>I(i)!==t)]:o.filter(i=>F(i)===i)).filter(i=>t?I(i)===t||(e?at(i)!==i:!1):!0)}const ge=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,n,i;const{rects:s,middlewareData:r,placement:c,platform:f,elements:m}=e,{crossAxis:u=!1,alignment:l,allowedPlacements:h=Tt,autoAlignment:d=!0,...p}=z(t,e),v=l!==void 0||h===Tt?me(l||null,d,h):h,w=await f.detectOverflow(e,p),S=((o=r.autoPlacement)==null?void 0:o.index)||0,R=v[S];if(R==null)return{};const g=Vt(R,s,await(f.isRTL==null?void 0:f.isRTL(m.floating)));if(c!==R)return{reset:{placement:v[0]}};const A=[w[F(R)],w[g[0]],w[g[1]]],T=[...((n=r.autoPlacement)==null?void 0:n.overflows)||[],{placement:R,overflows:A}],E=v[S+1];if(E)return{data:{index:S+1,overflows:T},reset:{placement:E}};const M=T.map(a=>{const x=I(a.placement);return[a.placement,x&&u?a.overflows.slice(0,2).reduce((O,C)=>O+C,0):a.overflows[0],a.overflows]}).sort((a,x)=>a[1]-x[1]),$=((i=M.filter(a=>a[2].slice(0,I(a[0])?2:3).every(x=>x<=0))[0])==null?void 0:i[0])||M[0][0];return $!==c?{data:{index:S+1,overflows:T},reset:{placement:$}}:{}}}},he=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;const{placement:i,middlewareData:s,rects:r,initialPlacement:c,platform:f,elements:m}=e,{mainAxis:u=!0,crossAxis:l=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...w}=z(t,e);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const S=F(i),R=X(c),g=F(c)===c,A=await(f.isRTL==null?void 0:f.isRTL(m.floating)),T=h||(g||!v?[ft(c)]:oe(c)),E=p!=="none";!h&&E&&T.push(...ce(c,v,p,A));const M=[c,...T],B=await f.detectOverflow(e,w),$=[];let a=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&$.push(B[S]),l){const b=Vt(i,r,A);$.push(B[b[0]],B[b[1]])}if(a=[...a,{placement:i,overflows:$}],!$.every(b=>b<=0)){var x,O;const b=(((x=s.flip)==null?void 0:x.index)||0)+1,P=M[b];if(P&&(!(l==="alignment"?R!==X(P):!1)||a.every(k=>X(k.placement)===R?k.overflows[0]>0:!0)))return{data:{index:b,overflows:a},reset:{placement:P}};let D=(O=a.filter(L=>L.overflows[0]<=0).sort((L,k)=>L.overflows[1]-k.overflows[1])[0])==null?void 0:O.placement;if(!D)switch(d){case"bestFit":{var C;const L=(C=a.filter(k=>{if(E){const y=X(k.placement);return y===R||y==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(y=>y>0).reduce((y,q)=>y+q,0)]).sort((k,y)=>k[1]-y[1])[0])==null?void 0:C[0];L&&(D=L);break}case"initialPlacement":D=c;break}if(i!==D)return{reset:{placement:D}}}return{}}}};function kt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _t(t){return It.some(e=>t[e]>=0)}const pe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:o,platform:n}=e,{strategy:i="referenceHidden",...s}=z(t,e);switch(i){case"referenceHidden":{const r=await n.detectOverflow(e,{...s,elementContext:"reference"}),c=kt(r,o.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:_t(c)}}}case"escaped":{const r=await n.detectOverflow(e,{...s,altBoundary:!0}),c=kt(r,o.floating);return{data:{escapedOffsets:c,escaped:_t(c)}}}default:return{}}}}};function Xt(t){const e=Y(...t.map(s=>s.left)),o=Y(...t.map(s=>s.top)),n=_(...t.map(s=>s.right)),i=_(...t.map(s=>s.bottom));return{x:e,y:o,width:n-e,height:i-o}}function we(t){const e=t.slice().sort((i,s)=>i.y-s.y),o=[];let n=null;for(let i=0;i<e.length;i++){const s=e[i];!n||s.y-n.y>n.height/2?o.push([s]):o[o.length-1].push(s),n=s}return o.map(i=>tt(Xt(i)))}const xe=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:o,elements:n,rects:i,platform:s,strategy:r}=e,{padding:c=2,x:f,y:m}=z(t,e),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),l=we(u),h=tt(Xt(u)),d=St(c);function p(){if(l.length===2&&l[0].left>l[1].right&&f!=null&&m!=null)return l.find(w=>f>w.left-d.left&&f<w.right+d.right&&m>w.top-d.top&&m<w.bottom+d.bottom)||h;if(l.length>=2){if(X(o)==="y"){const a=l[0],x=l[l.length-1],O=F(o)==="top",C=a.top,b=x.bottom,P=O?a.left:x.left,D=O?a.right:x.right,L=D-P,k=b-C;return{top:C,bottom:b,left:P,right:D,width:L,height:k,x:P,y:C}}const w=F(o)==="left",S=_(...l.map(a=>a.right)),R=Y(...l.map(a=>a.left)),g=l.filter(a=>w?a.left===R:a.right===S),A=g[0].top,T=g[g.length-1].bottom,E=R,M=S,B=M-E,$=T-A;return{top:A,bottom:T,left:E,right:M,width:B,height:$,x:E,y:A}}return h}const v=await s.getElementRects({reference:{getBoundingClientRect:p},floating:n.floating,strategy:r});return i.reference.x!==v.reference.x||i.reference.y!==v.reference.y||i.reference.width!==v.reference.width||i.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},ye=new Set(["left","top"]);async function ve(t,e){const{placement:o,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),r=F(o),c=I(o),f=X(o)==="y",m=ye.has(r)?-1:1,u=s&&f?-1:1,l=z(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return c&&typeof p=="number"&&(d=c==="end"?p*-1:p),f?{x:d*u,y:h*m}:{x:h*m,y:d*u}}const be=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;const{x:i,y:s,placement:r,middlewareData:c}=e,f=await ve(e,t);return r===((o=c.offset)==null?void 0:o.placement)&&(n=c.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},Re=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:n,placement:i,platform:s}=e,{mainAxis:r=!0,crossAxis:c=!1,limiter:f={fn:S=>{let{x:R,y:g}=S;return{x:R,y:g}}},...m}=z(t,e),u={x:o,y:n},l=await s.detectOverflow(e,m),h=X(F(i)),d=Ht(h);let p=u[d],v=u[h];if(r){const S=d==="y"?"top":"left",R=d==="y"?"bottom":"right",g=p+l[S],A=p-l[R];p=yt(g,p,A)}if(c){const S=h==="y"?"top":"left",R=h==="y"?"bottom":"right",g=v+l[S],A=v-l[R];v=yt(g,v,A)}const w=f.fn({...e,[d]:p,[h]:v});return{...w,data:{x:w.x-o,y:w.y-n,enabled:{[d]:r,[h]:c}}}}}},Se=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var o,n;const{placement:i,rects:s,platform:r,elements:c}=e,{apply:f=()=>{},...m}=z(t,e),u=await r.detectOverflow(e,m),l=F(i),h=I(i),d=X(i)==="y",{width:p,height:v}=s.floating;let w,S;l==="top"||l==="bottom"?(w=l,S=h===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(S=l,w=h==="end"?"top":"bottom");const R=v-u.top-u.bottom,g=p-u.left-u.right,A=Y(v-u[w],R),T=Y(p-u[S],g),E=!e.middlewareData.shift;let M=A,B=T;if((o=e.middlewareData.shift)!=null&&o.enabled.x&&(B=g),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(M=R),E&&!h){const a=_(u.left,0),x=_(u.right,0),O=_(u.top,0),C=_(u.bottom,0);d?B=p-2*(a!==0||x!==0?a+x:_(u.left,u.right)):M=v-2*(O!==0||C!==0?O+C:_(u.top,u.bottom))}await f({...e,availableWidth:B,availableHeight:M});const $=await r.getDimensions(c.floating);return p!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return jt(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function K(t){var e;return(e=(jt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jt(t){return ut()?t instanceof Node||t instanceof W(t).Node:!1}function H(t){return ut()?t instanceof Element||t instanceof W(t).Element:!1}function U(t){return ut()?t instanceof HTMLElement||t instanceof W(t).HTMLElement:!1}function Bt(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof W(t).ShadowRoot}function st(t){const{overflow:e,overflowX:o,overflowY:n,display:i}=V(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+o)&&i!=="inline"&&i!=="contents"}function Oe(t){return/^(table|td|th)$/.test(nt(t))}function dt(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Ae=/transform|translate|scale|rotate|perspective|filter/,Ce=/paint|layout|strict|content/,J=t=>!!t&&t!=="none";let wt;function Ot(t){const e=H(t)?V(t):t;return J(e.transform)||J(e.translate)||J(e.scale)||J(e.rotate)||J(e.perspective)||!At()&&(J(e.backdropFilter)||J(e.filter))||Ae.test(e.willChange||"")||Ce.test(e.contain||"")}function Pe(t){let e=G(t);for(;U(e)&&!et(e);){if(Ot(e))return e;if(dt(e))return null;e=G(e)}return null}function At(){return wt==null&&(wt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wt}function et(t){return/^(html|body|#document)$/.test(nt(t))}function V(t){return W(t).getComputedStyle(t)}function mt(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Bt(t)&&t.host||K(t);return Bt(e)?e.host:e}function Yt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:U(e)&&st(e)?e:Yt(e)}function zt(t,e,o){var n;e===void 0&&(e=[]);const i=Yt(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),r=W(i);return s?(vt(r),e.concat(r,r.visualViewport||[],st(i)?i:[],[])):e.concat(i,zt(i,[]))}function vt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Kt(t){const e=V(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=U(t),s=i?t.offsetWidth:o,r=i?t.offsetHeight:n,c=lt(o)!==s||lt(n)!==r;return c&&(o=s,n=r),{width:o,height:n,$:c}}function Ut(t){return H(t)?t:t.contextElement}function Z(t){const e=Ut(t);if(!U(e))return j(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:s}=Kt(e);let r=(s?lt(o.width):o.width)/n,c=(s?lt(o.height):o.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Ee=j(0);function Gt(t){const e=W(t);return!At()||!e.visualViewport?Ee:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function De(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==W(t)?!1:e}function it(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),s=Ut(t);let r=j(1);e&&(n?H(n)&&(r=Z(n)):r=Z(t));const c=De(s,o,n)?Gt(s):j(0);let f=(i.left+c.x)/r.x,m=(i.top+c.y)/r.y,u=i.width/r.x,l=i.height/r.y;if(s){const h=W(s),d=n&&H(n)?W(n):n;let p=h,v=vt(p);for(;v&&n&&d!==p;){const w=Z(v),S=v.getBoundingClientRect(),R=V(v),g=S.left+(v.clientLeft+parseFloat(R.paddingLeft))*w.x,A=S.top+(v.clientTop+parseFloat(R.paddingTop))*w.y;f*=w.x,m*=w.y,u*=w.x,l*=w.y,f+=g,m+=A,p=W(v),v=vt(p)}}return tt({width:u,height:l,x:f,y:m})}function gt(t,e){const o=mt(t).scrollLeft;return e?e.left+o:it(K(t)).left+o}function Jt(t,e){const o=t.getBoundingClientRect(),n=o.left+e.scrollLeft-gt(t,o),i=o.top+e.scrollTop;return{x:n,y:i}}function Te(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const s=i==="fixed",r=K(n),c=e?dt(e.floating):!1;if(n===r||c&&s)return o;let f={scrollLeft:0,scrollTop:0},m=j(1);const u=j(0),l=U(n);if((l||!l&&!s)&&((nt(n)!=="body"||st(r))&&(f=mt(n)),l)){const d=it(n);m=Z(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}const h=r&&!l&&!s?Jt(r,f):j(0);return{width:o.width*m.x,height:o.height*m.y,x:o.x*m.x-f.scrollLeft*m.x+u.x+h.x,y:o.y*m.y-f.scrollTop*m.y+u.y+h.y}}function Le(t){return Array.from(t.getClientRects())}function $e(t){const e=K(t),o=mt(t),n=t.ownerDocument.body,i=_(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=_(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let r=-o.scrollLeft+gt(t);const c=-o.scrollTop;return V(n).direction==="rtl"&&(r+=_(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:r,y:c}}const Nt=25;function Me(t,e){const o=W(t),n=K(t),i=o.visualViewport;let s=n.clientWidth,r=n.clientHeight,c=0,f=0;if(i){s=i.width,r=i.height;const u=At();(!u||u&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const m=gt(n);if(m<=0){const u=n.ownerDocument,l=u.body,h=getComputedStyle(l),d=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,p=Math.abs(n.clientWidth-l.clientWidth-d);p<=Nt&&(s-=p)}else m<=Nt&&(s+=m);return{width:s,height:r,x:c,y:f}}function ke(t,e){const o=it(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,s=U(t)?Z(t):j(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,f=i*s.x,m=n*s.y;return{width:r,height:c,x:f,y:m}}function Wt(t,e,o){let n;if(e==="viewport")n=Me(t,o);else if(e==="document")n=$e(K(t));else if(H(e))n=ke(e,o);else{const i=Gt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(n)}function Qt(t,e){const o=G(t);return o===e||!H(o)||et(o)?!1:V(o).position==="fixed"||Qt(o,e)}function _e(t,e){const o=e.get(t);if(o)return o;let n=zt(t,[]).filter(c=>H(c)&&nt(c)!=="body"),i=null;const s=V(t).position==="fixed";let r=s?G(t):t;for(;H(r)&&!et(r);){const c=V(r),f=Ot(r);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||st(r)&&!f&&Qt(t,r))?n=n.filter(u=>u!==r):i=c,r=G(r)}return e.set(t,n),n}function Be(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const r=[...o==="clippingAncestors"?dt(e)?[]:_e(e,this._c):[].concat(o),n],c=Wt(e,r[0],i);let f=c.top,m=c.right,u=c.bottom,l=c.left;for(let h=1;h<r.length;h++){const d=Wt(e,r[h],i);f=_(d.top,f),m=Y(d.right,m),u=Y(d.bottom,u),l=_(d.left,l)}return{width:m-l,height:u-f,x:l,y:f}}function Ne(t){const{width:e,height:o}=Kt(t);return{width:e,height:o}}function We(t,e,o){const n=U(e),i=K(e),s=o==="fixed",r=it(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const f=j(0);function m(){f.x=gt(i)}if(n||!n&&!s)if((nt(e)!=="body"||st(i))&&(c=mt(e)),n){const d=it(e,!0,s,e);f.x=d.x+e.clientLeft,f.y=d.y+e.clientTop}else i&&m();s&&!n&&i&&m();const u=i&&!n&&!s?Jt(i,c):j(0),l=r.left+c.scrollLeft-f.x-u.x,h=r.top+c.scrollTop-f.y-u.y;return{x:l,y:h,width:r.width,height:r.height}}function xt(t){return V(t).position==="static"}function Ft(t,e){if(!U(t)||V(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return K(t)===o&&(o=o.ownerDocument.body),o}function Zt(t,e){const o=W(t);if(dt(t))return o;if(!U(t)){let i=G(t);for(;i&&!et(i);){if(H(i)&&!xt(i))return i;i=G(i)}return o}let n=Ft(t,e);for(;n&&Oe(n)&&xt(n);)n=Ft(n,e);return n&&et(n)&&xt(n)&&!Ot(n)?o:n||Pe(t)||o}const Fe=async function(t){const e=this.getOffsetParent||Zt,o=this.getDimensions,n=await o(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qe(t){return V(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:Te,getDocumentElement:K,getClippingRect:Be,getOffsetParent:Zt,getElementRects:Fe,getClientRects:Le,getDimensions:Ne,getScale:Z,isElement:H,isRTL:qe},He=be,Ve=ge,Xe=Re,je=he,Ye=Se,ze=pe,Ke=de,Ue=xe,Ge=(t,e,o)=>{const n=new Map,i={platform:Ie,...o},s={...i.platform,_c:n};return ue(t,e,{...i,platform:s})};function Je(t){var e;const{char:o,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:r,$position:c}=t,f=n&&!i,m=ee.escapeForRegEx(o),u=new RegExp(`\\s${m}$`),l=r?"^":"",h=i?"":m,d=f?new RegExp(`${l}${m}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${l}(?:^)?${m}[^\\s${h}]*`,"gm"),p=((e=c.nodeBefore)==null?void 0:e.isText)&&c.nodeBefore.text;if(!p)return null;const v=c.pos-p.length,w=Array.from(p.matchAll(d)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const S=w.input.slice(Math.max(0,w.index-1),w.index),R=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(S);if(s!==null&&!R)return null;const g=v+w.index;let A=g+w[0].length;return f&&u.test(p.slice(A-1,A+1))&&(w[0]+=" ",A+=1),g<c.pos&&A>=c.pos?{range:{from:g,to:A},query:w[0].slice(o.length),text:w[0]}:null}function Qe(t){return t.docChanged?t.steps.some(e=>{const o=e.slice;if(!(o!=null&&o.content))return!1;const n=o.content.textBetween(0,o.content.size,`
2
- `);return/\s/.test(n)}):!1}var Ze=new qt.PluginKey("suggestion");function tn({pluginKey:t=Ze,editor:e,char:o="@",allowSpaces:n=!1,allowToIncludeChar:i=!1,allowedPrefixes:s=[" "],startOfLine:r=!1,decorationTag:c="span",decorationClass:f="suggestion",decorationContent:m="",decorationEmptyClass:u="is-empty",command:l=()=>null,items:h=()=>[],render:d=()=>({}),allow:p=()=>!0,findSuggestionMatch:v=Je,shouldShow:w,shouldResetDismissed:S}){let R;const g=d==null?void 0:d(),A=n&&!i,T=()=>{const a=e.state.selection.$anchor.pos,x=e.view.coordsAtPos(a),{top:O,right:C,bottom:b,left:P}=x;try{return new DOMRect(P,O,C-P,b-O)}catch{return null}},E=(a,x)=>x?()=>{const O=t.getState(e.state),C=O==null?void 0:O.decorationId,b=a.dom.querySelector(`[data-decoration-id="${C}"]`);return(b==null?void 0:b.getBoundingClientRect())||null}:T,M=({match:a,dismissedRange:x,state:O,transaction:C})=>S!=null&&S({editor:e,state:O,range:x,match:a,transaction:C,allowSpaces:A})?!1:A?a.range.from===x.from:a.range.from===x.from&&!Qe(C);function B(a,x){var O;try{const b=t.getState(a.state),P=b!=null&&b.decorationId?a.dom.querySelector(`[data-decoration-id="${b.decorationId}"]`):null,D={editor:e,range:(b==null?void 0:b.range)||{from:0,to:0},query:(b==null?void 0:b.query)||null,text:(b==null?void 0:b.text)||null,items:[],command:L=>l({editor:e,range:(b==null?void 0:b.range)||{from:0,to:0},props:L}),decorationNode:P,clientRect:E(a,P)};(O=g==null?void 0:g.onExit)==null||O.call(g,D)}catch{}const C=a.state.tr.setMeta(x,{exit:!0});a.dispatch(C)}const $=new qt.Plugin({key:t,view(){return{update:async(a,x)=>{var O,C,b,P,D,L,k;const y=(O=this.key)==null?void 0:O.getState(x),q=(C=this.key)==null?void 0:C.getState(a.state),N=y.active&&q.active&&y.range.from!==q.range.from,rt=!y.active&&q.active,Ct=y.active&&!q.active,ht=!rt&&!Ct&&y.query!==q.query,ot=rt||N&&ht,ct=ht||N,pt=Ct||N&&ht;if(!ot&&!ct&&!pt)return;const Q=pt&&!ot?y:q,Pt=a.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`);R={editor:e,range:Q.range,query:Q.query,text:Q.text,items:[],command:te=>l({editor:e,range:Q.range,props:te}),decorationNode:Pt,clientRect:E(a,Pt)},ot&&((b=g==null?void 0:g.onBeforeStart)==null||b.call(g,R)),ct&&((P=g==null?void 0:g.onBeforeUpdate)==null||P.call(g,R)),(ct||ot)&&(R.items=await h({editor:e,query:Q.query})),pt&&((D=g==null?void 0:g.onExit)==null||D.call(g,R)),ct&&((L=g==null?void 0:g.onUpdate)==null||L.call(g,R)),ot&&((k=g==null?void 0:g.onStart)==null||k.call(g,R))},destroy:()=>{var a;R&&((a=g==null?void 0:g.onExit)==null||a.call(g,R))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(a,x,O,C){const{isEditable:b}=e,{composing:P}=e.view,{selection:D}=a,{empty:L,from:k}=D,y={...x},q=a.getMeta(t);if(q&&q.exit)return y.active=!1,y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null,y.dismissedRange=x.active?{...x.range}:x.dismissedRange,y;if(y.composing=P,a.docChanged&&y.dismissedRange!==null&&(y.dismissedRange={from:a.mapping.map(y.dismissedRange.from),to:a.mapping.map(y.dismissedRange.to)}),b&&(L||e.view.composing)){(k<x.range.from||k>x.range.to)&&!P&&!x.composing&&(y.active=!1);const N=v({char:o,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:s,startOfLine:r,$position:D.$from}),rt=`id_${Math.floor(Math.random()*4294967295)}`;N&&p({editor:e,state:C,range:N.range,isActive:x.active})&&(!w||w({editor:e,range:N.range,query:N.query,text:N.text,transaction:a}))?(y.dismissedRange!==null&&!M({match:N,dismissedRange:y.dismissedRange,state:C,transaction:a})&&(y.dismissedRange=null),y.dismissedRange===null?(y.active=!0,y.decorationId=x.decorationId?x.decorationId:rt,y.range=N.range,y.query=N.query,y.text=N.text):y.active=!1):(N||(y.dismissedRange=null),y.active=!1)}else y.active=!1;return y.active||(y.decorationId=null,y.range={from:0,to:0},y.query=null,y.text=null),y}},props:{handleKeyDown(a,x){var O,C;const{active:b,range:P}=$.getState(a.state);if(!b)return!1;if(x.key==="Escape"||x.key==="Esc"){const L=$.getState(a.state);return(O=g==null?void 0:g.onKeyDown)==null||O.call(g,{view:a,event:x,range:L.range}),B(a,t),!0}return((C=g==null?void 0:g.onKeyDown)==null?void 0:C.call(g,{view:a,event:x,range:P}))||!1},decorations(a){const{active:x,range:O,decorationId:C,query:b}=$.getState(a);if(!x)return null;const P=!(b!=null&&b.length),D=[f];return P&&D.push(u),Et.DecorationSet.create(a.doc,[Et.Decoration.inline(O.from,O.to,{nodeName:c,class:D.join(" "),"data-decoration-id":C,"data-decoration-content":m})])}}});return $}exports.Suggestion=tn;exports.arrow=Ke;exports.autoPlacement=Ve;exports.computePosition=Ge;exports.flip=je;exports.hide=ze;exports.inline=Ue;exports.offset=He;exports.shift=Xe;exports.size=Ye;