birdclaw 0.8.3 → 0.8.4

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 (284) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +10 -8
  3. package/bin/birdclaw.mjs +4 -66
  4. package/dist/cli/birdclaw.js +28165 -0
  5. package/dist/client/assets/AvatarChip-DLoqM5xD.js +1 -0
  6. package/dist/client/assets/ProfilePreview-BejAuYsJ.js +1 -0
  7. package/dist/client/assets/SavedTimelineView-BIS7HKpp.js +1 -0
  8. package/dist/client/assets/SmartTimestamp-BR0-9se2.js +1 -0
  9. package/dist/client/assets/TimelineRouteFrame-CyGPj0eM.js +1 -0
  10. package/dist/client/assets/blocks-7UDKQp8H.js +1 -0
  11. package/dist/client/assets/bookmarks-CbBkMvXk.js +1 -0
  12. package/dist/client/assets/chunk-C0phanGV.js +1 -0
  13. package/dist/client/assets/circle-check-C_Vq3ElD.js +1 -0
  14. package/dist/client/assets/client-stream-contracts-ys3XhWG4.js +5 -0
  15. package/dist/client/assets/createLucideIcon-JV8isFFR.js +1 -0
  16. package/dist/client/assets/data-sources-Cm2bpNvg.js +1 -0
  17. package/dist/client/assets/discuss-DTjaOugw.js +1 -0
  18. package/dist/client/assets/dms-CGd6Eogq.js +1 -0
  19. package/dist/client/assets/inbox-BHlGuOy2.js +1 -0
  20. package/dist/client/assets/index-CEIG7S6s.js +31 -0
  21. package/dist/client/assets/index-bpFrQ5yG.css +1 -0
  22. package/dist/client/assets/likes-cLrcAQem.js +1 -0
  23. package/dist/client/assets/links-CM9QO1LC.js +1 -0
  24. package/dist/client/assets/mapbox-BxTlqXt9.js +2 -0
  25. package/dist/client/assets/mapbox-gl-dgf_hX3a.js +3215 -0
  26. package/dist/client/assets/mentions-CxKCgzIf.js +1 -0
  27. package/dist/client/assets/network-map-B5a3whqj.js +2 -0
  28. package/dist/client/assets/profile-analyze-CRtNEwlb.js +1 -0
  29. package/dist/client/assets/profile-hydration-client-YEtJsNTv.js +1 -0
  30. package/dist/client/assets/profiles._handle-C82_HoKX.js +1 -0
  31. package/dist/client/assets/query-client-fYu2rzRC.js +17 -0
  32. package/dist/client/assets/rate-limits-ScaEwdVK.js +1 -0
  33. package/dist/client/assets/react-dom-DHl6Ug7F.js +1 -0
  34. package/dist/client/assets/react-nBylq1U5.js +1 -0
  35. package/dist/client/assets/repeat-2-xCwHM9hD.js +1 -0
  36. package/dist/client/assets/routes-q7ZaW4En.js +1 -0
  37. package/dist/client/assets/schemas-I9r6F6ya.js +64 -0
  38. package/dist/client/assets/search-Dq5kYsxA.js +1 -0
  39. package/dist/client/assets/sparkles-CQVlvHsZ.js +1 -0
  40. package/dist/client/assets/styles-B8s3tt3r.css +2 -0
  41. package/dist/client/assets/today-CeG1O7Py.js +1 -0
  42. package/dist/client/assets/triangle-alert-CBL7s2pf.js +1 -0
  43. package/dist/client/assets/useTimelineRouteData-1HsqgvUi.js +1 -0
  44. package/dist/client/assets/users-CHbKlqUr.js +1 -0
  45. package/dist/server/assets/AvatarChip-zUDAEmjL.js +105 -0
  46. package/dist/server/assets/FeedState-ntW0Q2GB.js +214 -0
  47. package/dist/server/assets/ProfileAnalysisStream-BFvhVdhn.js +198 -0
  48. package/dist/server/assets/ProfilePreview-C6gAor_j.js +752 -0
  49. package/dist/server/assets/SavedTimelineView-BG1jnBp1.js +64 -0
  50. package/dist/server/assets/SmartTimestamp-DfwE1NGf.js +45 -0
  51. package/dist/server/assets/SyncNowButton-BOn_IBXS.js +76 -0
  52. package/dist/server/assets/TimelineRouteFrame-CU7ilM7U.js +85 -0
  53. package/dist/server/assets/TweetRichText-DhCVv1-6.js +74 -0
  54. package/dist/server/assets/_tanstack-start-manifest_v-C-ZRnG_n.js +148 -0
  55. package/dist/server/assets/account-selection-CTdFGWRk.js +44 -0
  56. package/dist/server/assets/blocks-C1mgGTB3.js +299 -0
  57. package/dist/server/assets/blocks-DSgQghqP.js +17 -0
  58. package/dist/server/assets/bookmarks-BJN8tykY.js +14 -0
  59. package/dist/server/assets/client-stream-contracts-C2xbWVjm.js +769 -0
  60. package/dist/server/assets/data-sources-BnA1Q94p.js +180 -0
  61. package/dist/server/assets/discuss-CJ1dau1j.js +15 -0
  62. package/dist/server/assets/discuss-QTo08NCN.js +338 -0
  63. package/dist/server/assets/dms-BuLj4bp8.js +368 -0
  64. package/dist/server/assets/dms-DAyQrVM2.js +240 -0
  65. package/dist/server/assets/empty-plugin-adapters-DzrEkdBF.js +5 -0
  66. package/dist/server/assets/inbox-CkGOaW1q.js +214 -0
  67. package/dist/server/assets/inbox-DpWd1EzC.js +146 -0
  68. package/dist/server/assets/likes-DBOAtsJU.js +14 -0
  69. package/dist/server/assets/links-DAhSjynu.js +240 -0
  70. package/dist/server/assets/links-DmH5lxHO.js +468 -0
  71. package/dist/server/assets/mentions-BH2MzKtB.js +26 -0
  72. package/dist/server/assets/network-map-D3CzRcC4.js +224 -0
  73. package/dist/server/assets/network-map-D5DoLOwR.js +582 -0
  74. package/dist/server/assets/profile-analyze-BP65PED0.js +90 -0
  75. package/dist/server/assets/profile-analyze-C1NoM0tV.js +9 -0
  76. package/dist/server/assets/profile-hydration-client-GJ4kwJS8.js +133 -0
  77. package/dist/server/assets/profiles._handle-DjwlN_ac.js +184 -0
  78. package/dist/server/assets/profiles._handle-DsLNj2Ca.js +12 -0
  79. package/dist/server/assets/query-client-BdauHBgd.js +923 -0
  80. package/dist/server/assets/rate-limits-VAr2qzYD.js +262 -0
  81. package/dist/server/assets/route-search-BUlQ5lGM.js +117 -0
  82. package/dist/server/assets/router-DqkwSPiM.js +17026 -0
  83. package/dist/server/assets/routes-A9c9ZhwN.js +26 -0
  84. package/dist/server/assets/start-FaDOTmto.js +4 -0
  85. package/dist/server/assets/today-B5hVM57Z.js +17 -0
  86. package/dist/server/assets/today-fvGiZ7ud.js +303 -0
  87. package/dist/server/assets/ui-qbmcMSSX.js +137 -0
  88. package/{src/components/useDebouncedValue.ts → dist/server/assets/useDebouncedValue-DOnA6Xcy.js} +4 -4
  89. package/dist/server/assets/useTimelineRouteData-27cxynxa.js +1101 -0
  90. package/dist/server/server.js +5520 -0
  91. package/package.json +26 -34
  92. package/playwright.config.ts +0 -35
  93. package/scripts/browser-perf.mjs +0 -427
  94. package/scripts/build-docs-site.mjs +0 -967
  95. package/scripts/docs-site-assets.mjs +0 -311
  96. package/scripts/run-vitest.mjs +0 -21
  97. package/scripts/sanitize-node-options.mjs +0 -23
  98. package/scripts/start-test-server.mjs +0 -42
  99. package/src/cli/command-context.ts +0 -17
  100. package/src/cli/register-analysis.ts +0 -500
  101. package/src/cli/register-compose.ts +0 -40
  102. package/src/cli/register-graph.ts +0 -132
  103. package/src/cli/register-inbox.ts +0 -41
  104. package/src/cli/register-storage.ts +0 -106
  105. package/src/cli-moderation.ts +0 -210
  106. package/src/cli.ts +0 -1616
  107. package/src/components/AccountSwitcher.tsx +0 -178
  108. package/src/components/AppNav.tsx +0 -118
  109. package/src/components/AvatarChip.tsx +0 -58
  110. package/src/components/AvatarPreload.ts +0 -149
  111. package/src/components/BrandMark.tsx +0 -67
  112. package/src/components/ConversationThread.tsx +0 -131
  113. package/src/components/DmWorkspace.tsx +0 -286
  114. package/src/components/EmbeddedTweetCard.tsx +0 -55
  115. package/src/components/FeedState.tsx +0 -147
  116. package/src/components/FloatingPreview.tsx +0 -382
  117. package/src/components/InboxCard.tsx +0 -152
  118. package/src/components/LinkPreviewCard.tsx +0 -292
  119. package/src/components/MarkdownCitations.tsx +0 -680
  120. package/src/components/MarkdownViewer.tsx +0 -111
  121. package/src/components/ProfileAnalysisClient.ts +0 -191
  122. package/src/components/ProfileAnalysisStream.tsx +0 -259
  123. package/src/components/ProfilePreview.tsx +0 -131
  124. package/src/components/SavedTimelineView.tsx +0 -155
  125. package/src/components/SmartTimestamp.tsx +0 -72
  126. package/src/components/SyncNowButton.tsx +0 -140
  127. package/src/components/ThemeSlider.tsx +0 -80
  128. package/src/components/TimelineCard.tsx +0 -533
  129. package/src/components/TimelineRouteFrame.tsx +0 -186
  130. package/src/components/TweetArticleCard.tsx +0 -66
  131. package/src/components/TweetMediaGrid.tsx +0 -185
  132. package/src/components/TweetRichText.tsx +0 -159
  133. package/src/components/account-selection.ts +0 -64
  134. package/src/components/links-controller.ts +0 -162
  135. package/src/components/links-model.ts +0 -198
  136. package/src/components/network-map-controller.ts +0 -84
  137. package/src/components/network-map-model.ts +0 -255
  138. package/src/components/useTimelineRouteData.ts +0 -193
  139. package/src/lib/account-sync-job.ts +0 -666
  140. package/src/lib/actions-transport.ts +0 -300
  141. package/src/lib/analysis-runtime.ts +0 -238
  142. package/src/lib/api-client.ts +0 -220
  143. package/src/lib/api-contracts.ts +0 -328
  144. package/src/lib/archive-finder.ts +0 -185
  145. package/src/lib/archive-import-plan.ts +0 -102
  146. package/src/lib/archive-import.ts +0 -2695
  147. package/src/lib/authored-live.ts +0 -1027
  148. package/src/lib/avatar-cache.ts +0 -349
  149. package/src/lib/backup.ts +0 -2652
  150. package/src/lib/bird-actions.ts +0 -294
  151. package/src/lib/bird-command.ts +0 -130
  152. package/src/lib/bird.ts +0 -1140
  153. package/src/lib/blocklist.ts +0 -136
  154. package/src/lib/blocks-write.ts +0 -171
  155. package/src/lib/blocks.ts +0 -387
  156. package/src/lib/bookmark-sync-job.ts +0 -536
  157. package/src/lib/config.ts +0 -224
  158. package/src/lib/conversation-surface.ts +0 -205
  159. package/src/lib/data-sources.ts +0 -219
  160. package/src/lib/database-metrics.ts +0 -88
  161. package/src/lib/database-migrations.ts +0 -34
  162. package/src/lib/database-schema.ts +0 -312
  163. package/src/lib/database-writer.ts +0 -69
  164. package/src/lib/db.ts +0 -889
  165. package/src/lib/dm-read-model.ts +0 -533
  166. package/src/lib/dms-live.ts +0 -870
  167. package/src/lib/effect-runtime.ts +0 -45
  168. package/src/lib/follow-graph.ts +0 -1087
  169. package/src/lib/geocoding.ts +0 -296
  170. package/src/lib/http-effect.ts +0 -222
  171. package/src/lib/identity-search-index.ts +0 -369
  172. package/src/lib/import-repository.ts +0 -138
  173. package/src/lib/inbox.ts +0 -242
  174. package/src/lib/link-index.ts +0 -641
  175. package/src/lib/link-insights.ts +0 -860
  176. package/src/lib/link-preview-metadata.ts +0 -754
  177. package/src/lib/live-sync-engine.ts +0 -209
  178. package/src/lib/live-transport-gateway.ts +0 -128
  179. package/src/lib/location.ts +0 -137
  180. package/src/lib/media-fetch.ts +0 -860
  181. package/src/lib/media-includes.ts +0 -165
  182. package/src/lib/mention-threads-live.ts +0 -830
  183. package/src/lib/mentions-export.ts +0 -147
  184. package/src/lib/mentions-live.ts +0 -1114
  185. package/src/lib/moderation-target.ts +0 -227
  186. package/src/lib/moderation-write.ts +0 -131
  187. package/src/lib/mutes-write.ts +0 -171
  188. package/src/lib/mutes.ts +0 -84
  189. package/src/lib/ndjson-stream.ts +0 -106
  190. package/src/lib/network-map.ts +0 -382
  191. package/src/lib/openai-response-runtime.ts +0 -251
  192. package/src/lib/openai.ts +0 -117
  193. package/src/lib/paginated-sync.ts +0 -93
  194. package/src/lib/period-digest.ts +0 -1364
  195. package/src/lib/present.ts +0 -118
  196. package/src/lib/profile-affiliation-hydration.ts +0 -228
  197. package/src/lib/profile-affiliations.ts +0 -262
  198. package/src/lib/profile-analysis.ts +0 -1198
  199. package/src/lib/profile-bio-entities.ts +0 -318
  200. package/src/lib/profile-history.ts +0 -164
  201. package/src/lib/profile-hydration.ts +0 -180
  202. package/src/lib/profile-replies.ts +0 -77
  203. package/src/lib/profile-resolver.ts +0 -650
  204. package/src/lib/queries.ts +0 -6
  205. package/src/lib/query-actions.ts +0 -437
  206. package/src/lib/query-client.tsx +0 -47
  207. package/src/lib/query-read-model-shared.ts +0 -52
  208. package/src/lib/query-read-models.ts +0 -5
  209. package/src/lib/query-resource.ts +0 -41
  210. package/src/lib/query-status.ts +0 -164
  211. package/src/lib/research.ts +0 -652
  212. package/src/lib/runtime-services.ts +0 -20
  213. package/src/lib/search-discussion.ts +0 -812
  214. package/src/lib/seed.ts +0 -613
  215. package/src/lib/server-runtime-services.ts +0 -30
  216. package/src/lib/sqlite.ts +0 -183
  217. package/src/lib/streaming-ingestion.ts +0 -240
  218. package/src/lib/sync-cache.ts +0 -70
  219. package/src/lib/sync-plan.ts +0 -175
  220. package/src/lib/theme-transition.ts +0 -113
  221. package/src/lib/theme.tsx +0 -165
  222. package/src/lib/timeline-collections-live.ts +0 -407
  223. package/src/lib/timeline-live.ts +0 -302
  224. package/src/lib/timeline-read-model.ts +0 -1191
  225. package/src/lib/tweet-account-edges.ts +0 -48
  226. package/src/lib/tweet-lookup.ts +0 -46
  227. package/src/lib/tweet-render.ts +0 -430
  228. package/src/lib/tweet-repository.ts +0 -156
  229. package/src/lib/tweet-search-live.ts +0 -462
  230. package/src/lib/types.ts +0 -723
  231. package/src/lib/ui.ts +0 -529
  232. package/src/lib/url-expansion-store.ts +0 -110
  233. package/src/lib/url-expansion.ts +0 -343
  234. package/src/lib/url-safety.ts +0 -220
  235. package/src/lib/web-sync.ts +0 -533
  236. package/src/lib/whois.ts +0 -1080
  237. package/src/lib/x-profile.ts +0 -365
  238. package/src/lib/x-web.ts +0 -199
  239. package/src/lib/xurl-rate-limits.ts +0 -267
  240. package/src/lib/xurl.ts +0 -1677
  241. package/src/routeTree.gen.ts +0 -723
  242. package/src/router.tsx +0 -20
  243. package/src/routes/__root.tsx +0 -82
  244. package/src/routes/api/action.tsx +0 -147
  245. package/src/routes/api/avatar.tsx +0 -50
  246. package/src/routes/api/blocks.tsx +0 -35
  247. package/src/routes/api/conversation.tsx +0 -45
  248. package/src/routes/api/data-sources.tsx +0 -24
  249. package/src/routes/api/inbox.tsx +0 -43
  250. package/src/routes/api/link-insights.tsx +0 -85
  251. package/src/routes/api/link-preview.tsx +0 -47
  252. package/src/routes/api/network-map.tsx +0 -55
  253. package/src/routes/api/period-digest.tsx +0 -101
  254. package/src/routes/api/profile-analysis.tsx +0 -97
  255. package/src/routes/api/profile-hydrate.tsx +0 -54
  256. package/src/routes/api/query.tsx +0 -121
  257. package/src/routes/api/search-discussion.tsx +0 -113
  258. package/src/routes/api/status.tsx +0 -30
  259. package/src/routes/api/sync.tsx +0 -108
  260. package/src/routes/api/xurl-rate-limits.tsx +0 -24
  261. package/src/routes/blocks.tsx +0 -343
  262. package/src/routes/bookmarks.tsx +0 -18
  263. package/src/routes/data-sources.tsx +0 -249
  264. package/src/routes/discuss.tsx +0 -419
  265. package/src/routes/dms.tsx +0 -415
  266. package/src/routes/inbox.tsx +0 -232
  267. package/src/routes/index.tsx +0 -32
  268. package/src/routes/likes.tsx +0 -18
  269. package/src/routes/links.tsx +0 -631
  270. package/src/routes/mentions.tsx +0 -32
  271. package/src/routes/network-map.tsx +0 -732
  272. package/src/routes/profile-analyze.tsx +0 -112
  273. package/src/routes/profiles.$handle.tsx +0 -228
  274. package/src/routes/rate-limits.tsx +0 -305
  275. package/src/routes/today.tsx +0 -511
  276. package/src/styles.css +0 -257
  277. package/tsconfig.json +0 -29
  278. package/vite.config.ts +0 -29
  279. /package/{public → dist/client}/birdclaw-mark.png +0 -0
  280. /package/{public → dist/client}/favicon.ico +0 -0
  281. /package/{public → dist/client}/logo192.png +0 -0
  282. /package/{public → dist/client}/logo512.png +0 -0
  283. /package/{public → dist/client}/manifest.json +0 -0
  284. /package/{public → dist/client}/robots.txt +0 -0
