@remarkablejames/editor 0.0.1

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 (456) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/lib/ActionMenuButton-B0EHT9CC.js +35 -0
  4. package/lib/ActionMenuButton-J1el_e6Z.cjs +1 -0
  5. package/lib/Attachment.cjs +19 -0
  6. package/lib/Attachment.js +273 -0
  7. package/lib/Blockquote.cjs +5 -0
  8. package/lib/Blockquote.js +107 -0
  9. package/lib/Bold.cjs +1 -0
  10. package/lib/Bold.js +123 -0
  11. package/lib/BulletList.cjs +1 -0
  12. package/lib/BulletList.js +53 -0
  13. package/lib/Callout.cjs +1 -0
  14. package/lib/Callout.js +225 -0
  15. package/lib/Clear.cjs +1 -0
  16. package/lib/Clear.js +49 -0
  17. package/lib/Code.cjs +1 -0
  18. package/lib/Code.js +100 -0
  19. package/lib/CodeBlock.cjs +44 -0
  20. package/lib/CodeBlock.js +4065 -0
  21. package/lib/CodeView.cjs +1 -0
  22. package/lib/CodeView.js +81 -0
  23. package/lib/Color.cjs +1 -0
  24. package/lib/Color.js +134 -0
  25. package/lib/Column.cjs +1 -0
  26. package/lib/Column.js +230 -0
  27. package/lib/Drawer-BCWVN-4l.js +1125 -0
  28. package/lib/Drawer-BTouEroZ.cjs +2 -0
  29. package/lib/Drawer.cjs +1 -0
  30. package/lib/Drawer.js +7 -0
  31. package/lib/Emoji.cjs +1 -0
  32. package/lib/Emoji.js +19888 -0
  33. package/lib/Excalidraw.cjs +1 -0
  34. package/lib/Excalidraw.js +276 -0
  35. package/lib/ExportPdf.cjs +39 -0
  36. package/lib/ExportPdf.js +142 -0
  37. package/lib/ExportWord.cjs +1 -0
  38. package/lib/ExportWord.js +107 -0
  39. package/lib/FontFamily.cjs +1 -0
  40. package/lib/FontFamily.js +84 -0
  41. package/lib/FontSize.cjs +1 -0
  42. package/lib/FontSize.js +106 -0
  43. package/lib/Heading.cjs +1 -0
  44. package/lib/Heading.js +167 -0
  45. package/lib/Highlight.cjs +1 -0
  46. package/lib/Highlight.js +203 -0
  47. package/lib/History.cjs +1 -0
  48. package/lib/History.js +990 -0
  49. package/lib/HorizontalRule.cjs +1 -0
  50. package/lib/HorizontalRule.js +118 -0
  51. package/lib/Iframe-BdgiWGml.js +416 -0
  52. package/lib/Iframe-BfBLILDA.cjs +1 -0
  53. package/lib/Iframe.cjs +1 -0
  54. package/lib/Iframe.js +7 -0
  55. package/lib/Image.cjs +1 -0
  56. package/lib/Image.js +6 -0
  57. package/lib/ImageGif.cjs +1 -0
  58. package/lib/ImageGif.js +400 -0
  59. package/lib/ImportWord.cjs +1 -0
  60. package/lib/ImportWord.js +145 -0
  61. package/lib/Indent-BpMcZKok.js +148 -0
  62. package/lib/Indent-Dvqz_WEn.cjs +1 -0
  63. package/lib/Indent.cjs +1 -0
  64. package/lib/Indent.js +6 -0
  65. package/lib/Italic.cjs +1 -0
  66. package/lib/Italic.js +123 -0
  67. package/lib/Katex-B8_uprkO.js +2753 -0
  68. package/lib/Katex-BQyeCeQ0.cjs +4 -0
  69. package/lib/Katex.cjs +1 -0
  70. package/lib/Katex.js +6 -0
  71. package/lib/LineHeight.cjs +1 -0
  72. package/lib/LineHeight.js +89 -0
  73. package/lib/Link.cjs +1 -0
  74. package/lib/Link.js +6 -0
  75. package/lib/LinkEditBlock-BX0fXXpF.js +1185 -0
  76. package/lib/LinkEditBlock-CIshn_8F.cjs +5 -0
  77. package/lib/Mention.cjs +1 -0
  78. package/lib/Mention.js +265 -0
  79. package/lib/Mermaid-0GiGVxn0.cjs +2 -0
  80. package/lib/Mermaid-D8bbIgAl.js +381 -0
  81. package/lib/Mermaid.cjs +1 -0
  82. package/lib/Mermaid.js +7 -0
  83. package/lib/MoreMark.cjs +1 -0
  84. package/lib/MoreMark.js +157 -0
  85. package/lib/OrderedList.cjs +1 -0
  86. package/lib/OrderedList.js +52 -0
  87. package/lib/SearchAndReplace.cjs +1 -0
  88. package/lib/SearchAndReplace.js +305 -0
  89. package/lib/SlashCommand.cjs +1 -0
  90. package/lib/SlashCommand.js +90 -0
  91. package/lib/SlashCommandNodeView-BcmtKbEE.js +249 -0
  92. package/lib/SlashCommandNodeView-rDJ7OjRd.cjs +1 -0
  93. package/lib/Strike.cjs +1 -0
  94. package/lib/Strike.js +112 -0
  95. package/lib/Table-BEhNBeuA.cjs +5 -0
  96. package/lib/Table-DbxuP5xh.js +1939 -0
  97. package/lib/Table.cjs +1 -0
  98. package/lib/Table.js +5 -0
  99. package/lib/TaskList.cjs +1 -0
  100. package/lib/TaskList.js +63 -0
  101. package/lib/TextAlign.cjs +1 -0
  102. package/lib/TextAlign.js +165 -0
  103. package/lib/TextDirection.cjs +1 -0
  104. package/lib/TextDirection.js +110 -0
  105. package/lib/TextUnderline.cjs +1 -0
  106. package/lib/TextUnderline.js +115 -0
  107. package/lib/Twitter-9I6BLNmg.js +1666 -0
  108. package/lib/Twitter-BuEBgpi9.cjs +1 -0
  109. package/lib/Twitter.cjs +1 -0
  110. package/lib/Twitter.js +6 -0
  111. package/lib/Video.cjs +1 -0
  112. package/lib/Video.js +7 -0
  113. package/lib/bubble.cjs +3 -0
  114. package/lib/bubble.d.ts +1 -0
  115. package/lib/bubble.js +9533 -0
  116. package/lib/clsx-CDyrfCnw.js +7391 -0
  117. package/lib/clsx-CXbNJWDD.cjs +54 -0
  118. package/lib/components/ActionButton.d.ts +23 -0
  119. package/lib/components/ActionMenuButton.d.ts +28 -0
  120. package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
  121. package/lib/components/Bubble/RichTextBubbleColumns.d.ts +1 -0
  122. package/lib/components/Bubble/RichTextBubbleDrawer.d.ts +1 -0
  123. package/lib/components/Bubble/RichTextBubbleExcalidraw.d.ts +1 -0
  124. package/lib/components/Bubble/RichTextBubbleIframe.d.ts +1 -0
  125. package/lib/components/Bubble/RichTextBubbleKatex.d.ts +1 -0
  126. package/lib/components/Bubble/RichTextBubbleLink.d.ts +6 -0
  127. package/lib/components/Bubble/RichTextBubbleMedia.d.ts +4 -0
  128. package/lib/components/Bubble/RichTextBubbleMenuDragHandle.d.ts +1 -0
  129. package/lib/components/Bubble/RichTextBubbleMermaid.d.ts +1 -0
  130. package/lib/components/Bubble/RichTextBubbleTable.d.ts +5 -0
  131. package/lib/components/Bubble/RichTextBubbleText.d.ts +5 -0
  132. package/lib/components/Bubble/RichTextBubbleTwitter.d.ts +1 -0
  133. package/lib/components/Bubble/formatBubble.d.ts +55 -0
  134. package/lib/components/Bubble/index.d.ts +13 -0
  135. package/lib/components/ColorPicker.d.ts +11 -0
  136. package/lib/components/ReactBus.d.ts +11 -0
  137. package/lib/components/RichTextProvider.d.ts +8 -0
  138. package/lib/components/SizeSetter/SizeSetter.d.ts +13 -0
  139. package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
  140. package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
  141. package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
  142. package/lib/components/icons/Activity.d.ts +2 -0
  143. package/lib/components/icons/Animas.d.ts +2 -0
  144. package/lib/components/icons/AspectRatio.d.ts +2 -0
  145. package/lib/components/icons/Blockquote.d.ts +2 -0
  146. package/lib/components/icons/CodeView.d.ts +1 -0
  147. package/lib/components/icons/ColumnAddLeft.d.ts +1 -0
  148. package/lib/components/icons/ColumnAddRight.d.ts +1 -0
  149. package/lib/components/icons/DeleteColumn.d.ts +2 -0
  150. package/lib/components/icons/DeleteRow.d.ts +2 -0
  151. package/lib/components/icons/Direction.d.ts +1 -0
  152. package/lib/components/icons/Excalidraw.d.ts +1 -0
  153. package/lib/components/icons/ExportPdf.d.ts +1 -0
  154. package/lib/components/icons/ExportWord.d.ts +2 -0
  155. package/lib/components/icons/FileWordOutline.d.ts +2 -0
  156. package/lib/components/icons/Flag.d.ts +2 -0
  157. package/lib/components/icons/Food.d.ts +2 -0
  158. package/lib/components/icons/GIfIcon.d.ts +1 -0
  159. package/lib/components/icons/Html.d.ts +1 -0
  160. package/lib/components/icons/Icon.d.ts +8 -0
  161. package/lib/components/icons/IconColorFill.d.ts +5 -0
  162. package/lib/components/icons/IconHighlightFill.d.ts +3 -0
  163. package/lib/components/icons/ImportWord.d.ts +2 -0
  164. package/lib/components/icons/LeftToRight.d.ts +1 -0
  165. package/lib/components/icons/LineHeight.d.ts +2 -0
  166. package/lib/components/icons/MenuDown.d.ts +2 -0
  167. package/lib/components/icons/Mermaid.d.ts +1 -0
  168. package/lib/components/icons/NoFill.d.ts +1 -0
  169. package/lib/components/icons/Object.d.ts +2 -0
  170. package/lib/components/icons/RightToLeft.d.ts +1 -0
  171. package/lib/components/icons/SizeL.d.ts +2 -0
  172. package/lib/components/icons/SizeM.d.ts +2 -0
  173. package/lib/components/icons/SizeS.d.ts +2 -0
  174. package/lib/components/icons/Symbol.d.ts +2 -0
  175. package/lib/components/icons/Travel.d.ts +2 -0
  176. package/lib/components/icons/Twitter.d.ts +1 -0
  177. package/lib/components/icons/icons.d.ts +1 -0
  178. package/lib/components/icons/index.d.ts +12 -0
  179. package/lib/components/index.d.ts +6 -0
  180. package/lib/components/ui/button.d.ts +11 -0
  181. package/lib/components/ui/checkbox.d.ts +4 -0
  182. package/lib/components/ui/dialog.d.ts +19 -0
  183. package/lib/components/ui/dropdown-menu.d.ts +27 -0
  184. package/lib/components/ui/emoji-picker.d.ts +7 -0
  185. package/lib/components/ui/index.d.ts +15 -0
  186. package/lib/components/ui/input.d.ts +5 -0
  187. package/lib/components/ui/label.d.ts +5 -0
  188. package/lib/components/ui/popover.d.ts +6 -0
  189. package/lib/components/ui/select.d.ts +13 -0
  190. package/lib/components/ui/separator.d.ts +4 -0
  191. package/lib/components/ui/switch.d.ts +4 -0
  192. package/lib/components/ui/tabs.d.ts +7 -0
  193. package/lib/components/ui/textarea.d.ts +5 -0
  194. package/lib/components/ui/toast.d.ts +15 -0
  195. package/lib/components/ui/toaster.d.ts +1 -0
  196. package/lib/components/ui/toggle.d.ts +12 -0
  197. package/lib/components/ui/tooltip.d.ts +7 -0
  198. package/lib/components/ui/use-toast.d.ts +44 -0
  199. package/lib/constants/index.d.ts +47 -0
  200. package/lib/constants/resetCSS.d.ts +1 -0
  201. package/lib/delete-node-CosiBes5.cjs +1 -0
  202. package/lib/delete-node-eQHsyyhR.js +24 -0
  203. package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
  204. package/lib/dom-dataset-CIEeltF6.js +47 -0
  205. package/lib/dropdown-menu-Bs69ZBbO.js +143 -0
  206. package/lib/dropdown-menu-DjWlG2-J.cjs +1 -0
  207. package/lib/extensions/Attachment/Attachment.d.ts +15 -0
  208. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIcon.d.ts +1 -0
  209. package/lib/extensions/Attachment/components/NodeViewAttachment/FileIconString.d.ts +1 -0
  210. package/lib/extensions/Attachment/components/NodeViewAttachment/NodeViewAttachment.d.ts +1 -0
  211. package/lib/extensions/Attachment/components/RichTextAttachment.d.ts +1 -0
  212. package/lib/extensions/Attachment/index.d.ts +1 -0
  213. package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
  214. package/lib/extensions/Blockquote/components/RichTextBlockquote.d.ts +1 -0
  215. package/lib/extensions/Blockquote/index.d.ts +1 -0
  216. package/lib/extensions/Bold/Bold.d.ts +6 -0
  217. package/lib/extensions/Bold/components/RichTextBold.d.ts +1 -0
  218. package/lib/extensions/Bold/index.d.ts +1 -0
  219. package/lib/extensions/BulletList/BulletList.d.ts +6 -0
  220. package/lib/extensions/BulletList/components/RichTextBulletList.d.ts +1 -0
  221. package/lib/extensions/BulletList/index.d.ts +1 -0
  222. package/lib/extensions/Callout/Callout.d.ts +18 -0
  223. package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
  224. package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
  225. package/lib/extensions/Callout/index.d.ts +1 -0
  226. package/lib/extensions/Clear/Clear.d.ts +6 -0
  227. package/lib/extensions/Clear/components/RichTextClear.d.ts +1 -0
  228. package/lib/extensions/Clear/index.d.ts +1 -0
  229. package/lib/extensions/Code/Code.d.ts +6 -0
  230. package/lib/extensions/Code/components/RichTextCode.d.ts +1 -0
  231. package/lib/extensions/Code/index.d.ts +1 -0
  232. package/lib/extensions/CodeBlock/CodeBlock.d.ts +21 -0
  233. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +1 -0
  234. package/lib/extensions/CodeBlock/components/RichTextCodeBlock.d.ts +1 -0
  235. package/lib/extensions/CodeBlock/index.d.ts +1 -0
  236. package/lib/extensions/CodeView/CodeView.d.ts +17 -0
  237. package/lib/extensions/CodeView/components/RichTextCodeView.d.ts +1 -0
  238. package/lib/extensions/CodeView/index.d.ts +1 -0
  239. package/lib/extensions/Color/Color.d.ts +22 -0
  240. package/lib/extensions/Color/components/RichTextColor.d.ts +1 -0
  241. package/lib/extensions/Color/index.d.ts +1 -0
  242. package/lib/extensions/Column/Column.d.ts +17 -0
  243. package/lib/extensions/Column/components/RichTextColumn.d.ts +1 -0
  244. package/lib/extensions/Column/index.d.ts +1 -0
  245. package/lib/extensions/Drawer/Drawer.d.ts +15 -0
  246. package/lib/extensions/Drawer/components/ControlDrawer/ControlDrawer.d.ts +2 -0
  247. package/lib/extensions/Drawer/components/ControlDrawer/icon.d.ts +28 -0
  248. package/lib/extensions/Drawer/components/EditDrawerBlock.d.ts +1 -0
  249. package/lib/extensions/Drawer/components/NodeViewDrawer/NodeViewDrawer.d.ts +1 -0
  250. package/lib/extensions/Drawer/components/RichTextDrawer.d.ts +1 -0
  251. package/lib/extensions/Drawer/index.d.ts +1 -0
  252. package/lib/extensions/Emoji/Emoji.d.ts +5 -0
  253. package/lib/extensions/Emoji/components/EmojiList/EmojiNodeView.d.ts +11 -0
  254. package/lib/extensions/Emoji/components/RichTextEmoji.d.ts +1 -0
  255. package/lib/extensions/Emoji/index.d.ts +1 -0
  256. package/lib/extensions/Excalidraw/Excalidraw.d.ts +17 -0
  257. package/lib/extensions/Excalidraw/components/NodeViewExcalidraw/NodeViewExcalidraw.d.ts +2 -0
  258. package/lib/extensions/Excalidraw/components/RichTextExcalidraw.d.ts +1 -0
  259. package/lib/extensions/Excalidraw/index.d.ts +1 -0
  260. package/lib/extensions/ExportPdf/ExportPdf.d.ts +21 -0
  261. package/lib/extensions/ExportPdf/components/RichTextExportPdf.d.ts +1 -0
  262. package/lib/extensions/ExportPdf/index.d.ts +1 -0
  263. package/lib/extensions/ExportWord/ExportWord.d.ts +13 -0
  264. package/lib/extensions/ExportWord/components/RichTextExportWord.d.ts +1 -0
  265. package/lib/extensions/ExportWord/index.d.ts +1 -0
  266. package/lib/extensions/FontFamily/FontFamily.d.ts +10 -0
  267. package/lib/extensions/FontFamily/components/RichTextFontFamily.d.ts +15 -0
  268. package/lib/extensions/FontFamily/index.d.ts +1 -0
  269. package/lib/extensions/FontSize/FontSize.d.ts +32 -0
  270. package/lib/extensions/FontSize/components/RichTextFontSize.d.ts +12 -0
  271. package/lib/extensions/FontSize/index.d.ts +1 -0
  272. package/lib/extensions/Heading/Heading.d.ts +6 -0
  273. package/lib/extensions/Heading/components/RichTextHeading.d.ts +15 -0
  274. package/lib/extensions/Heading/index.d.ts +1 -0
  275. package/lib/extensions/Highlight/Highlight.d.ts +18 -0
  276. package/lib/extensions/Highlight/components/RichTextHighlight.d.ts +1 -0
  277. package/lib/extensions/Highlight/index.d.ts +1 -0
  278. package/lib/extensions/History/History.d.ts +6 -0
  279. package/lib/extensions/History/components/RichTextHistory.d.ts +2 -0
  280. package/lib/extensions/History/index.d.ts +1 -0
  281. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
  282. package/lib/extensions/HorizontalRule/components/RichTextHorizontalRule.d.ts +1 -0
  283. package/lib/extensions/HorizontalRule/index.d.ts +1 -0
  284. package/lib/extensions/Iframe/Iframe.d.ts +16 -0
  285. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
  286. package/lib/extensions/Iframe/components/RichTextIframe.d.ts +1 -0
  287. package/lib/extensions/Iframe/index.d.ts +1 -0
  288. package/lib/extensions/Iframe/utils.d.ts +9 -0
  289. package/lib/extensions/Image/Image.d.ts +64 -0
  290. package/lib/extensions/Image/components/ImageCropper.d.ts +1 -0
  291. package/lib/extensions/Image/components/ImageView.d.ts +2 -0
  292. package/lib/extensions/Image/components/RichTextImage.d.ts +1 -0
  293. package/lib/extensions/Image/index.d.ts +1 -0
  294. package/lib/extensions/ImageGif/ImageGif.d.ts +39 -0
  295. package/lib/extensions/ImageGif/components/ImageGifView.d.ts +2 -0
  296. package/lib/extensions/ImageGif/components/RichTextImageGif.d.ts +1 -0
  297. package/lib/extensions/ImageGif/components/services.d.ts +458 -0
  298. package/lib/extensions/ImageGif/index.d.ts +1 -0
  299. package/lib/extensions/ImportWord/ImportWord.d.ts +18 -0
  300. package/lib/extensions/ImportWord/components/RichTextImportWord.d.ts +1 -0
  301. package/lib/extensions/ImportWord/index.d.ts +1 -0
  302. package/lib/extensions/Indent/Indent.d.ts +23 -0
  303. package/lib/extensions/Indent/components/RichTextIndent.d.ts +1 -0
  304. package/lib/extensions/Indent/index.d.ts +1 -0
  305. package/lib/extensions/Italic/Italic.d.ts +6 -0
  306. package/lib/extensions/Italic/components/RichTextItalic.d.ts +1 -0
  307. package/lib/extensions/Italic/index.d.ts +1 -0
  308. package/lib/extensions/Katex/Katex.d.ts +17 -0
  309. package/lib/extensions/Katex/components/KatexWrapper.d.ts +1 -0
  310. package/lib/extensions/Katex/components/RichTextKatex.d.ts +1 -0
  311. package/lib/extensions/Katex/index.d.ts +1 -0
  312. package/lib/extensions/LineHeight/LineHeight.d.ts +7 -0
  313. package/lib/extensions/LineHeight/components/RichTextLightHeight.d.ts +1 -0
  314. package/lib/extensions/LineHeight/index.d.ts +1 -0
  315. package/lib/extensions/Link/Link.d.ts +6 -0
  316. package/lib/extensions/Link/components/LinkEditBlock.d.ts +9 -0
  317. package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
  318. package/lib/extensions/Link/components/RichTextLink.d.ts +1 -0
  319. package/lib/extensions/Link/index.d.ts +1 -0
  320. package/lib/extensions/Mention/Mention.d.ts +3 -0
  321. package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +16 -0
  322. package/lib/extensions/Mention/index.d.ts +1 -0
  323. package/lib/extensions/Mermaid/Mermaid.d.ts +27 -0
  324. package/lib/extensions/Mermaid/components/EditMermaidBlock.d.ts +9 -0
  325. package/lib/extensions/Mermaid/components/NodeViewMermaid/NodeViewMermaid.d.ts +9 -0
  326. package/lib/extensions/Mermaid/components/RichTextMermaid.d.ts +1 -0
  327. package/lib/extensions/Mermaid/index.d.ts +1 -0
  328. package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
  329. package/lib/extensions/MoreMark/components/RichTextMoreMark.d.ts +14 -0
  330. package/lib/extensions/MoreMark/index.d.ts +1 -0
  331. package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
  332. package/lib/extensions/OrderedList/components/RichTextOrderedList.d.ts +1 -0
  333. package/lib/extensions/OrderedList/index.d.ts +1 -0
  334. package/lib/extensions/SearchAndReplace/SearchAndReplace.d.ts +36 -0
  335. package/lib/extensions/SearchAndReplace/components/RichTextSearchAndReplace.d.ts +1 -0
  336. package/lib/extensions/SearchAndReplace/index.d.ts +1 -0
  337. package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
  338. package/lib/extensions/SlashCommand/components/SlashCommandList.d.ts +6 -0
  339. package/lib/extensions/SlashCommand/components/SlashCommandNodeView.d.ts +3 -0
  340. package/lib/extensions/SlashCommand/index.d.ts +1 -0
  341. package/lib/extensions/SlashCommand/renderCommandListDefault.d.ts +7 -0
  342. package/lib/extensions/SlashCommand/types.d.ts +20 -0
  343. package/lib/extensions/Strike/Strike.d.ts +6 -0
  344. package/lib/extensions/Strike/components/RichTextStrike.d.ts +1 -0
  345. package/lib/extensions/Strike/index.d.ts +1 -0
  346. package/lib/extensions/Table/Table.d.ts +21 -0
  347. package/lib/extensions/Table/TableCellBackground.d.ts +14 -0
  348. package/lib/extensions/Table/components/CreateTablePopover.d.ts +7 -0
  349. package/lib/extensions/Table/components/RichTextTable.d.ts +1 -0
  350. package/lib/extensions/Table/index.d.ts +1 -0
  351. package/lib/extensions/TaskList/TaskList.d.ts +11 -0
  352. package/lib/extensions/TaskList/components/RichTextTaskList.d.ts +1 -0
  353. package/lib/extensions/TaskList/index.d.ts +1 -0
  354. package/lib/extensions/TextAlign/TextAlign.d.ts +17 -0
  355. package/lib/extensions/TextAlign/components/RichTextAlign.d.ts +14 -0
  356. package/lib/extensions/TextAlign/index.d.ts +1 -0
  357. package/lib/extensions/TextDirection/TextDirection.d.ts +5 -0
  358. package/lib/extensions/TextDirection/components/RichTextTextDirection.d.ts +15 -0
  359. package/lib/extensions/TextDirection/index.d.ts +1 -0
  360. package/lib/extensions/TextUnderline/TextUnderline.d.ts +6 -0
  361. package/lib/extensions/TextUnderline/components/RichTextUnderline.d.ts +1 -0
  362. package/lib/extensions/TextUnderline/index.d.ts +1 -0
  363. package/lib/extensions/Twitter/Twitter.d.ts +46 -0
  364. package/lib/extensions/Twitter/components/FormEditLinkTwitter.d.ts +6 -0
  365. package/lib/extensions/Twitter/components/NodeViewTweet.d.ts +8 -0
  366. package/lib/extensions/Twitter/components/RichTextTwitter.d.ts +1 -0
  367. package/lib/extensions/Twitter/index.d.ts +1 -0
  368. package/lib/extensions/Video/Video.d.ts +66 -0
  369. package/lib/extensions/Video/components/RichTextVideo.d.ts +1 -0
  370. package/lib/extensions/Video/index.d.ts +1 -0
  371. package/lib/hooks/useActive.d.ts +21 -0
  372. package/lib/hooks/useAttributes.d.ts +2 -0
  373. package/lib/hooks/useButtonProps.d.ts +1 -0
  374. package/lib/hooks/useCopy.d.ts +5 -0
  375. package/lib/hooks/useExtension.d.ts +1 -0
  376. package/lib/hooks/useLocalStorage.d.ts +13 -0
  377. package/lib/index-4Q5IhypJ.js +1349 -0
  378. package/lib/index-BCzvbrf5.cjs +12 -0
  379. package/lib/index-BG0kQamI.js +285 -0
  380. package/lib/index-C-tDsIKJ.js +1631 -0
  381. package/lib/index-C1WCZhyA.js +237 -0
  382. package/lib/index-CjhjjJsN.cjs +1 -0
  383. package/lib/index-Cs6cp0Y6.cjs +1 -0
  384. package/lib/index-CsSfYR30.js +1351 -0
  385. package/lib/index-D9oM__YW.cjs +1 -0
  386. package/lib/index-DjDf4BK8.js +707 -0
  387. package/lib/index-NsYff_Ni.cjs +1 -0
  388. package/lib/index-bVGIXhRg.cjs +1 -0
  389. package/lib/index-lj3VWExo.js +4883 -0
  390. package/lib/index-neeeY2o7.cjs +4 -0
  391. package/lib/index.cjs +115 -0
  392. package/lib/index.d.ts +2 -0
  393. package/lib/index.js +338 -0
  394. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  395. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  396. package/lib/lib/utils.d.ts +2 -0
  397. package/lib/locale-bundle.cjs +1 -0
  398. package/lib/locale-bundle.d.ts +1 -0
  399. package/lib/locale-bundle.js +11 -0
  400. package/lib/locales/en.d.ts +196 -0
  401. package/lib/locales/fi.d.ts +196 -0
  402. package/lib/locales/hu.d.ts +196 -0
  403. package/lib/locales/index.d.ts +1198 -0
  404. package/lib/locales/pt-br.d.ts +196 -0
  405. package/lib/locales/vi.d.ts +196 -0
  406. package/lib/locales/zh-cn.d.ts +196 -0
  407. package/lib/plugins/image-upload.d.ts +13 -0
  408. package/lib/popover-CPr9bHYn.js +24 -0
  409. package/lib/popover-D-hUKDYu.cjs +1 -0
  410. package/lib/renderNodeView-BJSrgyGj.js +28 -0
  411. package/lib/renderNodeView-DfLmGrgA.cjs +1 -0
  412. package/lib/select-C2KF4RNg.cjs +1 -0
  413. package/lib/select-CuE_HaQJ.js +120 -0
  414. package/lib/separator-CHzYNMVt.js +293 -0
  415. package/lib/separator-_gvUNba_.cjs +1 -0
  416. package/lib/store/EditorEditableReactive.d.ts +1 -0
  417. package/lib/store/ThemeColorReactive.d.ts +1 -0
  418. package/lib/store/commandList.d.ts +2 -0
  419. package/lib/store/editor.d.ts +21 -0
  420. package/lib/store/store.d.ts +3 -0
  421. package/lib/style.css +1 -0
  422. package/lib/textarea-DZj6EY-N.cjs +1 -0
  423. package/lib/textarea-gEoNp9CA.js +20 -0
  424. package/lib/theme/theme.d.ts +369 -0
  425. package/lib/theme.cjs +1 -0
  426. package/lib/theme.js +395 -0
  427. package/lib/types.d.ts +230 -0
  428. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  429. package/lib/updatePosition-e90ZrFWW.js +16 -0
  430. package/lib/utils/base64.d.ts +2 -0
  431. package/lib/utils/checkIsVideoUrl.d.ts +1 -0
  432. package/lib/utils/color.d.ts +7 -0
  433. package/lib/utils/columns.d.ts +14 -0
  434. package/lib/utils/customEvents/events.constant.d.ts +6 -0
  435. package/lib/utils/delete-node.d.ts +2 -0
  436. package/lib/utils/dom-dataset.d.ts +28 -0
  437. package/lib/utils/download.d.ts +1 -0
  438. package/lib/utils/dynamicCSS.d.ts +25 -0
  439. package/lib/utils/editor-container-size.d.ts +4 -0
  440. package/lib/utils/file.d.ts +30 -0
  441. package/lib/utils/getRenderContainer.d.ts +3 -0
  442. package/lib/utils/indent.d.ts +14 -0
  443. package/lib/utils/is-mobile.d.ts +19 -0
  444. package/lib/utils/json.d.ts +2 -0
  445. package/lib/utils/lru-cache.d.ts +31 -0
  446. package/lib/utils/mitt.d.ts +24 -0
  447. package/lib/utils/node.d.ts +15 -0
  448. package/lib/utils/pdf.d.ts +3 -0
  449. package/lib/utils/plateform.d.ts +11 -0
  450. package/lib/utils/renderNodeView.d.ts +6 -0
  451. package/lib/utils/shortId.d.ts +1 -0
  452. package/lib/utils/storage.d.ts +2 -0
  453. package/lib/utils/updatePosition.d.ts +1 -0
  454. package/lib/utils/utils.d.ts +20 -0
  455. package/lib/utils/validateFile.d.ts +16 -0
  456. package/package.json +845 -0
