reactjs-tiptap-editor 1.0.16 → 1.0.18
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.
- package/lib/{ActionMenuButton-a8LhmHXe.js → ActionMenuButton-BOjCHFTA.js} +12 -16
- package/lib/ActionMenuButton-Df077oOH.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +47 -89
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +11 -14
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +13 -16
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +15 -18
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +113 -113
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +12 -14
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +8 -11
- package/lib/CodeBlock.cjs +37 -37
- package/lib/CodeBlock.js +1566 -1613
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +9 -11
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +62 -82
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +27 -15
- package/lib/Drawer-DwrlY_lY.cjs +1 -0
- package/lib/Drawer-DxOoRiGQ.js +1099 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +71 -97
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +265 -5
- package/lib/ExportPdf.cjs +4 -4
- package/lib/ExportPdf.js +20 -31
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +11 -11
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +16 -39
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +25 -41
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +51 -65
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +60 -76
- package/lib/History.cjs +1 -1
- package/lib/History.js +322 -320
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +8 -11
- package/lib/{Iframe-CmjbQQcz.js → Iframe-AhNV5WH5.js} +52 -65
- package/lib/Iframe-C6pBw-AF.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +5 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +5 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +148 -181
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +19 -26
- package/lib/{Indent-BoG-vpIE.js → Indent-DZ5PcJA4.js} +24 -30
- package/lib/Indent-Do-X0AsY.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +11 -14
- package/lib/Katex-CIC9ygbL.cjs +4 -0
- package/lib/{Katex-ByL9snce.js → Katex-bIgoenn_.js} +243 -262
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +5 -4
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +23 -34
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-B0ZaACZO.cjs +5 -0
- package/lib/{LinkEditBlock-Ckih17pU.js → LinkEditBlock-D_cF9fnc.js} +324 -381
- package/lib/MarkdownPaste.cjs +58 -0
- package/lib/MarkdownPaste.js +1656 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +22 -17
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +125 -154
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +28 -40
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +13 -16
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +114 -186
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +15 -14
- package/lib/SlashCommandNodeView-Ba03hlVZ.cjs +1 -0
- package/lib/{SlashCommandNodeView-B2g1MbgN.js → SlashCommandNodeView-cg0x3NRF.js} +72 -79
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +12 -15
- package/lib/{Table-BEwrZVup.js → Table-KqLiT5wG.js} +85 -125
- package/lib/Table-ddU2LSc6.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +18 -21
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +65 -78
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +51 -77
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +7 -10
- package/lib/Twitter-BIiR78Jh.cjs +1 -0
- package/lib/{Twitter-4U_ZBhpv.js → Twitter-C1Lzqc7u.js} +567 -599
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +4 -3
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +5 -270
- package/lib/bubble.cjs +6 -4
- package/lib/bubble.js +3719 -3039
- package/lib/clsx-BWE7vnna.cjs +33 -0
- package/lib/clsx-eGVyq7ot.js +1062 -0
- package/lib/components/ActionButton.d.ts +2 -2
- package/lib/components/ActionMenuButton.d.ts +1 -1
- package/lib/components/Bubble/formatBubble.d.ts +5 -5
- package/lib/components/ReactBus.d.ts +11 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadImage.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/RenderDialogUploadVideo.d.ts +1 -0
- package/lib/components/SlashDialogTrigger/SlashDialogTrigger.d.ts +5 -0
- package/lib/components/ui/checkbox.d.ts +1 -1
- package/lib/components/ui/dialog.d.ts +1 -1
- package/lib/components/ui/dropdown-menu.d.ts +1 -1
- package/lib/components/ui/emoji-picker.d.ts +1 -1
- package/lib/components/ui/label.d.ts +1 -1
- package/lib/components/ui/popover.d.ts +1 -1
- package/lib/components/ui/select.d.ts +1 -1
- package/lib/components/ui/separator.d.ts +1 -1
- package/lib/components/ui/switch.d.ts +1 -1
- package/lib/components/ui/tabs.d.ts +1 -1
- package/lib/components/ui/toast.d.ts +1 -1
- package/lib/components/ui/toggle.d.ts +1 -1
- package/lib/components/ui/tooltip.d.ts +1 -1
- package/lib/{delete-node-IyVmiRbI.js → delete-node-eQHsyyhR.js} +3 -1
- package/lib/{dropdown-menu-CW3Kthwy.js → dropdown-menu-CexIkt_V.js} +8 -8
- package/lib/{dropdown-menu-eUeBXQeA.cjs → dropdown-menu-oSKIntXM.cjs} +1 -1
- package/lib/extensions/Blockquote/Blockquote.d.ts +1 -1
- package/lib/extensions/Bold/Bold.d.ts +1 -1
- package/lib/extensions/Code/Code.d.ts +1 -1
- package/lib/extensions/CodeView/CodeView.d.ts +2 -2
- package/lib/extensions/Heading/Heading.d.ts +1 -1
- package/lib/extensions/Highlight/Highlight.d.ts +1 -1
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +1 -1
- package/lib/extensions/ImportWord/ImportWord.d.ts +2 -2
- package/lib/extensions/Italic/Italic.d.ts +1 -1
- package/lib/extensions/Link/Link.d.ts +1 -1
- package/lib/extensions/MarkdownPaste/MarkdownPaste.d.ts +5 -0
- package/lib/extensions/MarkdownPaste/index.d.ts +1 -0
- package/lib/extensions/Mermaid/Mermaid.d.ts +1 -1
- package/lib/extensions/MoreMark/MoreMark.d.ts +1 -1
- package/lib/extensions/Strike/Strike.d.ts +1 -1
- package/lib/extensions/Table/Table.d.ts +1 -1
- package/lib/extensions/TextAlign/TextAlign.d.ts +1 -1
- package/lib/extensions/TextUnderline/TextUnderline.d.ts +1 -1
- package/lib/index-BUTn2LY6.cjs +1 -0
- package/lib/{index-C07N8gA1.js → index-BlXGgvT-.js} +21 -18
- package/lib/{index-CpTykZBR.js → index-BnW6t8z6.js} +23 -23
- package/lib/{index-BsFvo9PG.cjs → index-BqL4vAWE.cjs} +1 -1
- package/lib/index-BtxvYLJ1.cjs +12 -0
- package/lib/{index-DR5tIdL7.js → index-C6xmkxrQ.js} +232 -217
- package/lib/index-CJ9pyCM4.cjs +1 -0
- package/lib/{index-neeeY2o7.cjs → index-D0lc95kr.cjs} +3 -3
- package/lib/index-DHUN85fV.js +4855 -0
- package/lib/index-DUpSE1Gb.cjs +1 -0
- package/lib/index-D_8P0LE5.js +1362 -0
- package/lib/{index-4bHF5ovf.js → index-RIXs7STX.js} +1 -1
- package/lib/index-mfGK4pFo.js +6469 -0
- package/lib/index-zig3Dj7A.cjs +22 -0
- package/lib/index.cjs +3 -3
- package/lib/index.js +60 -72
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +1 -1
- package/lib/plugins/image-upload.d.ts +1 -1
- package/lib/popover-BYSZ3zBi.js +24 -0
- package/lib/popover-BcHDZqBt.cjs +1 -0
- package/lib/{renderNodeView-CSazLrKF.js → renderNodeView-BrM5kUj_.js} +2 -2
- package/lib/{renderNodeView-DfLmGrgA.cjs → renderNodeView-D1zydtli.cjs} +1 -1
- package/lib/{select-F0ZZ3VZB.js → select-C5SHDLFj.js} +8 -5
- package/lib/{select-Doa_-jkZ.cjs → select-DHjzKkcu.cjs} +1 -1
- package/lib/separator-BmixLrnJ.cjs +1 -0
- package/lib/separator-CFKVxAea.js +293 -0
- package/lib/store/editor.d.ts +1 -1
- package/lib/store/store.d.ts +2 -22
- package/lib/style.css +1 -1
- package/lib/{textarea-BAolHF_W.cjs → textarea-CasDcv3u.cjs} +1 -1
- package/lib/{textarea-tOsPnxHf.js → textarea-DNLrJoRl.js} +1 -1
- package/lib/theme.js +1 -1
- package/lib/types.d.ts +3 -3
- package/lib/updatePosition-CBRjbQMH.js +16 -0
- package/lib/updatePosition-CfmY5Trk.cjs +1 -0
- package/lib/utils/checkIsVideoUrl.d.ts +1 -0
- package/lib/utils/columns.d.ts +1 -1
- package/lib/utils/customEvents/events.constant.d.ts +1 -0
- package/lib/utils/mitt.d.ts +6 -3
- package/lib/utils/pdf.d.ts +1 -1
- package/lib/utils/utils.d.ts +1 -1
- package/package.json +262 -247
- package/lib/ActionMenuButton-BYu0NyVo.cjs +0 -1
- package/lib/Drawer-CbOJ1Igo.js +0 -1379
- package/lib/Drawer-DNaDMoAk.cjs +0 -1
- package/lib/Excalidraw-DnHTVOj8.js +0 -355
- package/lib/Excalidraw-DxfO1lQ_.cjs +0 -1
- package/lib/Icon-C0TJMAOm.js +0 -12
- package/lib/Icon-DzK0_ztP.cjs +0 -1
- package/lib/Iframe-BSNCsofW.cjs +0 -1
- package/lib/Image-BZEFuS0P.js +0 -925
- package/lib/Image-iKsGKjvg.cjs +0 -1
- package/lib/Indent-Bou16OcB.cjs +0 -1
- package/lib/Katex-BqDocr3a.cjs +0 -4
- package/lib/LinkEditBlock-B0I0EUrt.cjs +0 -5
- package/lib/SlashCommandNodeView-BEJhEzba.cjs +0 -1
- package/lib/Table-BclWwp6P.cjs +0 -9
- package/lib/Twitter-Dtq6PEMC.cjs +0 -1
- package/lib/button-Bwn6gUuS.js +0 -43
- package/lib/button-CqJztfH2.cjs +0 -1
- package/lib/checkbox-BAzbZY2Y.cjs +0 -1
- package/lib/checkbox-B_rpz5Xq.js +0 -27
- package/lib/clsx-CXbNJWDD.cjs +0 -54
- package/lib/clsx-DSzxBzvL.js +0 -7391
- package/lib/dialog-CJvpoeMm.js +0 -101
- package/lib/dialog-CWYTvz5J.cjs +0 -1
- package/lib/events.constant-Dq21NPdV.cjs +0 -1
- package/lib/events.constant-do95b767.js +0 -21
- package/lib/extensions/Image/store.d.ts +0 -4
- package/lib/extensions/Video/store.d.ts +0 -4
- package/lib/file-BLas99n7.js +0 -43
- package/lib/file-i7e4nQY2.cjs +0 -1
- package/lib/index-BCzvbrf5.cjs +0 -12
- package/lib/index-CL7JP-Xz.js +0 -426
- package/lib/index-CjhjjJsN.cjs +0 -1
- package/lib/index-Cn-t3Zxw.cjs +0 -1
- package/lib/index-Cs6cp0Y6.cjs +0 -1
- package/lib/index-D8li6EQ4.js +0 -1351
- package/lib/index-DoiuU6VA.js +0 -2315
- package/lib/index-VhKd73hZ.cjs +0 -1
- package/lib/input-B1egKb-t.js +0 -21
- package/lib/input-ZGRt7lWR.cjs +0 -1
- package/lib/isNumber-BTYSVlKo.cjs +0 -1
- package/lib/isNumber-ClwLypY2.js +0 -15
- package/lib/label-Cjrzc5H2.js +0 -19
- package/lib/label-tzSPdqui.cjs +0 -1
- package/lib/popover-C6Cya3Cz.cjs +0 -1
- package/lib/popover-CeY3RbI5.js +0 -24
- package/lib/separator-CUh5Y7Rh.cjs +0 -1
- package/lib/separator-Cjn4YH8a.js +0 -329
- package/lib/store/fast-context.d.ts +0 -7
- package/lib/store-BsJz5QRC.js +0 -10
- package/lib/store-DjkMIIEN.cjs +0 -1
- package/lib/tabs-BP8ypR_m.cjs +0 -1
- package/lib/tabs-CBDjOLl_.js +0 -46
- package/lib/throttle-D040PfWL.js +0 -249
- package/lib/throttle-gTTvqDTW.cjs +0 -1
- package/lib/toggle-C_SSvDRy.cjs +0 -1
- package/lib/toggle-DEerYRil.js +0 -99
- package/lib/tooltip-BJIvosho.js +0 -24
- package/lib/tooltip-FS1rsvd3.cjs +0 -1
- package/lib/updatePosition-CDK7OR0i.js +0 -16
- package/lib/updatePosition-Cjuj2E26.cjs +0 -1
- package/lib/useButtonProps-CtZCbMQu.js +0 -136
- package/lib/useButtonProps-Cz4W5dC8.cjs +0 -1
- package/lib/utils/_event.d.ts +0 -13
- package/lib/utils/customEvents/customEvents.d.ts +0 -3
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./index-
|
|
1
|
+
import { N as jt, m as Wt, a5 as Bt } from "./index-mfGK4pFo.js";
|
|
2
|
+
import { c as U, s as ot, N as Ft, a as Pt } from "./clsx-eGVyq7ot.js";
|
|
3
|
+
import { jsx as r, jsxs as h, Fragment as Ut } from "react/jsx-runtime";
|
|
4
|
+
import Ue, { useState as se, Fragment as zt, useEffect as ze, useMemo as He, createContext as Ht, useLayoutEffect as Gt, useContext as Xt, useRef as z, useCallback as Re, useDebugValue as Kt } from "react";
|
|
5
|
+
import { L as Qt, j as Jt, B as Yt, h as Zt, u as en, d as tn, A as nn, I as rn } from "./index-DHUN85fV.js";
|
|
6
6
|
import "./theme.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { P as rn, a as on, b as an } from "./popover-CeY3RbI5.js";
|
|
13
|
-
import { I as sn } from "./Icon-C0TJMAOm.js";
|
|
14
|
-
const cn = "_verified_lvyh0_1", Ue = {
|
|
15
|
-
verified: cn
|
|
16
|
-
}, ln = () => /* @__PURE__ */ r("svg", {
|
|
7
|
+
import { u as on } from "./index-BlXGgvT-.js";
|
|
8
|
+
import { P as an, a as sn, b as cn } from "./popover-BYSZ3zBi.js";
|
|
9
|
+
const ln = "_verified_lvyh0_1", Ge = {
|
|
10
|
+
verified: ln
|
|
11
|
+
}, dn = () => /* @__PURE__ */ r("svg", {
|
|
17
12
|
viewBox: "0 0 24 24",
|
|
18
13
|
"aria-label": "Verified account",
|
|
19
14
|
role: "img",
|
|
20
|
-
className:
|
|
15
|
+
className: Ge.verified,
|
|
21
16
|
children: /* @__PURE__ */ r("g", {
|
|
22
17
|
children: /* @__PURE__ */ r("path", {
|
|
23
18
|
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"
|
|
24
19
|
})
|
|
25
20
|
})
|
|
26
|
-
}),
|
|
21
|
+
}), un = () => /* @__PURE__ */ r("svg", {
|
|
27
22
|
viewBox: "0 0 22 22",
|
|
28
23
|
"aria-label": "Verified account",
|
|
29
24
|
role: "img",
|
|
30
|
-
className:
|
|
25
|
+
className: Ge.verified,
|
|
31
26
|
children: /* @__PURE__ */ h("g", {
|
|
32
27
|
children: [
|
|
33
28
|
/* @__PURE__ */ h("linearGradient", {
|
|
@@ -102,11 +97,11 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
102
97
|
})
|
|
103
98
|
]
|
|
104
99
|
})
|
|
105
|
-
}),
|
|
100
|
+
}), fn = () => /* @__PURE__ */ r("svg", {
|
|
106
101
|
viewBox: "0 0 22 22",
|
|
107
102
|
"aria-label": "Verified account",
|
|
108
103
|
role: "img",
|
|
109
|
-
className:
|
|
104
|
+
className: Ge.verified,
|
|
110
105
|
children: /* @__PURE__ */ r("g", {
|
|
111
106
|
children: /* @__PURE__ */ r("path", {
|
|
112
107
|
clipRule: "evenodd",
|
|
@@ -114,71 +109,71 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
114
109
|
fillRule: "evenodd"
|
|
115
110
|
})
|
|
116
111
|
})
|
|
117
|
-
}),
|
|
118
|
-
root:
|
|
119
|
-
article:
|
|
120
|
-
},
|
|
121
|
-
className: U("react-tweet-theme",
|
|
112
|
+
}), hn = "_root_98iqw_1", _n = "_article_98iqw_21", at = {
|
|
113
|
+
root: hn,
|
|
114
|
+
article: _n
|
|
115
|
+
}, Xe = ({ className: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
116
|
+
className: U("react-tweet-theme", at.root, e),
|
|
122
117
|
children: /* @__PURE__ */ r("article", {
|
|
123
|
-
className:
|
|
118
|
+
className: at.article,
|
|
124
119
|
children: t
|
|
125
120
|
})
|
|
126
|
-
}),
|
|
121
|
+
}), gt = (e) => /* @__PURE__ */ r("img", {
|
|
127
122
|
...e
|
|
128
|
-
}),
|
|
129
|
-
verifiedOld:
|
|
130
|
-
verifiedBlue:
|
|
131
|
-
verifiedGovernment:
|
|
132
|
-
},
|
|
123
|
+
}), mn = "_verifiedOld_lcna5_1", pn = "_verifiedBlue_lcna5_4", vn = "_verifiedGovernment_lcna5_7", Ie = {
|
|
124
|
+
verifiedOld: mn,
|
|
125
|
+
verifiedBlue: pn,
|
|
126
|
+
verifiedGovernment: vn
|
|
127
|
+
}, wt = ({ user: e, className: t }) => {
|
|
133
128
|
const n = e.verified || e.is_blue_verified || e.verified_type;
|
|
134
|
-
let o = /* @__PURE__ */ r(
|
|
129
|
+
let o = /* @__PURE__ */ r(dn, {}), a = Ie.verifiedBlue;
|
|
135
130
|
if (n)
|
|
136
|
-
switch (e.is_blue_verified || (a =
|
|
131
|
+
switch (e.is_blue_verified || (a = Ie.verifiedOld), e.verified_type) {
|
|
137
132
|
case "Government":
|
|
138
|
-
o = /* @__PURE__ */ r(
|
|
133
|
+
o = /* @__PURE__ */ r(fn, {}), a = Ie.verifiedGovernment;
|
|
139
134
|
break;
|
|
140
135
|
case "Business":
|
|
141
|
-
o = /* @__PURE__ */ r(
|
|
136
|
+
o = /* @__PURE__ */ r(un, {}), a = null;
|
|
142
137
|
break;
|
|
143
138
|
}
|
|
144
139
|
return n ? /* @__PURE__ */ r("div", {
|
|
145
140
|
className: U(t, a),
|
|
146
141
|
children: o
|
|
147
142
|
}) : null;
|
|
148
|
-
},
|
|
149
|
-
label:
|
|
150
|
-
},
|
|
143
|
+
}, gn = "_label_36ucz_1", wn = {
|
|
144
|
+
label: gn
|
|
145
|
+
}, yt = ({ user: e, className: t }) => {
|
|
151
146
|
var n;
|
|
152
147
|
const o = e.highlighted_label;
|
|
153
148
|
if (!o) return null;
|
|
154
149
|
const a = (n = o.badge) == null ? void 0 : n.url;
|
|
155
150
|
return a ? /* @__PURE__ */ r("div", {
|
|
156
|
-
className: U(
|
|
151
|
+
className: U(wn.label, t),
|
|
157
152
|
children: /* @__PURE__ */ r("img", {
|
|
158
153
|
src: a,
|
|
159
154
|
alt: o.description
|
|
160
155
|
})
|
|
161
156
|
}) : null;
|
|
162
|
-
},
|
|
163
|
-
header:
|
|
164
|
-
avatar:
|
|
165
|
-
avatarOverflow:
|
|
166
|
-
avatarSquare:
|
|
167
|
-
avatarShadow:
|
|
168
|
-
author:
|
|
157
|
+
}, yn = "_header_nqq4j_1", bn = "_avatar_nqq4j_11", Tn = "_avatarOverflow_nqq4j_16", xn = "_avatarSquare_nqq4j_23", Nn = "_avatarShadow_nqq4j_26", Rn = "_author_nqq4j_37", In = "_authorLink_nqq4j_44", Sn = "_authorVerified_nqq4j_53", kn = "_authorLinkText_nqq4j_56", En = "_authorMeta_nqq4j_63", Cn = "_authorFollow_nqq4j_66", On = "_username_nqq4j_69", Ln = "_follow_nqq4j_74", qn = "_separator_nqq4j_82", $n = "_brand_nqq4j_86", Dn = "_twitterIcon_nqq4j_90", N = {
|
|
158
|
+
header: yn,
|
|
159
|
+
avatar: bn,
|
|
160
|
+
avatarOverflow: Tn,
|
|
161
|
+
avatarSquare: xn,
|
|
162
|
+
avatarShadow: Nn,
|
|
163
|
+
author: Rn,
|
|
169
164
|
authorLink: In,
|
|
170
|
-
authorVerified:
|
|
171
|
-
authorLinkText:
|
|
172
|
-
authorMeta:
|
|
173
|
-
authorFollow:
|
|
174
|
-
username:
|
|
175
|
-
follow:
|
|
176
|
-
separator:
|
|
165
|
+
authorVerified: Sn,
|
|
166
|
+
authorLinkText: kn,
|
|
167
|
+
authorMeta: En,
|
|
168
|
+
authorFollow: Cn,
|
|
169
|
+
username: On,
|
|
170
|
+
follow: Ln,
|
|
171
|
+
separator: qn,
|
|
177
172
|
brand: $n,
|
|
178
|
-
twitterIcon:
|
|
179
|
-
},
|
|
173
|
+
twitterIcon: Dn
|
|
174
|
+
}, An = ({ tweet: e, components: t }) => {
|
|
180
175
|
var n;
|
|
181
|
-
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n :
|
|
176
|
+
const o = (n = t == null ? void 0 : t.AvatarImg) != null ? n : gt, { user: a } = e;
|
|
182
177
|
return /* @__PURE__ */ h("div", {
|
|
183
178
|
className: N.header,
|
|
184
179
|
children: [
|
|
@@ -221,11 +216,11 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
221
216
|
children: a.name
|
|
222
217
|
})
|
|
223
218
|
}),
|
|
224
|
-
/* @__PURE__ */ r(
|
|
219
|
+
/* @__PURE__ */ r(wt, {
|
|
225
220
|
user: a,
|
|
226
221
|
className: N.authorVerified
|
|
227
222
|
}),
|
|
228
|
-
/* @__PURE__ */ r(
|
|
223
|
+
/* @__PURE__ */ r(yt, {
|
|
229
224
|
user: a
|
|
230
225
|
})
|
|
231
226
|
]
|
|
@@ -285,29 +280,29 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
285
280
|
})
|
|
286
281
|
]
|
|
287
282
|
});
|
|
288
|
-
},
|
|
289
|
-
root:
|
|
290
|
-
},
|
|
283
|
+
}, Vn = "_root_1ec15_1", Mn = {
|
|
284
|
+
root: Vn
|
|
285
|
+
}, jn = ({ tweet: e }) => /* @__PURE__ */ h("a", {
|
|
291
286
|
href: e.in_reply_to_url,
|
|
292
|
-
className:
|
|
287
|
+
className: Mn.root,
|
|
293
288
|
target: "_blank",
|
|
294
289
|
rel: "noopener noreferrer",
|
|
295
290
|
children: [
|
|
296
291
|
"Replying to @",
|
|
297
292
|
e.in_reply_to_screen_name
|
|
298
293
|
]
|
|
299
|
-
}),
|
|
300
|
-
root:
|
|
301
|
-
},
|
|
294
|
+
}), Wn = "_root_eihfa_1", Bn = {
|
|
295
|
+
root: Wn
|
|
296
|
+
}, bt = ({ href: e, children: t }) => /* @__PURE__ */ r("a", {
|
|
302
297
|
href: e,
|
|
303
|
-
className:
|
|
298
|
+
className: Bn.root,
|
|
304
299
|
target: "_blank",
|
|
305
300
|
rel: "noopener noreferrer nofollow",
|
|
306
301
|
children: t
|
|
307
|
-
}),
|
|
308
|
-
root:
|
|
309
|
-
},
|
|
310
|
-
className:
|
|
302
|
+
}), Fn = "_root_1xq52_1", Pn = {
|
|
303
|
+
root: Fn
|
|
304
|
+
}, Un = ({ tweet: e }) => /* @__PURE__ */ h("p", {
|
|
305
|
+
className: Pn.root,
|
|
311
306
|
lang: e.lang,
|
|
312
307
|
dir: "auto",
|
|
313
308
|
children: [
|
|
@@ -317,7 +312,7 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
317
312
|
case "mention":
|
|
318
313
|
case "url":
|
|
319
314
|
case "symbol":
|
|
320
|
-
return /* @__PURE__ */ r(
|
|
315
|
+
return /* @__PURE__ */ r(bt, {
|
|
321
316
|
href: t.href,
|
|
322
317
|
children: t.text
|
|
323
318
|
}, n);
|
|
@@ -331,13 +326,13 @@ const cn = "_verified_lvyh0_1", Ue = {
|
|
|
331
326
|
}, n);
|
|
332
327
|
}
|
|
333
328
|
}),
|
|
334
|
-
e.note_tweet ? /* @__PURE__ */ r(
|
|
329
|
+
e.note_tweet ? /* @__PURE__ */ r(zn, {
|
|
335
330
|
tweet: e
|
|
336
331
|
}) : null
|
|
337
332
|
]
|
|
338
333
|
});
|
|
339
|
-
function
|
|
340
|
-
return /* @__PURE__ */ h(
|
|
334
|
+
function zn({ tweet: e }) {
|
|
335
|
+
return /* @__PURE__ */ h(bt, {
|
|
341
336
|
href: e.url,
|
|
342
337
|
children: [
|
|
343
338
|
/* @__PURE__ */ r("span", {
|
|
@@ -347,7 +342,7 @@ function Un({ tweet: e }) {
|
|
|
347
342
|
]
|
|
348
343
|
});
|
|
349
344
|
}
|
|
350
|
-
const
|
|
345
|
+
const Hn = {
|
|
351
346
|
hour: "numeric",
|
|
352
347
|
minute: "2-digit",
|
|
353
348
|
hour12: !0,
|
|
@@ -355,45 +350,45 @@ const zn = {
|
|
|
355
350
|
month: "short",
|
|
356
351
|
day: "numeric",
|
|
357
352
|
year: "numeric"
|
|
358
|
-
},
|
|
353
|
+
}, Gn = new Intl.DateTimeFormat("en-US", Hn), Xn = (e) => {
|
|
359
354
|
const t = {};
|
|
360
355
|
for (const n of e)
|
|
361
356
|
t[n.type] = n.value;
|
|
362
357
|
return t;
|
|
363
|
-
},
|
|
364
|
-
const t = Gn
|
|
358
|
+
}, Kn = (e) => {
|
|
359
|
+
const t = Xn(Gn.formatToParts(e)), n = `${t.hour}:${t.minute} ${t.dayPeriod}`, o = `${t.month} ${t.day}, ${t.year}`;
|
|
365
360
|
return `${n} · ${o}`;
|
|
366
|
-
},
|
|
361
|
+
}, st = (e) => `https://x.com/${e.user.screen_name}/status/${e.id_str}`, Tt = (e) => `https://x.com/${typeof e == "string" ? e : e.user.screen_name}`, Qn = (e) => `https://x.com/intent/like?tweet_id=${e.id_str}`, Jn = (e) => `https://x.com/intent/tweet?in_reply_to=${e.id_str}`, Yn = (e) => `https://x.com/intent/follow?screen_name=${e.user.screen_name}`, Zn = (e) => `https://x.com/hashtag/${e.text}`, er = (e) => `https://x.com/search?q=%24${e.text}`, tr = (e) => `https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`, xt = (e, t) => {
|
|
367
362
|
const n = new URL(e.media_url_https), o = n.pathname.split(".").pop();
|
|
368
363
|
return o ? (n.pathname = n.pathname.replace(`.${o}`, ""), n.searchParams.set("format", o), n.searchParams.set("name", t), n.toString()) : e.media_url_https;
|
|
369
|
-
},
|
|
364
|
+
}, nr = (e) => {
|
|
370
365
|
const { variants: t } = e.video_info;
|
|
371
366
|
return t.filter((o) => o.content_type === "video/mp4").sort((o, a) => {
|
|
372
367
|
var i, s;
|
|
373
368
|
return ((i = a.bitrate) != null ? i : 0) - ((s = o.bitrate) != null ? s : 0);
|
|
374
369
|
});
|
|
375
|
-
},
|
|
376
|
-
const t =
|
|
370
|
+
}, rr = (e) => {
|
|
371
|
+
const t = nr(e);
|
|
377
372
|
return t.length > 1 ? t[1] : t[0];
|
|
378
|
-
},
|
|
379
|
-
function
|
|
373
|
+
}, De = (e) => e > 999999 ? `${(e / 1e6).toFixed(1)}M` : e > 999 ? `${(e / 1e3).toFixed(1)}K` : e.toString();
|
|
374
|
+
function it(e) {
|
|
380
375
|
const t = Array.from(e.text), n = [
|
|
381
376
|
{
|
|
382
377
|
indices: e.display_text_range,
|
|
383
378
|
type: "text"
|
|
384
379
|
}
|
|
385
380
|
];
|
|
386
|
-
return
|
|
381
|
+
return he(n, "hashtag", e.entities.hashtags), he(n, "mention", e.entities.user_mentions), he(n, "url", e.entities.urls), he(n, "symbol", e.entities.symbols), e.entities.media && he(n, "media", e.entities.media), or(e, n), n.map((o) => {
|
|
387
382
|
const a = t.slice(o.indices[0], o.indices[1]).join("");
|
|
388
383
|
switch (o.type) {
|
|
389
384
|
case "hashtag":
|
|
390
385
|
return Object.assign(o, {
|
|
391
|
-
href:
|
|
386
|
+
href: Zn(o),
|
|
392
387
|
text: a
|
|
393
388
|
});
|
|
394
389
|
case "mention":
|
|
395
390
|
return Object.assign(o, {
|
|
396
|
-
href:
|
|
391
|
+
href: Tt(o.screen_name),
|
|
397
392
|
text: a
|
|
398
393
|
});
|
|
399
394
|
case "url":
|
|
@@ -404,7 +399,7 @@ function st(e) {
|
|
|
404
399
|
});
|
|
405
400
|
case "symbol":
|
|
406
401
|
return Object.assign(o, {
|
|
407
|
-
href:
|
|
402
|
+
href: er(o),
|
|
408
403
|
text: a
|
|
409
404
|
});
|
|
410
405
|
default:
|
|
@@ -414,7 +409,7 @@ function st(e) {
|
|
|
414
409
|
}
|
|
415
410
|
});
|
|
416
411
|
}
|
|
417
|
-
function
|
|
412
|
+
function he(e, t, n) {
|
|
418
413
|
for (const o of n)
|
|
419
414
|
for (const [a, i] of e.entries()) {
|
|
420
415
|
if (i.indices[0] > o.indices[0] || i.indices[1] < o.indices[1])
|
|
@@ -441,63 +436,63 @@ function de(e, t, n) {
|
|
|
441
436
|
break;
|
|
442
437
|
}
|
|
443
438
|
}
|
|
444
|
-
function
|
|
439
|
+
function or(e, t) {
|
|
445
440
|
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]);
|
|
446
441
|
const n = t.at(-1);
|
|
447
442
|
n && n.indices[1] > e.display_text_range[1] && (n.indices[1] = e.display_text_range[1]);
|
|
448
443
|
}
|
|
449
|
-
const
|
|
444
|
+
const ar = (e) => ({
|
|
450
445
|
...e,
|
|
451
|
-
url:
|
|
446
|
+
url: st(e),
|
|
452
447
|
user: {
|
|
453
448
|
...e.user,
|
|
454
|
-
url:
|
|
455
|
-
follow_url:
|
|
449
|
+
url: Tt(e),
|
|
450
|
+
follow_url: Yn(e)
|
|
456
451
|
},
|
|
457
|
-
like_url:
|
|
458
|
-
reply_url:
|
|
459
|
-
in_reply_to_url: e.in_reply_to_screen_name ?
|
|
460
|
-
entities:
|
|
452
|
+
like_url: Qn(e),
|
|
453
|
+
reply_url: Jn(e),
|
|
454
|
+
in_reply_to_url: e.in_reply_to_screen_name ? tr(e) : void 0,
|
|
455
|
+
entities: it(e),
|
|
461
456
|
quoted_tweet: e.quoted_tweet ? {
|
|
462
457
|
...e.quoted_tweet,
|
|
463
|
-
url:
|
|
464
|
-
entities:
|
|
458
|
+
url: st(e.quoted_tweet),
|
|
459
|
+
entities: it(e.quoted_tweet)
|
|
465
460
|
} : void 0
|
|
466
|
-
}),
|
|
467
|
-
root:
|
|
468
|
-
rounded:
|
|
469
|
-
mediaWrapper:
|
|
470
|
-
grid2Columns:
|
|
471
|
-
grid3:
|
|
472
|
-
grid2x2:
|
|
473
|
-
mediaContainer:
|
|
474
|
-
mediaLink:
|
|
475
|
-
skeleton:
|
|
476
|
-
image:
|
|
477
|
-
},
|
|
478
|
-
anchor:
|
|
479
|
-
videoButton:
|
|
480
|
-
videoButtonIcon:
|
|
481
|
-
watchOnTwitter:
|
|
482
|
-
viewReplies:
|
|
483
|
-
},
|
|
484
|
-
const [n, o] = se(!0), [a, i] = se(!1), [s, c] = se(!1), f =
|
|
485
|
-
let
|
|
486
|
-
return /* @__PURE__ */ h(
|
|
461
|
+
}), sr = "_root_g9tkv_1", ir = "_rounded_g9tkv_6", cr = "_mediaWrapper_g9tkv_10", lr = "_grid2Columns_g9tkv_17", dr = "_grid3_g9tkv_20", ur = "_grid2x2_g9tkv_23", fr = "_mediaContainer_g9tkv_26", hr = "_mediaLink_g9tkv_34", _r = "_skeleton_g9tkv_38", mr = "_image_g9tkv_43", E = {
|
|
462
|
+
root: sr,
|
|
463
|
+
rounded: ir,
|
|
464
|
+
mediaWrapper: cr,
|
|
465
|
+
grid2Columns: lr,
|
|
466
|
+
grid3: dr,
|
|
467
|
+
grid2x2: ur,
|
|
468
|
+
mediaContainer: fr,
|
|
469
|
+
mediaLink: hr,
|
|
470
|
+
skeleton: _r,
|
|
471
|
+
image: mr
|
|
472
|
+
}, pr = "_anchor_fp31d_1", vr = "_videoButton_fp31d_17", gr = "_videoButtonIcon_fp31d_35", wr = "_watchOnTwitter_fp31d_44", yr = "_viewReplies_fp31d_60", ae = {
|
|
473
|
+
anchor: pr,
|
|
474
|
+
videoButton: vr,
|
|
475
|
+
videoButtonIcon: gr,
|
|
476
|
+
watchOnTwitter: wr,
|
|
477
|
+
viewReplies: yr
|
|
478
|
+
}, br = ({ tweet: e, media: t }) => {
|
|
479
|
+
const [n, o] = se(!0), [a, i] = se(!1), [s, c] = se(!1), f = rr(t);
|
|
480
|
+
let u = 0;
|
|
481
|
+
return /* @__PURE__ */ h(Ut, {
|
|
487
482
|
children: [
|
|
488
483
|
/* @__PURE__ */ r("video", {
|
|
489
|
-
className:
|
|
490
|
-
poster:
|
|
484
|
+
className: E.image,
|
|
485
|
+
poster: xt(t, "small"),
|
|
491
486
|
controls: !n,
|
|
492
487
|
playsInline: !0,
|
|
493
488
|
preload: "none",
|
|
494
489
|
tabIndex: n ? -1 : 0,
|
|
495
490
|
onPlay: () => {
|
|
496
|
-
|
|
491
|
+
u && window.clearTimeout(u), a || i(!0), s && c(!1);
|
|
497
492
|
},
|
|
498
493
|
onPause: () => {
|
|
499
|
-
|
|
500
|
-
a && i(!1),
|
|
494
|
+
u && window.clearTimeout(u), u = window.setTimeout(() => {
|
|
495
|
+
a && i(!1), u = 0;
|
|
501
496
|
}, 100);
|
|
502
497
|
},
|
|
503
498
|
onEnded: () => {
|
|
@@ -512,12 +507,12 @@ const or = (e) => ({
|
|
|
512
507
|
type: "button",
|
|
513
508
|
className: ae.videoButton,
|
|
514
509
|
"aria-label": "View video on X",
|
|
515
|
-
onClick: (
|
|
516
|
-
const m =
|
|
517
|
-
|
|
510
|
+
onClick: (v) => {
|
|
511
|
+
const m = v.currentTarget.previousSibling;
|
|
512
|
+
v.preventDefault(), o(!1), m.load(), m.play().then(() => {
|
|
518
513
|
i(!0), m.focus();
|
|
519
|
-
}).catch((
|
|
520
|
-
console.error("Error playing video:",
|
|
514
|
+
}).catch((T) => {
|
|
515
|
+
console.error("Error playing video:", T), o(!0), i(!1);
|
|
521
516
|
});
|
|
522
517
|
},
|
|
523
518
|
children: /* @__PURE__ */ r("svg", {
|
|
@@ -550,63 +545,63 @@ const or = (e) => ({
|
|
|
550
545
|
})
|
|
551
546
|
]
|
|
552
547
|
});
|
|
553
|
-
},
|
|
548
|
+
}, Tr = (e) => /* @__PURE__ */ r("img", {
|
|
554
549
|
...e
|
|
555
|
-
}),
|
|
550
|
+
}), ct = (e, t) => {
|
|
556
551
|
let n = 56.25;
|
|
557
552
|
return t === 1 && (n = 100 / e.original_info.width * e.original_info.height), t === 2 && (n = n * 2), {
|
|
558
553
|
width: e.type === "photo" ? void 0 : "unset",
|
|
559
554
|
paddingBottom: `${n}%`
|
|
560
555
|
};
|
|
561
|
-
},
|
|
556
|
+
}, Nt = ({ tweet: e, components: t, quoted: n }) => {
|
|
562
557
|
var o, a, i;
|
|
563
558
|
const s = (i = (o = e.mediaDetails) == null ? void 0 : o.length) != null ? i : 0;
|
|
564
559
|
var c;
|
|
565
|
-
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c :
|
|
560
|
+
const f = (c = t == null ? void 0 : t.MediaImg) != null ? c : Tr;
|
|
566
561
|
return /* @__PURE__ */ r("div", {
|
|
567
|
-
className: U(
|
|
562
|
+
className: U(E.root, !n && E.rounded),
|
|
568
563
|
children: /* @__PURE__ */ r("div", {
|
|
569
|
-
className: U(
|
|
570
|
-
children: (a = e.mediaDetails) == null ? void 0 : a.map((
|
|
571
|
-
children:
|
|
564
|
+
className: U(E.mediaWrapper, s > 1 && E.grid2Columns, s === 3 && E.grid3, s > 4 && E.grid2x2),
|
|
565
|
+
children: (a = e.mediaDetails) == null ? void 0 : a.map((u) => /* @__PURE__ */ r(zt, {
|
|
566
|
+
children: u.type === "photo" ? /* @__PURE__ */ h("a", {
|
|
572
567
|
href: e.url,
|
|
573
|
-
className: U(
|
|
568
|
+
className: U(E.mediaContainer, E.mediaLink),
|
|
574
569
|
target: "_blank",
|
|
575
570
|
rel: "noopener noreferrer",
|
|
576
571
|
children: [
|
|
577
572
|
/* @__PURE__ */ r("div", {
|
|
578
|
-
className:
|
|
579
|
-
style:
|
|
573
|
+
className: E.skeleton,
|
|
574
|
+
style: ct(u, s)
|
|
580
575
|
}),
|
|
581
576
|
/* @__PURE__ */ r(f, {
|
|
582
|
-
src:
|
|
583
|
-
alt:
|
|
584
|
-
className:
|
|
577
|
+
src: xt(u, "small"),
|
|
578
|
+
alt: u.ext_alt_text || "Image",
|
|
579
|
+
className: E.image,
|
|
585
580
|
draggable: !0
|
|
586
581
|
})
|
|
587
582
|
]
|
|
588
|
-
},
|
|
589
|
-
className:
|
|
583
|
+
}, u.media_url_https) : /* @__PURE__ */ h("div", {
|
|
584
|
+
className: E.mediaContainer,
|
|
590
585
|
children: [
|
|
591
586
|
/* @__PURE__ */ r("div", {
|
|
592
|
-
className:
|
|
593
|
-
style:
|
|
587
|
+
className: E.skeleton,
|
|
588
|
+
style: ct(u, s)
|
|
594
589
|
}),
|
|
595
|
-
/* @__PURE__ */ r(
|
|
590
|
+
/* @__PURE__ */ r(br, {
|
|
596
591
|
tweet: e,
|
|
597
|
-
media:
|
|
592
|
+
media: u
|
|
598
593
|
})
|
|
599
594
|
]
|
|
600
|
-
},
|
|
601
|
-
},
|
|
595
|
+
}, u.media_url_https)
|
|
596
|
+
}, u.media_url_https))
|
|
602
597
|
})
|
|
603
598
|
});
|
|
604
|
-
},
|
|
605
|
-
root:
|
|
606
|
-
},
|
|
607
|
-
const t = new Date(e.created_at), n =
|
|
599
|
+
}, xr = "_root_i24yn_1", Nr = {
|
|
600
|
+
root: xr
|
|
601
|
+
}, Rr = ({ tweet: e }) => {
|
|
602
|
+
const t = new Date(e.created_at), n = Kn(t);
|
|
608
603
|
return /* @__PURE__ */ r("a", {
|
|
609
|
-
className:
|
|
604
|
+
className: Nr.root,
|
|
610
605
|
href: e.url,
|
|
611
606
|
target: "_blank",
|
|
612
607
|
rel: "noopener noreferrer",
|
|
@@ -616,18 +611,18 @@ const or = (e) => ({
|
|
|
616
611
|
children: n
|
|
617
612
|
})
|
|
618
613
|
});
|
|
619
|
-
}, Ir = "_info_19qcj_1",
|
|
614
|
+
}, Ir = "_info_19qcj_1", Sr = "_infoLink_19qcj_10", kr = "_infoIcon_19qcj_30", Se = {
|
|
620
615
|
info: Ir,
|
|
621
|
-
infoLink:
|
|
622
|
-
infoIcon:
|
|
623
|
-
},
|
|
624
|
-
className:
|
|
616
|
+
infoLink: Sr,
|
|
617
|
+
infoIcon: kr
|
|
618
|
+
}, Er = ({ tweet: e }) => /* @__PURE__ */ h("div", {
|
|
619
|
+
className: Se.info,
|
|
625
620
|
children: [
|
|
626
|
-
/* @__PURE__ */ r(
|
|
621
|
+
/* @__PURE__ */ r(Rr, {
|
|
627
622
|
tweet: e
|
|
628
623
|
}),
|
|
629
624
|
/* @__PURE__ */ r("a", {
|
|
630
|
-
className:
|
|
625
|
+
className: Se.infoLink,
|
|
631
626
|
href: "https://help.x.com/en/x-for-websites-ads-info-and-privacy",
|
|
632
627
|
target: "_blank",
|
|
633
628
|
rel: "noopener noreferrer",
|
|
@@ -635,7 +630,7 @@ const or = (e) => ({
|
|
|
635
630
|
children: /* @__PURE__ */ r("svg", {
|
|
636
631
|
viewBox: "0 0 24 24",
|
|
637
632
|
"aria-hidden": "true",
|
|
638
|
-
className:
|
|
633
|
+
className: Se.infoIcon,
|
|
639
634
|
children: /* @__PURE__ */ r("g", {
|
|
640
635
|
children: /* @__PURE__ */ r("path", {
|
|
641
636
|
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"
|
|
@@ -644,25 +639,25 @@ const or = (e) => ({
|
|
|
644
639
|
})
|
|
645
640
|
})
|
|
646
641
|
]
|
|
647
|
-
}),
|
|
648
|
-
actions:
|
|
649
|
-
like:
|
|
650
|
-
reply:
|
|
651
|
-
copy:
|
|
642
|
+
}), Cr = "_actions_n2anf_1", Or = "_like_n2anf_13", Lr = "_reply_n2anf_14", qr = "_copy_n2anf_15", $r = "_likeIconWrapper_n2anf_27", Dr = "_likeCount_n2anf_30", Ar = "_replyIconWrapper_n2anf_35", Vr = "_copyIconWrapper_n2anf_36", Mr = "_likeIcon_n2anf_27", jr = "_replyIcon_n2anf_35", Wr = "_copyIcon_n2anf_36", Br = "_replyText_n2anf_56", Fr = "_copyText_n2anf_57", S = {
|
|
643
|
+
actions: Cr,
|
|
644
|
+
like: Or,
|
|
645
|
+
reply: Lr,
|
|
646
|
+
copy: qr,
|
|
652
647
|
likeIconWrapper: $r,
|
|
653
|
-
likeCount:
|
|
654
|
-
replyIconWrapper:
|
|
655
|
-
copyIconWrapper:
|
|
656
|
-
likeIcon:
|
|
657
|
-
replyIcon:
|
|
658
|
-
copyIcon:
|
|
659
|
-
replyText:
|
|
660
|
-
copyText:
|
|
661
|
-
},
|
|
648
|
+
likeCount: Dr,
|
|
649
|
+
replyIconWrapper: Ar,
|
|
650
|
+
copyIconWrapper: Vr,
|
|
651
|
+
likeIcon: Mr,
|
|
652
|
+
replyIcon: jr,
|
|
653
|
+
copyIcon: Wr,
|
|
654
|
+
replyText: Br,
|
|
655
|
+
copyText: Fr
|
|
656
|
+
}, Pr = ({ tweet: e }) => {
|
|
662
657
|
const [t, n] = se(!1), o = () => {
|
|
663
658
|
navigator.clipboard.writeText(e.url), n(!0);
|
|
664
659
|
};
|
|
665
|
-
return
|
|
660
|
+
return ze(() => {
|
|
666
661
|
if (t) {
|
|
667
662
|
const a = setTimeout(() => {
|
|
668
663
|
n(!1);
|
|
@@ -673,15 +668,15 @@ const or = (e) => ({
|
|
|
673
668
|
t
|
|
674
669
|
]), /* @__PURE__ */ h("button", {
|
|
675
670
|
type: "button",
|
|
676
|
-
className:
|
|
671
|
+
className: S.copy,
|
|
677
672
|
"aria-label": "Copy link",
|
|
678
673
|
onClick: o,
|
|
679
674
|
children: [
|
|
680
675
|
/* @__PURE__ */ r("div", {
|
|
681
|
-
className:
|
|
676
|
+
className: S.copyIconWrapper,
|
|
682
677
|
children: t ? /* @__PURE__ */ r("svg", {
|
|
683
678
|
viewBox: "0 0 24 24",
|
|
684
|
-
className:
|
|
679
|
+
className: S.copyIcon,
|
|
685
680
|
"aria-hidden": "true",
|
|
686
681
|
children: /* @__PURE__ */ r("g", {
|
|
687
682
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -690,7 +685,7 @@ const or = (e) => ({
|
|
|
690
685
|
})
|
|
691
686
|
}) : /* @__PURE__ */ r("svg", {
|
|
692
687
|
viewBox: "0 0 24 24",
|
|
693
|
-
className:
|
|
688
|
+
className: S.copyIcon,
|
|
694
689
|
"aria-hidden": "true",
|
|
695
690
|
children: /* @__PURE__ */ r("g", {
|
|
696
691
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -700,28 +695,28 @@ const or = (e) => ({
|
|
|
700
695
|
})
|
|
701
696
|
}),
|
|
702
697
|
/* @__PURE__ */ r("span", {
|
|
703
|
-
className:
|
|
698
|
+
className: S.copyText,
|
|
704
699
|
children: t ? "Copied!" : "Copy link"
|
|
705
700
|
})
|
|
706
701
|
]
|
|
707
702
|
});
|
|
708
|
-
},
|
|
709
|
-
const t =
|
|
703
|
+
}, Ur = ({ tweet: e }) => {
|
|
704
|
+
const t = De(e.favorite_count);
|
|
710
705
|
return /* @__PURE__ */ h("div", {
|
|
711
|
-
className:
|
|
706
|
+
className: S.actions,
|
|
712
707
|
children: [
|
|
713
708
|
/* @__PURE__ */ h("a", {
|
|
714
|
-
className:
|
|
709
|
+
className: S.like,
|
|
715
710
|
href: e.like_url,
|
|
716
711
|
target: "_blank",
|
|
717
712
|
rel: "noopener noreferrer",
|
|
718
713
|
"aria-label": `Like. This Tweet has ${t} likes`,
|
|
719
714
|
children: [
|
|
720
715
|
/* @__PURE__ */ r("div", {
|
|
721
|
-
className:
|
|
716
|
+
className: S.likeIconWrapper,
|
|
722
717
|
children: /* @__PURE__ */ r("svg", {
|
|
723
718
|
viewBox: "0 0 24 24",
|
|
724
|
-
className:
|
|
719
|
+
className: S.likeIcon,
|
|
725
720
|
"aria-hidden": "true",
|
|
726
721
|
children: /* @__PURE__ */ r("g", {
|
|
727
722
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -731,23 +726,23 @@ const or = (e) => ({
|
|
|
731
726
|
})
|
|
732
727
|
}),
|
|
733
728
|
/* @__PURE__ */ r("span", {
|
|
734
|
-
className:
|
|
729
|
+
className: S.likeCount,
|
|
735
730
|
children: t
|
|
736
731
|
})
|
|
737
732
|
]
|
|
738
733
|
}),
|
|
739
734
|
/* @__PURE__ */ h("a", {
|
|
740
|
-
className:
|
|
735
|
+
className: S.reply,
|
|
741
736
|
href: e.reply_url,
|
|
742
737
|
target: "_blank",
|
|
743
738
|
rel: "noopener noreferrer",
|
|
744
739
|
"aria-label": "Reply to this Tweet on Twitter",
|
|
745
740
|
children: [
|
|
746
741
|
/* @__PURE__ */ r("div", {
|
|
747
|
-
className:
|
|
742
|
+
className: S.replyIconWrapper,
|
|
748
743
|
children: /* @__PURE__ */ r("svg", {
|
|
749
744
|
viewBox: "0 0 24 24",
|
|
750
|
-
className:
|
|
745
|
+
className: S.replyIcon,
|
|
751
746
|
"aria-hidden": "true",
|
|
752
747
|
children: /* @__PURE__ */ r("g", {
|
|
753
748
|
children: /* @__PURE__ */ r("path", {
|
|
@@ -757,56 +752,56 @@ const or = (e) => ({
|
|
|
757
752
|
})
|
|
758
753
|
}),
|
|
759
754
|
/* @__PURE__ */ r("span", {
|
|
760
|
-
className:
|
|
755
|
+
className: S.replyText,
|
|
761
756
|
children: "Reply"
|
|
762
757
|
})
|
|
763
758
|
]
|
|
764
759
|
}),
|
|
765
|
-
/* @__PURE__ */ r(
|
|
760
|
+
/* @__PURE__ */ r(Pr, {
|
|
766
761
|
tweet: e
|
|
767
762
|
})
|
|
768
763
|
]
|
|
769
764
|
});
|
|
770
|
-
},
|
|
771
|
-
replies:
|
|
772
|
-
link:
|
|
773
|
-
text:
|
|
774
|
-
},
|
|
775
|
-
className:
|
|
765
|
+
}, zr = "_replies_1cutb_1", Hr = "_link_1cutb_4", Gr = "_text_1cutb_23", ke = {
|
|
766
|
+
replies: zr,
|
|
767
|
+
link: Hr,
|
|
768
|
+
text: Gr
|
|
769
|
+
}, Xr = ({ tweet: e }) => /* @__PURE__ */ r("div", {
|
|
770
|
+
className: ke.replies,
|
|
776
771
|
children: /* @__PURE__ */ r("a", {
|
|
777
|
-
className:
|
|
772
|
+
className: ke.link,
|
|
778
773
|
href: e.url,
|
|
779
774
|
target: "_blank",
|
|
780
775
|
rel: "noopener noreferrer",
|
|
781
776
|
children: /* @__PURE__ */ r("span", {
|
|
782
|
-
className:
|
|
783
|
-
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${
|
|
777
|
+
className: ke.text,
|
|
778
|
+
children: e.conversation_count === 0 ? "Read more on X" : e.conversation_count === 1 ? `Read ${De(e.conversation_count)} reply` : `Read ${De(e.conversation_count)} replies`
|
|
784
779
|
})
|
|
785
780
|
})
|
|
786
|
-
}),
|
|
787
|
-
root:
|
|
788
|
-
article:
|
|
789
|
-
},
|
|
790
|
-
className:
|
|
781
|
+
}), Kr = "_root_q5799_1", Qr = "_article_q5799_16", lt = {
|
|
782
|
+
root: Kr,
|
|
783
|
+
article: Qr
|
|
784
|
+
}, Jr = ({ tweet: e, children: t }) => /* @__PURE__ */ r("div", {
|
|
785
|
+
className: lt.root,
|
|
791
786
|
onClick: (n) => {
|
|
792
787
|
n.preventDefault(), window.open(e.url, "_blank");
|
|
793
788
|
},
|
|
794
789
|
children: /* @__PURE__ */ r("article", {
|
|
795
|
-
className:
|
|
790
|
+
className: lt.article,
|
|
796
791
|
children: t
|
|
797
792
|
})
|
|
798
|
-
}),
|
|
799
|
-
header:
|
|
800
|
-
avatar:
|
|
801
|
-
avatarOverflow:
|
|
802
|
-
avatarSquare:
|
|
803
|
-
author:
|
|
804
|
-
authorText:
|
|
805
|
-
username:
|
|
806
|
-
},
|
|
793
|
+
}), Yr = "_header_f00ab_1", Zr = "_avatar_f00ab_11", eo = "_avatarOverflow_f00ab_16", to = "_avatarSquare_f00ab_23", no = "_author_f00ab_27", ro = "_authorText_f00ab_33", oo = "_username_f00ab_40", Q = {
|
|
794
|
+
header: Yr,
|
|
795
|
+
avatar: Zr,
|
|
796
|
+
avatarOverflow: eo,
|
|
797
|
+
avatarSquare: to,
|
|
798
|
+
author: no,
|
|
799
|
+
authorText: ro,
|
|
800
|
+
username: oo
|
|
801
|
+
}, ao = ({ tweet: e, components: t }) => {
|
|
807
802
|
const { user: n } = e;
|
|
808
803
|
var o;
|
|
809
|
-
const a = (o = t == null ? void 0 : t.AvatarImg) != null ? o :
|
|
804
|
+
const a = (o = t == null ? void 0 : t.AvatarImg) != null ? o : gt;
|
|
810
805
|
return /* @__PURE__ */ h("div", {
|
|
811
806
|
className: Q.header,
|
|
812
807
|
children: [
|
|
@@ -835,10 +830,10 @@ const or = (e) => ({
|
|
|
835
830
|
children: n.name
|
|
836
831
|
})
|
|
837
832
|
}),
|
|
838
|
-
/* @__PURE__ */ r(
|
|
833
|
+
/* @__PURE__ */ r(wt, {
|
|
839
834
|
user: n
|
|
840
835
|
}),
|
|
841
|
-
/* @__PURE__ */ r(
|
|
836
|
+
/* @__PURE__ */ r(yt, {
|
|
842
837
|
user: n
|
|
843
838
|
}),
|
|
844
839
|
/* @__PURE__ */ r("div", {
|
|
@@ -855,10 +850,10 @@ const or = (e) => ({
|
|
|
855
850
|
})
|
|
856
851
|
]
|
|
857
852
|
});
|
|
858
|
-
},
|
|
859
|
-
root:
|
|
860
|
-
},
|
|
861
|
-
className:
|
|
853
|
+
}, so = "_root_175ot_1", io = {
|
|
854
|
+
root: so
|
|
855
|
+
}, co = ({ tweet: e }) => /* @__PURE__ */ r("p", {
|
|
856
|
+
className: io.root,
|
|
862
857
|
lang: e.lang,
|
|
863
858
|
dir: "auto",
|
|
864
859
|
children: e.entities.map((t, n) => /* @__PURE__ */ r("span", {
|
|
@@ -866,65 +861,65 @@ const or = (e) => ({
|
|
|
866
861
|
__html: t.text
|
|
867
862
|
}
|
|
868
863
|
}, n))
|
|
869
|
-
}),
|
|
864
|
+
}), lo = ({ tweet: e, components: t }) => {
|
|
870
865
|
var n;
|
|
871
|
-
return /* @__PURE__ */ h(
|
|
866
|
+
return /* @__PURE__ */ h(Jr, {
|
|
872
867
|
tweet: e,
|
|
873
868
|
children: [
|
|
874
|
-
/* @__PURE__ */ r(
|
|
869
|
+
/* @__PURE__ */ r(ao, {
|
|
875
870
|
tweet: e,
|
|
876
871
|
components: t
|
|
877
872
|
}),
|
|
878
|
-
/* @__PURE__ */ r(
|
|
873
|
+
/* @__PURE__ */ r(co, {
|
|
879
874
|
tweet: e
|
|
880
875
|
}),
|
|
881
|
-
(n = e.mediaDetails) != null && n.length ? /* @__PURE__ */ r(
|
|
876
|
+
(n = e.mediaDetails) != null && n.length ? /* @__PURE__ */ r(Nt, {
|
|
882
877
|
quoted: !0,
|
|
883
878
|
tweet: e
|
|
884
879
|
}) : null
|
|
885
880
|
]
|
|
886
881
|
});
|
|
887
|
-
},
|
|
882
|
+
}, uo = ({ tweet: e, components: t }) => {
|
|
888
883
|
var n;
|
|
889
|
-
const o =
|
|
884
|
+
const o = He(() => ar(e), [
|
|
890
885
|
e
|
|
891
886
|
]);
|
|
892
|
-
return /* @__PURE__ */ h(
|
|
887
|
+
return /* @__PURE__ */ h(Xe, {
|
|
893
888
|
children: [
|
|
894
|
-
/* @__PURE__ */ r(
|
|
889
|
+
/* @__PURE__ */ r(An, {
|
|
895
890
|
tweet: o,
|
|
896
891
|
components: t
|
|
897
892
|
}),
|
|
898
|
-
o.in_reply_to_status_id_str && /* @__PURE__ */ r(
|
|
893
|
+
o.in_reply_to_status_id_str && /* @__PURE__ */ r(jn, {
|
|
899
894
|
tweet: o
|
|
900
895
|
}),
|
|
901
|
-
/* @__PURE__ */ r(
|
|
896
|
+
/* @__PURE__ */ r(Un, {
|
|
902
897
|
tweet: o
|
|
903
898
|
}),
|
|
904
|
-
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(
|
|
899
|
+
(n = o.mediaDetails) != null && n.length ? /* @__PURE__ */ r(Nt, {
|
|
905
900
|
tweet: o,
|
|
906
901
|
components: t
|
|
907
902
|
}) : null,
|
|
908
|
-
o.quoted_tweet && /* @__PURE__ */ r(
|
|
903
|
+
o.quoted_tweet && /* @__PURE__ */ r(lo, {
|
|
909
904
|
tweet: o.quoted_tweet,
|
|
910
905
|
components: t
|
|
911
906
|
}),
|
|
912
|
-
/* @__PURE__ */ r(
|
|
907
|
+
/* @__PURE__ */ r(Er, {
|
|
913
908
|
tweet: o
|
|
914
909
|
}),
|
|
915
|
-
/* @__PURE__ */ r(
|
|
910
|
+
/* @__PURE__ */ r(Ur, {
|
|
916
911
|
tweet: o
|
|
917
912
|
}),
|
|
918
|
-
/* @__PURE__ */ r(
|
|
913
|
+
/* @__PURE__ */ r(Xr, {
|
|
919
914
|
tweet: o
|
|
920
915
|
})
|
|
921
916
|
]
|
|
922
917
|
});
|
|
923
|
-
},
|
|
924
|
-
root:
|
|
925
|
-
},
|
|
918
|
+
}, fo = "_root_16yxa_1", ho = {
|
|
919
|
+
root: fo
|
|
920
|
+
}, _o = (e) => /* @__PURE__ */ r(Xe, {
|
|
926
921
|
children: /* @__PURE__ */ h("div", {
|
|
927
|
-
className:
|
|
922
|
+
className: ho.root,
|
|
928
923
|
children: [
|
|
929
924
|
/* @__PURE__ */ r("h3", {
|
|
930
925
|
children: "Tweet not found"
|
|
@@ -934,23 +929,23 @@ const or = (e) => ({
|
|
|
934
929
|
})
|
|
935
930
|
]
|
|
936
931
|
})
|
|
937
|
-
}),
|
|
938
|
-
skeleton:
|
|
939
|
-
},
|
|
940
|
-
className:
|
|
932
|
+
}), mo = "_skeleton_oi7hr_1", po = {
|
|
933
|
+
skeleton: mo
|
|
934
|
+
}, ge = ({ style: e }) => /* @__PURE__ */ r("span", {
|
|
935
|
+
className: po.skeleton,
|
|
941
936
|
style: e
|
|
942
|
-
}),
|
|
943
|
-
root:
|
|
944
|
-
},
|
|
945
|
-
className:
|
|
937
|
+
}), vo = "_root_17qqv_1", go = {
|
|
938
|
+
root: vo
|
|
939
|
+
}, wo = () => /* @__PURE__ */ h(Xe, {
|
|
940
|
+
className: go.root,
|
|
946
941
|
children: [
|
|
947
|
-
/* @__PURE__ */ r(
|
|
942
|
+
/* @__PURE__ */ r(ge, {
|
|
948
943
|
style: {
|
|
949
944
|
height: "3rem",
|
|
950
945
|
marginBottom: "0.75rem"
|
|
951
946
|
}
|
|
952
947
|
}),
|
|
953
|
-
/* @__PURE__ */ r(
|
|
948
|
+
/* @__PURE__ */ r(ge, {
|
|
954
949
|
style: {
|
|
955
950
|
height: "6rem",
|
|
956
951
|
margin: "0.5rem 0"
|
|
@@ -962,12 +957,12 @@ const or = (e) => ({
|
|
|
962
957
|
margin: "0.5rem 0"
|
|
963
958
|
}
|
|
964
959
|
}),
|
|
965
|
-
/* @__PURE__ */ r(
|
|
960
|
+
/* @__PURE__ */ r(ge, {
|
|
966
961
|
style: {
|
|
967
962
|
height: "2rem"
|
|
968
963
|
}
|
|
969
964
|
}),
|
|
970
|
-
/* @__PURE__ */ r(
|
|
965
|
+
/* @__PURE__ */ r(ge, {
|
|
971
966
|
style: {
|
|
972
967
|
height: "2rem",
|
|
973
968
|
borderRadius: "9999px",
|
|
@@ -975,9 +970,9 @@ const or = (e) => ({
|
|
|
975
970
|
}
|
|
976
971
|
})
|
|
977
972
|
]
|
|
978
|
-
}),
|
|
979
|
-
var
|
|
980
|
-
function
|
|
973
|
+
}), Rt = 0, It = 1, St = 2, dt = 3;
|
|
974
|
+
var ut = Object.prototype.hasOwnProperty;
|
|
975
|
+
function Ae(e, t) {
|
|
981
976
|
var n, o;
|
|
982
977
|
if (e === t) return !0;
|
|
983
978
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
@@ -985,112 +980,112 @@ function $e(e, t) {
|
|
|
985
980
|
if (n === RegExp) return e.toString() === t.toString();
|
|
986
981
|
if (n === Array) {
|
|
987
982
|
if ((o = e.length) === t.length)
|
|
988
|
-
for (; o-- &&
|
|
983
|
+
for (; o-- && Ae(e[o], t[o]); ) ;
|
|
989
984
|
return o === -1;
|
|
990
985
|
}
|
|
991
986
|
if (!n || typeof e == "object") {
|
|
992
987
|
o = 0;
|
|
993
988
|
for (n in e)
|
|
994
|
-
if (
|
|
989
|
+
if (ut.call(e, n) && ++o && !ut.call(t, n) || !(n in t) || !Ae(e[n], t[n])) return !1;
|
|
995
990
|
return Object.keys(t).length === o;
|
|
996
991
|
}
|
|
997
992
|
}
|
|
998
993
|
return e !== e && t !== t;
|
|
999
994
|
}
|
|
1000
995
|
const F = /* @__PURE__ */ new WeakMap(), P = () => {
|
|
1001
|
-
},
|
|
996
|
+
}, I = (
|
|
1002
997
|
/*#__NOINLINE__*/
|
|
1003
998
|
P()
|
|
1004
|
-
),
|
|
999
|
+
), Ve = Object, d = (e) => e === I, W = (e) => typeof e == "function", H = (e, t) => ({
|
|
1005
1000
|
...e,
|
|
1006
1001
|
...t
|
|
1007
|
-
}),
|
|
1002
|
+
}), kt = (e) => W(e.then), Ee = {}, we = {}, Ke = "undefined", _e = typeof window != Ke, Me = typeof document != Ke, yo = _e && "Deno" in window, bo = () => _e && typeof window.requestAnimationFrame != Ke, Et = (e, t) => {
|
|
1008
1003
|
const n = F.get(e);
|
|
1009
1004
|
return [
|
|
1010
1005
|
// Getter
|
|
1011
|
-
() => !
|
|
1006
|
+
() => !d(t) && e.get(t) || Ee,
|
|
1012
1007
|
// Setter
|
|
1013
1008
|
(o) => {
|
|
1014
|
-
if (!
|
|
1009
|
+
if (!d(t)) {
|
|
1015
1010
|
const a = e.get(t);
|
|
1016
|
-
t in
|
|
1011
|
+
t in we || (we[t] = a), n[5](t, H(a, o), a || Ee);
|
|
1017
1012
|
}
|
|
1018
1013
|
},
|
|
1019
1014
|
// Subscriber
|
|
1020
1015
|
n[6],
|
|
1021
1016
|
// Get server cache snapshot
|
|
1022
|
-
() => !
|
|
1017
|
+
() => !d(t) && t in we ? we[t] : !d(t) && e.get(t) || Ee
|
|
1023
1018
|
];
|
|
1024
1019
|
};
|
|
1025
|
-
let
|
|
1026
|
-
const
|
|
1020
|
+
let je = !0;
|
|
1021
|
+
const To = () => je, [We, Be] = _e && window.addEventListener ? [
|
|
1027
1022
|
window.addEventListener.bind(window),
|
|
1028
1023
|
window.removeEventListener.bind(window)
|
|
1029
1024
|
] : [
|
|
1030
1025
|
P,
|
|
1031
1026
|
P
|
|
1032
|
-
],
|
|
1033
|
-
const e =
|
|
1034
|
-
return
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1037
|
-
}),
|
|
1027
|
+
], xo = () => {
|
|
1028
|
+
const e = Me && document.visibilityState;
|
|
1029
|
+
return d(e) || e !== "hidden";
|
|
1030
|
+
}, No = (e) => (Me && document.addEventListener("visibilitychange", e), We("focus", e), () => {
|
|
1031
|
+
Me && document.removeEventListener("visibilitychange", e), Be("focus", e);
|
|
1032
|
+
}), Ro = (e) => {
|
|
1038
1033
|
const t = () => {
|
|
1039
|
-
|
|
1034
|
+
je = !0, e();
|
|
1040
1035
|
}, n = () => {
|
|
1041
|
-
|
|
1036
|
+
je = !1;
|
|
1042
1037
|
};
|
|
1043
|
-
return
|
|
1044
|
-
|
|
1038
|
+
return We("online", t), We("offline", n), () => {
|
|
1039
|
+
Be("online", t), Be("offline", n);
|
|
1045
1040
|
};
|
|
1046
1041
|
}, Io = {
|
|
1047
|
-
isOnline:
|
|
1048
|
-
isVisible:
|
|
1049
|
-
},
|
|
1050
|
-
initFocus:
|
|
1051
|
-
initReconnect:
|
|
1052
|
-
},
|
|
1042
|
+
isOnline: To,
|
|
1043
|
+
isVisible: xo
|
|
1044
|
+
}, So = {
|
|
1045
|
+
initFocus: No,
|
|
1046
|
+
initReconnect: Ro
|
|
1047
|
+
}, ft = !Ue.useId, ie = !_e || yo, ko = (e) => bo() ? window.requestAnimationFrame(e) : setTimeout(e, 1), Ce = ie ? ze : Gt, Oe = typeof navigator < "u" && navigator.connection, ht = !ie && Oe && ([
|
|
1053
1048
|
"slow-2g",
|
|
1054
1049
|
"2g"
|
|
1055
|
-
].includes(
|
|
1056
|
-
let
|
|
1057
|
-
const
|
|
1058
|
-
const t = typeof e, n =
|
|
1050
|
+
].includes(Oe.effectiveType) || Oe.saveData), ye = /* @__PURE__ */ new WeakMap(), Eo = (e) => Ve.prototype.toString.call(e), Le = (e, t) => e === `[object ${t}]`;
|
|
1051
|
+
let Co = 0;
|
|
1052
|
+
const Fe = (e) => {
|
|
1053
|
+
const t = typeof e, n = Eo(e), o = Le(n, "Date"), a = Le(n, "RegExp"), i = Le(n, "Object");
|
|
1059
1054
|
let s, c;
|
|
1060
|
-
if (
|
|
1061
|
-
if (s =
|
|
1062
|
-
if (s = ++
|
|
1055
|
+
if (Ve(e) === e && !o && !a) {
|
|
1056
|
+
if (s = ye.get(e), s) return s;
|
|
1057
|
+
if (s = ++Co + "~", ye.set(e, s), Array.isArray(e)) {
|
|
1063
1058
|
for (s = "@", c = 0; c < e.length; c++)
|
|
1064
|
-
s +=
|
|
1065
|
-
|
|
1059
|
+
s += Fe(e[c]) + ",";
|
|
1060
|
+
ye.set(e, s);
|
|
1066
1061
|
}
|
|
1067
1062
|
if (i) {
|
|
1068
1063
|
s = "#";
|
|
1069
|
-
const f =
|
|
1070
|
-
for (; !
|
|
1071
|
-
|
|
1072
|
-
|
|
1064
|
+
const f = Ve.keys(e).sort();
|
|
1065
|
+
for (; !d(c = f.pop()); )
|
|
1066
|
+
d(e[c]) || (s += c + ":" + Fe(e[c]) + ",");
|
|
1067
|
+
ye.set(e, s);
|
|
1073
1068
|
}
|
|
1074
1069
|
} else
|
|
1075
1070
|
s = o ? e.toJSON() : t == "symbol" ? e.toString() : t == "string" ? JSON.stringify(e) : "" + e;
|
|
1076
1071
|
return s;
|
|
1077
|
-
},
|
|
1078
|
-
if (
|
|
1072
|
+
}, Qe = (e) => {
|
|
1073
|
+
if (W(e))
|
|
1079
1074
|
try {
|
|
1080
1075
|
e = e();
|
|
1081
1076
|
} catch {
|
|
1082
1077
|
e = "";
|
|
1083
1078
|
}
|
|
1084
1079
|
const t = e;
|
|
1085
|
-
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ?
|
|
1080
|
+
return e = typeof e == "string" ? e : (Array.isArray(e) ? e.length : e) ? Fe(e) : "", [
|
|
1086
1081
|
e,
|
|
1087
1082
|
t
|
|
1088
1083
|
];
|
|
1089
1084
|
};
|
|
1090
|
-
let
|
|
1091
|
-
const
|
|
1092
|
-
async function
|
|
1093
|
-
const [t, n, o, a] = e, i =
|
|
1085
|
+
let Oo = 0;
|
|
1086
|
+
const Pe = () => ++Oo;
|
|
1087
|
+
async function Ct(...e) {
|
|
1088
|
+
const [t, n, o, a] = e, i = H({
|
|
1094
1089
|
populateCache: !0,
|
|
1095
1090
|
throwOnError: !0
|
|
1096
1091
|
}, typeof a == "boolean" ? {
|
|
@@ -1099,92 +1094,92 @@ async function Et(...e) {
|
|
|
1099
1094
|
let s = i.populateCache;
|
|
1100
1095
|
const c = i.rollbackOnError;
|
|
1101
1096
|
let f = i.optimisticData;
|
|
1102
|
-
const
|
|
1103
|
-
if (
|
|
1104
|
-
const
|
|
1105
|
-
for (const L of
|
|
1097
|
+
const u = (T) => typeof c == "function" ? c(T) : c !== !1, v = i.throwOnError;
|
|
1098
|
+
if (W(n)) {
|
|
1099
|
+
const T = n, R = [], k = t.keys();
|
|
1100
|
+
for (const L of k)
|
|
1106
1101
|
// Skip the special useSWRInfinite and useSWRSubscription keys.
|
|
1107
|
-
!/^\$(inf|sub)\$/.test(L) &&
|
|
1108
|
-
return Promise.all(
|
|
1102
|
+
!/^\$(inf|sub)\$/.test(L) && T(t.get(L)._k) && R.push(L);
|
|
1103
|
+
return Promise.all(R.map(m));
|
|
1109
1104
|
}
|
|
1110
1105
|
return m(n);
|
|
1111
|
-
async function m(
|
|
1112
|
-
const [
|
|
1113
|
-
if (!
|
|
1114
|
-
const [
|
|
1115
|
-
const
|
|
1116
|
-
return (
|
|
1106
|
+
async function m(T) {
|
|
1107
|
+
const [R] = Qe(T);
|
|
1108
|
+
if (!R) return;
|
|
1109
|
+
const [k, L] = Et(t, R), [D, ce, l, me] = F.get(t), J = () => {
|
|
1110
|
+
const q = D[R];
|
|
1111
|
+
return (W(i.revalidate) ? i.revalidate(k().data, T) : i.revalidate !== !1) && (delete l[R], delete me[R], q && q[0]) ? q[0](St).then(() => k().data) : k().data;
|
|
1117
1112
|
};
|
|
1118
1113
|
if (e.length < 3)
|
|
1119
1114
|
return J();
|
|
1120
|
-
let
|
|
1121
|
-
const Y =
|
|
1122
|
-
ce[
|
|
1115
|
+
let x = o, A, V = !1;
|
|
1116
|
+
const Y = Pe();
|
|
1117
|
+
ce[R] = [
|
|
1123
1118
|
Y,
|
|
1124
1119
|
0
|
|
1125
1120
|
];
|
|
1126
|
-
const p = !
|
|
1127
|
-
if (p && (f =
|
|
1121
|
+
const p = !d(f), Z = k(), M = Z.data, ee = Z._c, G = d(ee) ? M : ee;
|
|
1122
|
+
if (p && (f = W(f) ? f(G, M) : f, L({
|
|
1128
1123
|
data: f,
|
|
1129
|
-
_c:
|
|
1130
|
-
})),
|
|
1124
|
+
_c: G
|
|
1125
|
+
})), W(x))
|
|
1131
1126
|
try {
|
|
1132
|
-
|
|
1133
|
-
} catch (
|
|
1134
|
-
A =
|
|
1127
|
+
x = x(G);
|
|
1128
|
+
} catch (q) {
|
|
1129
|
+
A = q, V = !0;
|
|
1135
1130
|
}
|
|
1136
|
-
if (
|
|
1137
|
-
if (
|
|
1138
|
-
A =
|
|
1139
|
-
}), Y !== ce[
|
|
1131
|
+
if (x && kt(x))
|
|
1132
|
+
if (x = await x.catch((q) => {
|
|
1133
|
+
A = q, V = !0;
|
|
1134
|
+
}), Y !== ce[R][0]) {
|
|
1140
1135
|
if (V) throw A;
|
|
1141
|
-
return
|
|
1142
|
-
} else V && p &&
|
|
1143
|
-
data:
|
|
1144
|
-
_c:
|
|
1136
|
+
return x;
|
|
1137
|
+
} else V && p && u(A) && (s = !0, L({
|
|
1138
|
+
data: G,
|
|
1139
|
+
_c: I
|
|
1145
1140
|
}));
|
|
1146
1141
|
if (s && !V)
|
|
1147
|
-
if (
|
|
1148
|
-
const
|
|
1142
|
+
if (W(s)) {
|
|
1143
|
+
const q = s(x, G);
|
|
1149
1144
|
L({
|
|
1150
|
-
data:
|
|
1151
|
-
error:
|
|
1152
|
-
_c:
|
|
1145
|
+
data: q,
|
|
1146
|
+
error: I,
|
|
1147
|
+
_c: I
|
|
1153
1148
|
});
|
|
1154
1149
|
} else
|
|
1155
1150
|
L({
|
|
1156
|
-
data:
|
|
1157
|
-
error:
|
|
1158
|
-
_c:
|
|
1151
|
+
data: x,
|
|
1152
|
+
error: I,
|
|
1153
|
+
_c: I
|
|
1159
1154
|
});
|
|
1160
|
-
if (ce[
|
|
1155
|
+
if (ce[R][1] = Pe(), Promise.resolve(J()).then(() => {
|
|
1161
1156
|
L({
|
|
1162
|
-
_c:
|
|
1157
|
+
_c: I
|
|
1163
1158
|
});
|
|
1164
1159
|
}), V) {
|
|
1165
|
-
if (
|
|
1160
|
+
if (v) throw A;
|
|
1166
1161
|
return;
|
|
1167
1162
|
}
|
|
1168
|
-
return
|
|
1163
|
+
return x;
|
|
1169
1164
|
}
|
|
1170
1165
|
}
|
|
1171
|
-
const
|
|
1166
|
+
const _t = (e, t) => {
|
|
1172
1167
|
for (const n in e)
|
|
1173
1168
|
e[n][0] && e[n][0](t);
|
|
1174
|
-
},
|
|
1169
|
+
}, Lo = (e, t) => {
|
|
1175
1170
|
if (!F.has(e)) {
|
|
1176
|
-
const n =
|
|
1171
|
+
const n = H(So, t), o = /* @__PURE__ */ Object.create(null), a = Ct.bind(I, e);
|
|
1177
1172
|
let i = P;
|
|
1178
|
-
const s = /* @__PURE__ */ Object.create(null), c = (
|
|
1179
|
-
const
|
|
1180
|
-
return s[
|
|
1181
|
-
}, f = (
|
|
1182
|
-
e.set(
|
|
1183
|
-
const
|
|
1184
|
-
if (
|
|
1185
|
-
for (const
|
|
1186
|
-
|
|
1187
|
-
},
|
|
1173
|
+
const s = /* @__PURE__ */ Object.create(null), c = (v, m) => {
|
|
1174
|
+
const T = s[v] || [];
|
|
1175
|
+
return s[v] = T, T.push(m), () => T.splice(T.indexOf(m), 1);
|
|
1176
|
+
}, f = (v, m, T) => {
|
|
1177
|
+
e.set(v, m);
|
|
1178
|
+
const R = s[v];
|
|
1179
|
+
if (R)
|
|
1180
|
+
for (const k of R)
|
|
1181
|
+
k(m, T);
|
|
1182
|
+
}, u = () => {
|
|
1188
1183
|
if (!F.has(e) && (F.set(e, [
|
|
1189
1184
|
o,
|
|
1190
1185
|
/* @__PURE__ */ Object.create(null),
|
|
@@ -1194,16 +1189,16 @@ const ht = (e, t) => {
|
|
|
1194
1189
|
f,
|
|
1195
1190
|
c
|
|
1196
1191
|
]), !ie)) {
|
|
1197
|
-
const
|
|
1192
|
+
const v = n.initFocus(setTimeout.bind(I, _t.bind(I, o, Rt))), m = n.initReconnect(setTimeout.bind(I, _t.bind(I, o, It)));
|
|
1198
1193
|
i = () => {
|
|
1199
|
-
|
|
1194
|
+
v && v(), m && m(), F.delete(e);
|
|
1200
1195
|
};
|
|
1201
1196
|
}
|
|
1202
1197
|
};
|
|
1203
|
-
return
|
|
1198
|
+
return u(), [
|
|
1204
1199
|
e,
|
|
1205
1200
|
a,
|
|
1206
|
-
|
|
1201
|
+
u,
|
|
1207
1202
|
i
|
|
1208
1203
|
];
|
|
1209
1204
|
}
|
|
@@ -1211,16 +1206,16 @@ const ht = (e, t) => {
|
|
|
1211
1206
|
e,
|
|
1212
1207
|
F.get(e)[4]
|
|
1213
1208
|
];
|
|
1214
|
-
},
|
|
1209
|
+
}, qo = (e, t, n, o, a) => {
|
|
1215
1210
|
const i = n.errorRetryCount, s = a.retryCount, c = ~~((Math.random() + 0.5) * (1 << (s < 8 ? s : 8))) * n.errorRetryInterval;
|
|
1216
|
-
!
|
|
1217
|
-
}, $o =
|
|
1211
|
+
!d(i) && s > i || setTimeout(o, c, a);
|
|
1212
|
+
}, $o = Ae, [Ot, Do] = Lo(/* @__PURE__ */ new Map()), Ao = H(
|
|
1218
1213
|
{
|
|
1219
1214
|
// events
|
|
1220
1215
|
onLoadingSlow: P,
|
|
1221
1216
|
onSuccess: P,
|
|
1222
1217
|
onError: P,
|
|
1223
|
-
onErrorRetry:
|
|
1218
|
+
onErrorRetry: qo,
|
|
1224
1219
|
onDiscarded: P,
|
|
1225
1220
|
// switches
|
|
1226
1221
|
revalidateOnFocus: !0,
|
|
@@ -1228,29 +1223,29 @@ const ht = (e, t) => {
|
|
|
1228
1223
|
revalidateIfStale: !0,
|
|
1229
1224
|
shouldRetryOnError: !0,
|
|
1230
1225
|
// timeouts
|
|
1231
|
-
errorRetryInterval:
|
|
1226
|
+
errorRetryInterval: ht ? 1e4 : 5e3,
|
|
1232
1227
|
focusThrottleInterval: 5 * 1e3,
|
|
1233
1228
|
dedupingInterval: 2 * 1e3,
|
|
1234
|
-
loadingTimeout:
|
|
1229
|
+
loadingTimeout: ht ? 5e3 : 3e3,
|
|
1235
1230
|
// providers
|
|
1236
1231
|
compare: $o,
|
|
1237
1232
|
isPaused: () => !1,
|
|
1238
|
-
cache:
|
|
1239
|
-
mutate:
|
|
1233
|
+
cache: Ot,
|
|
1234
|
+
mutate: Do,
|
|
1240
1235
|
fallback: {}
|
|
1241
1236
|
},
|
|
1242
1237
|
// use web preset by default
|
|
1243
1238
|
Io
|
|
1244
|
-
),
|
|
1245
|
-
const n =
|
|
1239
|
+
), Vo = (e, t) => {
|
|
1240
|
+
const n = H(e, t);
|
|
1246
1241
|
if (t) {
|
|
1247
1242
|
const { use: o, fallback: a } = e, { use: i, fallback: s } = t;
|
|
1248
|
-
o && i && (n.use = o.concat(i)), a && s && (n.fallback =
|
|
1243
|
+
o && i && (n.use = o.concat(i)), a && s && (n.fallback = H(a, s));
|
|
1249
1244
|
}
|
|
1250
1245
|
return n;
|
|
1251
|
-
},
|
|
1252
|
-
|
|
1253
|
-
},
|
|
1246
|
+
}, Mo = Ht({}), jo = "$inf$", Lt = _e && window.__SWR_DEVTOOLS_USE__, Wo = Lt ? window.__SWR_DEVTOOLS_USE__ : [], Bo = () => {
|
|
1247
|
+
Lt && (window.__SWR_DEVTOOLS_REACT__ = Ue);
|
|
1248
|
+
}, Fo = (e) => W(e[1]) ? [
|
|
1254
1249
|
e[0],
|
|
1255
1250
|
e[1],
|
|
1256
1251
|
e[2] || {}
|
|
@@ -1258,33 +1253,33 @@ const ht = (e, t) => {
|
|
|
1258
1253
|
e[0],
|
|
1259
1254
|
null,
|
|
1260
1255
|
(e[1] === null ? e[2] : e[1]) || {}
|
|
1261
|
-
],
|
|
1262
|
-
const e =
|
|
1263
|
-
return
|
|
1256
|
+
], Po = () => {
|
|
1257
|
+
const e = Xt(Mo);
|
|
1258
|
+
return He(() => H(Ao, e), [
|
|
1264
1259
|
e
|
|
1265
1260
|
]);
|
|
1266
|
-
},
|
|
1267
|
-
const [s] =
|
|
1268
|
-
if (s.startsWith(
|
|
1261
|
+
}, Uo = (e) => (t, n, o) => e(t, n && ((...i) => {
|
|
1262
|
+
const [s] = Qe(t), [, , , c] = F.get(Ot);
|
|
1263
|
+
if (s.startsWith(jo))
|
|
1269
1264
|
return n(...i);
|
|
1270
1265
|
const f = c[s];
|
|
1271
|
-
return
|
|
1272
|
-
}), o),
|
|
1273
|
-
const o =
|
|
1266
|
+
return d(f) ? n(...i) : (delete c[s], f);
|
|
1267
|
+
}), o), zo = Wo.concat(Uo), Ho = (e) => function(...n) {
|
|
1268
|
+
const o = Po(), [a, i, s] = Fo(n), c = Vo(o, s);
|
|
1274
1269
|
let f = e;
|
|
1275
|
-
const { use:
|
|
1276
|
-
for (let m =
|
|
1277
|
-
f =
|
|
1270
|
+
const { use: u } = c, v = (u || []).concat(zo);
|
|
1271
|
+
for (let m = v.length; m--; )
|
|
1272
|
+
f = v[m](f);
|
|
1278
1273
|
return f(a, i || c.fetcher || null, c);
|
|
1279
|
-
},
|
|
1274
|
+
}, Go = (e, t, n) => {
|
|
1280
1275
|
const o = t[e] || (t[e] = []);
|
|
1281
1276
|
return o.push(n), () => {
|
|
1282
1277
|
const a = o.indexOf(n);
|
|
1283
1278
|
a >= 0 && (o[a] = o[o.length - 1], o.pop());
|
|
1284
1279
|
};
|
|
1285
1280
|
};
|
|
1286
|
-
|
|
1287
|
-
const
|
|
1281
|
+
Bo();
|
|
1282
|
+
const qe = Ue.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax
|
|
1288
1283
|
// and emitting an error.
|
|
1289
1284
|
// We assume that this is only for the `use(thenable)` case, not `use(context)`.
|
|
1290
1285
|
// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45
|
|
@@ -1303,98 +1298,106 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1303
1298
|
e.status = "rejected", e.reason = t;
|
|
1304
1299
|
}), e;
|
|
1305
1300
|
}
|
|
1306
|
-
}),
|
|
1301
|
+
}), $e = {
|
|
1307
1302
|
dedupe: !0
|
|
1308
|
-
},
|
|
1309
|
-
const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval:
|
|
1310
|
-
for (const
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
if (!a(_[
|
|
1303
|
+
}, mt = Promise.resolve(I), Xo = () => P, Ko = (e, t, n) => {
|
|
1304
|
+
const { cache: o, compare: a, suspense: i, fallbackData: s, revalidateOnMount: c, revalidateIfStale: f, refreshInterval: u, refreshWhenHidden: v, refreshWhenOffline: m, keepPreviousData: T, strictServerPrefetchWarning: R } = n, [k, L, D, ce] = F.get(o), [l, me] = Qe(e), J = z(!1), x = z(!1), A = z(l), V = z(t), Y = z(n), p = () => Y.current, Z = () => p().isVisible() && p().isOnline(), [M, ee, G, q] = Et(o, l), te = z({}).current, ne = d(s) ? d(n.fallback) ? I : n.fallback[l] : s, Je = (_, g) => {
|
|
1305
|
+
for (const w in te) {
|
|
1306
|
+
const y = w;
|
|
1307
|
+
if (y === "data") {
|
|
1308
|
+
if (!a(_[y], g[y]) && (!d(_[y]) || !a(ve, g[y])))
|
|
1314
1309
|
return !1;
|
|
1315
|
-
} else if (
|
|
1310
|
+
} else if (g[y] !== _[y])
|
|
1316
1311
|
return !1;
|
|
1317
1312
|
}
|
|
1318
1313
|
return !0;
|
|
1319
|
-
},
|
|
1320
|
-
const _ =
|
|
1321
|
-
const
|
|
1322
|
-
return delete
|
|
1314
|
+
}, be = !J.current, Ye = He(() => {
|
|
1315
|
+
const _ = M(), g = q(), w = (b) => {
|
|
1316
|
+
const $ = H(b);
|
|
1317
|
+
return delete $._k, (() => {
|
|
1318
|
+
if (!l || !t || p().isPaused()) return !1;
|
|
1319
|
+
if (be && !d(c)) return c;
|
|
1320
|
+
const fe = d(ne) ? $.data : ne;
|
|
1321
|
+
return d(fe) || f;
|
|
1322
|
+
})() ? {
|
|
1323
1323
|
isValidating: !0,
|
|
1324
1324
|
isLoading: !0,
|
|
1325
|
-
|
|
1326
|
-
} :
|
|
1327
|
-
}, y =
|
|
1328
|
-
let
|
|
1325
|
+
...$
|
|
1326
|
+
} : $;
|
|
1327
|
+
}, y = w(_), j = _ === g ? y : w(g);
|
|
1328
|
+
let C = y;
|
|
1329
1329
|
return [
|
|
1330
1330
|
() => {
|
|
1331
|
-
const
|
|
1332
|
-
return
|
|
1331
|
+
const b = w(M());
|
|
1332
|
+
return Je(b, C) ? (C.data = b.data, C.isLoading = b.isLoading, C.isValidating = b.isValidating, C.error = b.error, C) : (C = b, b);
|
|
1333
1333
|
},
|
|
1334
|
-
() =>
|
|
1334
|
+
() => j
|
|
1335
1335
|
];
|
|
1336
1336
|
}, [
|
|
1337
1337
|
o,
|
|
1338
1338
|
l
|
|
1339
|
-
]),
|
|
1340
|
-
(_) =>
|
|
1341
|
-
|
|
1339
|
+
]), re = ot.useSyncExternalStore(Re(
|
|
1340
|
+
(_) => G(l, (g, w) => {
|
|
1341
|
+
Je(w, g) || _();
|
|
1342
1342
|
}),
|
|
1343
1343
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1344
1344
|
[
|
|
1345
1345
|
o,
|
|
1346
1346
|
l
|
|
1347
1347
|
]
|
|
1348
|
-
),
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1348
|
+
), Ye[0], Ye[1]), $t = k[l] && k[l].length > 0, oe = re.data, X = d(oe) ? ne && kt(ne) ? qe(ne) : ne : oe, pe = re.error, Te = z(X), ve = T ? d(oe) ? d(Te.current) ? X : Te.current : oe : X, K = l && d(X), le = z(null);
|
|
1349
|
+
!ie && // getServerSnapshot is only called during hydration
|
|
1350
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1351
|
+
ot.useSyncExternalStore(Xo, () => (le.current = !1, le), () => (le.current = !0, le));
|
|
1352
|
+
const Dt = le.current;
|
|
1353
|
+
R && Dt && !i && 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.`);
|
|
1354
|
+
const Ze = !l || !t || p().isPaused() || $t && !d(pe) ? !1 : be && !d(c) ? c : i ? d(X) ? !1 : f : d(X) || f, et = be && Ze, At = d(re.isValidating) ? et : re.isValidating, Vt = d(re.isLoading) ? et : re.isLoading, de = Re(
|
|
1352
1355
|
async (_) => {
|
|
1353
|
-
const
|
|
1354
|
-
if (!l || !
|
|
1356
|
+
const g = V.current;
|
|
1357
|
+
if (!l || !g || x.current || p().isPaused())
|
|
1355
1358
|
return !1;
|
|
1356
|
-
let
|
|
1357
|
-
const
|
|
1359
|
+
let w, y, j = !0;
|
|
1360
|
+
const C = _ || {}, b = !D[l] || !C.dedupe, $ = () => ft ? !x.current && l === A.current && J.current : l === A.current, ue = {
|
|
1358
1361
|
isValidating: !1,
|
|
1359
1362
|
isLoading: !1
|
|
1360
|
-
},
|
|
1361
|
-
ee(
|
|
1362
|
-
},
|
|
1363
|
+
}, fe = () => {
|
|
1364
|
+
ee(ue);
|
|
1365
|
+
}, nt = () => {
|
|
1363
1366
|
const O = D[l];
|
|
1364
|
-
O && O[1] ===
|
|
1365
|
-
},
|
|
1367
|
+
O && O[1] === y && delete D[l];
|
|
1368
|
+
}, rt = {
|
|
1366
1369
|
isValidating: !0
|
|
1367
1370
|
};
|
|
1368
|
-
|
|
1371
|
+
d(M().data) && (rt.isLoading = !0);
|
|
1369
1372
|
try {
|
|
1370
|
-
if (
|
|
1371
|
-
|
|
1373
|
+
if (b && (ee(rt), n.loadingTimeout && d(M().data) && setTimeout(() => {
|
|
1374
|
+
j && $() && p().onLoadingSlow(l, n);
|
|
1372
1375
|
}, n.loadingTimeout), D[l] = [
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
]), [
|
|
1376
|
-
return
|
|
1377
|
-
|
|
1376
|
+
g(me),
|
|
1377
|
+
Pe()
|
|
1378
|
+
]), [w, y] = D[l], w = await w, b && setTimeout(nt, n.dedupingInterval), !D[l] || D[l][1] !== y)
|
|
1379
|
+
return b && $() && p().onDiscarded(l), !1;
|
|
1380
|
+
ue.error = I;
|
|
1378
1381
|
const O = L[l];
|
|
1379
|
-
if (!
|
|
1380
|
-
(
|
|
1381
|
-
|
|
1382
|
+
if (!d(O) && // case 1
|
|
1383
|
+
(y <= O[0] || // case 2
|
|
1384
|
+
y <= O[1] || // case 3
|
|
1382
1385
|
O[1] === 0))
|
|
1383
|
-
return
|
|
1386
|
+
return fe(), b && $() && p().onDiscarded(l), !1;
|
|
1384
1387
|
const B = M().data;
|
|
1385
|
-
|
|
1388
|
+
ue.data = a(B, w) ? B : w, b && $() && p().onSuccess(w, l, n);
|
|
1386
1389
|
} catch (O) {
|
|
1387
|
-
|
|
1388
|
-
const B = p(), { shouldRetryOnError:
|
|
1389
|
-
B.isPaused() || (
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1390
|
+
nt();
|
|
1391
|
+
const B = p(), { shouldRetryOnError: xe } = B;
|
|
1392
|
+
B.isPaused() || (ue.error = O, b && $() && (B.onError(O, l, B), (xe === !0 || W(xe) && xe(O)) && (!p().revalidateOnFocus || !p().revalidateOnReconnect || Z()) && B.onErrorRetry(O, l, B, (Mt) => {
|
|
1393
|
+
const Ne = k[l];
|
|
1394
|
+
Ne && Ne[0] && Ne[0](dt, Mt);
|
|
1392
1395
|
}, {
|
|
1393
|
-
retryCount: (
|
|
1396
|
+
retryCount: (C.retryCount || 0) + 1,
|
|
1394
1397
|
dedupe: !0
|
|
1395
1398
|
})));
|
|
1396
1399
|
}
|
|
1397
|
-
return
|
|
1400
|
+
return j = !1, fe(), !0;
|
|
1398
1401
|
},
|
|
1399
1402
|
// `setState` is immutable, and `eventsCallback`, `fnArg`, and
|
|
1400
1403
|
// `keyValidating` are depending on `key`, so we can exclude them from
|
|
@@ -1411,102 +1414,102 @@ const Ce = Be.use || // This extra generic is to avoid TypeScript mixing up the
|
|
|
1411
1414
|
l,
|
|
1412
1415
|
o
|
|
1413
1416
|
]
|
|
1414
|
-
),
|
|
1417
|
+
), tt = Re(
|
|
1415
1418
|
// Use callback to make sure `keyRef.current` returns latest result every time
|
|
1416
|
-
(..._) =>
|
|
1419
|
+
(..._) => Ct(o, A.current, ..._),
|
|
1417
1420
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1418
1421
|
[]
|
|
1419
1422
|
);
|
|
1420
|
-
if (
|
|
1421
|
-
V.current = t, Y.current = n,
|
|
1422
|
-
}),
|
|
1423
|
+
if (Ce(() => {
|
|
1424
|
+
V.current = t, Y.current = n, d(oe) || (Te.current = oe);
|
|
1425
|
+
}), Ce(() => {
|
|
1423
1426
|
if (!l) return;
|
|
1424
|
-
const _ =
|
|
1425
|
-
let
|
|
1426
|
-
p().revalidateOnFocus && (
|
|
1427
|
-
const
|
|
1428
|
-
if (
|
|
1429
|
-
const
|
|
1430
|
-
p().revalidateOnFocus &&
|
|
1431
|
-
} else if (
|
|
1427
|
+
const _ = de.bind(I, $e);
|
|
1428
|
+
let g = 0;
|
|
1429
|
+
p().revalidateOnFocus && (g = Date.now() + p().focusThrottleInterval);
|
|
1430
|
+
const y = Go(l, k, (j, C = {}) => {
|
|
1431
|
+
if (j == Rt) {
|
|
1432
|
+
const b = Date.now();
|
|
1433
|
+
p().revalidateOnFocus && b > g && Z() && (g = b + p().focusThrottleInterval, _());
|
|
1434
|
+
} else if (j == It)
|
|
1432
1435
|
p().revalidateOnReconnect && Z() && _();
|
|
1433
1436
|
else {
|
|
1434
|
-
if (
|
|
1435
|
-
return
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1437
|
+
if (j == St)
|
|
1438
|
+
return de();
|
|
1439
|
+
if (j == dt)
|
|
1440
|
+
return de(C);
|
|
1438
1441
|
}
|
|
1439
1442
|
});
|
|
1440
|
-
return
|
|
1441
|
-
_k:
|
|
1442
|
-
}),
|
|
1443
|
-
|
|
1443
|
+
return x.current = !1, A.current = l, J.current = !0, ee({
|
|
1444
|
+
_k: me
|
|
1445
|
+
}), Ze && (D[l] || (d(X) || ie ? _() : ko(_))), () => {
|
|
1446
|
+
x.current = !0, y();
|
|
1444
1447
|
};
|
|
1445
1448
|
}, [
|
|
1446
1449
|
l
|
|
1447
|
-
]),
|
|
1450
|
+
]), Ce(() => {
|
|
1448
1451
|
let _;
|
|
1449
|
-
function
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1452
|
+
function g() {
|
|
1453
|
+
const y = W(u) ? u(M().data) : u;
|
|
1454
|
+
y && _ !== -1 && (_ = setTimeout(w, y));
|
|
1452
1455
|
}
|
|
1453
|
-
function
|
|
1454
|
-
!M().error && (
|
|
1456
|
+
function w() {
|
|
1457
|
+
!M().error && (v || p().isVisible()) && (m || p().isOnline()) ? de($e).then(g) : g();
|
|
1455
1458
|
}
|
|
1456
|
-
return
|
|
1459
|
+
return g(), () => {
|
|
1457
1460
|
_ && (clearTimeout(_), _ = -1);
|
|
1458
1461
|
};
|
|
1459
1462
|
}, [
|
|
1460
|
-
|
|
1461
|
-
|
|
1463
|
+
u,
|
|
1464
|
+
v,
|
|
1462
1465
|
m,
|
|
1463
1466
|
l
|
|
1464
|
-
]),
|
|
1465
|
-
if (!
|
|
1467
|
+
]), Kt(ve), i) {
|
|
1468
|
+
if (!ft && ie && K)
|
|
1466
1469
|
throw new Error("Fallback data is required when using Suspense in SSR.");
|
|
1467
|
-
|
|
1468
|
-
const _ = ce[l],
|
|
1469
|
-
if (
|
|
1470
|
-
throw
|
|
1471
|
-
const
|
|
1472
|
-
!
|
|
1470
|
+
K && (V.current = t, Y.current = n, x.current = !1);
|
|
1471
|
+
const _ = ce[l], g = !d(_) && K ? tt(_) : mt;
|
|
1472
|
+
if (qe(g), !d(pe) && K)
|
|
1473
|
+
throw pe;
|
|
1474
|
+
const w = K ? de($e) : mt;
|
|
1475
|
+
!d(ve) && K && (w.status = "fulfilled", w.value = !0), qe(w);
|
|
1473
1476
|
}
|
|
1474
1477
|
return {
|
|
1475
|
-
mutate:
|
|
1478
|
+
mutate: tt,
|
|
1476
1479
|
get data() {
|
|
1477
|
-
return te.data = !0,
|
|
1480
|
+
return te.data = !0, ve;
|
|
1478
1481
|
},
|
|
1479
1482
|
get error() {
|
|
1480
|
-
return te.error = !0,
|
|
1483
|
+
return te.error = !0, pe;
|
|
1481
1484
|
},
|
|
1482
1485
|
get isValidating() {
|
|
1483
|
-
return te.isValidating = !0,
|
|
1486
|
+
return te.isValidating = !0, At;
|
|
1484
1487
|
},
|
|
1485
1488
|
get isLoading() {
|
|
1486
|
-
return te.isLoading = !0,
|
|
1489
|
+
return te.isLoading = !0, Vt;
|
|
1487
1490
|
}
|
|
1488
1491
|
};
|
|
1489
|
-
},
|
|
1490
|
-
class
|
|
1492
|
+
}, pt = Ho(Ko);
|
|
1493
|
+
class Qo extends Error {
|
|
1491
1494
|
constructor({ message: t, status: n, data: o }) {
|
|
1492
1495
|
super(t), this.name = "TwitterApiError", this.status = n, this.data = o;
|
|
1493
1496
|
}
|
|
1494
1497
|
}
|
|
1495
|
-
const
|
|
1496
|
-
async function
|
|
1498
|
+
const Jo = pt.default || pt, Yo = "https://react-tweet.vercel.app";
|
|
1499
|
+
async function Zo([e, t]) {
|
|
1497
1500
|
const n = await fetch(e, t), o = await n.json();
|
|
1498
1501
|
if (n.ok) return o.data || null;
|
|
1499
|
-
throw new
|
|
1502
|
+
throw new Qo({
|
|
1500
1503
|
message: `Failed to fetch tweet at "${e}" with "${n.status}".`,
|
|
1501
1504
|
data: o,
|
|
1502
1505
|
status: n.status
|
|
1503
1506
|
});
|
|
1504
1507
|
}
|
|
1505
|
-
const
|
|
1506
|
-
const { isLoading: o, data: a, error: i } =
|
|
1507
|
-
t || e && `${
|
|
1508
|
+
const ea = (e, t, n) => {
|
|
1509
|
+
const { isLoading: o, data: a, error: i } = Jo(() => t || e ? [
|
|
1510
|
+
t || e && `${Yo}/api/tweet/${e}`,
|
|
1508
1511
|
n
|
|
1509
|
-
] : null,
|
|
1512
|
+
] : null, Zo, {
|
|
1510
1513
|
revalidateIfStale: !1,
|
|
1511
1514
|
revalidateOnFocus: !1,
|
|
1512
1515
|
shouldRetryOnError: !1
|
|
@@ -1518,120 +1521,83 @@ const Yo = (e, t, n) => {
|
|
|
1518
1521
|
data: a,
|
|
1519
1522
|
error: i
|
|
1520
1523
|
};
|
|
1521
|
-
},
|
|
1522
|
-
const { data: s, error: c, isLoading: f } =
|
|
1524
|
+
}, ta = ({ id: e, apiUrl: t, fallback: n = /* @__PURE__ */ r(wo, {}), components: o, fetchOptions: a, onError: i }) => {
|
|
1525
|
+
const { data: s, error: c, isLoading: f } = ea(e, t, a);
|
|
1523
1526
|
if (f) return n;
|
|
1524
1527
|
if (c || !s) {
|
|
1525
|
-
const
|
|
1526
|
-
return /* @__PURE__ */ r(
|
|
1528
|
+
const u = (o == null ? void 0 : o.TweetNotFound) || _o;
|
|
1529
|
+
return /* @__PURE__ */ r(u, {
|
|
1527
1530
|
error: i ? i(c) : c
|
|
1528
1531
|
});
|
|
1529
1532
|
}
|
|
1530
|
-
return /* @__PURE__ */ r(
|
|
1533
|
+
return /* @__PURE__ */ r(uo, {
|
|
1531
1534
|
tweet: s,
|
|
1532
1535
|
components: o
|
|
1533
1536
|
});
|
|
1534
1537
|
};
|
|
1535
|
-
function
|
|
1538
|
+
function na({ node: e }) {
|
|
1536
1539
|
var o;
|
|
1537
1540
|
const t = ((o = e == null ? void 0 : e.attrs) == null ? void 0 : o.src) || "", n = t == null ? void 0 : t.split("/").pop();
|
|
1538
|
-
return n ? /* @__PURE__ */ r(
|
|
1541
|
+
return n ? /* @__PURE__ */ r(Ft, { children: /* @__PURE__ */ r("div", { "data-twitter": "", children: /* @__PURE__ */ r(ta, { id: n }) }) }) : null;
|
|
1539
1542
|
}
|
|
1540
|
-
function
|
|
1541
|
-
const { t } =
|
|
1542
|
-
|
|
1543
|
+
function ra(e) {
|
|
1544
|
+
const { t } = on(), [n, o] = se("");
|
|
1545
|
+
ze(() => {
|
|
1543
1546
|
var i;
|
|
1544
1547
|
if (e != null && e.editor) {
|
|
1545
|
-
const { src: s } = (i = e.editor) == null ? void 0 : i.getAttributes(
|
|
1548
|
+
const { src: s } = (i = e.editor) == null ? void 0 : i.getAttributes(qt.name);
|
|
1546
1549
|
s && o(s);
|
|
1547
1550
|
}
|
|
1548
1551
|
}, [e == null ? void 0 : e.editor]);
|
|
1549
1552
|
function a(i) {
|
|
1550
1553
|
i.preventDefault(), i.stopPropagation(), e == null || e.onSetLink(n);
|
|
1551
1554
|
}
|
|
1552
|
-
return /* @__PURE__ */ h(
|
|
1553
|
-
"
|
|
1554
|
-
{
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
value: n
|
|
1568
|
-
}
|
|
1569
|
-
) }) }),
|
|
1570
|
-
/* @__PURE__ */ r(
|
|
1571
|
-
Zt,
|
|
1572
|
-
{
|
|
1573
|
-
className: "richtext-mt-2 richtext-self-end",
|
|
1574
|
-
type: "submit",
|
|
1575
|
-
children: t("editor.link.dialog.button.apply")
|
|
1576
|
-
}
|
|
1577
|
-
)
|
|
1578
|
-
]
|
|
1579
|
-
}
|
|
1580
|
-
);
|
|
1555
|
+
return /* @__PURE__ */ h("form", { className: "richtext-flex richtext-flex-col richtext-gap-2", onSubmit: a, children: [
|
|
1556
|
+
/* @__PURE__ */ r(Qt, { className: "mb-[6px]", children: t("editor.link.dialog.text") }),
|
|
1557
|
+
/* @__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(
|
|
1558
|
+
Jt,
|
|
1559
|
+
{
|
|
1560
|
+
className: "richtext-w-80",
|
|
1561
|
+
onChange: (i) => o(i.target.value),
|
|
1562
|
+
placeholder: "Text",
|
|
1563
|
+
required: !0,
|
|
1564
|
+
type: "text",
|
|
1565
|
+
value: n
|
|
1566
|
+
}
|
|
1567
|
+
) }) }),
|
|
1568
|
+
/* @__PURE__ */ r(Yt, { className: "richtext-mt-2 richtext-self-end", type: "submit", children: t("editor.link.dialog.button.apply") })
|
|
1569
|
+
] });
|
|
1581
1570
|
}
|
|
1582
|
-
function
|
|
1583
|
-
const [e, t] = se(!1), n =
|
|
1571
|
+
function ma() {
|
|
1572
|
+
const [e, t] = se(!1), n = Zt(), o = en(qt.name), {
|
|
1584
1573
|
icon: a = void 0,
|
|
1585
1574
|
tooltip: i = void 0,
|
|
1586
1575
|
tooltipOptions: s = {},
|
|
1587
1576
|
action: c = void 0,
|
|
1588
1577
|
isActive: f = void 0
|
|
1589
|
-
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled:
|
|
1590
|
-
function
|
|
1591
|
-
|
|
1578
|
+
} = (o == null ? void 0 : o.componentProps) ?? {}, { editorDisabled: u } = tn(f);
|
|
1579
|
+
function v(m) {
|
|
1580
|
+
u || c && (c(m), t(!1));
|
|
1592
1581
|
}
|
|
1593
|
-
return /* @__PURE__ */ h(
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
tooltipOptions: s,
|
|
1607
|
-
children: /* @__PURE__ */ r(sn, { name: a })
|
|
1608
|
-
}
|
|
1609
|
-
) }),
|
|
1610
|
-
/* @__PURE__ */ r(
|
|
1611
|
-
an,
|
|
1612
|
-
{
|
|
1613
|
-
align: "start",
|
|
1614
|
-
className: "richtext-w-full",
|
|
1615
|
-
hideWhenDetached: !0,
|
|
1616
|
-
side: "bottom",
|
|
1617
|
-
children: /* @__PURE__ */ r(
|
|
1618
|
-
ta,
|
|
1619
|
-
{
|
|
1620
|
-
editor: n,
|
|
1621
|
-
onSetLink: g
|
|
1622
|
-
}
|
|
1623
|
-
)
|
|
1624
|
-
}
|
|
1625
|
-
)
|
|
1626
|
-
]
|
|
1627
|
-
}
|
|
1628
|
-
);
|
|
1582
|
+
return /* @__PURE__ */ h(an, { modal: !0, onOpenChange: t, open: e, children: [
|
|
1583
|
+
/* @__PURE__ */ r(sn, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1584
|
+
nn,
|
|
1585
|
+
{
|
|
1586
|
+
disabled: u,
|
|
1587
|
+
isActive: f,
|
|
1588
|
+
tooltip: i,
|
|
1589
|
+
tooltipOptions: s,
|
|
1590
|
+
children: /* @__PURE__ */ r(rn, { name: a })
|
|
1591
|
+
}
|
|
1592
|
+
) }),
|
|
1593
|
+
/* @__PURE__ */ r(cn, { align: "start", className: "richtext-w-full", hideWhenDetached: !0, side: "bottom", children: /* @__PURE__ */ r(ra, { editor: n, onSetLink: v }) })
|
|
1594
|
+
] });
|
|
1629
1595
|
}
|
|
1630
|
-
const
|
|
1631
|
-
function
|
|
1632
|
-
return e.match(
|
|
1596
|
+
const oa = /(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g, aa = /^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;
|
|
1597
|
+
function vt(e) {
|
|
1598
|
+
return e.match(aa);
|
|
1633
1599
|
}
|
|
1634
|
-
const
|
|
1600
|
+
const qt = /* @__PURE__ */ jt.create({
|
|
1635
1601
|
name: "twitter",
|
|
1636
1602
|
draggable: !0,
|
|
1637
1603
|
selectable: !0,
|
|
@@ -1656,7 +1622,9 @@ const Lt = /* @__PURE__ */ jt.create({
|
|
|
1656
1622
|
};
|
|
1657
1623
|
},
|
|
1658
1624
|
addNodeView() {
|
|
1659
|
-
return
|
|
1625
|
+
return Pt(na, {
|
|
1626
|
+
attrs: this.options.HTMLAttributes
|
|
1627
|
+
});
|
|
1660
1628
|
},
|
|
1661
1629
|
inline() {
|
|
1662
1630
|
return this.options.inline;
|
|
@@ -1680,17 +1648,17 @@ const Lt = /* @__PURE__ */ jt.create({
|
|
|
1680
1648
|
},
|
|
1681
1649
|
addCommands() {
|
|
1682
1650
|
return {
|
|
1683
|
-
setTweet: (e) => ({ commands: t }) =>
|
|
1651
|
+
setTweet: (e) => ({ commands: t }) => vt(e.src) ? t.insertContent({
|
|
1684
1652
|
type: this.name,
|
|
1685
1653
|
attrs: e
|
|
1686
1654
|
}) : !1,
|
|
1687
|
-
updateTweet: (e) => ({ commands: t }) =>
|
|
1655
|
+
updateTweet: (e) => ({ commands: t }) => vt(e.src) ? t.updateAttributes(this.name, { src: e.src }) : !1
|
|
1688
1656
|
};
|
|
1689
1657
|
},
|
|
1690
1658
|
addPasteRules() {
|
|
1691
1659
|
return this.options.addPasteHandler ? [
|
|
1692
1660
|
Bt({
|
|
1693
|
-
find:
|
|
1661
|
+
find: oa,
|
|
1694
1662
|
type: this.type,
|
|
1695
1663
|
getAttributes: (e) => ({ src: e.input })
|
|
1696
1664
|
})
|
|
@@ -1701,7 +1669,7 @@ const Lt = /* @__PURE__ */ jt.create({
|
|
|
1701
1669
|
}
|
|
1702
1670
|
});
|
|
1703
1671
|
export {
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1672
|
+
ra as F,
|
|
1673
|
+
ma as R,
|
|
1674
|
+
qt as T
|
|
1707
1675
|
};
|