@@ -0,0 +1,582 @@
1
+ import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, Ht as searchFieldInputClass, Kt as segmentClass, Ot as pageTitleClass, Tt as pageHeaderClass, Ut as searchFieldShellClass, Vt as searchFieldIconClass, Wt as secondaryButtonClass, m as cx, on as statusCopyClass, q as errorCopyClass, qt as segmentedClass, wt as pageHeaderActionsClass } from "./ui-qbmcMSSX.js";
2
+ import { o as validateNetworkMapSearch } from "./route-search-BUlQ5lGM.js";
3
+ import { a as avatarPath, c as compareClusterFeatures, d as getClusterDisplayAnchor, f as isCluster, i as avatarInitial, l as formatNumber, m as relationshipColor, n as useNetworkMapController, o as buildClusterIndex, p as readViewport, r as WORLD_VIEWPORT, s as clusterGradient, t as Route$1, u as formatRelationship } from "./network-map-D3CzRcC4.js";
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Globe2, MapPin, RefreshCw, Search, Users, WifiOff } from "lucide-react";
7
+ //#region src/routes/network-map.tsx?tsr-split=component
8
+ function StatTile({ icon: Icon, label, value }) {
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "flex min-w-0 flex-col gap-2 border-b border-[var(--line)] px-4 py-3 sm:border-r",
11
+ children: [/* @__PURE__ */ jsxs("div", {
12
+ className: "flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]",
13
+ children: [/* @__PURE__ */ jsx(Icon, {
14
+ className: "size-4",
15
+ strokeWidth: 1.8
16
+ }), /* @__PURE__ */ jsx("span", { children: label })]
17
+ }), /* @__PURE__ */ jsx("div", {
18
+ className: "truncate text-[24px] font-bold tracking-tight text-[var(--ink)]",
19
+ children: formatNumber(value)
20
+ })]
21
+ });
22
+ }
23
+ function useMapboxModule() {
24
+ const [module, setModule] = useState(null);
25
+ const [error, setError] = useState(null);
26
+ useEffect(() => {
27
+ let cancelled = false;
28
+ import("react-map-gl/mapbox").then((loaded) => {
29
+ if (!cancelled) setModule(loaded);
30
+ }).catch((cause) => {
31
+ if (!cancelled) setError(cause instanceof Error ? cause.message : "Map failed");
32
+ });
33
+ return () => {
34
+ cancelled = true;
35
+ };
36
+ }, []);
37
+ return {
38
+ module,
39
+ error
40
+ };
41
+ }
42
+ function Avatar({ feature, size = 36, className, style }) {
43
+ const src = avatarPath(feature);
44
+ const [failedSrc, setFailedSrc] = useState(null);
45
+ const showImage = src && failedSrc !== src;
46
+ return /* @__PURE__ */ jsx("div", {
47
+ className: cx("relative grid shrink-0 place-items-center overflow-hidden rounded-full bg-[var(--accent-soft)] text-[12px] font-bold text-[var(--accent)] ring-2 ring-white", className),
48
+ style: {
49
+ width: size,
50
+ height: size,
51
+ ...style
52
+ },
53
+ children: showImage ? /* @__PURE__ */ jsx("img", {
54
+ src,
55
+ alt: "",
56
+ className: "h-full w-full object-cover",
57
+ loading: "lazy",
58
+ onError: () => setFailedSrc(src)
59
+ }) : /* @__PURE__ */ jsx("span", { children: avatarInitial(feature) })
60
+ });
61
+ }
62
+ function ProfileMarker({ feature }) {
63
+ const color = relationshipColor(feature.properties.relationship);
64
+ return /* @__PURE__ */ jsxs("button", {
65
+ type: "button",
66
+ className: "group relative grid size-11 place-items-center rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-110",
67
+ "aria-label": `Open @${feature.properties.handle}`,
68
+ title: `@${feature.properties.handle}`,
69
+ children: [/* @__PURE__ */ jsx("span", {
70
+ className: "absolute inset-0 rounded-full opacity-90 shadow-[0_10px_28px_rgba(15,20,25,0.28)]",
71
+ style: { backgroundColor: color }
72
+ }), /* @__PURE__ */ jsx(Avatar, {
73
+ feature,
74
+ size: 34,
75
+ className: "relative ring-[3px]"
76
+ })]
77
+ });
78
+ }
79
+ function ClusterMarker({ count, features, stats }) {
80
+ const size = Math.min(82, Math.max(52, 44 + Math.log2(count) * 7));
81
+ const avatarSize = size >= 72 ? 30 : 25;
82
+ return /* @__PURE__ */ jsxs("button", {
83
+ type: "button",
84
+ className: "group relative rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-105",
85
+ "aria-label": `${formatNumber(count)} located profiles`,
86
+ title: `${formatNumber(count)} profiles`,
87
+ style: {
88
+ width: size,
89
+ height: size
90
+ },
91
+ children: [
92
+ /* @__PURE__ */ jsx("span", {
93
+ className: "absolute inset-0 rounded-full opacity-95 shadow-[0_18px_42px_rgba(15,20,25,0.32)]",
94
+ style: { background: clusterGradient(stats) }
95
+ }),
96
+ /* @__PURE__ */ jsx("span", { className: "absolute inset-[4px] rounded-full bg-white/88 backdrop-blur-sm" }),
97
+ /* @__PURE__ */ jsx("span", {
98
+ className: "absolute inset-0 flex items-center justify-center",
99
+ children: features.slice(0, 4).map((feature, index) => /* @__PURE__ */ jsx(Avatar, {
100
+ feature,
101
+ size: avatarSize,
102
+ className: "absolute",
103
+ style: { transform: `translate(${[
104
+ -10,
105
+ 10,
106
+ -7,
107
+ 8
108
+ ][index] ?? 0}px, ${[
109
+ -9,
110
+ -8,
111
+ 11,
112
+ 10
113
+ ][index] ?? 0}px)` }
114
+ }, feature.properties.profileId))
115
+ }),
116
+ /* @__PURE__ */ jsx("span", {
117
+ className: "absolute -right-1 -top-1 min-w-7 rounded-full bg-[#0f1419] px-1.5 py-0.5 text-center text-[11px] font-bold leading-5 text-white ring-2 ring-white",
118
+ children: count > 99 ? "99+" : formatNumber(count)
119
+ })
120
+ ]
121
+ });
122
+ }
123
+ function MapboxPanel({ data, onViewportChange }) {
124
+ const { module, error } = useMapboxModule();
125
+ const mapRef = useRef(null);
126
+ const [viewport, setViewport] = useState(WORLD_VIEWPORT);
127
+ const [selected, setSelected] = useState(null);
128
+ const clusterIndex = useMemo(() => buildClusterIndex(data.features), [data]);
129
+ const visibleClusters = useMemo(() => clusterIndex.getClusters(viewport.bounds, Math.max(0, Math.floor(viewport.zoom))), [clusterIndex, viewport]);
130
+ useEffect(() => {
131
+ setSelected(null);
132
+ }, [data]);
133
+ const updateViewport = useCallback((event) => {
134
+ const next = readViewport(event.target);
135
+ if (!next) return;
136
+ setViewport(next);
137
+ onViewportChange(next);
138
+ }, [onViewportChange]);
139
+ if (!data.config.mapboxToken) return /* @__PURE__ */ jsx(SvgMapFallback, { data });
140
+ if (error) return /* @__PURE__ */ jsxs("div", {
141
+ className: statusCopyClass,
142
+ children: [/* @__PURE__ */ jsx(WifiOff, {
143
+ className: "mr-2 inline size-4",
144
+ strokeWidth: 1.8
145
+ }), error]
146
+ });
147
+ if (!module) return /* @__PURE__ */ jsx("div", {
148
+ className: statusCopyClass,
149
+ children: "Loading map..."
150
+ });
151
+ const { default: Map, Marker, NavigationControl, Popup } = module;
152
+ return /* @__PURE__ */ jsx("div", {
153
+ className: "min-h-[520px] flex-1 overflow-hidden bg-[var(--bg-active)] min-[1180px]:min-h-0",
154
+ children: /* @__PURE__ */ jsxs(Map, {
155
+ ref: mapRef,
156
+ initialViewState: {
157
+ longitude: 9,
158
+ latitude: 24,
159
+ zoom: 1.2
160
+ },
161
+ mapStyle: document.documentElement.dataset.theme === "dark" ? "mapbox://styles/mapbox/dark-v11" : "mapbox://styles/mapbox/light-v11",
162
+ mapboxAccessToken: data.config.mapboxToken,
163
+ onClick: () => setSelected(null),
164
+ onLoad: updateViewport,
165
+ onMoveEnd: updateViewport,
166
+ projection: "mercator",
167
+ style: {
168
+ width: "100%",
169
+ height: "100%"
170
+ },
171
+ children: [
172
+ /* @__PURE__ */ jsx(NavigationControl, {
173
+ position: "top-right",
174
+ showCompass: false
175
+ }),
176
+ visibleClusters.map((item) => {
177
+ const [longitude, latitude] = item.geometry.coordinates;
178
+ if (isCluster(item)) {
179
+ const fallbackCoordinates = item.geometry.coordinates;
180
+ const leaves = clusterIndex.getLeaves(item.properties.cluster_id, 48).map((leaf) => data.features[leaf.properties.featureIndex]).filter((feature) => Boolean(feature)).sort(compareClusterFeatures);
181
+ const [displayLongitude, displayLatitude] = getClusterDisplayAnchor(leaves, fallbackCoordinates);
182
+ return /* @__PURE__ */ jsx(Marker, {
183
+ longitude: displayLongitude,
184
+ latitude: displayLatitude,
185
+ anchor: "center",
186
+ onClick: (event) => {
187
+ event.originalEvent?.stopPropagation();
188
+ const expansionZoom = Math.min(clusterIndex.getClusterExpansionZoom(item.properties.cluster_id), 12);
189
+ mapRef.current?.flyTo?.({
190
+ center: [displayLongitude, displayLatitude],
191
+ zoom: Math.max(viewport.zoom + .85, expansionZoom - .6),
192
+ duration: 520
193
+ });
194
+ setSelected({
195
+ kind: "cluster",
196
+ coordinates: [displayLongitude, displayLatitude],
197
+ count: item.properties.point_count,
198
+ features: leaves,
199
+ stats: item.properties
200
+ });
201
+ },
202
+ children: /* @__PURE__ */ jsx(ClusterMarker, {
203
+ count: item.properties.point_count,
204
+ features: leaves,
205
+ stats: item.properties
206
+ })
207
+ }, `cluster-${String(item.properties.cluster_id)}`);
208
+ }
209
+ const feature = data.features[item.properties.featureIndex];
210
+ if (!feature) return null;
211
+ return /* @__PURE__ */ jsx(Marker, {
212
+ longitude,
213
+ latitude,
214
+ anchor: "center",
215
+ onClick: (event) => {
216
+ event.originalEvent?.stopPropagation();
217
+ setSelected({
218
+ kind: "profile",
219
+ feature
220
+ });
221
+ },
222
+ children: /* @__PURE__ */ jsx(ProfileMarker, { feature })
223
+ }, feature.properties.profileId);
224
+ }),
225
+ selected ? /* @__PURE__ */ jsx(Popup, {
226
+ longitude: selected.kind === "profile" ? selected.feature.geometry.coordinates[0] : selected.coordinates[0],
227
+ latitude: selected.kind === "profile" ? selected.feature.geometry.coordinates[1] : selected.coordinates[1],
228
+ closeButton: false,
229
+ offset: 12,
230
+ onClose: () => setSelected(null),
231
+ children: selected.kind === "profile" ? /* @__PURE__ */ jsx(ProfilePopup, { feature: selected.feature }) : /* @__PURE__ */ jsx(ClusterPopup, {
232
+ count: selected.count,
233
+ features: selected.features,
234
+ stats: selected.stats
235
+ })
236
+ }) : null
237
+ ]
238
+ })
239
+ });
240
+ }
241
+ function SvgMapFallback({ data }) {
242
+ const points = data.features.slice(0, 1500).map((feature) => {
243
+ const [lng, lat] = feature.geometry.coordinates;
244
+ return {
245
+ feature,
246
+ x: (lng + 180) / 360 * 1e3,
247
+ y: (90 - lat) / 180 * 500
248
+ };
249
+ });
250
+ return /* @__PURE__ */ jsx("div", {
251
+ className: "border-b border-[var(--line)] bg-[var(--bg-active)] px-4 py-4",
252
+ children: /* @__PURE__ */ jsxs("svg", {
253
+ viewBox: "0 0 1000 500",
254
+ className: "h-auto w-full rounded-md border border-[var(--line)] bg-[var(--bg)]",
255
+ role: "img",
256
+ "aria-label": "Network map",
257
+ children: [
258
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
259
+ id: "map-grid",
260
+ width: "100",
261
+ height: "100",
262
+ patternUnits: "userSpaceOnUse",
263
+ children: /* @__PURE__ */ jsx("path", {
264
+ d: "M 100 0 L 0 0 0 100",
265
+ fill: "none",
266
+ stroke: "currentColor",
267
+ strokeOpacity: "0.08",
268
+ strokeWidth: "1"
269
+ })
270
+ }) }),
271
+ /* @__PURE__ */ jsx("rect", {
272
+ width: "1000",
273
+ height: "500",
274
+ fill: "url(#map-grid)"
275
+ }),
276
+ /* @__PURE__ */ jsx("path", {
277
+ d: "M60 205 C145 155 210 145 280 178 C352 212 424 186 495 194 C594 206 665 157 746 178 C836 201 907 227 952 282",
278
+ fill: "none",
279
+ stroke: "currentColor",
280
+ strokeOpacity: "0.18",
281
+ strokeWidth: "36",
282
+ strokeLinecap: "round"
283
+ }),
284
+ points.map(({ feature, x, y }) => /* @__PURE__ */ jsx("circle", {
285
+ cx: x,
286
+ cy: y,
287
+ r: feature.properties.relationship === "mutual" ? 4.5 : 3.5,
288
+ fill: feature.properties.relationship === "mutual" ? "#22c55e" : feature.properties.relationship === "following" ? "#f59e0b" : "#1d9bf0",
289
+ opacity: "0.86"
290
+ }, feature.properties.profileId))
291
+ ]
292
+ })
293
+ });
294
+ }
295
+ function ProfilePopup({ feature }) {
296
+ return /* @__PURE__ */ jsxs("div", {
297
+ className: "flex max-w-[280px] gap-3 text-[13px] text-[#0f1419]",
298
+ children: [/* @__PURE__ */ jsx(Avatar, {
299
+ feature,
300
+ size: 48,
301
+ className: "ring-[#d9e2ea]"
302
+ }), /* @__PURE__ */ jsxs("div", {
303
+ className: "min-w-0",
304
+ children: [
305
+ /* @__PURE__ */ jsx("div", {
306
+ className: "truncate font-bold",
307
+ children: feature.properties.name
308
+ }),
309
+ /* @__PURE__ */ jsxs("div", {
310
+ className: "truncate text-[#536471]",
311
+ children: ["@", feature.properties.handle]
312
+ }),
313
+ /* @__PURE__ */ jsx("div", {
314
+ className: "mt-1 line-clamp-2",
315
+ children: feature.properties.location
316
+ }),
317
+ feature.properties.resolvedLocation ? /* @__PURE__ */ jsx("div", {
318
+ className: "truncate text-[#536471]",
319
+ children: feature.properties.resolvedLocation
320
+ }) : null
321
+ ]
322
+ })]
323
+ });
324
+ }
325
+ function ClusterPopup({ count, features, stats }) {
326
+ return /* @__PURE__ */ jsxs("div", {
327
+ className: "w-[290px] text-[13px] text-[#0f1419]",
328
+ children: [
329
+ /* @__PURE__ */ jsxs("div", {
330
+ className: "flex items-center justify-between gap-3",
331
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
332
+ className: "font-bold",
333
+ children: [formatNumber(count), " profiles here"]
334
+ }), /* @__PURE__ */ jsxs("div", {
335
+ className: "text-[#536471]",
336
+ children: [
337
+ formatNumber(stats.mutual),
338
+ " mutual ·",
339
+ " ",
340
+ formatNumber(stats.following),
341
+ " following ·",
342
+ " ",
343
+ formatNumber(stats.followers),
344
+ " followers"
345
+ ]
346
+ })] }), /* @__PURE__ */ jsx("div", {
347
+ className: "size-11 shrink-0 rounded-full ring-2 ring-[#d9e2ea]",
348
+ style: { background: clusterGradient(stats) }
349
+ })]
350
+ }),
351
+ /* @__PURE__ */ jsx("div", {
352
+ className: "mt-3 flex -space-x-2",
353
+ children: features.slice(0, 6).map((feature) => /* @__PURE__ */ jsx(Avatar, {
354
+ feature,
355
+ size: 36,
356
+ className: "ring-[#ffffff]"
357
+ }, feature.properties.profileId))
358
+ }),
359
+ /* @__PURE__ */ jsx("div", {
360
+ className: "mt-3 divide-y divide-[#eff3f4]",
361
+ children: features.slice(0, 5).map((feature) => /* @__PURE__ */ jsxs("div", {
362
+ className: "flex min-w-0 items-center gap-2 py-2",
363
+ children: [
364
+ /* @__PURE__ */ jsx(Avatar, {
365
+ feature,
366
+ size: 28,
367
+ className: "ring-[#ffffff]"
368
+ }),
369
+ /* @__PURE__ */ jsxs("div", {
370
+ className: "min-w-0 flex-1",
371
+ children: [/* @__PURE__ */ jsx("div", {
372
+ className: "truncate font-semibold",
373
+ children: feature.properties.name
374
+ }), /* @__PURE__ */ jsxs("div", {
375
+ className: "truncate text-[#536471]",
376
+ children: ["@", feature.properties.handle]
377
+ })]
378
+ }),
379
+ /* @__PURE__ */ jsx("div", {
380
+ className: "size-2 rounded-full",
381
+ style: { backgroundColor: relationshipColor(feature.properties.relationship) }
382
+ })
383
+ ]
384
+ }, feature.properties.profileId))
385
+ })
386
+ ]
387
+ });
388
+ }
389
+ function ProfileRow({ feature }) {
390
+ return /* @__PURE__ */ jsxs("a", {
391
+ className: "flex min-w-0 gap-3 border-b border-[var(--line)] px-4 py-3 transition-colors hover:bg-[var(--bg-hover)]",
392
+ href: `/profiles/${encodeURIComponent(feature.properties.handle)}`,
393
+ children: [/* @__PURE__ */ jsx(Avatar, {
394
+ feature,
395
+ size: 40,
396
+ className: "ring-[var(--bg)]"
397
+ }), /* @__PURE__ */ jsxs("div", {
398
+ className: "min-w-0 flex-1",
399
+ children: [
400
+ /* @__PURE__ */ jsxs("div", {
401
+ className: "flex min-w-0 items-center gap-1.5",
402
+ children: [/* @__PURE__ */ jsx("span", {
403
+ className: "truncate font-bold text-[var(--ink)]",
404
+ children: feature.properties.name
405
+ }), /* @__PURE__ */ jsxs("span", {
406
+ className: "truncate text-[var(--ink-soft)]",
407
+ children: ["@", feature.properties.handle]
408
+ })]
409
+ }),
410
+ /* @__PURE__ */ jsxs("div", {
411
+ className: "truncate text-[13px] text-[var(--ink-soft)]",
412
+ children: [feature.properties.location, feature.properties.resolvedLocation ? ` -> ${feature.properties.resolvedLocation}` : ""]
413
+ }),
414
+ /* @__PURE__ */ jsxs("div", {
415
+ className: "mt-1 flex flex-wrap gap-2 text-[12px] text-[var(--ink-soft)]",
416
+ children: [/* @__PURE__ */ jsx("span", { children: formatRelationship(feature.properties.relationship) }), /* @__PURE__ */ jsxs("span", { children: [formatNumber(feature.properties.followersCount), " followers"] })]
417
+ })
418
+ ]
419
+ })]
420
+ });
421
+ }
422
+ function VisibleProfilesPanel({ features, search, onSearchChange, totalVisible, zoom }) {
423
+ return /* @__PURE__ */ jsxs("aside", {
424
+ className: "flex min-h-[420px] min-w-0 flex-col border-t border-[var(--line)] bg-[var(--bg)] min-[1180px]:h-full min-[1180px]:border-t-0 min-[1180px]:border-l",
425
+ children: [/* @__PURE__ */ jsxs("header", {
426
+ className: "sticky top-0 z-10 border-b border-[var(--line)] bg-[color:color-mix(in_srgb,var(--bg)_88%,transparent)] px-4 py-3 backdrop-blur",
427
+ children: [/* @__PURE__ */ jsxs("div", {
428
+ className: "flex items-start justify-between gap-3",
429
+ children: [/* @__PURE__ */ jsxs("div", {
430
+ className: "min-w-0",
431
+ children: [/* @__PURE__ */ jsx("h2", {
432
+ className: "truncate text-[16px] font-bold text-[var(--ink)]",
433
+ children: "Who's In View"
434
+ }), /* @__PURE__ */ jsxs("p", {
435
+ className: "truncate text-[13px] text-[var(--ink-soft)]",
436
+ children: [
437
+ formatNumber(totalVisible),
438
+ " in this map view · zoom",
439
+ " ",
440
+ zoom.toFixed(1)
441
+ ]
442
+ })]
443
+ }), /* @__PURE__ */ jsx("div", {
444
+ className: "rounded-full border border-[var(--line)] px-2 py-1 text-[12px] font-semibold text-[var(--ink-soft)]",
445
+ children: formatNumber(features.length)
446
+ })]
447
+ }), /* @__PURE__ */ jsxs("label", {
448
+ className: cx(searchFieldShellClass, "mt-3 h-10"),
449
+ children: [/* @__PURE__ */ jsx(Search, {
450
+ className: searchFieldIconClass,
451
+ strokeWidth: 2
452
+ }), /* @__PURE__ */ jsx("input", {
453
+ className: searchFieldInputClass,
454
+ onChange: (event) => onSearchChange(event.target.value),
455
+ placeholder: "Search visible people",
456
+ value: search
457
+ })]
458
+ })]
459
+ }), /* @__PURE__ */ jsx("div", {
460
+ className: "min-h-0 flex-1 overflow-y-auto",
461
+ children: features.length > 0 ? features.map((feature) => /* @__PURE__ */ jsx(ProfileRow, { feature }, feature.properties.profileId)) : /* @__PURE__ */ jsx("div", {
462
+ className: statusCopyClass,
463
+ children: search.trim() ? "No visible profiles match that search." : "Pan or zoom the map to see profiles in this area."
464
+ })
465
+ })]
466
+ });
467
+ }
468
+ function NetworkMapRoute() {
469
+ const search = Route$1.useSearch();
470
+ const navigate = Route$1.useNavigate();
471
+ return /* @__PURE__ */ jsx(NetworkMapRouteView, {
472
+ searchState: search,
473
+ onSearchChange: (next, options) => void navigate({
474
+ search: next,
475
+ replace: options?.replace
476
+ })
477
+ });
478
+ }
479
+ function NetworkMapRouteView({ searchState: controlledSearch, onSearchChange } = {}) {
480
+ const [localSearch, setLocalSearch] = useState(() => validateNetworkMapSearch({}));
481
+ const searchState = controlledSearch ?? localSearch;
482
+ const updateSearch = (next, options) => onSearchChange ? onSearchChange(next, options) : setLocalSearch(next);
483
+ const { type, setType, viewport, setViewport, visibleSearch, setVisibleSearch, data, loading, error, refresh, visibleFeatures, filteredVisibleFeatures, mapTypes } = useNetworkMapController(searchState, updateSearch);
484
+ return /* @__PURE__ */ jsxs("section", {
485
+ className: "flex min-h-screen flex-col min-[1180px]:h-screen min-[1180px]:min-h-0 min-[1180px]:overflow-hidden",
486
+ children: [
487
+ /* @__PURE__ */ jsxs("header", {
488
+ className: pageHeaderClass,
489
+ children: [/* @__PURE__ */ jsxs("div", {
490
+ className: pageHeaderRowClass,
491
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
492
+ className: pageTitleClass,
493
+ children: "Network Map"
494
+ }), /* @__PURE__ */ jsx("div", {
495
+ className: pageSubtitleClass,
496
+ children: data ? `${formatNumber(data.meta.locatedProfiles)} located · ${formatNumber(data.meta.meaningfulProfiles)} with usable locations` : "Loading network geography..."
497
+ })] }), /* @__PURE__ */ jsx("div", {
498
+ className: pageHeaderActionsClass,
499
+ children: /* @__PURE__ */ jsxs("button", {
500
+ className: secondaryButtonClass,
501
+ type: "button",
502
+ onClick: () => refresh(),
503
+ disabled: loading,
504
+ children: [/* @__PURE__ */ jsx(RefreshCw, { className: cx("size-4", loading && "animate-spin") }), "Refresh"]
505
+ })
506
+ })]
507
+ }), /* @__PURE__ */ jsx("div", {
508
+ className: "border-t border-[var(--line)] px-4 py-3",
509
+ children: /* @__PURE__ */ jsx("div", {
510
+ className: segmentedClass,
511
+ children: mapTypes.map((item) => /* @__PURE__ */ jsx("button", {
512
+ type: "button",
513
+ className: cx(segmentClass, type === item.value && "bg-[var(--bg-active)] text-[var(--ink)]"),
514
+ onClick: () => setType(item.value),
515
+ children: item.label
516
+ }, item.value))
517
+ })
518
+ })]
519
+ }),
520
+ error ? /* @__PURE__ */ jsx("div", {
521
+ className: errorCopyClass,
522
+ children: error
523
+ }) : null,
524
+ data ? /* @__PURE__ */ jsxs("div", {
525
+ className: "grid min-h-[620px] flex-1 grid-cols-1 min-[1180px]:min-h-0 min-[1180px]:grid-cols-[minmax(0,1fr)_390px] min-[1180px]:overflow-hidden min-[1500px]:grid-cols-[minmax(0,1fr)_430px]",
526
+ children: [/* @__PURE__ */ jsxs("div", {
527
+ className: "flex min-h-0 min-w-0 flex-col",
528
+ children: [
529
+ /* @__PURE__ */ jsxs("div", {
530
+ className: "grid sm:grid-cols-4",
531
+ children: [
532
+ /* @__PURE__ */ jsx(StatTile, {
533
+ icon: Users,
534
+ label: "Profiles",
535
+ value: data.meta.totalProfiles
536
+ }),
537
+ /* @__PURE__ */ jsx(StatTile, {
538
+ icon: MapPin,
539
+ label: "Locations",
540
+ value: data.meta.meaningfulProfiles
541
+ }),
542
+ /* @__PURE__ */ jsx(StatTile, {
543
+ icon: Globe2,
544
+ label: "Located",
545
+ value: data.meta.locatedProfiles
546
+ }),
547
+ /* @__PURE__ */ jsx(StatTile, {
548
+ icon: RefreshCw,
549
+ label: "Geocoded",
550
+ value: data.meta.geocodedThisRun
551
+ })
552
+ ]
553
+ }),
554
+ !data.meta.opencageConfigured && data.meta.missingGeocodes > 0 ? /* @__PURE__ */ jsx("div", {
555
+ className: statusCopyClass,
556
+ children: "OpenCage key missing; showing cached and coordinate locations only."
557
+ }) : null,
558
+ !data.meta.mapboxTokenConfigured ? /* @__PURE__ */ jsx("div", {
559
+ className: statusCopyClass,
560
+ children: "Mapbox token missing; showing the lightweight map."
561
+ }) : null,
562
+ /* @__PURE__ */ jsx(MapboxPanel, {
563
+ data,
564
+ onViewportChange: setViewport
565
+ })
566
+ ]
567
+ }), /* @__PURE__ */ jsx(VisibleProfilesPanel, {
568
+ features: filteredVisibleFeatures,
569
+ onSearchChange: setVisibleSearch,
570
+ search: visibleSearch,
571
+ totalVisible: visibleFeatures.length,
572
+ zoom: viewport.zoom
573
+ })]
574
+ }) : loading ? /* @__PURE__ */ jsx("div", {
575
+ className: statusCopyClass,
576
+ children: "Loading map..."
577
+ }) : null
578
+ ]
579
+ });
580
+ }
581
+ //#endregion
582
+ export { NetworkMapRouteView, NetworkMapRoute as component };
@@ -0,0 +1,90 @@
1
+ import { Dt as pageSubtitleClass, Et as pageHeaderRowClass, Ht as searchFieldInputClass, Mt as primaryButtonClass, Ot as pageTitleClass, Tt as pageHeaderClass, Ut as searchFieldShellClass, Vt as searchFieldIconClass, Wt as secondaryButtonClass, m as cx, wt as pageHeaderActionsClass } from "./ui-qbmcMSSX.js";
2
+ import { t as Route$1 } from "./profile-analyze-C1NoM0tV.js";
3
+ import { a as formatProfileAnalysisCounts, i as cleanProfileHandle, n as ProfileAnalysisStatusLine, r as useProfileAnalysisStream, t as ProfileAnalysisOutput } from "./ProfileAnalysisStream-BFvhVdhn.js";
4
+ import { useEffect, useMemo, useRef, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Loader2, RefreshCw, Search, UserSearch } from "lucide-react";
7
+ //#region src/routes/profile-analyze.tsx?tsr-split=component
8
+ function ProfileAnalyzeRoute() {
9
+ const search = Route$1.useSearch();
10
+ const [handle, setHandle] = useState(cleanProfileHandle(search.handle));
11
+ const submittedHandle = useMemo(() => cleanProfileHandle(handle), [handle]);
12
+ const analysis = useProfileAnalysisStream(submittedHandle);
13
+ const autoRunHandleRef = useRef("");
14
+ const runAnalysisRef = useRef(analysis.run);
15
+ useEffect(() => {
16
+ runAnalysisRef.current = analysis.run;
17
+ }, [analysis.run]);
18
+ useEffect(() => {
19
+ const urlHandle = cleanProfileHandle(search.handle);
20
+ setHandle(urlHandle);
21
+ if (urlHandle && autoRunHandleRef.current !== urlHandle) {
22
+ autoRunHandleRef.current = urlHandle;
23
+ runAnalysisRef.current(false, urlHandle);
24
+ }
25
+ }, [search.handle]);
26
+ const submit = (event) => {
27
+ event.preventDefault();
28
+ analysis.run(false);
29
+ };
30
+ return /* @__PURE__ */ jsxs("section", {
31
+ className: "flex min-h-screen flex-col gap-6 px-4 py-8",
32
+ children: [
33
+ /* @__PURE__ */ jsxs("header", {
34
+ className: cx(pageHeaderClass, "border-b-0"),
35
+ children: [/* @__PURE__ */ jsxs("div", {
36
+ className: pageHeaderRowClass,
37
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h1", {
38
+ className: pageTitleClass,
39
+ children: "Profile Analyse"
40
+ }), /* @__PURE__ */ jsx("p", {
41
+ className: pageSubtitleClass,
42
+ children: formatProfileAnalysisCounts(analysis.context)
43
+ })] }), /* @__PURE__ */ jsx("div", {
44
+ className: pageHeaderActionsClass,
45
+ children: /* @__PURE__ */ jsxs("button", {
46
+ className: secondaryButtonClass,
47
+ disabled: !submittedHandle || analysis.loading,
48
+ onClick: () => analysis.run(true),
49
+ type: "button",
50
+ children: [/* @__PURE__ */ jsx(RefreshCw, {
51
+ className: "size-4",
52
+ strokeWidth: 1.8
53
+ }), "Refresh"]
54
+ })
55
+ })]
56
+ }), /* @__PURE__ */ jsxs("form", {
57
+ className: "mt-5 flex flex-col gap-3 sm:flex-row",
58
+ onSubmit: submit,
59
+ children: [/* @__PURE__ */ jsxs("label", {
60
+ className: cx(searchFieldShellClass, "min-w-0 flex-1"),
61
+ children: [/* @__PURE__ */ jsx(Search, {
62
+ className: searchFieldIconClass,
63
+ strokeWidth: 1.8
64
+ }), /* @__PURE__ */ jsx("input", {
65
+ className: searchFieldInputClass,
66
+ onChange: (event) => setHandle(event.target.value),
67
+ placeholder: "handle",
68
+ value: handle
69
+ })]
70
+ }), /* @__PURE__ */ jsxs("button", {
71
+ className: primaryButtonClass,
72
+ disabled: !submittedHandle || analysis.loading,
73
+ type: "submit",
74
+ children: [analysis.loading ? /* @__PURE__ */ jsx(Loader2, {
75
+ className: "size-4 animate-spin",
76
+ strokeWidth: 1.8
77
+ }) : /* @__PURE__ */ jsx(UserSearch, {
78
+ className: "size-4",
79
+ strokeWidth: 1.8
80
+ }), "Analyse"]
81
+ })]
82
+ })]
83
+ }),
84
+ /* @__PURE__ */ jsx(ProfileAnalysisStatusLine, { analysis }),
85
+ /* @__PURE__ */ jsx(ProfileAnalysisOutput, { analysis })
86
+ ]
87
+ });
88
+ }
89
+ //#endregion
90
+ export { ProfileAnalyzeRoute as component };
@@ -0,0 +1,9 @@
1
+ import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
2
+ //#region src/routes/profile-analyze.tsx
3
+ var $$splitComponentImporter = () => import("./profile-analyze-BP65PED0.js");
4
+ var Route = createFileRoute("/profile-analyze")({
5
+ component: lazyRouteComponent($$splitComponentImporter, "component"),
6
+ validateSearch: (search) => ({ handle: typeof search.handle === "string" ? search.handle : "" })
7
+ });
8
+ //#endregion
9
+ export { Route as t };