@@ -0,0 +1,1666 @@
1
+ import { j as U, a8 as rt, h as Mt, N as jt, m as Wt, a9 as Bt, k as Ft } from "./clsx-CDyrfCnw.js";
2
+ import { jsx as r, jsxs as h, Fragment as Pt } from "react/jsx-runtime";
3
+ import Be, { useState as se, Fragment as Ut, useEffect as Fe, useMemo as Pe, createContext as zt, useLayoutEffect as Ht, useContext as Gt, useRef as K, useCallback as Te, useDebugValue as Xt } from "react";
4
+ import { L as Kt, j as Qt, B as Jt, h as Yt, u as Zt, d as en, A as tn, I as nn } from "./index-lj3VWExo.js";
5
+ import "./theme.js";
6
+ import { u as rn } from "./index-4Q5IhypJ.js";
7
+ import { P as on, a as an, b as sn } from "./popover-CPr9bHYn.js";
8
+ const cn = "_verified_lvyh0_1", Ue = {
9
+ verified: cn
10
+ }, ln = () => /* @__PURE__ */ r("svg", {
11
+ viewBox: "0 0 24 24",
12
+ "aria-label": "Verified account",
13
+ role: "img",
14
+ className: Ue.verified,
15
+ children: /* @__PURE__ */ r("g", {
16
+ children: /* @__PURE__ */ r("path", {
17
+ 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"
18
+ })
19
+ })
20
+ }), dn = () => /* @__PURE__ */ r("svg", {
21
+ viewBox: "0 0 22 22",
22
+ "aria-label": "Verified account",
23
+ role: "img",
24
+ className: Ue.verified,
25
+ children: /* @__PURE__ */ h("g", {
26
+ children: [
27
+ /* @__PURE__ */ h("linearGradient", {
28
+ gradientUnits: "userSpaceOnUse",
29
+ id: "0-a",
30
+ x1: "4.411",
31
+ x2: "18.083",
32
+ y1: "2.495",
33
+ y2: "21.508",
34
+ children: [
35
+ /* @__PURE__ */ r("stop", {
36
+ offset: "0",
37
+ stopColor: "#f4e72a"
38
+ }),
39
+ /* @__PURE__ */ r("stop", {
40
+ offset: ".539",
41
+ stopColor: "#cd8105"
42
+ }),
43
+ /* @__PURE__ */ r("stop", {
44
+ offset: ".68",
45
+ stopColor: "#cb7b00"
46
+ }),
47
+ /* @__PURE__ */ r("stop", {
48
+ offset: "1",
49
+ stopColor: "#f4ec26"
50
+ }),
51
+ /* @__PURE__ */ r("stop", {
52
+ offset: "1",
53
+ stopColor: "#f4e72a"
54
+ })
55
+ ]
56
+ }),
57
+ /* @__PURE__ */ h("linearGradient", {
58
+ gradientUnits: "userSpaceOnUse",
59
+ id: "0-b",
60
+ x1: "5.355",
61
+ x2: "16.361",
62
+ y1: "3.395",
63
+ y2: "19.133",
64
+ children: [
65
+ /* @__PURE__ */ r("stop", {
66
+ offset: "0",
67
+ stopColor: "#f9e87f"
68
+ }),
69
+ /* @__PURE__ */ r("stop", {
70
+ offset: ".406",
71
+ stopColor: "#e2b719"
72
+ }),
73
+ /* @__PURE__ */ r("stop", {
74
+ offset: ".989",
75
+ stopColor: "#e2b719"
76
+ })
77
+ ]
78
+ }),
79
+ /* @__PURE__ */ h("g", {
80
+ clipRule: "evenodd",
81
+ fillRule: "evenodd",
82
+ children: [
83
+ /* @__PURE__ */ r("path", {
84
+ 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",
85
+ fill: "url(#0-a)"
86
+ }),
87
+ /* @__PURE__ */ r("path", {
88
+ 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",
89
+ fill: "url(#0-b)"
90
+ }),
91
+ /* @__PURE__ */ r("path", {
92
+ 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",
93
+ fill: "#d18800"
94
+ })
95
+ ]
96
+ })
97
+ ]
98
+ })
99
+ }), un = () => /* @__PURE__ */ r("svg", {
100
+ viewBox: "0 0 22 22",
101
+ "aria-label": "Verified account",
102
+ role: "img",
103
+ className: Ue.verified,
104
+ children: /* @__PURE__ */ r("g", {
105
+ children: /* @__PURE__ */ r("path", {
106
+ clipRule: "evenodd",
107
+ 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",
108
+ fillRule: "evenodd"
109
+ })
110
+ })
111
+ }), fn = "_root_98iqw_1", hn = "_article_98iqw_21", ot = {
112
+ root: fn,
113
+ article: hn
114
+ }, ze = ({ className: e, children: t }) => /* @__PURE__ */ r("div", {
115
+ className: U("react-tweet-theme", ot.root, e),
116
+ children: /* @__PURE__ */ r("article", {
117
+ className: ot.article,
118
+ children: t
119
+ })
120
+ }), vt = (e) => /* @__PURE__ */ r("img", {
121
+ ...e
122
+ }), _n = "_verifiedOld_lcna5_1", mn = "_verifiedBlue_lcna5_4", pn = "_verifiedGovernment_lcna5_7", xe = {
123
+ verifiedOld: _n,
124
+ verifiedBlue: mn,
125
+ verifiedGovernment: pn
126
+ }, gt = ({ user: e, className: t }) => {
127
+ const n = e.verified || e.is_blue_verified || e.verified_type;
128
+ let o = /* @__PURE__ */ r(ln, {}), a = xe.verifiedBlue;
129
+ if (n)
130
+ switch (e.is_blue_verified || (a = xe.verifiedOld), e.verified_type) {
131
+ case "Government":
132
+ o = /* @__PURE__ */ r(un, {}), a = xe.verifiedGovernment;
133
+ break;
134
+ case "Business":
135
+ o = /* @__PURE__ */ r(dn, {}), a = null;
136
+ break;
137
+ }
138
+ return n ? /* @__PURE__ */ r("div", {
139
+ className: U(t, a),
140
+ children: o
141
+ }) : null;
142
+ }, vn = "_label_36ucz_1", gn = {
143
+ label: vn
144
+ }, wt = ({ user: e, className: t }) => {
145
+ var n;
146
+ const o = e.highlighted_label;
147
+ if (!o) return null;
148
+ const a = (n = o.badge) == null ? void 0 : n.url;
149
+ return a ? /* @__PURE__ */ r("div", {
150
+ className: U(gn.label, t),
151
+ children: /* @__PURE__ */ r("img", {
152
+ src: a,
153
+ alt: o.description
154
+ })
155
+ }) : null;
156
+ }, wn = "_header_nqq4j_1", yn = "_avatar_nqq4j_11", bn = "_avatarOverflow_nqq4j_16", Tn = "_avatarSquare_nqq4j_23", xn = "_avatarShadow_nqq4j_26", Nn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Rn = "_authorVerified_nqq4j_53", Sn = "_authorLinkText_nqq4j_56", kn = "_authorMeta_nqq4j_63", En = "_authorFollow_nqq4j_66", Cn = "_username_nqq4j_69", On = "_follow_nqq4j_74", Ln = "_separator_nqq4j_82", $n = "_brand_nqq4j_86", qn = "_twitterIcon_nqq4j_90", N = {
157
+ header: wn,
158
+ avatar: yn,
159
+ avatarOverflow: bn,
160
+ avatarSquare: Tn,
161
+ avatarShadow: xn,
162
+ author: Nn,
163
+ authorLink: In,
164
+ authorVerified: Rn,
165
+ authorLinkText: Sn,
166
+ authorMeta: kn,
167
+ authorFollow: En,
168
+ username: Cn,
169
+ follow: On,
170
+ separator: Ln,
171
+ brand: $n,
172
+ twitterIcon: qn
173
+ }, Dn = ({ tweet: e, components: t }) => {
174
+ var n;
175
+ const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : vt, { user: a } = e;
176
+ return /* @__PURE__ */ h("div", {
177
+ className: N.header,
178
+ children: [
179
+ /* @__PURE__ */ h("a", {
180
+ href: e.url,
181
+ className: N.avatar,
182
+ target: "_blank",
183
+ rel: "noopener noreferrer",
184
+ children: [
185
+ /* @__PURE__ */ r("div", {
186
+ className: U(N.avatarOverflow, a.profile_image_shape === "Square" && N.avatarSquare),
187
+ children: /* @__PURE__ */ r(o, {
188
+ src: a.profile_image_url_https,
189
+ alt: a.name,
190
+ width: 48,
191
+ height: 48
192
+ })
193
+ }),
194
+ /* @__PURE__ */ r("div", {
195
+ className: N.avatarOverflow,
196
+ children: /* @__PURE__ */ r("div", {
197
+ className: N.avatarShadow
198
+ })
199
+ })
200
+ ]
201
+ }),
202
+ /* @__PURE__ */ h("div", {
203
+ className: N.author,
204
+ children: [
205
+ /* @__PURE__ */ h("a", {
206
+ href: e.url,
207
+ className: N.authorLink,
208
+ target: "_blank",
209
+ rel: "noopener noreferrer",
210
+ children: [
211
+ /* @__PURE__ */ r("div", {
212
+ className: N.authorLinkText,
213
+ children: /* @__PURE__ */ r("span", {
214
+ title: a.name,
215
+ children: a.name
216
+ })
217
+ }),
218
+ /* @__PURE__ */ r(gt, {
219
+ user: a,
220
+ className: N.authorVerified
221
+ }),
222
+ /* @__PURE__ */ r(wt, {
223
+ user: a
224
+ })
225
+ ]
226
+ }),
227
+ /* @__PURE__ */ h("div", {
228
+ className: N.authorMeta,
229
+ children: [
230
+ /* @__PURE__ */ r("a", {
231
+ href: e.url,
232
+ className: N.username,
233
+ target: "_blank",
234
+ rel: "noopener noreferrer",
235
+ children: /* @__PURE__ */ h("span", {
236
+ title: `@${a.screen_name}`,
237
+ children: [
238
+ "@",
239
+ a.screen_name
240
+ ]
241
+ })
242
+ }),
243
+ /* @__PURE__ */ h("div", {
244
+ className: N.authorFollow,
245
+ children: [
246
+ /* @__PURE__ */ r("span", {
247
+ className: N.separator,
248
+ children: "·"
249
+ }),
250
+ /* @__PURE__ */ r("a", {
251
+ href: a.follow_url,
252
+ className: N.follow,
253
+ target: "_blank",
254
+ rel: "noopener noreferrer",
255
+ children: "Follow"
256
+ })
257
+ ]
258
+ })
259
+ ]
260
+ })
261
+ ]
262
+ }),
263
+ /* @__PURE__ */ r("a", {
264
+ href: e.url,
265
+ className: N.brand,
266
+ target: "_blank",
267
+ rel: "noopener noreferrer",
268
+ "aria-label": "View on Twitter",
269
+ children: /* @__PURE__ */ r("svg", {
270
+ viewBox: "0 0 24 24",
271
+ "aria-hidden": "true",
272
+ className: N.twitterIcon,
273
+ children: /* @__PURE__ */ r("g", {
274
+ children: /* @__PURE__ */ r("path", {
275
+ 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"
276
+ })
277
+ })
278
+ })
279
+ })
280
+ ]
281
+ });
282
+ }, An = "_root_1ec15_1", Vn = {
283
+ root: An
284
+ }, Mn = ({ tweet: e }) => /* @__PURE__ */ h("a", {
285
+ href: e.in_reply_to_url,
286
+ className: Vn.root,
287
+ target: "_blank",
288
+ rel: "noopener noreferrer",
289
+ children: [
290
+ "Replying to @",
291
+ e.in_reply_to_screen_name
292
+ ]
293
+ }), jn = "_root_eihfa_1", Wn = {
294
+ root: jn
295
+ }, yt = ({ href: e, children: t }) => /* @__PURE__ */ r("a", {
296
+ href: e,
297
+ className: Wn.root,
298
+ target: "_blank",
299
+ rel: "noopener noreferrer nofollow",
300
+ children: t
301
+ }), Bn = "_root_1xq52_1", Fn = {
302
+ root: Bn
303
+ }, Pn = ({ tweet: e }) => /* @__PURE__ */ h("p", {
304
+ className: Fn.root,
305
+ lang: e.lang,
306
+ dir: "auto",
307
+ children: [
308
+ e.entities.map((t, n) => {
309
+ switch (t.type) {
310
+ case "hashtag":
311
+ case "mention":
312
+ case "url":
313
+ case "symbol":
314
+ return /* @__PURE__ */ r(yt, {
315
+ href: t.href,
316
+ children: t.text
317
+ }, n);
318
+ case "media":
319
+ return;
320
+ default:
321
+ return /* @__PURE__ */ r("span", {
322
+ dangerouslySetInnerHTML: {
323
+ __html: t.text
324
+ }
325
+ }, n);
326
+ }
327
+ }),
328
+ e.note_tweet ? /* @__PURE__ */ r(Un, {
329
+ tweet: e
330
+ }) : null
331
+ ]
332
+ });
333
+ function Un({ tweet: e }) {
334
+ return /* @__PURE__ */ h(yt, {
335
+ href: e.url,
336
+ children: [
337
+ /* @__PURE__ */ r("span", {
338
+ children: " "
339
+ }),
340
+ "Show more"
341
+ ]
342
+ });
343
+ }
344
+ const zn = {
345
+ hour: "numeric",
346
+ minute: "2-digit",
347
+ hour12: !0,
348
+ weekday: "short",
349
+ month: "short",
350
+ day: "numeric",
351
+ year: "numeric"
352
+ }, Hn = new Intl.DateTimeFormat("en-US", zn), Gn = (e) => {
353
+ const t = {};
354
+ for (const n of e)
355
+ t[n.type] = n.value;
356
+ return t;
357
+ }, Xn = (e) => {
358
+ const t = Gn(Hn.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
359
+ return `${n} · ${o}`;
360
+ }, at = (e) => `https://x.com/${e.user.screen_name}/status/${e.id_str}`, bt = (e) => `https://x.com/${typeof e == "string" ? e : e.user.screen_name}`, Kn = (e) => `https://x.com/intent/like?tweet_id=${e.id_str}`, Qn = (e) => `https://x.com/intent/tweet?in_reply_to=${e.id_str}`, Jn = (e) => `https://x.com/intent/follow?screen_name=${e.user.screen_name}`, Yn = (e) => `https://x.com/hashtag/${e.text}`, Zn = (e) => `https://x.com/search?q=%24${e.text}`, er = (e) => `https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`, Tt = (e, t) => {
361
+ const n = new URL(e.media_url_https), o = n.pathname.split(".").pop();
362
+ return o ? (n.pathname = n.pathname.replace(`.${o}`, ""), n.searchParams.set("format", o), n.searchParams.set("name", t), n.toString()) : e.media_url_https;
363
+ }, tr = (e) => {
364
+ const { variants: t } = e.video_info;
365
+ return t.filter((o) => o.content_type === "video/mp4").sort((o, a) => {
366
+ var i, s;
367
+ return ((i = a.bitrate) != null ? i : 0) - ((s = o.bitrate) != null ? s : 0);
368
+ });
369
+ }, nr = (e) => {
370
+ const t = tr(e);
371
+ return t.length > 1 ? t[1] : t[0];
372
+ }, Le = (e) => e > 999999 ? `${(e / 1e6).toFixed(1)}M` : e > 999 ? `${(e / 1e3).toFixed(1)}K` : e.toString();
373
+ function st(e) {
374
+ const t = Array.from(e.text), n = [
375
+ {
376
+ indices: e.display_text_range,
377
+ type: "text"
378
+ }
379
+ ];
380
+ return de(n, "hashtag", e.entities.hashtags), de(n, "mention", e.entities.user_mentions), de(n, "url", e.entities.urls), de(n, "symbol", e.entities.symbols), e.entities.media && de(n, "media", e.entities.media), rr(e, n), n.map((o) => {
381
+ const a = t.slice(o.indices[0], o.indices[1]).join("");
382
+ switch (o.type) {
383
+ case "hashtag":
384
+ return Object.assign(o, {
385
+ href: Yn(o),
386
+ text: a
387
+ });
388
+ case "mention":
389
+ return Object.assign(o, {
390
+ href: bt(o.screen_name),
391
+ text: a
392
+ });
393
+ case "url":
394
+ case "media":
395
+ return Object.assign(o, {
396
+ href: o.expanded_url,
397
+ text: o.display_url
398
+ });
399
+ case "symbol":
400
+ return Object.assign(o, {
401
+ href: Zn(o),
402
+ text: a
403
+ });
404
+ default:
405
+ return Object.assign(o, {
406
+ text: a
407
+ });
408
+ }
409
+ });
410
+ }
411
+ function de(e, t, n) {
412
+ for (const o of n)
413
+ for (const [a, i] of e.entries()) {
414
+ if (i.indices[0] > o.indices[0] || i.indices[1] < o.indices[1])
415
+ continue;
416
+ const s = [
417
+ {
418
+ ...o,
419
+ type: t
420
+ }
421
+ ];
422
+ i.indices[0] < o.indices[0] && s.unshift({
423
+ indices: [
424
+ i.indices[0],
425
+ o.indices[0]
426
+ ],
427
+ type: "text"
428
+ }), i.indices[1] > o.indices[1] && s.push({
429
+ indices: [
430
+ o.indices[1],
431
+ i.indices[1]
432
+ ],
433
+ type: "text"
434
+ }), e.splice(a, 1, ...s);
435
+ break;
436
+ }
437
+ }
438
+ function rr(e, t) {
439
+ 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]);
440
+ const n = t.at(-1);
441
+ n && n.indices[1] > e.display_text_range[1] && (n.indices[1] = e.display_text_range[1]);
442
+ }
443
+ const or = (e) => ({
444
+ ...e,
445
+ url: at(e),
446
+ user: {
447
+ ...e.user,
448
+ url: bt(e),
449
+ follow_url: Jn(e)
450
+ },
451
+ like_url: Kn(e),
452
+ reply_url: Qn(e),
453
+ in_reply_to_url: e.in_reply_to_screen_name ? er(e) : void 0,
454
+ entities: st(e),
455
+ quoted_tweet: e.quoted_tweet ? {
456
+ ...e.quoted_tweet,
457
+ url: at(e.quoted_tweet),
458
+ entities: st(e.quoted_tweet)
459
+ } : void 0
460
+ }), ar = "_root_g9tkv_1", sr = "_rounded_g9tkv_6", ir = "_mediaWrapper_g9tkv_10", cr = "_grid2Columns_g9tkv_17", lr = "_grid3_g9tkv_20", dr = "_grid2x2_g9tkv_23", ur = "_mediaContainer_g9tkv_26", fr = "_mediaLink_g9tkv_34", hr = "_skeleton_g9tkv_38", _r = "_image_g9tkv_43", C = {
461
+ root: ar,
462
+ rounded: sr,
463
+ mediaWrapper: ir,
464
+ grid2Columns: cr,
465
+ grid3: lr,
466
+ grid2x2: dr,
467
+ mediaContainer: ur,
468
+ mediaLink: fr,
469
+ skeleton: hr,
470
+ image: _r
471
+ }, mr = "_anchor_fp31d_1", pr = "_videoButton_fp31d_17", vr = "_videoButtonIcon_fp31d_35", gr = "_watchOnTwitter_fp31d_44", wr = "_viewReplies_fp31d_60", ae = {
472
+ anchor: mr,
473
+ videoButton: pr,
474
+ videoButtonIcon: vr,
475
+ watchOnTwitter: gr,
476
+ viewReplies: wr
477
+ }, yr = ({ tweet: e, media: t }) => {
478
+ const [n, o] = se(!0), [a, i] = se(!1), [s, c] = se(!1), f = nr(t);
479
+ let d = 0;
480
+ return /* @__PURE__ */ h(Pt, {
481
+ children: [
482
+ /* @__PURE__ */ r("video", {
483
+ className: C.image,
484
+ poster: Tt(t, "small"),
485
+ controls: !n,
486
+ playsInline: !0,
487
+ preload: "none",
488
+ tabIndex: n ? -1 : 0,
489
+ onPlay: () => {
490
+ d && window.clearTimeout(d), a || i(!0), s && c(!1);
491
+ },
492
+ onPause: () => {
493
+ d && window.clearTimeout(d), d = window.setTimeout(() => {
494
+ a && i(!1), d = 0;
495
+ }, 100);
496
+ },
497
+ onEnded: () => {
498
+ c(!0);
499
+ },
500
+ children: /* @__PURE__ */ r("source", {
501
+ src: f.url,
502
+ type: f.content_type
503
+ })
504
+ }),
505
+ n && /* @__PURE__ */ r("button", {
506
+ type: "button",
507
+ className: ae.videoButton,
508
+ "aria-label": "View video on X",
509
+ onClick: (g) => {
510
+ const m = g.currentTarget.previousSibling;
511
+ g.preventDefault(), o(!1), m.load(), m.play().then(() => {
512
+ i(!0), m.focus();
513
+ }).catch((b) => {
514
+ console.error("Error playing video:", b), o(!0), i(!1);
515
+ });
516
+ },
517
+ children: /* @__PURE__ */ r("svg", {
518
+ viewBox: "0 0 24 24",
519
+ className: ae.videoButtonIcon,
520
+ "aria-hidden": "true",
521
+ children: /* @__PURE__ */ r("g", {
522
+ children: /* @__PURE__ */ r("path", {
523
+ d: "M21 12L4 2v20l17-10z"
524
+ })
525
+ })
526
+ })
527
+ }),
528
+ !a && !s && /* @__PURE__ */ r("div", {
529
+ className: ae.watchOnTwitter,
530
+ children: /* @__PURE__ */ r("a", {
531
+ href: e.url,
532
+ className: ae.anchor,
533
+ target: "_blank",
534
+ rel: "noopener noreferrer",
535
+ children: n ? "Watch on X" : "Continue watching on X"
536
+ })
537
+ }),
538
+ s && /* @__PURE__ */ r("a", {
539
+ href: e.url,
540
+ className: U(ae.anchor, ae.viewReplies),
541
+ target: "_blank",
542
+ rel: "noopener noreferrer",
543
+ children: "View replies"
544
+ })
545
+ ]
546
+ });
547
+ }, br = (e) => /* @__PURE__ */ r("img", {
548
+ ...e
549
+ }), it = (e, t) => {
550
+ let n = 56.25;
551
+ return t === 1 && (n = 100 / e.original_info.width * e.original_info.height), t === 2 && (n = n * 2), {
552
+ width: e.type === "photo" ? void 0 : "unset",
553
+ paddingBottom: `${n}%`
554
+ };
555
+ }, xt = ({ tweet: e, components: t, quoted: n }) => {
556
+ var o, a, i;
557
+ const s = (i = (o = e.mediaDetails) == null ? void 0 : o.length) != null ? i : 0;
558
+ var c;
559
+ const f = (c = t == null ? void 0 : t.MediaImg) != null ? c : br;
560
+ return /* @__PURE__ */ r("div", {
561
+ className: U(C.root, !n && C.rounded),
562
+ children: /* @__PURE__ */ r("div", {
563
+ className: U(C.mediaWrapper, s > 1 && C.grid2Columns, s === 3 && C.grid3, s > 4 && C.grid2x2),
564
+ children: (a = e.mediaDetails) == null ? void 0 : a.map((d) => /* @__PURE__ */ r(Ut, {
565
+ children: d.type === "photo" ? /* @__PURE__ */ h("a", {
566
+ href: e.url,
567
+ className: U(C.mediaContainer, C.mediaLink),
568
+ target: "_blank",
569
+ rel: "noopener noreferrer",
570
+ children: [
571
+ /* @__PURE__ */ r("div", {
572
+ className: C.skeleton,
573
+ style: it(d, s)
574
+ }),
575
+ /* @__PURE__ */ r(f, {
576
+ src: Tt(d, "small"),
577
+ alt: d.ext_alt_text || "Image",
578
+ className: C.image,
579
+ draggable: !0
580
+ })
581
+ ]
582
+ }, d.media_url_https) : /* @__PURE__ */ h("div", {
583
+ className: C.mediaContainer,
584
+ children: [
585
+ /* @__PURE__ */ r("div", {
586
+ className: C.skeleton,
587
+ style: it(d, s)
588
+ }),
589
+ /* @__PURE__ */ r(yr, {
590
+ tweet: e,
591
+ media: d
592
+ })
593
+ ]
594
+ }, d.media_url_https)
595
+ }, d.media_url_https))
596
+ })
597
+ });
598
+ }, Tr = "_root_i24yn_1", xr = {
599
+ root: Tr
600
+ }, Nr = ({ tweet: e }) => {
601
+ const t = new Date(e.created_at), n = Xn(t);
602
+ return /* @__PURE__ */ r("a", {
603
+ className: xr.root,
604
+ href: e.url,
605
+ target: "_blank",
606
+ rel: "noopener noreferrer",
607
+ "aria-label": n,
608
+ children: /* @__PURE__ */ r("time", {
609
+ dateTime: t.toISOString(),
610
+ children: n
611
+ })
612
+ });
613
+ }, Ir = "_info_19qcj_1", Rr = "_infoLink_19qcj_10", Sr = "_infoIcon_19qcj_30", Ne = {
614
+ info: Ir,
615
+ infoLink: Rr,
616
+ infoIcon: Sr
617
+ }, kr = ({ tweet: e }) => /* @__PURE__ */ h("div", {
618
+ className: Ne.info,
619
+ children: [
620
+ /* @__PURE__ */ r(Nr, {
621
+ tweet: e
622
+ }),
623
+ /* @__PURE__ */ r("a", {
624
+ className: Ne.infoLink,
625
+ href: "https://help.x.com/en/x-for-websites-ads-info-and-privacy",
626
+ target: "_blank",
627
+ rel: "noopener noreferrer",
628
+ "aria-label": "Twitter for Websites, Ads Information and Privacy",
629
+ children: /* @__PURE__ */ r("svg", {
630
+ viewBox: "0 0 24 24",
631
+ "aria-hidden": "true",
632
+ className: Ne.infoIcon,
633
+ children: /* @__PURE__ */ r("g", {
634
+ children: /* @__PURE__ */ r("path", {
635
+ 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"
636
+ })
637
+ })
638
+ })
639
+ })
640
+ ]
641
+ }), Er = "_actions_n2anf_1", Cr = "_like_n2anf_13", Or = "_reply_n2anf_14", Lr = "_copy_n2anf_15", $r = "_likeIconWrapper_n2anf_27", qr = "_likeCount_n2anf_30", Dr = "_replyIconWrapper_n2anf_35", Ar = "_copyIconWrapper_n2anf_36", Vr = "_likeIcon_n2anf_27", Mr = "_replyIcon_n2anf_35", jr = "_copyIcon_n2anf_36", Wr = "_replyText_n2anf_56", Br = "_copyText_n2anf_57", k = {
642
+ actions: Er,
643
+ like: Cr,
644
+ reply: Or,
645
+ copy: Lr,
646
+ likeIconWrapper: $r,
647
+ likeCount: qr,
648
+ replyIconWrapper: Dr,
649
+ copyIconWrapper: Ar,
650
+ likeIcon: Vr,
651
+ replyIcon: Mr,
652
+ copyIcon: jr,
653
+ replyText: Wr,
654
+ copyText: Br
655
+ }, Fr = ({ tweet: e }) => {
656
+ const [t, n] = se(!1), o = () => {
657
+ navigator.clipboard.writeText(e.url), n(!0);
658
+ };
659
+ return Fe(() => {
660
+ if (t) {
661
+ const a = setTimeout(() => {
662
+ n(!1);
663
+ }, 6e3);
664
+ return () => clearTimeout(a);
665
+ }
666
+ }, [
667
+ t
668
+ ]), /* @__PURE__ */ h("button", {
669
+ type: "button",
670
+ className: k.copy,
671
+ "aria-label": "Copy link",
672
+ onClick: o,
673
+ children: [
674
+ /* @__PURE__ */ r("div", {
675
+ className: k.copyIconWrapper,
676
+ children: t ? /* @__PURE__ */ r("svg", {
677
+ viewBox: "0 0 24 24",
678
+ className: k.copyIcon,
679
+ "aria-hidden": "true",
680
+ children: /* @__PURE__ */ r("g", {
681
+ children: /* @__PURE__ */ r("path", {
682
+ 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"
683
+ })
684
+ })
685
+ }) : /* @__PURE__ */ r("svg", {
686
+ viewBox: "0 0 24 24",
687
+ className: k.copyIcon,
688
+ "aria-hidden": "true",
689
+ children: /* @__PURE__ */ r("g", {
690
+ children: /* @__PURE__ */ r("path", {
691
+ 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"
692
+ })
693
+ })
694
+ })
695
+ }),
696
+ /* @__PURE__ */ r("span", {
697
+ className: k.copyText,
698
+ children: t ? "Copied!" : "Copy link"
699
+ })
700
+ ]
701
+ });
702
+ }, Pr = ({ tweet: e }) => {
703
+ const t = Le(e.favorite_count);
704
+ return /* @__PURE__ */ h("div", {
705
+ className: k.actions,
706
+ children: [
707
+ /* @__PURE__ */ h("a", {
708
+ className: k.like,
709
+ href: e.like_url,
710
+ target: "_blank",
711
+ rel: "noopener noreferrer",
712
+ "aria-label": `Like. This Tweet has ${t} likes`,
713
+ children: [
714
+ /* @__PURE__ */ r("div", {
715
+ className: k.likeIconWrapper,
716
+ children: /* @__PURE__ */ r("svg", {
717
+ viewBox: "0 0 24 24",
718
+ className: k.likeIcon,
719
+ "aria-hidden": "true",
720
+ children: /* @__PURE__ */ r("g", {
721
+ children: /* @__PURE__ */ r("path", {
722
+ 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"
723
+ })
724
+ })
725
+ })
726
+ }),
727
+ /* @__PURE__ */ r("span", {
728
+ className: k.likeCount,
729
+ children: t
730
+ })
731
+ ]
732
+ }),
733
+ /* @__PURE__ */ h("a", {
734
+ className: k.reply,
735
+ href: e.reply_url,
736
+ target: "_blank",
737
+ rel: "noopener noreferrer",
738
+ "aria-label": "Reply to this Tweet on Twitter",
739
+ children: [
740
+ /* @__PURE__ */ r("div", {
741
+ className: k.replyIconWrapper,
742
+ children: /* @__PURE__ */ r("svg", {
743
+ viewBox: "0 0 24 24",
744
+ className: k.replyIcon,
745
+ "aria-hidden": "true",
746
+ children: /* @__PURE__ */ r("g", {
747
+ children: /* @__PURE__ */ r("path", {
748
+ 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"
749
+ })
750
+ })
751
+ })
752
+ }),
753
+ /* @__PURE__ */ r("span", {
754
+ className: k.replyText,
755
+ children: "Reply"
756
+ })
757
+ ]
758
+ }),
759
+ /* @__PURE__ */ r(Fr, {
760
+ tweet: e
761
+ })
762
+ ]
763
+ });
764
+ }, Ur = "_replies_1cutb_1", zr = "_link_1cutb_4", Hr = "_text_1cutb_23", Ie = {
765
+ replies: Ur,
766
+ link: zr,
767
+ text: Hr
768
+ }, Gr = ({ tweet: e }) => /* @__PURE__ */ r("div", {
769
+ className: Ie.replies,
770
+ children: /* @__PURE__ */ r("a", {
771
+ className: Ie.link,
772
+ href: e.url,
773
+ target: "_blank",
774
+ rel: "noopener noreferrer",
775
+ children: /* @__PURE__ */ r("span", {
776
+ className: Ie.text,
777
+ children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${Le(e.conversation_count)} reply` : `Read ${Le(e.conversation_count)} replies`
778
+ })
779
+ })
780
+ }), Xr = "_root_q5799_1", Kr = "_article_q5799_16", ct = {
781
+ root: Xr,
782
+ article: Kr
783
+ }, Qr = ({ tweet: e, children: t }) => /* @__PURE__ */ r("div", {
784
+ className: ct.root,
785
+ onClick: (n) => {
786
+ n.preventDefault(), window.open(e.url, "_blank");
787
+ },
788
+ children: /* @__PURE__ */ r("article", {
789
+ className: ct.article,
790
+ children: t
791
+ })
792
+ }), Jr = "_header_f00ab_1", Yr = "_avatar_f00ab_11", Zr = "_avatarOverflow_f00ab_16", eo = "_avatarSquare_f00ab_23", to = "_author_f00ab_27", no = "_authorText_f00ab_33", ro = "_username_f00ab_40", Q = {
793
+ header: Jr,
794
+ avatar: Yr,
795
+ avatarOverflow: Zr,
796
+ avatarSquare: eo,
797
+ author: to,
798
+ authorText: no,
799
+ username: ro
800
+ }, oo = ({ tweet: e, components: t }) => {
801
+ const { user: n } = e;
802
+ var o;
803
+ const a = (o = t == null ? void 0 : t.AvatarImg) != null ? o : vt;
804
+ return /* @__PURE__ */ h("div", {
805
+ className: Q.header,
806
+ children: [
807
+ /* @__PURE__ */ r("a", {
808
+ href: e.url,
809
+ className: Q.avatar,
810
+ target: "_blank",
811
+ rel: "noopener noreferrer",
812
+ children: /* @__PURE__ */ r("div", {
813
+ className: U(Q.avatarOverflow, n.profile_image_shape === "Square" && Q.avatarSquare),
814
+ children: /* @__PURE__ */ r(a, {
815
+ src: n.profile_image_url_https,
816
+ alt: n.name,
817
+ width: 20,
818
+ height: 20
819
+ })
820
+ })
821
+ }),
822
+ /* @__PURE__ */ h("div", {
823
+ className: Q.author,
824
+ children: [
825
+ /* @__PURE__ */ r("div", {
826
+ className: Q.authorText,
827
+ children: /* @__PURE__ */ r("span", {
828
+ title: n.name,
829
+ children: n.name
830
+ })
831
+ }),
832
+ /* @__PURE__ */ r(gt, {
833
+ user: n
834
+ }),
835
+ /* @__PURE__ */ r(wt, {
836
+ user: n
837
+ }),
838
+ /* @__PURE__ */ r("div", {
839
+ className: Q.username,
840
+ children: /* @__PURE__ */ h("span", {
841
+ title: `@${n.screen_name}`,
842
+ children: [
843
+ "@",
844
+ n.screen_name
845
+ ]
846
+ })
847
+ })
848
+ ]
849
+ })
850
+ ]
851
+ });
852
+ }, ao = "_root_175ot_1", so = {
853
+ root: ao
854
+ }, io = ({ tweet: e }) => /* @__PURE__ */ r("p", {
855
+ className: so.root,
856
+ lang: e.lang,
857
+ dir: "auto",
858
+ children: e.entities.map((t, n) => /* @__PURE__ */ r("span", {
859
+ dangerouslySetInnerHTML: {
860
+ __html: t.text
861
+ }
862
+ }, n))
863
+ }), co = ({ tweet: e, components: t }) => {
864
+ var n;
865
+ return /* @__PURE__ */ h(Qr, {
866
+ tweet: e,
867
+ children: [
868
+ /* @__PURE__ */ r(oo, {
869
+ tweet: e,
870
+ components: t
871
+ }),
872
+ /* @__PURE__ */ r(io, {
873
+ tweet: e
874
+ }),
875
+ (n = e.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
876
+ quoted: !0,
877
+ tweet: e
878
+ }) : null
879
+ ]
880
+ });
881
+ }, lo = ({ tweet: e, components: t }) => {
882
+ var n;
883
+ const o = Pe(() => or(e), [
884
+ e
885
+ ]);
886
+ return /* @__PURE__ */ h(ze, {
887
+ children: [
888
+ /* @__PURE__ */ r(Dn, {
889
+ tweet: o,
890
+ components: t
891
+ }),
892
+ o.in_reply_to_status_id_str && /* @__PURE__ */ r(Mn, {
893
+ tweet: o
894
+ }),
895
+ /* @__PURE__ */ r(Pn, {
896
+ tweet: o
897
+ }),
898
+ (n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(xt, {
899
+ tweet: o,
900
+ components: t
901
+ }) : null,
902
+ o.quoted_tweet && /* @__PURE__ */ r(co, {
903
+ tweet: o.quoted_tweet,
904
+ components: t
905
+ }),
906
+ /* @__PURE__ */ r(kr, {
907
+ tweet: o
908
+ }),
909
+ /* @__PURE__ */ r(Pr, {
910
+ tweet: o
911
+ }),
912
+ /* @__PURE__ */ r(Gr, {
913
+ tweet: o
914
+ })
915
+ ]
916
+ });
917
+ }, uo = "_root_16yxa_1", fo = {
918
+ root: uo
919
+ }, ho = (e) => /* @__PURE__ */ r(ze, {
920
+ children: /* @__PURE__ */ h("div", {
921
+ className: fo.root,
922
+ children: [
923
+ /* @__PURE__ */ r("h3", {
924
+ children: "Tweet not found"
925
+ }),
926
+ /* @__PURE__ */ r("p", {
927
+ children: "The embedded tweet could not be found…"
928
+ })
929
+ ]
930
+ })
931
+ }), _o = "_skeleton_oi7hr_1", mo = {
932
+ skeleton: _o
933
+ }, pe = ({ style: e }) => /* @__PURE__ */ r("span", {
934
+ className: mo.skeleton,
935
+ style: e
936
+ }), po = "_root_17qqv_1", vo = {
937
+ root: po
938
+ }, go = () => /* @__PURE__ */ h(ze, {
939
+ className: vo.root,
940
+ children: [
941
+ /* @__PURE__ */ r(pe, {
942
+ style: {
943
+ height: "3rem",
944
+ marginBottom: "0.75rem"
945
+ }
946
+ }),
947
+ /* @__PURE__ */ r(pe, {
948
+ style: {
949
+ height: "6rem",
950
+ margin: "0.5rem 0"
951
+ }
952
+ }),
953
+ /* @__PURE__ */ r("div", {
954
+ style: {
955
+ borderTop: "var(--tweet-border)",
956
+ margin: "0.5rem 0"
957
+ }
958
+ }),
959
+ /* @__PURE__ */ r(pe, {
960
+ style: {
961
+ height: "2rem"
962
+ }
963
+ }),
964
+ /* @__PURE__ */ r(pe, {
965
+ style: {
966
+ height: "2rem",
967
+ borderRadius: "9999px",
968
+ marginTop: "0.5rem"
969
+ }
970
+ })
971
+ ]
972
+ }), Nt = 0, It = 1, Rt = 2, lt = 3;
973
+ var dt = Object.prototype.hasOwnProperty;
974
+ function $e(e, t) {
975
+ var n, o;
976
+ if (e === t) return !0;
977
+ if (e && t && (n = e.constructor) === t.constructor) {
978
+ if (n === Date) return e.getTime() === t.getTime();
979
+ if (n === RegExp) return e.toString() === t.toString();
980
+ if (n === Array) {
981
+ if ((o = e.length) === t.length)
982
+ for (; o-- && $e(e[o], t[o]); ) ;
983
+ return o === -1;
984
+ }
985
+ if (!n || typeof e == "object") {
986
+ o = 0;
987
+ for (n in e)
988
+ if (dt.call(e, n) && ++o && !dt.call(t, n) || !(n in t) || !$e(e[n], t[n])) return !1;
989
+ return Object.keys(t).length === o;
990
+ }
991
+ }
992
+ return e !== e && t !== t;
993
+ }
994
+ const F = /* @__PURE__ */ new WeakMap(), P = () => {
995
+ }, R = (
996
+ /*#__NOINLINE__*/
997
+ P()
998
+ ), qe = Object, u = (e) => e === R, j = (e) => typeof e == "function", z = (e, t) => ({
999
+ ...e,
1000
+ ...t
1001
+ }), St = (e) => j(e.then), Re = {}, ve = {}, He = "undefined", ue = typeof window != He, De = typeof document != He, wo = ue && "Deno" in window, yo = () => ue && typeof window.requestAnimationFrame != He, kt = (e, t) => {
1002
+ const n = F.get(e);
1003
+ return [
1004
+ // Getter
1005
+ () => !u(t) && e.get(t) || Re,
1006
+ // Setter
1007
+ (o) => {
1008
+ if (!u(t)) {
1009
+ const a = e.get(t);
1010
+ t in ve || (ve[t] = a), n[5](t, z(a, o), a || Re);
1011
+ }
1012
+ },
1013
+ // Subscriber
1014
+ n[6],
1015
+ // Get server cache snapshot
1016
+ () => !u(t) && t in ve ? ve[t] : !u(t) && e.get(t) || Re
1017
+ ];
1018
+ };
1019
+ let Ae = !0;
1020
+ const bo = () => Ae, [Ve, Me] = ue && window.addEventListener ? [
1021
+ window.addEventListener.bind(window),
1022
+ window.removeEventListener.bind(window)
1023
+ ] : [
1024
+ P,
1025
+ P
1026
+ ], To = () => {
1027
+ const e = De && document.visibilityState;
1028
+ return u(e) || e !== "hidden";
1029
+ }, xo = (e) => (De && document.addEventListener("visibilitychange", e), Ve("focus", e), () => {
1030
+ De && document.removeEventListener("visibilitychange", e), Me("focus", e);
1031
+ }), No = (e) => {
1032
+ const t = () => {
1033
+ Ae = !0, e();
1034
+ }, n = () => {
1035
+ Ae = !1;
1036
+ };
1037
+ return Ve("online", t), Ve("offline", n), () => {
1038
+ Me("online", t), Me("offline", n);
1039
+ };
1040
+ }, Io = {
1041
+ isOnline: bo,
1042
+ isVisible: To
1043
+ }, Ro = {
1044
+ initFocus: xo,
1045
+ initReconnect: No
1046
+ }, ut = !Be.useId, ie = !ue || wo, So = (e) => yo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Se = ie ? Fe : Ht, ke = typeof navigator < "u" && navigator.connection, ft = !ie && ke && ([
1047
+ "slow-2g",
1048
+ "2g"
1049
+ ].includes(ke.effectiveType) || ke.saveData), ge = /* @__PURE__ */ new WeakMap(), ko = (e) => qe.prototype.toString.call(e), Ee = (e, t) => e === `[object ${t}]`;
1050
+ let Eo = 0;
1051
+ const je = (e) => {
1052
+ const t = typeof e, n = ko(e), o = Ee(n, "Date"), a = Ee(n, "RegExp"), i = Ee(n, "Object");
1053
+ let s, c;
1054
+ if (qe(e) === e && !o && !a) {
1055
+ if (s = ge.get(e), s) return s;
1056
+ if (s = ++Eo + "~", ge.set(e, s), Array.isArray(e)) {
1057
+ for (s = "@", c = 0; c < e.length; c++)
1058
+ s += je(e[c]) + ",";
1059
+ ge.set(e, s);
1060
+ }
1061
+ if (i) {
1062
+ s = "#";
1063
+ const f = qe.keys(e).sort();
1064
+ for (; !u(c = f.pop()); )
1065
+ u(e[c]) || (s += c + ":" + je(e[c]) + ",");
1066
+ ge.set(e, s);
1067
+ }
1068
+ } else
1069
+ s = o ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
1070
+ return s;
1071
+ }, Ge = (e) => {
1072
+ if (j(e))
1073
+ try {
1074
+ e = e();
1075
+ } catch {
1076
+ e = "";
1077
+ }
1078
+ const t = e;
1079
+ return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? je(e) : "", [
1080
+ e,
1081
+ t
1082
+ ];
1083
+ };
1084
+ let Co = 0;
1085
+ const We = () => ++Co;
1086
+ async function Et(...e) {
1087
+ const [t, n, o, a] = e, i = z({
1088
+ populateCache: !0,
1089
+ throwOnError: !0
1090
+ }, typeof a == "boolean" ? {
1091
+ revalidate: a
1092
+ } : a || {});
1093
+ let s = i.populateCache;
1094
+ const c = i.rollbackOnError;
1095
+ let f = i.optimisticData;
1096
+ const d = (b) => typeof c == "function" ? c(b) : c !== !1, g = i.throwOnError;
1097
+ if (j(n)) {
1098
+ const b = n, I = [], E = t.keys();
1099
+ for (const L of E)
1100
+ // Skip the special useSWRInfinite and useSWRSubscription keys.
1101
+ !/^\$(inf|sub)\$/.test(L) && b(t.get(L)._k) && I.push(L);
1102
+ return Promise.all(I.map(m));
1103
+ }
1104
+ return m(n);
1105
+ async function m(b) {
1106
+ const [I] = Ge(b);
1107
+ if (!I) return;
1108
+ const [E, L] = kt(t, I), [D, ce, l, fe] = F.get(t), J = () => {
1109
+ const $ = D[I];
1110
+ return (j(i.revalidate) ? i.revalidate(E().data, b) : i.revalidate !== !1) && (delete l[I], delete fe[I], $ && $[0]) ? $[0](Rt).then(() => E().data) : E().data;
1111
+ };
1112
+ if (e.length < 3)
1113
+ return J();
1114
+ let T = o, A, V = !1;
1115
+ const Y = We();
1116
+ ce[I] = [
1117
+ Y,
1118
+ 0
1119
+ ];
1120
+ const p = !u(f), Z = E(), M = Z.data, ee = Z._c, H = u(ee) ? M : ee;
1121
+ if (p && (f = j(f) ? f(H, M) : f, L({
1122
+ data: f,
1123
+ _c: H
1124
+ })), j(T))
1125
+ try {
1126
+ T = T(H);
1127
+ } catch ($) {
1128
+ A = $, V = !0;
1129
+ }
1130
+ if (T && St(T))
1131
+ if (T = await T.catch(($) => {
1132
+ A = $, V = !0;
1133
+ }), Y !== ce[I][0]) {
1134
+ if (V) throw A;
1135
+ return T;
1136
+ } else V && p && d(A) && (s = !0, L({
1137
+ data: H,
1138
+ _c: R
1139
+ }));
1140
+ if (s && !V)
1141
+ if (j(s)) {
1142
+ const $ = s(T, H);
1143
+ L({
1144
+ data: $,
1145
+ error: R,
1146
+ _c: R
1147
+ });
1148
+ } else
1149
+ L({
1150
+ data: T,
1151
+ error: R,
1152
+ _c: R
1153
+ });
1154
+ if (ce[I][1] = We(), Promise.resolve(J()).then(() => {
1155
+ L({
1156
+ _c: R
1157
+ });
1158
+ }), V) {
1159
+ if (g) throw A;
1160
+ return;
1161
+ }
1162
+ return T;
1163
+ }
1164
+ }
1165
+ const ht = (e, t) => {
1166
+ for (const n in e)
1167
+ e[n][0] && e[n][0](t);
1168
+ }, Oo = (e, t) => {
1169
+ if (!F.has(e)) {
1170
+ const n = z(Ro, t), o = /* @__PURE__ */ Object.create(null), a = Et.bind(R, e);
1171
+ let i = P;
1172
+ const s = /* @__PURE__ */ Object.create(null), c = (g, m) => {
1173
+ const b = s[g] || [];
1174
+ return s[g] = b, b.push(m), () => b.splice(b.indexOf(m), 1);
1175
+ }, f = (g, m, b) => {
1176
+ e.set(g, m);
1177
+ const I = s[g];
1178
+ if (I)
1179
+ for (const E of I)
1180
+ E(m, b);
1181
+ }, d = () => {
1182
+ if (!F.has(e) && (F.set(e, [
1183
+ o,
1184
+ /* @__PURE__ */ Object.create(null),
1185
+ /* @__PURE__ */ Object.create(null),
1186
+ /* @__PURE__ */ Object.create(null),
1187
+ a,
1188
+ f,
1189
+ c
1190
+ ]), !ie)) {
1191
+ const g = n.initFocus(setTimeout.bind(R, ht.bind(R, o, Nt))), m = n.initReconnect(setTimeout.bind(R, ht.bind(R, o, It)));
1192
+ i = () => {
1193
+ g && g(), m && m(), F.delete(e);
1194
+ };
1195
+ }
1196
+ };
1197
+ return d(), [
1198
+ e,
1199
+ a,
1200
+ d,
1201
+ i
1202
+ ];
1203
+ }
1204
+ return [
1205
+ e,
1206
+ F.get(e)[4]
1207
+ ];
1208
+ }, Lo = (e, t, n, o, a) => {
1209
+ const i = n.errorRetryCount, s = a.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
1210
+ !u(i) && s > i || setTimeout(o, c, a);
1211
+ }, $o = $e, [Ct, qo] = Oo(/* @__PURE__ */ new Map()), Do = z(
1212
+ {
1213
+ // events
1214
+ onLoadingSlow: P,
1215
+ onSuccess: P,
1216
+ onError: P,
1217
+ onErrorRetry: Lo,
1218
+ onDiscarded: P,
1219
+ // switches
1220
+ revalidateOnFocus: !0,
1221
+ revalidateOnReconnect: !0,
1222
+ revalidateIfStale: !0,
1223
+ shouldRetryOnError: !0,
1224
+ // timeouts
1225
+ errorRetryInterval: ft ? 1e4 : 5e3,
1226
+ focusThrottleInterval: 5 * 1e3,
1227
+ dedupingInterval: 2 * 1e3,
1228
+ loadingTimeout: ft ? 5e3 : 3e3,
1229
+ // providers
1230
+ compare: $o,
1231
+ isPaused: () => !1,
1232
+ cache: Ct,
1233
+ mutate: qo,
1234
+ fallback: {}
1235
+ },
1236
+ // use web preset by default
1237
+ Io
1238
+ ), Ao = (e, t) => {
1239
+ const n = z(e, t);
1240
+ if (t) {
1241
+ const { use: o, fallback: a } = e, { use: i, fallback: s } = t;
1242
+ o && i && (n.use = o.concat(i)), a && s && (n.fallback = z(a, s));
1243
+ }
1244
+ return n;
1245
+ }, Vo = zt({}), Mo = "$inf$", Ot = ue && window.__SWR_DEVTOOLS_USE__, jo = Ot ? window.__SWR_DEVTOOLS_USE__ : [], Wo = () => {
1246
+ Ot && (window.__SWR_DEVTOOLS_REACT__ = Be);
1247
+ }, Bo = (e) => j(e[1]) ? [
1248
+ e[0],
1249
+ e[1],
1250
+ e[2] || {}
1251
+ ] : [
1252
+ e[0],
1253
+ null,
1254
+ (e[1] === null ? e[2] : e[1]) || {}
1255
+ ], Fo = () => {
1256
+ const e = Gt(Vo);
1257
+ return Pe(() => z(Do, e), [
1258
+ e
1259
+ ]);
1260
+ }, Po = (e) => (t, n, o) => e(t, n && ((...i) => {
1261
+ const [s] = Ge(t), [, , , c] = F.get(Ct);
1262
+ if (s.startsWith(Mo))
1263
+ return n(...i);
1264
+ const f = c[s];
1265
+ return u(f) ? n(...i) : (delete c[s], f);
1266
+ }), o), Uo = jo.concat(Po), zo = (e) => function(...n) {
1267
+ const o = Fo(), [a, i, s] = Bo(n), c = Ao(o, s);
1268
+ let f = e;
1269
+ const { use: d } = c, g = (d || []).concat(Uo);
1270
+ for (let m = g.length; m--; )
1271
+ f = g[m](f);
1272
+ return f(a, i || c.fetcher || null, c);
1273
+ }, Ho = (e, t, n) => {
1274
+ const o = t[e] || (t[e] = []);
1275
+ return o.push(n), () => {
1276
+ const a = o.indexOf(n);
1277
+ a >= 0 && (o[a] = o[o.length - 1], o.pop());
1278
+ };
1279
+ };
1280
+ Wo();
1281
+ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
1282
+ // and emitting an error.
1283
+ // We assume that this is only for the `use(thenable)` case, not `use(context)`.
1284
+ // https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
1285
+ ((e) => {
1286
+ switch (e.status) {
1287
+ case "pending":
1288
+ throw e;
1289
+ case "fulfilled":
1290
+ return e.value;
1291
+ case "rejected":
1292
+ throw e.reason;
1293
+ default:
1294
+ throw e.status = "pending", e.then((t) => {
1295
+ e.status = "fulfilled", e.value = t;
1296
+ }, (t) => {
1297
+ e.status = "rejected", e.reason = t;
1298
+ }), e;
1299
+ }
1300
+ }), Oe = {
1301
+ dedupe: !0
1302
+ }, _t = Promise.resolve(R), Go = (e, t, n) => {
1303
+ const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: d, refreshWhenHidden: g, refreshWhenOffline: m, keepPreviousData: b, strictServerPrefetchWarning: I } = n, [E, L, D, ce] = F.get(o), [l, fe] = Ge(e), J = K(!1), T = K(!1), A = K(l), V = K(t), Y = K(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, H, $] = kt(o, l), te = K({}).current, he = u(s) ? u(n.fallback) ? R : n.fallback[l] : s, Xe = (_, v) => {
1304
+ for (const y in te) {
1305
+ const w = y;
1306
+ if (w === "data") {
1307
+ if (!a(_[w], v[w]) && (!u(_[w]) || !a(me, v[w])))
1308
+ return !1;
1309
+ } else if (v[w] !== _[w])
1310
+ return !1;
1311
+ }
1312
+ return !0;
1313
+ }, Ke = Pe(() => {
1314
+ const _ = !l || !t ? !1 : u(c) ? p().isPaused() || i ? !1 : f !== !1 : c, v = (S) => {
1315
+ const W = z(S);
1316
+ return delete W._k, _ ? {
1317
+ isValidating: !0,
1318
+ isLoading: !0,
1319
+ ...W
1320
+ } : W;
1321
+ }, y = M(), w = $(), q = v(y), oe = y === w ? q : v(w);
1322
+ let x = q;
1323
+ return [
1324
+ () => {
1325
+ const S = v(M());
1326
+ return Xe(S, x) ? (x.data = S.data, x.isLoading = S.isLoading, x.isValidating = S.isValidating, x.error = S.error, x) : (x = S, S);
1327
+ },
1328
+ () => oe
1329
+ ];
1330
+ }, [
1331
+ o,
1332
+ l
1333
+ ]), ne = rt.useSyncExternalStore(Te(
1334
+ (_) => H(l, (v, y) => {
1335
+ Xe(y, v) || _();
1336
+ }),
1337
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1338
+ [
1339
+ o,
1340
+ l
1341
+ ]
1342
+ ), Ke[0], Ke[1]), Qe = !J.current, $t = E[l] && E[l].length > 0, re = ne.data, G = u(re) ? he && St(he) ? Ce(he) : he : re, _e = ne.error, we = K(G), me = b ? u(re) ? u(we.current) ? G : we.current : re : G, X = l && u(G), qt = !ie && // eslint-disable-next-line react-hooks/rules-of-hooks
1343
+ rt.useSyncExternalStore(() => P, () => !1, () => !0);
1344
+ I && qt && !i && X && console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);
1345
+ const Je = $t && !u(_e) ? !1 : Qe && !u(c) ? c : p().isPaused() ? !1 : i ? u(G) ? !1 : f : u(G) || f, Ye = !!(l && t && Qe && Je), Dt = u(ne.isValidating) ? Ye : ne.isValidating, At = u(ne.isLoading) ? Ye : ne.isLoading, le = Te(
1346
+ async (_) => {
1347
+ const v = V.current;
1348
+ if (!l || !v || T.current || p().isPaused())
1349
+ return !1;
1350
+ let y, w, q = !0;
1351
+ const oe = _ || {}, x = !D[l] || !oe.dedupe, S = () => ut ? !T.current && l === A.current && J.current : l === A.current, W = {
1352
+ isValidating: !1,
1353
+ isLoading: !1
1354
+ }, et = () => {
1355
+ ee(W);
1356
+ }, tt = () => {
1357
+ const O = D[l];
1358
+ O && O[1] === w && delete D[l];
1359
+ }, nt = {
1360
+ isValidating: !0
1361
+ };
1362
+ u(M().data) && (nt.isLoading = !0);
1363
+ try {
1364
+ if (x && (ee(nt), n.loadingTimeout && u(M().data) && setTimeout(() => {
1365
+ q && S() && p().onLoadingSlow(l, n);
1366
+ }, n.loadingTimeout), D[l] = [
1367
+ v(fe),
1368
+ We()
1369
+ ]), [y, w] = D[l], y = await y, x && setTimeout(tt, n.dedupingInterval), !D[l] || D[l][1] !== w)
1370
+ return x && S() && p().onDiscarded(l), !1;
1371
+ W.error = R;
1372
+ const O = L[l];
1373
+ if (!u(O) && // case 1
1374
+ (w <= O[0] || // case 2
1375
+ w <= O[1] || // case 3
1376
+ O[1] === 0))
1377
+ return et(), x && S() && p().onDiscarded(l), !1;
1378
+ const B = M().data;
1379
+ W.data = a(B, y) ? B : y, x && S() && p().onSuccess(y, l, n);
1380
+ } catch (O) {
1381
+ tt();
1382
+ const B = p(), { shouldRetryOnError: ye } = B;
1383
+ B.isPaused() || (W.error = O, x && S() && (B.onError(O, l, B), (ye === !0 || j(ye) && ye(O)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(O, l, B, (Vt) => {
1384
+ const be = E[l];
1385
+ be && be[0] && be[0](lt, Vt);
1386
+ }, {
1387
+ retryCount: (oe.retryCount || 0) + 1,
1388
+ dedupe: !0
1389
+ })));
1390
+ }
1391
+ return q = !1, et(), !0;
1392
+ },
1393
+ // `setState` is immutable, and `eventsCallback`, `fnArg`, and
1394
+ // `keyValidating` are depending on `key`, so we can exclude them from
1395
+ // the deps array.
1396
+ //
1397
+ // FIXME:
1398
+ // `fn` and `config` might be changed during the lifecycle,
1399
+ // but they might be changed every render like this.
1400
+ // `useSWR('key', () => fetch('/api/'), { suspense: true })`
1401
+ // So we omit the values from the deps array
1402
+ // even though it might cause unexpected behaviors.
1403
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1404
+ [
1405
+ l,
1406
+ o
1407
+ ]
1408
+ ), Ze = Te(
1409
+ // Use callback to make sure `keyRef.current` returns latest result every time
1410
+ (..._) => Et(o, A.current, ..._),
1411
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1412
+ []
1413
+ );
1414
+ if (Se(() => {
1415
+ V.current = t, Y.current = n, u(re) || (we.current = re);
1416
+ }), Se(() => {
1417
+ if (!l) return;
1418
+ const _ = le.bind(R, Oe);
1419
+ let v = 0;
1420
+ p().revalidateOnFocus && (v = Date.now() + p().focusThrottleInterval);
1421
+ const w = Ho(l, E, (q, oe = {}) => {
1422
+ if (q == Nt) {
1423
+ const x = Date.now();
1424
+ p().revalidateOnFocus && x > v && Z() && (v = x + p().focusThrottleInterval, _());
1425
+ } else if (q == It)
1426
+ p().revalidateOnReconnect && Z() && _();
1427
+ else {
1428
+ if (q == Rt)
1429
+ return le();
1430
+ if (q == lt)
1431
+ return le(oe);
1432
+ }
1433
+ });
1434
+ return T.current = !1, A.current = l, J.current = !0, ee({
1435
+ _k: fe
1436
+ }), Je && (D[l] || (u(G) || ie ? _() : So(_))), () => {
1437
+ T.current = !0, w();
1438
+ };
1439
+ }, [
1440
+ l
1441
+ ]), Se(() => {
1442
+ let _;
1443
+ function v() {
1444
+ const w = j(d) ? d(M().data) : d;
1445
+ w && _ !== -1 && (_ = setTimeout(y, w));
1446
+ }
1447
+ function y() {
1448
+ !M().error && (g || p().isVisible()) && (m || p().isOnline()) ? le(Oe).then(v) : v();
1449
+ }
1450
+ return v(), () => {
1451
+ _ && (clearTimeout(_), _ = -1);
1452
+ };
1453
+ }, [
1454
+ d,
1455
+ g,
1456
+ m,
1457
+ l
1458
+ ]), Xt(me), i) {
1459
+ if (!ut && ie && X)
1460
+ throw new Error("Fallback data is required when using Suspense in SSR.");
1461
+ X && (V.current = t, Y.current = n, T.current = !1);
1462
+ const _ = ce[l], v = !u(_) && X ? Ze(_) : _t;
1463
+ if (Ce(v), !u(_e) && X)
1464
+ throw _e;
1465
+ const y = X ? le(Oe) : _t;
1466
+ !u(me) && X && (y.status = "fulfilled", y.value = !0), Ce(y);
1467
+ }
1468
+ return {
1469
+ mutate: Ze,
1470
+ get data() {
1471
+ return te.data = !0, me;
1472
+ },
1473
+ get error() {
1474
+ return te.error = !0, _e;
1475
+ },
1476
+ get isValidating() {
1477
+ return te.isValidating = !0, Dt;
1478
+ },
1479
+ get isLoading() {
1480
+ return te.isLoading = !0, At;
1481
+ }
1482
+ };
1483
+ }, mt = zo(Go);
1484
+ class Xo extends Error {
1485
+ constructor({ message: t, status: n, data: o }) {
1486
+ super(t), this.name = "TwitterApiError", this.status = n, this.data = o;
1487
+ }
1488
+ }
1489
+ const Ko = mt.default || mt, Qo = "https://react-tweet.vercel.app";
1490
+ async function Jo([e, t]) {
1491
+ const n = await fetch(e, t), o = await n.json();
1492
+ if (n.ok) return o.data || null;
1493
+ throw new Xo({
1494
+ message: `Failed to fetch tweet at "${e}" with "${n.status}".`,
1495
+ data: o,
1496
+ status: n.status
1497
+ });
1498
+ }
1499
+ const Yo = (e, t, n) => {
1500
+ const { isLoading: o, data: a, error: i } = Ko(() => t || e ? [
1501
+ t || e && `${Qo}/api/tweet/${e}`,
1502
+ n
1503
+ ] : null, Jo, {
1504
+ revalidateIfStale: !1,
1505
+ revalidateOnFocus: !1,
1506
+ shouldRetryOnError: !1
1507
+ });
1508
+ return {
1509
+ // If data is `undefined` then it might be the first render where SWR hasn't started doing
1510
+ // any work, so we set `isLoading` to `true`.
1511
+ isLoading: !!(o || a === void 0 && !i),
1512
+ data: a,
1513
+ error: i
1514
+ };
1515
+ }, Zo = ({ id: e, apiUrl: t, fallback: n = /* @__PURE__ */ r(go, {}), components: o, fetchOptions: a, onError: i }) => {
1516
+ const { data: s, error: c, isLoading: f } = Yo(e, t, a);
1517
+ if (f) return n;
1518
+ if (c || !s) {
1519
+ const d = (o == null ? void 0 : o.TweetNotFound) || ho;
1520
+ return /* @__PURE__ */ r(d, {
1521
+ error: i ? i(c) : c
1522
+ });
1523
+ }
1524
+ return /* @__PURE__ */ r(lo, {
1525
+ tweet: s,
1526
+ components: o
1527
+ });
1528
+ };
1529
+ function ea({ node: e }) {
1530
+ var o;
1531
+ const t = ((o = e == null ? void 0 : e.attrs) == null ? void 0 : o.src) || "", n = t == null ? void 0 : t.split("/").pop();
1532
+ return n ? /* @__PURE__ */ r(Mt, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(Zo, { id: n }) }) }) : null;
1533
+ }
1534
+ function ta(e) {
1535
+ const { t } = rn(), [n, o] = se("");
1536
+ Fe(() => {
1537
+ var i;
1538
+ if (e != null && e.editor) {
1539
+ const { src: s } = (i = e.editor) == null ? void 0 : i.getAttributes(Lt.name);
1540
+ s && o(s);
1541
+ }
1542
+ }, [e == null ? void 0 : e.editor]);
1543
+ function a(i) {
1544
+ i.preventDefault(), i.stopPropagation(), e == null || e.onSetLink(n);
1545
+ }
1546
+ return /* @__PURE__ */ h("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: a, children: [
1547
+ /* @__PURE__ */ r(Kt, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
1548
+ /* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
1549
+ Qt,
1550
+ {
1551
+ className: "richtext-w-80",
1552
+ onChange: (i) => o(i.target.value),
1553
+ placeholder: "Text",
1554
+ required: !0,
1555
+ type: "text",
1556
+ value: n
1557
+ }
1558
+ ) }) }),
1559
+ /* @__PURE__ */ r(Jt, { className: "richtext-mt-2 richtext-self-end", type: "submit", children: t("editor.link.dialog.button.apply") })
1560
+ ] });
1561
+ }
1562
+ function fa() {
1563
+ const [e, t] = se(!1), n = Yt(), o = Zt(Lt.name), {
1564
+ icon: a = void 0,
1565
+ tooltip: i = void 0,
1566
+ tooltipOptions: s = {},
1567
+ action: c = void 0,
1568
+ isActive: f = void 0
1569
+ } = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: d } = en(f);
1570
+ function g(m) {
1571
+ d || c && (c(m), t(!1));
1572
+ }
1573
+ return /* @__PURE__ */ h(on, { modal: !0, onOpenChange: t, open: e, children: [
1574
+ /* @__PURE__ */ r(an, { asChild: !0, children: /* @__PURE__ */ r(
1575
+ tn,
1576
+ {
1577
+ disabled: d,
1578
+ isActive: f,
1579
+ tooltip: i,
1580
+ tooltipOptions: s,
1581
+ children: /* @__PURE__ */ r(nn, { name: a })
1582
+ }
1583
+ ) }),
1584
+ /* @__PURE__ */ r(sn, { align: "start", className: "richtext-w-full", hideWhenDetached: !0, side: "bottom", children: /* @__PURE__ */ r(ta, { editor: n, onSetLink: g }) })
1585
+ ] });
1586
+ }
1587
+ const na = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, ra = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
1588
+ function pt(e) {
1589
+ return e.match(ra);
1590
+ }
1591
+ const Lt = /* @__PURE__ */ jt.create({
1592
+ name: "twitter",
1593
+ draggable: !0,
1594
+ selectable: !0,
1595
+ addOptions() {
1596
+ return {
1597
+ addPasteHandler: !0,
1598
+ HTMLAttributes: {},
1599
+ inline: !1,
1600
+ origin: "",
1601
+ button: ({ editor: e, t }) => ({
1602
+ componentProps: {
1603
+ action: (n) => {
1604
+ e.commands.setTweet({ src: n });
1605
+ },
1606
+ isActive: () => !1,
1607
+ disabled: !1,
1608
+ icon: "Twitter",
1609
+ tooltip: t("editor.twitter.tooltip"),
1610
+ editor: e
1611
+ }
1612
+ })
1613
+ };
1614
+ },
1615
+ addNodeView() {
1616
+ return Ft(ea, {
1617
+ attrs: this.options.HTMLAttributes
1618
+ });
1619
+ },
1620
+ inline() {
1621
+ return this.options.inline;
1622
+ },
1623
+ group() {
1624
+ return this.options.inline ? "inline" : "block";
1625
+ },
1626
+ addAttributes() {
1627
+ return {
1628
+ src: {
1629
+ default: null
1630
+ }
1631
+ };
1632
+ },
1633
+ parseHTML() {
1634
+ return [
1635
+ {
1636
+ tag: "div[data-twitter]"
1637
+ }
1638
+ ];
1639
+ },
1640
+ addCommands() {
1641
+ return {
1642
+ setTweet: (e) => ({ commands: t }) => pt(e.src) ? t.insertContent({
1643
+ type: this.name,
1644
+ attrs: e
1645
+ }) : !1,
1646
+ updateTweet: (e) => ({ commands: t }) => pt(e.src) ? t.updateAttributes(this.name, { src: e.src }) : !1
1647
+ };
1648
+ },
1649
+ addPasteRules() {
1650
+ return this.options.addPasteHandler ? [
1651
+ Bt({
1652
+ find: na,
1653
+ type: this.type,
1654
+ getAttributes: (e) => ({ src: e.input })
1655
+ })
1656
+ ] : [];
1657
+ },
1658
+ renderHTML({ HTMLAttributes: e }) {
1659
+ return ["div", Wt({ "data-twitter": "" }, e)];
1660
+ }
1661
+ });
1662
+ export {
1663
+ ta as F,
1664
+ fa as R,
1665
+ Lt as T
1666
+ };