sanity-plugin-seo-copilot 0.2.14 → 0.2.16

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 (40) hide show
  1. package/README.md +63 -50
  2. package/dist/index.js +868 -797
  3. package/dist/index.mjs +791 -720
  4. package/package.json +9 -8
  5. package/dist/index.js.map +0 -1
  6. package/dist/index.mjs.map +0 -1
  7. package/sanity.json +0 -3
  8. package/src/components/ChatPanel.tsx +0 -311
  9. package/src/components/ConfigContext.tsx +0 -22
  10. package/src/components/FeedbackButton.tsx +0 -218
  11. package/src/components/KeywordBadge.tsx +0 -50
  12. package/src/components/KeywordPanel.tsx +0 -1233
  13. package/src/components/OnboardingPopup.tsx +0 -108
  14. package/src/components/PlacementIndicators.tsx +0 -80
  15. package/src/components/ReportProblemButton.tsx +0 -212
  16. package/src/components/SEOCopilotPanel.tsx +0 -1287
  17. package/src/components/ScoreDonut.tsx +0 -158
  18. package/src/components/SeedKeywordInput.tsx +0 -128
  19. package/src/components/ShimmerLoader.tsx +0 -123
  20. package/src/components/TabBar.tsx +0 -373
  21. package/src/components/styles.ts +0 -158
  22. package/src/components/tabs/AEOTab.tsx +0 -585
  23. package/src/components/tabs/LinkingTab.tsx +0 -446
  24. package/src/components/tabs/MetaTab.tsx +0 -431
  25. package/src/components/tabs/SummaryTab.tsx +0 -405
  26. package/src/components/tabs/TechnicalTab.tsx +0 -933
  27. package/src/hooks/useDocumentContent.ts +0 -48
  28. package/src/hooks/useKeywordAnalysis.ts +0 -292
  29. package/src/hooks/useSEOChat.ts +0 -254
  30. package/src/index.ts +0 -16
  31. package/src/inspector.ts +0 -58
  32. package/src/lib/api.ts +0 -260
  33. package/src/lib/documentExtract.ts +0 -422
  34. package/src/lib/geoAnalysis.ts +0 -122
  35. package/src/lib/persistence.ts +0 -69
  36. package/src/lib/scoring.ts +0 -197
  37. package/src/lib/summary.ts +0 -645
  38. package/src/lib/types.ts +0 -212
  39. package/src/lib/utils.ts +0 -35
  40. package/v2-incompatible.js +0 -10
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { definePlugin } from "sanity";
5
5
  import { createElement } from "react";
6
6
 
7
7
  // src/components/SEOCopilotPanel.tsx
8
- import { useState as useState17, useRef as useRef12, useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo5, Suspense } from "react";
8
+ import { useState as useState18, useRef as useRef12, useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo5, Suspense } from "react";
9
9
  import { useWorkspace } from "sanity";
10
10
  import { createPortal } from "react-dom";
11
11
 
@@ -389,6 +389,15 @@ function useDocumentContent() {
389
389
  // src/hooks/useKeywordAnalysis.ts
390
390
  import { useState as useState2, useEffect as useEffect2, useCallback, useRef as useRef2 } from "react";
391
391
 
392
+ // src/lib/apiKey.ts
393
+ var SHARED_CLIENT_KEY = "seo-copilot-public-client-key-v1";
394
+ function authHeaders() {
395
+ return { "x-api-key": SHARED_CLIENT_KEY };
396
+ }
397
+ function jsonHeaders() {
398
+ return { "Content-Type": "application/json", ...authHeaders() };
399
+ }
400
+
392
401
  // src/lib/api.ts
393
402
  function safeParseJson(text) {
394
403
  try {
@@ -409,7 +418,7 @@ function safeParseJson(text) {
409
418
  async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword, signal) {
410
419
  const response = await fetch(`${apiUrl}/api/seo-copilot/analyze`, {
411
420
  method: "POST",
412
- headers: { "Content-Type": "application/json" },
421
+ headers: jsonHeaders(),
413
422
  body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword }),
414
423
  signal
415
424
  });
@@ -424,7 +433,7 @@ async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, d
424
433
  async function fetchChatStream(apiUrl, messages, documentContext, publication, keywordPanelData, signal) {
425
434
  const response = await fetch(`${apiUrl}/api/seo-copilot/chat`, {
426
435
  method: "POST",
427
- headers: { "Content-Type": "application/json" },
436
+ headers: jsonHeaders(),
428
437
  body: JSON.stringify({ messages, documentContext, publication, keywordPanelData }),
429
438
  signal
430
439
  });
@@ -438,7 +447,7 @@ async function fetchChatStream(apiUrl, messages, documentContext, publication, k
438
447
  async function submitFeedback(apiUrl, data) {
439
448
  const res = await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
440
449
  method: "POST",
441
- headers: { "Content-Type": "application/json" },
450
+ headers: jsonHeaders(),
442
451
  body: JSON.stringify(data)
443
452
  });
444
453
  if (!res.ok) throw new Error(`Feedback submit failed: HTTP ${res.status}`);
@@ -446,7 +455,7 @@ async function submitFeedback(apiUrl, data) {
446
455
  async function lookupKeywords(apiUrl, keywords, signal) {
447
456
  const response = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
448
457
  method: "POST",
449
- headers: { "Content-Type": "application/json" },
458
+ headers: jsonHeaders(),
450
459
  body: JSON.stringify({ keywords }),
451
460
  signal
452
461
  });
@@ -457,24 +466,12 @@ async function lookupKeywords(apiUrl, keywords, signal) {
457
466
  }
458
467
  return response.json();
459
468
  }
460
- async function loadChatHistory(apiUrl, userId, documentId) {
461
- try {
462
- const res = await fetch(
463
- `${apiUrl}/api/seo-copilot/chat-history?userId=${encodeURIComponent(userId)}&documentId=${encodeURIComponent(documentId)}`
464
- );
465
- if (!res.ok) return [];
466
- const data = await res.json();
467
- return data.messages || [];
468
- } catch {
469
- return [];
470
- }
471
- }
472
469
  async function fetchContentSuggestions(apiUrl, content, primaryKeyword, publication, signal) {
473
470
  const empty = { keyTakeaways: [], infographicOpportunities: [], bulletListItems: [] };
474
471
  try {
475
472
  const res = await fetch(`${apiUrl}/api/seo-copilot/content-suggestions`, {
476
473
  method: "POST",
477
- headers: { "Content-Type": "application/json" },
474
+ headers: jsonHeaders(),
478
475
  body: JSON.stringify({ content, primaryKeyword, publication }),
479
476
  signal
480
477
  });
@@ -495,7 +492,7 @@ async function fetchLinkingSuggestions(apiUrl, content, primaryKeyword, supporti
495
492
  try {
496
493
  const res = await fetch(`${apiUrl}/api/seo-copilot/linking-suggestions`, {
497
494
  method: "POST",
498
- headers: { "Content-Type": "application/json" },
495
+ headers: jsonHeaders(),
499
496
  body: JSON.stringify({ content, primaryKeyword, supportingKeywords, currentDocumentId, publication }),
500
497
  signal
501
498
  });
@@ -512,7 +509,7 @@ async function checkLinks(apiUrl, urls) {
512
509
  try {
513
510
  const res = await fetch(`${apiUrl}/api/seo-copilot/check-links`, {
514
511
  method: "POST",
515
- headers: { "Content-Type": "application/json" },
512
+ headers: jsonHeaders(),
516
513
  body: JSON.stringify({ urls })
517
514
  });
518
515
  if (!res.ok) return [];
@@ -523,16 +520,6 @@ async function checkLinks(apiUrl, urls) {
523
520
  return [];
524
521
  }
525
522
  }
526
- async function saveChatHistory(apiUrl, userId, documentId, messages, publication) {
527
- try {
528
- await fetch(`${apiUrl}/api/seo-copilot/chat-history`, {
529
- method: "POST",
530
- headers: { "Content-Type": "application/json" },
531
- body: JSON.stringify({ userId, documentId, messages, publication })
532
- });
533
- } catch {
534
- }
535
- }
536
523
 
537
524
  // src/hooks/useKeywordAnalysis.ts
538
525
  function mergeVolumes(analysis, volumeMap) {
@@ -764,21 +751,6 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
764
751
 
765
752
  // src/hooks/useSEOChat.ts
766
753
  import { useState as useState3, useCallback as useCallback2, useEffect as useEffect3, useRef as useRef3 } from "react";
767
- import { useCurrentUser } from "sanity";
768
- function getLocalUserId() {
769
- if (typeof window === "undefined") return "anonymous";
770
- const key = "seo-copilot-user-id";
771
- try {
772
- let id = localStorage.getItem(key);
773
- if (!id) {
774
- id = `user-${Math.random().toString(36).slice(2)}-${Date.now()}`;
775
- localStorage.setItem(key, id);
776
- }
777
- return id;
778
- } catch {
779
- return "anonymous";
780
- }
781
- }
782
754
  function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documentId) {
783
755
  const chatCacheKey = documentId ? `seo-copilot-chat-${documentId}` : "seo-copilot-chat-default";
784
756
  const loadCachedMessages = useCallback2(() => {
@@ -795,14 +767,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
795
767
  setMessagesRaw(msgs);
796
768
  }, []);
797
769
  const [isStreaming, setIsStreaming] = useState3(false);
798
- const [historyLoaded, setHistoryLoaded] = useState3(false);
799
- const sanityUser = useCurrentUser();
800
- const userId = useRef3(sanityUser?.id || getLocalUserId());
801
- useEffect3(() => {
802
- if (sanityUser?.id && userId.current !== sanityUser.id) {
803
- userId.current = sanityUser.id;
804
- }
805
- }, [sanityUser?.id]);
806
770
  useEffect3(() => {
807
771
  messagesRef.current = messages;
808
772
  }, [messages]);
@@ -819,10 +783,8 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
819
783
  useEffect3(() => {
820
784
  return () => {
821
785
  streamAbortRef.current?.abort();
822
- if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
823
786
  };
824
787
  }, []);
825
- const saveTimerRef = useRef3(null);
826
788
  const opVersionRef = useRef3(0);
827
789
  const didInitRef = useRef3(false);
828
790
  useEffect3(() => {
@@ -835,34 +797,7 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
835
797
  streamAbortRef.current = null;
836
798
  setMessagesRaw(loadCachedMessages());
837
799
  setIsStreaming(false);
838
- setHistoryLoaded(false);
839
- if (saveTimerRef.current) {
840
- clearTimeout(saveTimerRef.current);
841
- saveTimerRef.current = null;
842
- }
843
800
  }, [documentId, loadCachedMessages]);
844
- useEffect3(() => {
845
- if (!documentId || historyLoaded) return;
846
- const myVersion = opVersionRef.current;
847
- let cancelled = false;
848
- loadChatHistory(apiUrl, userId.current, documentId).then((loaded) => {
849
- if (cancelled || opVersionRef.current !== myVersion) return;
850
- if (loaded.length > 0) {
851
- setMessages((current) => current.length === 0 ? loaded : current);
852
- }
853
- setHistoryLoaded(true);
854
- });
855
- return () => {
856
- cancelled = true;
857
- };
858
- }, [apiUrl, documentId, historyLoaded]);
859
- const scheduleSave = useCallback2((msgs) => {
860
- if (!documentId) return;
861
- if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
862
- saveTimerRef.current = setTimeout(() => {
863
- saveChatHistory(apiUrl, userId.current, documentId, msgs, publication);
864
- }, 800);
865
- }, [apiUrl, documentId, publication]);
866
801
  const sendMessage = useCallback2(
867
802
  async (text) => {
868
803
  const myVersion = opVersionRef.current;
@@ -931,13 +866,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
931
866
  }
932
867
  }
933
868
  }
934
- if (opVersionRef.current === myVersion) {
935
- const finalMessages = [
936
- ...updatedMessages,
937
- { role: "assistant", content: assistantContent }
938
- ];
939
- scheduleSave(finalMessages);
940
- }
941
869
  } catch (err) {
942
870
  if (err instanceof Error && err.name === "AbortError") {
943
871
  setIsStreaming(false);
@@ -955,14 +883,11 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
955
883
  }
956
884
  if (opVersionRef.current === myVersion) setIsStreaming(false);
957
885
  },
958
- [apiUrl, documentText, publication, keywordPanelData, scheduleSave]
886
+ [apiUrl, documentText, publication, keywordPanelData]
959
887
  );
960
888
  const clearChat = useCallback2(() => {
961
889
  setMessages([]);
962
- if (documentId) {
963
- saveChatHistory(apiUrl, userId.current, documentId, [], publication);
964
- }
965
- }, [apiUrl, documentId, publication]);
890
+ }, [setMessages]);
966
891
  return { messages, isStreaming, sendMessage, clearChat };
967
892
  }
968
893
 
@@ -1015,7 +940,7 @@ function IndicatorDot({ letter, active, tooltip }) {
1015
940
  lineHeight: 1,
1016
941
  cursor: "default",
1017
942
  flexShrink: 0,
1018
- // Inactive = a solid WHITE disc (was a near-invisible faint-grey ring on
943
+ // Inactive = a solid white disc (was a near-invisible faint-grey ring on
1019
944
  // transparent) so each indicator reads clearly on the warm panel; a light
1020
945
  // edge + soft lift keep it defined even on a white card. Active = green.
1021
946
  background: active ? "#16a34a" : "#ffffff",
@@ -1300,20 +1225,24 @@ function SeedKeywordInput({ seeds, onSeedsChange }) {
1300
1225
 
1301
1226
  // src/components/FeedbackButton.tsx
1302
1227
  import { useState as useState6, useRef as useRef5, useEffect as useEffect4 } from "react";
1303
- import { useCurrentUser as useCurrentUser2 } from "sanity";
1228
+ import { useCurrentUser } from "sanity";
1304
1229
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1305
1230
  function FeedbackButton({ suggestionType, suggestionText, documentId, publication }) {
1306
1231
  const { apiUrl } = useConfig();
1307
- const sanityUser = useCurrentUser2();
1232
+ const sanityUser = useCurrentUser();
1308
1233
  const [vote, setVote] = useState6(null);
1309
1234
  const [showReasonPopup, setShowReasonPopup] = useState6(false);
1310
1235
  const [reason, setReason] = useState6("");
1311
1236
  const [submitted, setSubmitted] = useState6(false);
1237
+ const [failed, setFailed] = useState6(false);
1312
1238
  const popupRef = useRef5(null);
1313
1239
  const inputRef = useRef5(null);
1314
1240
  const submitTimerRef = useRef5(null);
1241
+ const downVoteUnsentRef = useRef5(false);
1242
+ const mounted = useRef5(true);
1315
1243
  useEffect4(() => {
1316
1244
  return () => {
1245
+ mounted.current = false;
1317
1246
  if (submitTimerRef.current) clearTimeout(submitTimerRef.current);
1318
1247
  };
1319
1248
  }, []);
@@ -1322,6 +1251,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1322
1251
  const handler = (e) => {
1323
1252
  if (popupRef.current && !popupRef.current.contains(e.target)) {
1324
1253
  setShowReasonPopup(false);
1254
+ if (downVoteUnsentRef.current) setVote(null);
1325
1255
  }
1326
1256
  };
1327
1257
  document.addEventListener("mousedown", handler);
@@ -1332,56 +1262,69 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1332
1262
  setTimeout(() => inputRef.current?.focus(), 50);
1333
1263
  }
1334
1264
  }, [showReasonPopup]);
1265
+ const send = async (type, text, v) => {
1266
+ try {
1267
+ await submitFeedback(apiUrl, {
1268
+ suggestion_type: type,
1269
+ suggestion_text: text,
1270
+ vote: v,
1271
+ document_id: documentId,
1272
+ publication,
1273
+ user_id: sanityUser?.id
1274
+ });
1275
+ return true;
1276
+ } catch (e) {
1277
+ console.error("[SEO Copilot] failed to send feedback:", e);
1278
+ return false;
1279
+ }
1280
+ };
1335
1281
  const handleVote = async (v) => {
1282
+ setFailed(false);
1336
1283
  if (v === "down" && vote !== "down") {
1337
1284
  setVote("down");
1338
1285
  setShowReasonPopup(true);
1339
1286
  setSubmitted(false);
1340
- try {
1341
- await submitFeedback(apiUrl, {
1342
- suggestion_type: suggestionType,
1343
- suggestion_text: suggestionText,
1344
- vote: "down",
1345
- document_id: documentId,
1346
- publication,
1347
- user_id: sanityUser?.id
1348
- });
1349
- } catch {
1350
- }
1287
+ downVoteUnsentRef.current = true;
1288
+ const ok = await send(suggestionType, suggestionText, "down");
1289
+ if (ok) downVoteUnsentRef.current = false;
1290
+ else if (mounted.current) setFailed(true);
1351
1291
  return;
1352
1292
  }
1353
1293
  const newVote = vote === v ? null : v;
1354
1294
  setVote(newVote);
1355
1295
  setShowReasonPopup(false);
1356
1296
  if (newVote) {
1357
- try {
1358
- await submitFeedback(apiUrl, {
1359
- suggestion_type: suggestionType,
1360
- suggestion_text: suggestionText,
1361
- vote: newVote,
1362
- document_id: documentId,
1363
- publication,
1364
- user_id: sanityUser?.id
1365
- });
1366
- } catch {
1297
+ const ok = await send(suggestionType, suggestionText, newVote);
1298
+ if (!ok && mounted.current) {
1299
+ setVote(null);
1300
+ setFailed(true);
1367
1301
  }
1368
1302
  }
1369
1303
  };
1304
+ const handleSkip = () => {
1305
+ setShowReasonPopup(false);
1306
+ setReason("");
1307
+ if (downVoteUnsentRef.current) setVote(null);
1308
+ };
1370
1309
  const handleSubmitReason = async () => {
1371
1310
  const trimmed = reason.trim();
1311
+ setFailed(false);
1312
+ if (downVoteUnsentRef.current) {
1313
+ const ok = await send(suggestionType, suggestionText, "down");
1314
+ if (!ok) {
1315
+ if (mounted.current) setFailed(true);
1316
+ return;
1317
+ }
1318
+ downVoteUnsentRef.current = false;
1319
+ }
1372
1320
  if (trimmed) {
1373
- try {
1374
- await submitFeedback(apiUrl, {
1375
- suggestion_type: suggestionType + "_reason",
1376
- suggestion_text: suggestionText + " | REASON: " + trimmed,
1377
- vote: "down",
1378
- document_id: documentId,
1379
- publication,
1380
- user_id: sanityUser?.id
1381
- });
1382
- } catch {
1321
+ const ok = await send(suggestionType + "_reason", suggestionText + " | REASON: " + trimmed, "down");
1322
+ if (!ok) {
1323
+ if (mounted.current) setFailed(true);
1324
+ return;
1383
1325
  }
1384
1326
  }
1327
+ if (!mounted.current) return;
1385
1328
  setSubmitted(true);
1386
1329
  submitTimerRef.current = setTimeout(() => {
1387
1330
  setShowReasonPopup(false);
@@ -1427,6 +1370,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1427
1370
  children: /* @__PURE__ */ jsx4("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx4("path", { d: "M19 11.75a1.25 1.25 0 11-2.5 0v-7.5a1.25 1.25 0 112.5 0v7.5zM9 17v1.3c0 .268-.14.526-.395.607A2 2 0 016 17c0-.995.182-1.948.514-2.826.204-.54-.166-1.174-.744-1.174H3.25c-1.243 0-2.261-1.01-2.146-2.247a23.864 23.864 0 011.341-5.974A1.637 1.637 0 014 3.75h9.5V12.5L9 17z" }) })
1428
1371
  }
1429
1372
  ),
1373
+ failed && !showReasonPopup && /* @__PURE__ */ jsx4("span", { role: "alert", style: { fontSize: 10, color: "#dc2626", fontWeight: 600, whiteSpace: "nowrap", marginLeft: 2 }, children: "Couldn't send - try again" }),
1430
1374
  showReasonPopup && /* @__PURE__ */ jsx4(
1431
1375
  "div",
1432
1376
  {
@@ -1445,7 +1389,9 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1445
1389
  border: "1px solid #e5e7eb"
1446
1390
  },
1447
1391
  children: submitted ? /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, color: "#16a34a", textAlign: "center", padding: "4px 0" }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
1448
- /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom: 6 }, children: "Sorry! What went wrong?" }),
1392
+ /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom: 3 }, children: "Sorry! What went wrong?" }),
1393
+ /* @__PURE__ */ jsx4("div", { style: { fontSize: 10, color: "#6b7280", marginBottom: 6, lineHeight: 1.45 }, children: "Sends your vote, this suggestion and your note, plus your user ID, document ID and publication when available." }),
1394
+ failed && /* @__PURE__ */ jsx4("div", { role: "alert", style: { fontSize: 10.5, color: "#dc2626", marginBottom: 6, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - try again" }),
1449
1395
  /* @__PURE__ */ jsx4(
1450
1396
  "input",
1451
1397
  {
@@ -1473,10 +1419,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1473
1419
  /* @__PURE__ */ jsx4(
1474
1420
  "button",
1475
1421
  {
1476
- onClick: () => {
1477
- setShowReasonPopup(false);
1478
- setReason("");
1479
- },
1422
+ onClick: handleSkip,
1480
1423
  style: {
1481
1424
  padding: "3px 8px",
1482
1425
  fontSize: 10,
@@ -1554,6 +1497,165 @@ function usePersistentState(key, initial) {
1554
1497
  return [val, set];
1555
1498
  }
1556
1499
 
1500
+ // src/lib/keywordAnchor.ts
1501
+ function keywordAnchorId(term) {
1502
+ const key = term.toLowerCase().trim();
1503
+ const slug = key.replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
1504
+ let hash = 5381;
1505
+ for (let i = 0; i < key.length; i++) hash = (hash * 33 ^ key.charCodeAt(i)) >>> 0;
1506
+ return `anchor-kw-${slug}-${hash.toString(36)}`;
1507
+ }
1508
+
1509
+ // src/lib/format.ts
1510
+ function abbrevVol(v) {
1511
+ if (v == null) return "";
1512
+ if (v === 0) return "N/A";
1513
+ if (v >= 1e4) return Math.round(v / 1e3) + "K";
1514
+ if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
1515
+ return String(v);
1516
+ }
1517
+
1518
+ // src/lib/scoring.ts
1519
+ function countWholeMatches(haystack, needle) {
1520
+ if (!needle) return 0;
1521
+ const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1522
+ const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
1523
+ return m ? m.length : 0;
1524
+ }
1525
+ function isKeywordInText(text, term) {
1526
+ return text.toLowerCase().includes(term.toLowerCase());
1527
+ }
1528
+ function calculateContentScoreDetailed(content, analysis, documentFields) {
1529
+ if (!content || !analysis) {
1530
+ return { total: 0, components: [] };
1531
+ }
1532
+ const lowerContent = content.toLowerCase();
1533
+ const words = content.split(/\s+/).filter(Boolean).length;
1534
+ const components = [];
1535
+ const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
1536
+ if (primaryTerm) {
1537
+ const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
1538
+ const phraseCount = countWholeMatches(lowerContent, primaryTerm);
1539
+ let occurrences = phraseCount;
1540
+ let viaTokens = false;
1541
+ if (phraseCount === 0 && tokens.length > 0) {
1542
+ const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
1543
+ if (counts.every((c) => c > 0)) {
1544
+ occurrences = Math.min(...counts);
1545
+ viaTokens = true;
1546
+ }
1547
+ }
1548
+ const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
1549
+ let pts = 0;
1550
+ let detail;
1551
+ if (occurrences === 0) {
1552
+ detail = `Primary keyword "${primaryTerm}" not found in content`;
1553
+ } else {
1554
+ pts += 12;
1555
+ const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
1556
+ if (density >= 0.5 && density <= 2.5) {
1557
+ pts += 13;
1558
+ detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
1559
+ } else if (density < 0.5) {
1560
+ pts += 7;
1561
+ detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
1562
+ } else if (viaTokens && density <= 6) {
1563
+ pts += 11;
1564
+ detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
1565
+ } else {
1566
+ pts += 4;
1567
+ detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
1568
+ }
1569
+ if (viaTokens) {
1570
+ detail = `Exact phrase "${analysis.primaryKeyword.term}" is not in the article - its words appear separately`;
1571
+ }
1572
+ }
1573
+ components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
1574
+ } else {
1575
+ components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
1576
+ }
1577
+ const supportingKws = analysis.supportingKeywords || [];
1578
+ if (supportingKws.length > 0) {
1579
+ const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
1580
+ const coverageRatio = inContentCount / supportingKws.length;
1581
+ const pts = Math.round(coverageRatio * 25);
1582
+ components.push({
1583
+ label: "Supporting keyword coverage",
1584
+ points: pts,
1585
+ max: 25,
1586
+ detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
1587
+ });
1588
+ } else {
1589
+ components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
1590
+ }
1591
+ let wcPts = 0;
1592
+ let wcDetail;
1593
+ if (words >= 1500) {
1594
+ wcPts = 15;
1595
+ wcDetail = `${words} words - strong length for clinical content`;
1596
+ } else if (words >= 450) {
1597
+ wcPts = 11;
1598
+ wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
1599
+ } else if (words >= 200) {
1600
+ wcPts = 5;
1601
+ wcDetail = `${words} words - below the 450-word floor`;
1602
+ } else {
1603
+ wcDetail = `${words} words - start writing`;
1604
+ }
1605
+ components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
1606
+ let hasH1orTitle;
1607
+ let hasSubheadings;
1608
+ if (documentFields) {
1609
+ hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
1610
+ const det = documentFields.headingsDetailed;
1611
+ const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
1612
+ hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
1613
+ } else {
1614
+ hasH1orTitle = /^#\s|<h1/im.test(content);
1615
+ hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
1616
+ }
1617
+ const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
1618
+ const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
1619
+ components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
1620
+ const suggested = [];
1621
+ const seen = /* @__PURE__ */ new Set();
1622
+ for (const kw of [...analysis.supportingKeywords || [], ...analysis.missingKeywords || []]) {
1623
+ if (kw == null || typeof kw.term !== "string") continue;
1624
+ const key = kw.term.toLowerCase();
1625
+ if (seen.has(key)) continue;
1626
+ seen.add(key);
1627
+ suggested.push({ term: kw.term, volume: kw.volume ?? null });
1628
+ }
1629
+ const withVolume = suggested.filter((kw) => kw.volume != null && kw.volume > 0);
1630
+ const pool = withVolume.length > 0 ? withVolume : suggested;
1631
+ const stillMissing = pool.filter((kw) => !isKeywordInText(content, kw.term)).sort((a, b) => (b.volume ?? 0) - (a.volume ?? 0));
1632
+ let mPts = 0;
1633
+ let mDetail;
1634
+ if (stillMissing.length === 0) {
1635
+ mPts = 15;
1636
+ mDetail = "No missing keywords - every suggestion is in your article";
1637
+ } else {
1638
+ const usedShare = (pool.length - stillMissing.length) / pool.length;
1639
+ mPts = usedShare >= 0.75 ? 15 : usedShare >= 0.5 ? 10 : usedShare >= 0.25 ? 5 : 0;
1640
+ mDetail = "Suggested keywords not in your article yet";
1641
+ }
1642
+ components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail, missingKeywords: stillMissing });
1643
+ let qCount;
1644
+ if (documentFields) {
1645
+ qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
1646
+ } else {
1647
+ qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
1648
+ }
1649
+ let aeoPts = 0;
1650
+ if (qCount >= 3) aeoPts = 10;
1651
+ else if (qCount === 2) aeoPts = 7;
1652
+ else if (qCount === 1) aeoPts = 4;
1653
+ const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
1654
+ components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
1655
+ const total = components.reduce((sum, c) => sum + c.points, 0);
1656
+ return { total: Math.min(100, Math.max(0, total)), components };
1657
+ }
1658
+
1557
1659
  // src/components/KeywordPanel.tsx
1558
1660
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1559
1661
  function loadLocalArray(key) {
@@ -1574,29 +1676,21 @@ var cardStyle = {
1574
1676
  boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.85), inset 1.5px 2px 1px -1px rgba(255,255,255,1), inset -2px -3px 2px -1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.07), 0 10px 26px rgba(0,0,0,0.08)",
1575
1677
  padding: "14px"
1576
1678
  };
1577
- function abbrevVol(v) {
1578
- if (v == null) return "";
1579
- if (v === 0) return "N/A";
1580
- if (v >= 1e4) return Math.round(v / 1e3) + "K";
1581
- if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
1582
- return String(v);
1583
- }
1584
1679
  function placementCount(p) {
1585
1680
  if (!p) return 0;
1586
1681
  return [p.inBody, p.inTitle, p.inMetaDescription, p.inImages, p.inUrl].filter(Boolean).length;
1587
1682
  }
1588
1683
  function buildSuggestedKeywords(supporting, missing, documentText, documentFields) {
1589
1684
  const merged = [];
1590
- const lowerText = documentText.toLowerCase();
1591
1685
  for (const kw of supporting) {
1592
1686
  if (kw == null || typeof kw.term !== "string") continue;
1593
- const actuallyInContent = lowerText.includes(kw.term.toLowerCase());
1687
+ const actuallyInContent = isKeywordInText(documentText, kw.term);
1594
1688
  const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
1595
1689
  merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, placement: livePlacement });
1596
1690
  }
1597
1691
  for (const kw of missing) {
1598
1692
  if (kw == null || typeof kw.term !== "string") continue;
1599
- const actuallyInContent = lowerText.includes(kw.term.toLowerCase());
1693
+ const actuallyInContent = isKeywordInText(documentText, kw.term);
1600
1694
  const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
1601
1695
  merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, reason: kw.reason, placement: livePlacement });
1602
1696
  }
@@ -1880,7 +1974,8 @@ function SuggestedKeywordsCard({
1880
1974
  documentId,
1881
1975
  secondaryKeyword,
1882
1976
  onSelectSecondary,
1883
- primaryTerm
1977
+ primaryTerm,
1978
+ focusKeyword
1884
1979
  }) {
1885
1980
  const docScope = documentId || "default";
1886
1981
  const [helpData, setHelpData] = usePersistentState(
@@ -1941,7 +2036,7 @@ function SuggestedKeywordsCard({
1941
2036
  const previousSuggestions = forceRegenerate && helpData[term] ? helpData[term].map((s) => s.revised || s.sentence || "").filter(Boolean) : void 0;
1942
2037
  const res = await fetch(`${apiUrl}/api/seo-copilot/keyword-help`, {
1943
2038
  method: "POST",
1944
- headers: { "Content-Type": "application/json" },
2039
+ headers: jsonHeaders(),
1945
2040
  // Clip to 5,000 chars: the backend only reads the first 4,000 anyway, so sending
1946
2041
  // the full article needlessly bloats the request on long pieces.
1947
2042
  body: JSON.stringify({ keyword: term, content: text.slice(0, 5e3), publication, previousSuggestions })
@@ -1969,7 +2064,7 @@ function SuggestedKeywordsCard({
1969
2064
  try {
1970
2065
  const res = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
1971
2066
  method: "POST",
1972
- headers: { "Content-Type": "application/json" },
2067
+ headers: jsonHeaders(),
1973
2068
  body: JSON.stringify({ keywords: [trimmed] })
1974
2069
  });
1975
2070
  if (res.ok) {
@@ -2005,6 +2100,24 @@ function SuggestedKeywordsCard({
2005
2100
  return next;
2006
2101
  });
2007
2102
  };
2103
+ useEffect6(() => {
2104
+ if (!focusKeyword) return;
2105
+ const reveal = setTimeout(() => {
2106
+ setExpanded(true);
2107
+ setActiveFilters(/* @__PURE__ */ new Set());
2108
+ }, 0);
2109
+ const scroll = setTimeout(() => {
2110
+ const el = typeof document !== "undefined" ? document.getElementById(keywordAnchorId(focusKeyword.term)) : null;
2111
+ if (!el) return;
2112
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
2113
+ el.classList.add("seo-copilot-flash");
2114
+ setTimeout(() => el.classList.remove("seo-copilot-flash"), 1400);
2115
+ }, 80);
2116
+ return () => {
2117
+ clearTimeout(reveal);
2118
+ clearTimeout(scroll);
2119
+ };
2120
+ }, [focusKeyword?.nonce]);
2008
2121
  let filtered = keywords;
2009
2122
  if (activeFilters.size > 0) {
2010
2123
  const hasNoneFilter = activeFilters.has("none");
@@ -2050,7 +2163,7 @@ function SuggestedKeywordsCard({
2050
2163
  const existingTerms = allKeywords.map((kw) => kw.term);
2051
2164
  const res = await fetch(`${apiUrl}/api/seo-copilot/more-keywords`, {
2052
2165
  method: "POST",
2053
- headers: { "Content-Type": "application/json" },
2166
+ headers: jsonHeaders(),
2054
2167
  body: JSON.stringify({ content: text, existingKeywords: existingTerms, publication })
2055
2168
  });
2056
2169
  if (res.ok) {
@@ -2343,7 +2456,7 @@ function SuggestedKeywordsCard({
2343
2456
  }
2344
2457
  )
2345
2458
  ] }),
2346
- /* @__PURE__ */ jsx5("div", { children: visible.map((kw, i) => /* @__PURE__ */ jsxs4("div", { children: [
2459
+ /* @__PURE__ */ jsx5("div", { children: visible.map((kw, i) => /* @__PURE__ */ jsxs4("div", { id: keywordAnchorId(kw.term), children: [
2347
2460
  /* @__PURE__ */ jsxs4("div", { style: {
2348
2461
  display: "flex",
2349
2462
  alignItems: "center",
@@ -2473,7 +2586,8 @@ function KeywordPanel({
2473
2586
  onSelectSecondary,
2474
2587
  documentFields,
2475
2588
  documentId,
2476
- externalAnalysis
2589
+ externalAnalysis,
2590
+ focusKeyword
2477
2591
  }) {
2478
2592
  const { apiUrl } = useConfig();
2479
2593
  const { analysis, isLoading, error, deepAnalysis, isDeepLoading, runDeepAnalysis } = externalAnalysis;
@@ -2574,7 +2688,8 @@ function KeywordPanel({
2574
2688
  documentId,
2575
2689
  secondaryKeyword,
2576
2690
  onSelectSecondary,
2577
- primaryTerm: activeTerm
2691
+ primaryTerm: activeTerm,
2692
+ focusKeyword
2578
2693
  },
2579
2694
  documentId || "default"
2580
2695
  ),
@@ -3030,7 +3145,7 @@ function TabBar({ tabs, activeTab, onTabChange }) {
3030
3145
  WebkitBackdropFilter: "blur(16px) saturate(170%)",
3031
3146
  // Beveled glass: top-left light edge + bottom-right inner shadow + a soft blue glow.
3032
3147
  boxShadow: "inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 5px rgba(0,0,0,0.28), 0 0 14px rgba(0,93,172,0.40), 0 2px 8px rgba(0,0,0,0.15)",
3033
- // Always a DEFINED transition (never "none") - that's what keeps every
3148
+ // Always a defined transition (never "none") - that's what keeps every
3034
3149
  // click animating. Normally: a real slide with a gentle bounce that lands
3035
3150
  // on arrival (ease-out-back), for the distance-scaled duration so long
3036
3151
  // jumps glide instead of darting. While resizing: 0ms = track instantly
@@ -3260,11 +3375,11 @@ function OnboardingCard({ onDismiss, closing }) {
3260
3375
 
3261
3376
  // src/components/ReportProblemButton.tsx
3262
3377
  import { useState as useState11, useRef as useRef10, useEffect as useEffect9 } from "react";
3263
- import { useCurrentUser as useCurrentUser3 } from "sanity";
3378
+ import { useCurrentUser as useCurrentUser2 } from "sanity";
3264
3379
  import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3265
3380
  function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
3266
3381
  const { apiUrl } = useConfig();
3267
- const sanityUser = useCurrentUser3();
3382
+ const sanityUser = useCurrentUser2();
3268
3383
  const [open, setOpen] = useState11(false);
3269
3384
  const [text, setText] = useState11("");
3270
3385
  const [submitting, setSubmitting] = useState11(false);
@@ -3387,7 +3502,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
3387
3502
  },
3388
3503
  children: submitted ? /* @__PURE__ */ jsx9("div", { style: { fontSize: 12, color: "#16a34a", textAlign: "center", padding: "6px 0", fontWeight: 600 }, children: "Thanks - we got it." }) : /* @__PURE__ */ jsxs8(Fragment5, { children: [
3389
3504
  /* @__PURE__ */ jsx9("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
3390
- /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also note which tab you're on to help us track it down." }),
3505
+ /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also include your Sanity user ID, the tab, document and keyword you're working on, the page URL and basic browser details to help us track it down." }),
3391
3506
  failed && /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#dc2626", marginBottom: 8, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - please try again." }),
3392
3507
  /* @__PURE__ */ jsx9(
3393
3508
  "textarea",
@@ -3466,7 +3581,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
3466
3581
  }
3467
3582
 
3468
3583
  // src/components/tabs/SummaryTab.tsx
3469
- import { useMemo, useState as useState13 } from "react";
3584
+ import { useMemo, useState as useState14 } from "react";
3470
3585
 
3471
3586
  // src/components/ShimmerLoader.tsx
3472
3587
  import { useEffect as useEffect10, useState as useState12 } from "react";
@@ -3567,134 +3682,6 @@ var DEFAULT_GENERATE_ALL_MESSAGES = [
3567
3682
  "Compiling summary"
3568
3683
  ];
3569
3684
 
3570
- // src/lib/scoring.ts
3571
- function countWholeMatches(haystack, needle) {
3572
- if (!needle) return 0;
3573
- const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3574
- const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
3575
- return m ? m.length : 0;
3576
- }
3577
- function calculateContentScoreDetailed(content, analysis, documentFields) {
3578
- if (!content || !analysis) {
3579
- return { total: 0, components: [] };
3580
- }
3581
- const lowerContent = content.toLowerCase();
3582
- const words = content.split(/\s+/).filter(Boolean).length;
3583
- const components = [];
3584
- const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
3585
- if (primaryTerm) {
3586
- const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
3587
- const phraseCount = countWholeMatches(lowerContent, primaryTerm);
3588
- let occurrences = phraseCount;
3589
- let viaTokens = false;
3590
- if (phraseCount === 0 && tokens.length > 0) {
3591
- const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
3592
- if (counts.every((c) => c > 0)) {
3593
- occurrences = Math.min(...counts);
3594
- viaTokens = true;
3595
- }
3596
- }
3597
- const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
3598
- let pts = 0;
3599
- let detail;
3600
- if (occurrences === 0) {
3601
- detail = `Primary keyword "${primaryTerm}" not found in content`;
3602
- } else {
3603
- pts += 12;
3604
- const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
3605
- if (density >= 0.5 && density <= 2.5) {
3606
- pts += 13;
3607
- detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
3608
- } else if (density < 0.5) {
3609
- pts += 7;
3610
- detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
3611
- } else if (viaTokens && density <= 6) {
3612
- pts += 11;
3613
- detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
3614
- } else {
3615
- pts += 4;
3616
- detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
3617
- }
3618
- }
3619
- components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
3620
- } else {
3621
- components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
3622
- }
3623
- const supportingKws = analysis.supportingKeywords || [];
3624
- if (supportingKws.length > 0) {
3625
- const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
3626
- const coverageRatio = inContentCount / supportingKws.length;
3627
- const pts = Math.round(coverageRatio * 25);
3628
- components.push({
3629
- label: "Supporting keyword coverage",
3630
- points: pts,
3631
- max: 25,
3632
- detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
3633
- });
3634
- } else {
3635
- components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
3636
- }
3637
- let wcPts = 0;
3638
- let wcDetail;
3639
- if (words >= 1500) {
3640
- wcPts = 15;
3641
- wcDetail = `${words} words - strong length for clinical content`;
3642
- } else if (words >= 450) {
3643
- wcPts = 11;
3644
- wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
3645
- } else if (words >= 200) {
3646
- wcPts = 5;
3647
- wcDetail = `${words} words - below the 450-word floor`;
3648
- } else {
3649
- wcDetail = `${words} words - start writing`;
3650
- }
3651
- components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
3652
- let hasH1orTitle;
3653
- let hasSubheadings;
3654
- if (documentFields) {
3655
- hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
3656
- const det = documentFields.headingsDetailed;
3657
- const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
3658
- hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
3659
- } else {
3660
- hasH1orTitle = /^#\s|<h1/im.test(content);
3661
- hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
3662
- }
3663
- const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
3664
- const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
3665
- components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
3666
- const missingCount = (analysis.missingKeywords || []).length;
3667
- let mPts = 0;
3668
- let mDetail;
3669
- if (missingCount === 0) {
3670
- mPts = 15;
3671
- mDetail = "No missing keywords flagged";
3672
- } else if (missingCount <= 2) {
3673
- mPts = 10;
3674
- mDetail = `${missingCount} suggested keywords missing - quick add`;
3675
- } else if (missingCount <= 4) {
3676
- mPts = 5;
3677
- mDetail = `${missingCount} suggested keywords missing`;
3678
- } else {
3679
- mDetail = `${missingCount} suggested keywords missing - significant gaps`;
3680
- }
3681
- components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail });
3682
- let qCount;
3683
- if (documentFields) {
3684
- qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
3685
- } else {
3686
- qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
3687
- }
3688
- let aeoPts = 0;
3689
- if (qCount >= 3) aeoPts = 10;
3690
- else if (qCount === 2) aeoPts = 7;
3691
- else if (qCount === 1) aeoPts = 4;
3692
- const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
3693
- components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
3694
- const total = components.reduce((sum, c) => sum + c.points, 0);
3695
- return { total: Math.min(100, Math.max(0, total)), components };
3696
- }
3697
-
3698
3685
  // src/lib/utils.ts
3699
3686
  function containsKeywordTokens(haystack, needle) {
3700
3687
  if (!needle) return true;
@@ -4050,7 +4037,7 @@ function buildSummaryItems(input) {
4050
4037
  category: "images",
4051
4038
  severity: "warning",
4052
4039
  label: `${missingTitles} image${missingTitles === 1 ? "" : "s"} missing a title`,
4053
- description: "The title attribute shows on hover and sends an SEO signal.",
4040
+ description: "The title attribute shows on hover and helps readers.",
4054
4041
  howToFix: "Add a descriptive title attribute (2-5 keywords) to each image that's missing one.",
4055
4042
  jumpTo: { tab: "technical", anchorId: "anchor-image-titles" }
4056
4043
  });
@@ -4212,9 +4199,9 @@ function buildSummaryItems(input) {
4212
4199
  id: `deep-gap-${i}`,
4213
4200
  category: "content",
4214
4201
  severity: "opportunity",
4215
- label: "Competitive gap",
4202
+ label: "Possible gap",
4216
4203
  description: note,
4217
- howToFix: "Add a section covering this topic so the article matches what competing pages offer.",
4204
+ howToFix: "Consider adding a section on this topic if it fits the article.",
4218
4205
  jumpTo: { tab: "summary" }
4219
4206
  });
4220
4207
  });
@@ -4239,8 +4226,77 @@ function buildSummaryItems(input) {
4239
4226
  return items;
4240
4227
  }
4241
4228
 
4229
+ // src/components/tabs/MissingKeywordsDetail.tsx
4230
+ import { useState as useState13 } from "react";
4231
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
4232
+ function MissingKeywordsDetail({ detail, keywords, onKeywordClick }) {
4233
+ const [open, setOpen] = useState13(false);
4234
+ if (keywords.length === 0) {
4235
+ return /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: detail });
4236
+ }
4237
+ return /* @__PURE__ */ jsxs10("div", { children: [
4238
+ /* @__PURE__ */ jsxs10(
4239
+ "button",
4240
+ {
4241
+ type: "button",
4242
+ onClick: () => setOpen((o) => !o),
4243
+ "aria-expanded": open,
4244
+ style: {
4245
+ display: "flex",
4246
+ alignItems: "baseline",
4247
+ gap: 5,
4248
+ padding: 0,
4249
+ margin: 0,
4250
+ background: "none",
4251
+ border: "none",
4252
+ cursor: "pointer",
4253
+ textAlign: "left",
4254
+ fontSize: 10.5,
4255
+ color: "#4b5563",
4256
+ lineHeight: 1.4,
4257
+ fontFamily: "inherit"
4258
+ },
4259
+ children: [
4260
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", style: { fontSize: 9, width: 8, flexShrink: 0, color: "#1f2937" }, children: open ? "\u25BE" : "\u25B8" }),
4261
+ /* @__PURE__ */ jsx11("span", { children: detail })
4262
+ ]
4263
+ }
4264
+ ),
4265
+ open && /* @__PURE__ */ jsx11("ul", { style: { listStyle: "none", margin: "4px 0 0 13px", padding: 0, display: "flex", flexDirection: "column", gap: 1 }, children: keywords.map((kw) => /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsxs10(
4266
+ "button",
4267
+ {
4268
+ type: "button",
4269
+ onClick: () => onKeywordClick(kw.term),
4270
+ title: "Show on the Keywords tab",
4271
+ style: {
4272
+ display: "flex",
4273
+ alignItems: "baseline",
4274
+ justifyContent: "space-between",
4275
+ gap: 8,
4276
+ width: "100%",
4277
+ padding: "3px 0",
4278
+ margin: 0,
4279
+ background: "none",
4280
+ border: "none",
4281
+ cursor: "pointer",
4282
+ textAlign: "left",
4283
+ fontSize: 11,
4284
+ fontFamily: "inherit"
4285
+ },
4286
+ children: [
4287
+ /* @__PURE__ */ jsx11("span", { style: { color: MJH_BLUE, fontWeight: 500 }, children: kw.term }),
4288
+ kw.volume != null && kw.volume > 0 && /* @__PURE__ */ jsxs10("span", { style: { fontSize: 10.5, fontWeight: 600, color: "#1f2937", flexShrink: 0 }, children: [
4289
+ abbrevVol(kw.volume),
4290
+ "/mo"
4291
+ ] })
4292
+ ]
4293
+ }
4294
+ ) }, kw.term)) })
4295
+ ] });
4296
+ }
4297
+
4242
4298
  // src/components/tabs/SummaryTab.tsx
4243
- import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
4299
+ import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4244
4300
  var cardStyle2 = {
4245
4301
  borderRadius: 14,
4246
4302
  background: "rgba(255,255,255,0.55)",
@@ -4267,11 +4323,11 @@ function componentTier(pct) {
4267
4323
  if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
4268
4324
  return { label: "Low", color: "#dc2626", bar: "#dc2626" };
4269
4325
  }
4270
- function ScoreBadge({ score, breakdown }) {
4326
+ function ScoreBadge({ score, breakdown, onKeywordClick }) {
4271
4327
  const c = scoreColors(score);
4272
- return /* @__PURE__ */ jsxs10("div", { style: cardStyle2, children: [
4273
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
4274
- /* @__PURE__ */ jsx11(
4328
+ return /* @__PURE__ */ jsxs11("div", { style: cardStyle2, children: [
4329
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
4330
+ /* @__PURE__ */ jsx12(
4275
4331
  "div",
4276
4332
  {
4277
4333
  style: {
@@ -4284,24 +4340,24 @@ function ScoreBadge({ score, breakdown }) {
4284
4340
  justifyContent: "center",
4285
4341
  flexShrink: 0
4286
4342
  },
4287
- children: /* @__PURE__ */ jsx11("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
4343
+ children: /* @__PURE__ */ jsx12("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
4288
4344
  }
4289
4345
  ),
4290
- /* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
4291
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
4292
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
4346
+ /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4347
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
4348
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
4293
4349
  ] })
4294
4350
  ] }),
4295
- breakdown.length > 0 && /* @__PURE__ */ jsx11("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
4351
+ breakdown.length > 0 && /* @__PURE__ */ jsx12("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
4296
4352
  const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
4297
4353
  const tier = componentTier(pct);
4298
- return /* @__PURE__ */ jsxs10("div", { children: [
4299
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
4300
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
4301
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
4354
+ return /* @__PURE__ */ jsxs11("div", { children: [
4355
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
4356
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
4357
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
4302
4358
  ] }),
4303
- /* @__PURE__ */ jsx11("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ jsx11("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
4304
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
4359
+ /* @__PURE__ */ jsx12("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ jsx12("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
4360
+ comp.missingKeywords ? /* @__PURE__ */ jsx12(MissingKeywordsDetail, { detail: comp.detail, keywords: comp.missingKeywords, onKeywordClick }) : /* @__PURE__ */ jsx12("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
4305
4361
  ] }, i);
4306
4362
  }) })
4307
4363
  ] });
@@ -4315,7 +4371,7 @@ function ItemCard({ item, onClick }) {
4315
4371
  const v = severityVisual(item.severity);
4316
4372
  const tab = item.jumpTo.tab;
4317
4373
  const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
4318
- return /* @__PURE__ */ jsxs10(
4374
+ return /* @__PURE__ */ jsxs11(
4319
4375
  "div",
4320
4376
  {
4321
4377
  onClick,
@@ -4332,8 +4388,8 @@ function ItemCard({ item, onClick }) {
4332
4388
  cursor: "pointer"
4333
4389
  },
4334
4390
  children: [
4335
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4336
- /* @__PURE__ */ jsx11(
4391
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4392
+ /* @__PURE__ */ jsx12(
4337
4393
  "div",
4338
4394
  {
4339
4395
  style: {
@@ -4346,12 +4402,12 @@ function ItemCard({ item, onClick }) {
4346
4402
  }
4347
4403
  }
4348
4404
  ),
4349
- /* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
4350
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4351
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4405
+ /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4406
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4407
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4352
4408
  ] })
4353
4409
  ] }),
4354
- /* @__PURE__ */ jsxs10(
4410
+ /* @__PURE__ */ jsxs11(
4355
4411
  "div",
4356
4412
  {
4357
4413
  style: {
@@ -4363,12 +4419,12 @@ function ItemCard({ item, onClick }) {
4363
4419
  lineHeight: 1.55
4364
4420
  },
4365
4421
  children: [
4366
- /* @__PURE__ */ jsx11("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4422
+ /* @__PURE__ */ jsx12("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4367
4423
  item.howToFix
4368
4424
  ]
4369
4425
  }
4370
4426
  ),
4371
- item.jumpTo.tab !== "summary" && /* @__PURE__ */ jsx11("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs10("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4427
+ item.jumpTo.tab !== "summary" && /* @__PURE__ */ jsx12("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs11("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4372
4428
  "Go to ",
4373
4429
  tabLabel,
4374
4430
  " \u203A"
@@ -4384,7 +4440,7 @@ function FilterChip({
4384
4440
  count,
4385
4441
  dotColor
4386
4442
  }) {
4387
- return /* @__PURE__ */ jsxs10(
4443
+ return /* @__PURE__ */ jsxs11(
4388
4444
  "button",
4389
4445
  {
4390
4446
  onClick,
@@ -4403,9 +4459,9 @@ function FilterChip({
4403
4459
  transition: "all 150ms"
4404
4460
  },
4405
4461
  children: [
4406
- dotColor && /* @__PURE__ */ jsx11("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4407
- /* @__PURE__ */ jsx11("span", { children: label }),
4408
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4462
+ dotColor && /* @__PURE__ */ jsx12("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4463
+ /* @__PURE__ */ jsx12("span", { children: label }),
4464
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4409
4465
  ]
4410
4466
  }
4411
4467
  );
@@ -4421,7 +4477,8 @@ function SummaryTab({
4421
4477
  secondaryKeyword,
4422
4478
  isAnyLoading,
4423
4479
  onGenerateAll,
4424
- onItemClick
4480
+ onItemClick,
4481
+ onKeywordClick
4425
4482
  }) {
4426
4483
  const scoreDetail = useMemo(() => {
4427
4484
  if (!analysis) return null;
@@ -4443,7 +4500,7 @@ function SummaryTab({
4443
4500
  }),
4444
4501
  [analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
4445
4502
  );
4446
- const [filter, setFilter] = useState13("all");
4503
+ const [filter, setFilter] = useState14("all");
4447
4504
  const counts = useMemo(
4448
4505
  () => ({
4449
4506
  all: items.length,
@@ -4455,15 +4512,15 @@ function SummaryTab({
4455
4512
  );
4456
4513
  const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
4457
4514
  if (!analysis) {
4458
- return /* @__PURE__ */ jsxs10("div", { style: { padding: 24, textAlign: "center" }, children: [
4459
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4460
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4515
+ return /* @__PURE__ */ jsxs11("div", { style: { padding: 24, textAlign: "center" }, children: [
4516
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4517
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4461
4518
  ] });
4462
4519
  }
4463
- return /* @__PURE__ */ jsxs10("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4464
- score != null && scoreDetail && /* @__PURE__ */ jsx11(ScoreBadge, { score, breakdown: scoreDetail.components }),
4465
- /* @__PURE__ */ jsxs10("div", { style: cardStyle2, children: [
4466
- isAnyLoading ? /* @__PURE__ */ jsx11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ jsx11(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ jsx11(
4520
+ return /* @__PURE__ */ jsxs11("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4521
+ score != null && scoreDetail && /* @__PURE__ */ jsx12(ScoreBadge, { score, breakdown: scoreDetail.components, onKeywordClick }),
4522
+ /* @__PURE__ */ jsxs11("div", { style: cardStyle2, children: [
4523
+ isAnyLoading ? /* @__PURE__ */ jsx12("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ jsx12(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ jsx12(
4467
4524
  "button",
4468
4525
  {
4469
4526
  onClick: onGenerateAll,
@@ -4491,24 +4548,24 @@ function SummaryTab({
4491
4548
  children: "Run all analyses"
4492
4549
  }
4493
4550
  ),
4494
- /* @__PURE__ */ jsxs10("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4551
+ /* @__PURE__ */ jsxs11("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4495
4552
  "Runs the analyses that fill the ",
4496
- /* @__PURE__ */ jsx11("strong", { children: "AEO/GEO" }),
4553
+ /* @__PURE__ */ jsx12("strong", { children: "AEO/GEO" }),
4497
4554
  ", ",
4498
- /* @__PURE__ */ jsx11("strong", { children: "Linking" }),
4555
+ /* @__PURE__ */ jsx12("strong", { children: "Linking" }),
4499
4556
  ", and ",
4500
- /* @__PURE__ */ jsx11("strong", { children: "Other Recs" }),
4557
+ /* @__PURE__ */ jsx12("strong", { children: "Other Recs" }),
4501
4558
  " tabs. New issues they find appear in this Summary as each one finishes."
4502
4559
  ] })
4503
4560
  ] }),
4504
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4505
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4506
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4507
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4508
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4561
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4562
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4563
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4564
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4565
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4509
4566
  ] }),
4510
- /* @__PURE__ */ jsx11("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ jsx11("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
4511
- /* @__PURE__ */ jsx11(
4567
+ /* @__PURE__ */ jsx12("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ jsx12("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ jsxs11(Fragment6, { children: [
4568
+ /* @__PURE__ */ jsx12(
4512
4569
  "div",
4513
4570
  {
4514
4571
  style: {
@@ -4521,21 +4578,21 @@ function SummaryTab({
4521
4578
  justifyContent: "center",
4522
4579
  margin: "0 auto 8px"
4523
4580
  },
4524
- children: /* @__PURE__ */ jsx11("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ jsx11("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) })
4581
+ children: /* @__PURE__ */ jsx12("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) })
4525
4582
  }
4526
4583
  ),
4527
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4528
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4529
- ] }) : /* @__PURE__ */ jsx11("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ jsx11(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4530
- isAnyLoading && items.length > 0 && /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4531
- /* @__PURE__ */ jsx11(LoadingBars, { size: "xs", color: MJH_BLUE }),
4532
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4584
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4585
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4586
+ ] }) : /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ jsx12(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4587
+ isAnyLoading && items.length > 0 && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4588
+ /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: MJH_BLUE }),
4589
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4533
4590
  ] })
4534
4591
  ] });
4535
4592
  }
4536
4593
 
4537
4594
  // src/components/tabs/AEOTab.tsx
4538
- import { useEffect as useEffect11, useMemo as useMemo2, useRef as useRef11, useState as useState14 } from "react";
4595
+ import { useEffect as useEffect11, useMemo as useMemo2, useRef as useRef11, useState as useState15 } from "react";
4539
4596
 
4540
4597
  // src/lib/geoAnalysis.ts
4541
4598
  var FACT_PATTERN = /\d+(?:\.\d+)?\s*%|\b\d{1,3}(?:,\d{3})+\b|\bn\s*=\s*\d+\b|\bp\s*[<=]\s*0?\.\d+\b|\b\d+(?:\.\d+)?\s*(?:patients|participants|subjects|cases|deaths|adverse events|mg|mcg|hours|days|weeks|months|years|fold|x)\b|\b(?:NEJM|JAMA|FDA|EMA|CDC|WHO|NIH|ACC|ASCO|ASH|ESMO|AHA|ACS)\b|\bet al\.?\b|\b(?:phase|stage)\s+(?:I{1,3}V?|1|2|3|4)\b/i;
@@ -4609,7 +4666,7 @@ function analyzeGEO(text, headings) {
4609
4666
  }
4610
4667
 
4611
4668
  // src/components/tabs/AEOTab.tsx
4612
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4669
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4613
4670
  var AEO_PURPLE = "#005DAC";
4614
4671
  var GEO_TEAL = "#C9A716";
4615
4672
  var cardStyle3 = {
@@ -4621,7 +4678,7 @@ var cardStyle3 = {
4621
4678
  padding: "14px"
4622
4679
  };
4623
4680
  function AiPill() {
4624
- return /* @__PURE__ */ jsx12(
4681
+ return /* @__PURE__ */ jsx13(
4625
4682
  "span",
4626
4683
  {
4627
4684
  style: {
@@ -4640,14 +4697,14 @@ function AiPill() {
4640
4697
  );
4641
4698
  }
4642
4699
  function SectionHeader2({ label, iconColor, ai }) {
4643
- return /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4644
- /* @__PURE__ */ jsx12("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4645
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4646
- ai && /* @__PURE__ */ jsx12(AiPill, {})
4700
+ return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4701
+ /* @__PURE__ */ jsx13("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4702
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4703
+ ai && /* @__PURE__ */ jsx13(AiPill, {})
4647
4704
  ] });
4648
4705
  }
4649
4706
  function CopyButton({ text }) {
4650
- const [copied, setCopied] = useState14(false);
4707
+ const [copied, setCopied] = useState15(false);
4651
4708
  const copyTimerRef = useRef11(null);
4652
4709
  useEffect11(() => {
4653
4710
  return () => {
@@ -4662,7 +4719,7 @@ function CopyButton({ text }) {
4662
4719
  } catch {
4663
4720
  }
4664
4721
  };
4665
- return /* @__PURE__ */ jsx12(
4722
+ return /* @__PURE__ */ jsx13(
4666
4723
  "button",
4667
4724
  {
4668
4725
  onClick: handleCopy,
@@ -4681,9 +4738,9 @@ function CopyButton({ text }) {
4681
4738
  transition: "color 150ms"
4682
4739
  },
4683
4740
  title: copied ? "Copied!" : "Copy to clipboard",
4684
- children: copied ? /* @__PURE__ */ jsx12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }) : /* @__PURE__ */ jsxs11("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4685
- /* @__PURE__ */ jsx12("path", { d: "M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" }),
4686
- /* @__PURE__ */ jsx12("path", { d: "M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" })
4741
+ children: copied ? /* @__PURE__ */ jsx13("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx13("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }) : /* @__PURE__ */ jsxs12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4742
+ /* @__PURE__ */ jsx13("path", { d: "M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" }),
4743
+ /* @__PURE__ */ jsx13("path", { d: "M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" })
4687
4744
  ] })
4688
4745
  }
4689
4746
  );
@@ -4698,13 +4755,13 @@ function GEOCard({ geo, publication }) {
4698
4755
  const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
4699
4756
  const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
4700
4757
  const totalHeadings = geo.headingAudit.length;
4701
- return /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4702
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4703
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4704
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4758
+ return /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
4759
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4760
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4761
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4705
4762
  ] }),
4706
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }, children: "How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite." }),
4707
- /* @__PURE__ */ jsxs11(
4763
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }, children: "How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite." }),
4764
+ /* @__PURE__ */ jsxs12(
4708
4765
  "div",
4709
4766
  {
4710
4767
  style: {
@@ -4717,7 +4774,7 @@ function GEOCard({ geo, publication }) {
4717
4774
  marginBottom: 8
4718
4775
  },
4719
4776
  children: [
4720
- /* @__PURE__ */ jsxs11(
4777
+ /* @__PURE__ */ jsxs12(
4721
4778
  "div",
4722
4779
  {
4723
4780
  style: {
@@ -4733,17 +4790,17 @@ function GEOCard({ geo, publication }) {
4733
4790
  boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
4734
4791
  },
4735
4792
  children: [
4736
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4737
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4793
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4794
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4738
4795
  ]
4739
4796
  }
4740
4797
  ),
4741
- /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4742
- /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4798
+ /* @__PURE__ */ jsxs12("div", { style: { flex: 1, minWidth: 0 }, children: [
4799
+ /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4743
4800
  "Fact density: ",
4744
4801
  fdLabel
4745
4802
  ] }),
4746
- /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4803
+ /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4747
4804
  fd.factCount,
4748
4805
  " specific stat",
4749
4806
  fd.factCount === 1 ? "" : "s",
@@ -4759,7 +4816,7 @@ function GEOCard({ geo, publication }) {
4759
4816
  ]
4760
4817
  }
4761
4818
  ),
4762
- fd.driftPassages > 0 && /* @__PURE__ */ jsxs11(
4819
+ fd.driftPassages > 0 && /* @__PURE__ */ jsxs12(
4763
4820
  "div",
4764
4821
  {
4765
4822
  style: {
@@ -4773,15 +4830,15 @@ function GEOCard({ geo, publication }) {
4773
4830
  lineHeight: 1.45
4774
4831
  },
4775
4832
  children: [
4776
- /* @__PURE__ */ jsx12("strong", { children: fd.driftPassages }),
4833
+ /* @__PURE__ */ jsx13("strong", { children: fd.driftPassages }),
4777
4834
  " passage",
4778
4835
  fd.driftPassages === 1 ? "" : "s",
4779
4836
  " over 200 words with no specific stats or citations. AI engines tend to skip these."
4780
4837
  ]
4781
4838
  }
4782
4839
  ),
4783
- totalHeadings > 0 && /* @__PURE__ */ jsxs11("div", { style: { marginTop: 4 }, children: [
4784
- /* @__PURE__ */ jsxs11(
4840
+ totalHeadings > 0 && /* @__PURE__ */ jsxs12("div", { style: { marginTop: 4 }, children: [
4841
+ /* @__PURE__ */ jsxs12(
4785
4842
  "button",
4786
4843
  {
4787
4844
  onClick: () => setShowDetails((v) => !v),
@@ -4800,22 +4857,22 @@ function GEOCard({ geo, publication }) {
4800
4857
  color: GEO_TEAL
4801
4858
  },
4802
4859
  children: [
4803
- /* @__PURE__ */ jsxs11("span", { children: [
4860
+ /* @__PURE__ */ jsxs12("span", { children: [
4804
4861
  "Short-answer paragraphs: ",
4805
4862
  goodCount,
4806
4863
  "/",
4807
4864
  totalHeadings,
4808
4865
  " headings have one"
4809
4866
  ] }),
4810
- /* @__PURE__ */ jsx12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
4867
+ /* @__PURE__ */ jsx13("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx13("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
4811
4868
  ]
4812
4869
  }
4813
4870
  ),
4814
- showDetails && /* @__PURE__ */ jsxs11("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4815
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 4 }, children: "Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract." }),
4871
+ showDetails && /* @__PURE__ */ jsxs12("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4872
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 4 }, children: "Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract." }),
4816
4873
  geo.headingAudit.map((h, i) => {
4817
4874
  const c = h.status === "good" ? { bg: "rgba(22,163,74,0.08)", color: "#16a34a", label: `${h.words} words \u2713` } : h.status === "too-short" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - too short` } : h.status === "too-long" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - condense to 40-60` } : { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "no body content" };
4818
- return /* @__PURE__ */ jsxs11(
4875
+ return /* @__PURE__ */ jsxs12(
4819
4876
  "div",
4820
4877
  {
4821
4878
  style: {
@@ -4829,8 +4886,8 @@ function GEOCard({ geo, publication }) {
4829
4886
  gap: 8
4830
4887
  },
4831
4888
  children: [
4832
- /* @__PURE__ */ jsx12("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4833
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4889
+ /* @__PURE__ */ jsx13("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4890
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4834
4891
  ]
4835
4892
  },
4836
4893
  i
@@ -4867,8 +4924,8 @@ function AEOTab({
4867
4924
  originalHeading: void 0,
4868
4925
  rationale: h.rationale
4869
4926
  })) ?? [];
4870
- return /* @__PURE__ */ jsxs11("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4871
- aeoContentChanged && /* @__PURE__ */ jsxs11(
4927
+ return /* @__PURE__ */ jsxs12("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4928
+ aeoContentChanged && /* @__PURE__ */ jsxs12(
4872
4929
  "div",
4873
4930
  {
4874
4931
  onClick: runDeepAnalysis,
@@ -4891,30 +4948,30 @@ function AEOTab({
4891
4948
  cursor: "pointer"
4892
4949
  },
4893
4950
  children: [
4894
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4895
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4951
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4952
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4896
4953
  ]
4897
4954
  }
4898
4955
  ),
4899
- hasEnoughTextForGEO && /* @__PURE__ */ jsx12(GEOCard, { geo, publication }),
4900
- hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ jsx12("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4901
- /* @__PURE__ */ jsx12("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4956
+ hasEnoughTextForGEO && /* @__PURE__ */ jsx13(GEOCard, { geo, publication }),
4957
+ hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ jsx13("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4958
+ /* @__PURE__ */ jsx13("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4902
4959
  " needs at least 150 words to read fact density.",
4903
- /* @__PURE__ */ jsx12("br", {}),
4904
- /* @__PURE__ */ jsxs11("span", { style: { color: "#4b5563" }, children: [
4960
+ /* @__PURE__ */ jsx13("br", {}),
4961
+ /* @__PURE__ */ jsxs12("span", { style: { color: "#4b5563" }, children: [
4905
4962
  "Current: ",
4906
4963
  geoWordCount,
4907
4964
  " word",
4908
4965
  geoWordCount === 1 ? "" : "s"
4909
4966
  ] })
4910
4967
  ] }) }),
4911
- !deepAnalysis && isDeepLoading && /* @__PURE__ */ jsxs11("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4912
- /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4913
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4968
+ !deepAnalysis && isDeepLoading && /* @__PURE__ */ jsxs12("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4969
+ /* @__PURE__ */ jsx13(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4970
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4914
4971
  ] }),
4915
- !deepAnalysis && !isDeepLoading && /* @__PURE__ */ jsxs11("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4916
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4917
- /* @__PURE__ */ jsx12(
4972
+ !deepAnalysis && !isDeepLoading && /* @__PURE__ */ jsxs12("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4973
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4974
+ /* @__PURE__ */ jsx13(
4918
4975
  "button",
4919
4976
  {
4920
4977
  onClick: runDeepAnalysis,
@@ -4934,11 +4991,11 @@ function AEOTab({
4934
4991
  }
4935
4992
  )
4936
4993
  ] }),
4937
- deepAnalysis && !aeo && /* @__PURE__ */ jsx12("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4938
- questionHeadings.length > 0 && /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4939
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4940
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4941
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ jsxs11(
4994
+ deepAnalysis && !aeo && /* @__PURE__ */ jsx13("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4995
+ questionHeadings.length > 0 && /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
4996
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4997
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4998
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ jsxs12(
4942
4999
  "div",
4943
5000
  {
4944
5001
  style: {
@@ -4948,26 +5005,26 @@ function AEOTab({
4948
5005
  borderLeft: `3px solid ${AEO_PURPLE}`
4949
5006
  },
4950
5007
  children: [
4951
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4952
- /* @__PURE__ */ jsxs11("div", { style: { flex: 1 }, children: [
4953
- h.originalHeading && /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
4954
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
5008
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5009
+ /* @__PURE__ */ jsxs12("div", { style: { flex: 1 }, children: [
5010
+ h.originalHeading && /* @__PURE__ */ jsx13("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
5011
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
4955
5012
  ] }),
4956
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4957
- /* @__PURE__ */ jsx12(CopyButton, { text: h.heading }),
4958
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
5013
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5014
+ /* @__PURE__ */ jsx13(CopyButton, { text: h.heading }),
5015
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
4959
5016
  ] })
4960
5017
  ] }),
4961
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
5018
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
4962
5019
  ]
4963
5020
  },
4964
5021
  i
4965
5022
  )) })
4966
5023
  ] }),
4967
- /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4968
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
4969
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10 }, children: "Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points." }),
4970
- !contentSuggestions && !isCSLoading && /* @__PURE__ */ jsx12(
5024
+ /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
5025
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
5026
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10 }, children: "Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points." }),
5027
+ !contentSuggestions && !isCSLoading && /* @__PURE__ */ jsx13(
4971
5028
  "button",
4972
5029
  {
4973
5030
  onClick: loadContentSuggestions,
@@ -4991,15 +5048,15 @@ function AEOTab({
4991
5048
  children: "Generate suggestions"
4992
5049
  }
4993
5050
  ),
4994
- isCSLoading && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
4995
- /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4996
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
5051
+ isCSLoading && /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
5052
+ /* @__PURE__ */ jsx13(LoadingBars, { size: "xs", color: AEO_PURPLE }),
5053
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
4997
5054
  ] }),
4998
- csError && /* @__PURE__ */ jsx12("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
4999
- contentSuggestions && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
5000
- contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5001
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
5002
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ jsxs11(
5055
+ csError && /* @__PURE__ */ jsx13("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
5056
+ contentSuggestions && /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
5057
+ contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5058
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
5059
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ jsxs12(
5003
5060
  "div",
5004
5061
  {
5005
5062
  style: {
@@ -5012,19 +5069,19 @@ function AEOTab({
5012
5069
  alignItems: "flex-start"
5013
5070
  },
5014
5071
  children: [
5015
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
5016
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5017
- /* @__PURE__ */ jsx12(CopyButton, { text: kt }),
5018
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
5072
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
5073
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5074
+ /* @__PURE__ */ jsx13(CopyButton, { text: kt }),
5075
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
5019
5076
  ] })
5020
5077
  ]
5021
5078
  },
5022
5079
  i
5023
5080
  )) })
5024
5081
  ] }),
5025
- contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5026
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
5027
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ jsxs11(
5082
+ contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5083
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
5084
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ jsxs12(
5028
5085
  "div",
5029
5086
  {
5030
5087
  style: {
@@ -5034,23 +5091,23 @@ function AEOTab({
5034
5091
  borderLeft: `2px solid ${AEO_PURPLE}`
5035
5092
  },
5036
5093
  children: [
5037
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5038
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
5039
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
5094
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5095
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
5096
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
5040
5097
  ] }),
5041
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
5098
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
5042
5099
  ]
5043
5100
  },
5044
5101
  i
5045
5102
  )) })
5046
5103
  ] }),
5047
- contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5048
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
5049
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5050
- /* @__PURE__ */ jsx12("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ jsx12("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
5051
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5052
- /* @__PURE__ */ jsx12(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
5053
- /* @__PURE__ */ jsx12(
5104
+ contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5105
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
5106
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5107
+ /* @__PURE__ */ jsx13("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ jsx13("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
5108
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5109
+ /* @__PURE__ */ jsx13(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
5110
+ /* @__PURE__ */ jsx13(
5054
5111
  FeedbackButton,
5055
5112
  {
5056
5113
  suggestionType: "aeo_bullets",
@@ -5061,7 +5118,7 @@ function AEOTab({
5061
5118
  ] })
5062
5119
  ] })
5063
5120
  ] }),
5064
- /* @__PURE__ */ jsx12(
5121
+ /* @__PURE__ */ jsx13(
5065
5122
  "button",
5066
5123
  {
5067
5124
  onClick: loadContentSuggestions,
@@ -5090,8 +5147,8 @@ function AEOTab({
5090
5147
  }
5091
5148
 
5092
5149
  // src/components/ScoreDonut.tsx
5093
- import { useState as useState15 } from "react";
5094
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
5150
+ import { useState as useState16 } from "react";
5151
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
5095
5152
  var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
5096
5153
  var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
5097
5154
  var TRACK = "#eef2f7";
@@ -5103,7 +5160,7 @@ function ScoreDonut({
5103
5160
  sectionFit,
5104
5161
  composite
5105
5162
  }) {
5106
- const [hovered, setHovered] = useState15(false);
5163
+ const [hovered, setHovered] = useState16(false);
5107
5164
  const radius = (size - strokeWidth) / 2;
5108
5165
  const circumference = 2 * Math.PI * radius;
5109
5166
  const cTopic = topic * W.topic;
@@ -5116,7 +5173,7 @@ function ScoreDonut({
5116
5173
  const topicLen = seg(cTopic);
5117
5174
  const freshLen = seg(cFresh);
5118
5175
  const sectionLen = seg(cSection);
5119
- const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ jsx13(
5176
+ const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ jsx14(
5120
5177
  "circle",
5121
5178
  {
5122
5179
  cx: size / 2,
@@ -5130,20 +5187,20 @@ function ScoreDonut({
5130
5187
  strokeDashoffset: -offset
5131
5188
  }
5132
5189
  );
5133
- return /* @__PURE__ */ jsxs12(
5190
+ return /* @__PURE__ */ jsxs13(
5134
5191
  "div",
5135
5192
  {
5136
5193
  style: { position: "relative", width: size, height: size, flexShrink: 0 },
5137
5194
  onMouseEnter: () => setHovered(true),
5138
5195
  onMouseLeave: () => setHovered(false),
5139
5196
  children: [
5140
- /* @__PURE__ */ jsxs12("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
5141
- /* @__PURE__ */ jsx13("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
5142
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
5143
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
5144
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
5197
+ /* @__PURE__ */ jsxs13("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
5198
+ /* @__PURE__ */ jsx14("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
5199
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
5200
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
5201
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
5145
5202
  ] }),
5146
- /* @__PURE__ */ jsxs12(
5203
+ /* @__PURE__ */ jsxs13(
5147
5204
  "div",
5148
5205
  {
5149
5206
  style: {
@@ -5157,15 +5214,15 @@ function ScoreDonut({
5157
5214
  lineHeight: 1
5158
5215
  },
5159
5216
  children: [
5160
- /* @__PURE__ */ jsxs12("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
5217
+ /* @__PURE__ */ jsxs13("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
5161
5218
  compositeValue,
5162
5219
  "%"
5163
5220
  ] }),
5164
- /* @__PURE__ */ jsx13("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
5221
+ /* @__PURE__ */ jsx14("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
5165
5222
  ]
5166
5223
  }
5167
5224
  ),
5168
- hovered && /* @__PURE__ */ jsxs12(
5225
+ hovered && /* @__PURE__ */ jsxs13(
5169
5226
  "div",
5170
5227
  {
5171
5228
  role: "tooltip",
@@ -5186,9 +5243,9 @@ function ScoreDonut({
5186
5243
  pointerEvents: "none"
5187
5244
  },
5188
5245
  children: [
5189
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
5190
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
5191
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
5246
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
5247
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
5248
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
5192
5249
  ]
5193
5250
  }
5194
5251
  )
@@ -5197,31 +5254,31 @@ function ScoreDonut({
5197
5254
  );
5198
5255
  }
5199
5256
  function SubScoreRow({ color, label, value }) {
5200
- return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
5201
- /* @__PURE__ */ jsx13("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
5202
- /* @__PURE__ */ jsx13("span", { style: { flex: 1 }, children: label }),
5203
- /* @__PURE__ */ jsxs12("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
5257
+ return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
5258
+ /* @__PURE__ */ jsx14("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
5259
+ /* @__PURE__ */ jsx14("span", { style: { flex: 1 }, children: label }),
5260
+ /* @__PURE__ */ jsxs13("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
5204
5261
  Math.round(value),
5205
5262
  "/100"
5206
5263
  ] })
5207
5264
  ] });
5208
5265
  }
5209
5266
  function ScoreDonutLegend() {
5210
- return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
5211
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
5212
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
5213
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
5267
+ return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
5268
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
5269
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
5270
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
5214
5271
  ] });
5215
5272
  }
5216
5273
  function LegendDot({ color, label }) {
5217
- return /* @__PURE__ */ jsxs12("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5218
- /* @__PURE__ */ jsx13("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
5274
+ return /* @__PURE__ */ jsxs13("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5275
+ /* @__PURE__ */ jsx14("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
5219
5276
  label
5220
5277
  ] });
5221
5278
  }
5222
5279
 
5223
5280
  // src/components/tabs/LinkingTab.tsx
5224
- import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
5281
+ import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5225
5282
  function buildLiveUrl(publication, slug) {
5226
5283
  if (!slug) return null;
5227
5284
  const pub = (publication || "").trim().toLowerCase();
@@ -5237,7 +5294,7 @@ function buildSanityUrl(baseUrl, id, type) {
5237
5294
  return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
5238
5295
  }
5239
5296
  function LinkChip({ href, label, color }) {
5240
- return /* @__PURE__ */ jsxs13(
5297
+ return /* @__PURE__ */ jsxs14(
5241
5298
  "a",
5242
5299
  {
5243
5300
  href,
@@ -5259,16 +5316,16 @@ function LinkChip({ href, label, color }) {
5259
5316
  },
5260
5317
  children: [
5261
5318
  label,
5262
- /* @__PURE__ */ jsxs13("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5263
- /* @__PURE__ */ jsx14("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5264
- /* @__PURE__ */ jsx14("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5319
+ /* @__PURE__ */ jsxs14("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5320
+ /* @__PURE__ */ jsx15("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5321
+ /* @__PURE__ */ jsx15("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5265
5322
  ] })
5266
5323
  ]
5267
5324
  }
5268
5325
  );
5269
5326
  }
5270
5327
  function ClickableBadge({ clickable }) {
5271
- return /* @__PURE__ */ jsxs13(
5328
+ return /* @__PURE__ */ jsxs14(
5272
5329
  "span",
5273
5330
  {
5274
5331
  style: {
@@ -5285,7 +5342,7 @@ function ClickableBadge({ clickable }) {
5285
5342
  color: clickable ? "#16a34a" : "#9ca3af"
5286
5343
  },
5287
5344
  children: [
5288
- /* @__PURE__ */ jsx14("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
5345
+ /* @__PURE__ */ jsx15("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
5289
5346
  clickable ? "Clickable link" : "No live link"
5290
5347
  ]
5291
5348
  }
@@ -5300,7 +5357,7 @@ var cardStyle4 = {
5300
5357
  padding: "14px"
5301
5358
  };
5302
5359
  function AiPill2() {
5303
- return /* @__PURE__ */ jsx14(
5360
+ return /* @__PURE__ */ jsx15(
5304
5361
  "span",
5305
5362
  {
5306
5363
  style: {
@@ -5324,10 +5381,10 @@ function SectionHeader3({
5324
5381
  ai,
5325
5382
  action
5326
5383
  }) {
5327
- return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
5328
- /* @__PURE__ */ jsx14("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
5329
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
5330
- ai && /* @__PURE__ */ jsx14(AiPill2, {}),
5384
+ return /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
5385
+ /* @__PURE__ */ jsx15("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
5386
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
5387
+ ai && /* @__PURE__ */ jsx15(AiPill2, {}),
5331
5388
  action
5332
5389
  ] });
5333
5390
  }
@@ -5348,7 +5405,7 @@ function freshnessChip(label, score) {
5348
5405
  };
5349
5406
  const c = map[label];
5350
5407
  if (!c) return null;
5351
- return /* @__PURE__ */ jsx14(
5408
+ return /* @__PURE__ */ jsx15(
5352
5409
  "span",
5353
5410
  {
5354
5411
  style: {
@@ -5368,8 +5425,8 @@ function freshnessChip(label, score) {
5368
5425
  );
5369
5426
  }
5370
5427
  function RefreshIcon({ spinning }) {
5371
- if (spinning) return /* @__PURE__ */ jsx14(LoadingBars, { size: "xs", color: "#9ca3af" });
5372
- return /* @__PURE__ */ jsx14("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx14("path", { fillRule: "evenodd", d: "M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H4.598a.75.75 0 00-.75.75v3.634a.75.75 0 001.5 0v-2.033l.312.311a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm-10.624-2.85a5.5 5.5 0 019.201-2.466l.312.311h-2.433a.75.75 0 000 1.5h3.634a.75.75 0 00.75-.75V3.535a.75.75 0 00-1.5 0v2.033l-.312-.311A7 7 0 002.628 8.395a.75.75 0 001.449.39z", clipRule: "evenodd" }) });
5428
+ if (spinning) return /* @__PURE__ */ jsx15(LoadingBars, { size: "xs", color: "#9ca3af" });
5429
+ return /* @__PURE__ */ jsx15("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx15("path", { fillRule: "evenodd", d: "M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H4.598a.75.75 0 00-.75.75v3.634a.75.75 0 001.5 0v-2.033l.312.311a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm-10.624-2.85a5.5 5.5 0 019.201-2.466l.312.311h-2.433a.75.75 0 000 1.5h3.634a.75.75 0 00.75-.75V3.535a.75.75 0 00-1.5 0v2.033l-.312-.311A7 7 0 002.628 8.395a.75.75 0 001.449.39z", clipRule: "evenodd" }) });
5373
5430
  }
5374
5431
  function LinkingTab({
5375
5432
  analysis,
@@ -5385,21 +5442,21 @@ function LinkingTab({
5385
5442
  documentType
5386
5443
  }) {
5387
5444
  if (!analysis) {
5388
- return /* @__PURE__ */ jsxs13("div", { style: { padding: 24, textAlign: "center" }, children: [
5389
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5390
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes." })
5445
+ return /* @__PURE__ */ jsxs14("div", { style: { padding: 24, textAlign: "center" }, children: [
5446
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5447
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes." })
5391
5448
  ] });
5392
5449
  }
5393
5450
  const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
5394
5451
  const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
5395
5452
  const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
5396
- return /* @__PURE__ */ jsx14("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ jsxs13("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5397
- /* @__PURE__ */ jsx14(
5453
+ return /* @__PURE__ */ jsx15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ jsxs14("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5454
+ /* @__PURE__ */ jsx15(
5398
5455
  SectionHeader3,
5399
5456
  {
5400
5457
  label: "Suggested Links",
5401
5458
  iconColor: MJH_BLUE,
5402
- action: /* @__PURE__ */ jsx14(
5459
+ action: /* @__PURE__ */ jsx15(
5403
5460
  "button",
5404
5461
  {
5405
5462
  onClick: onRefresh,
@@ -5414,20 +5471,20 @@ function LinkingTab({
5414
5471
  fontSize: 10
5415
5472
  },
5416
5473
  title: "Refresh",
5417
- children: /* @__PURE__ */ jsx14(RefreshIcon, { spinning: isLoading })
5474
+ children: /* @__PURE__ */ jsx15(RefreshIcon, { spinning: isLoading })
5418
5475
  }
5419
5476
  )
5420
5477
  }
5421
5478
  ),
5422
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5479
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5423
5480
  "Other articles on this site that fit this topic.",
5424
- wordCount2 > 0 && /* @__PURE__ */ jsxs13(Fragment7, { children: [
5481
+ wordCount2 > 0 && /* @__PURE__ */ jsxs14(Fragment7, { children: [
5425
5482
  " ",
5426
5483
  "For a ",
5427
5484
  wordCount2.toLocaleString(),
5428
5485
  "-word article, aim for",
5429
5486
  " ",
5430
- /* @__PURE__ */ jsxs13("strong", { children: [
5487
+ /* @__PURE__ */ jsxs14("strong", { children: [
5431
5488
  recommendedMin,
5432
5489
  "-",
5433
5490
  recommendedMax,
@@ -5436,17 +5493,17 @@ function LinkingTab({
5436
5493
  "."
5437
5494
  ] })
5438
5495
  ] }),
5439
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5496
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5440
5497
  "Each suggestion gets a 0-100% match score from three signals - ",
5441
- /* @__PURE__ */ jsx14("strong", { children: "topic match" }),
5498
+ /* @__PURE__ */ jsx15("strong", { children: "topic match" }),
5442
5499
  ", ",
5443
- /* @__PURE__ */ jsx14("strong", { children: "freshness" }),
5500
+ /* @__PURE__ */ jsx15("strong", { children: "freshness" }),
5444
5501
  ", and ",
5445
- /* @__PURE__ */ jsx14("strong", { children: "section fit" }),
5502
+ /* @__PURE__ */ jsx15("strong", { children: "section fit" }),
5446
5503
  " (where in your article the link belongs). The percentage on each card is the weighted total:"
5447
5504
  ] }),
5448
- /* @__PURE__ */ jsx14("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ jsx14(ScoreDonutLegend, {}) }),
5449
- isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ jsxs13(
5505
+ /* @__PURE__ */ jsx15("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ jsx15(ScoreDonutLegend, {}) }),
5506
+ isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ jsxs14(
5450
5507
  "div",
5451
5508
  {
5452
5509
  role: "button",
@@ -5471,16 +5528,16 @@ function LinkingTab({
5471
5528
  cursor: "pointer"
5472
5529
  },
5473
5530
  children: [
5474
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5475
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5531
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5532
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5476
5533
  ]
5477
5534
  }
5478
5535
  ),
5479
- isLoading && suggestions.length === 0 && /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5480
- /* @__PURE__ */ jsx14(LoadingBars, { size: "xs", color: MJH_BLUE }),
5481
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5536
+ isLoading && suggestions.length === 0 && /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5537
+ /* @__PURE__ */ jsx15(LoadingBars, { size: "xs", color: MJH_BLUE }),
5538
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5482
5539
  ] }),
5483
- !isLoading && error && /* @__PURE__ */ jsxs13(
5540
+ !isLoading && error && /* @__PURE__ */ jsxs14(
5484
5541
  "div",
5485
5542
  {
5486
5543
  style: {
@@ -5491,9 +5548,9 @@ function LinkingTab({
5491
5548
  textAlign: "center"
5492
5549
  },
5493
5550
  children: [
5494
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5495
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5496
- /* @__PURE__ */ jsx14(
5551
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5552
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5553
+ /* @__PURE__ */ jsx15(
5497
5554
  "button",
5498
5555
  {
5499
5556
  onClick: onRefresh,
@@ -5513,14 +5570,14 @@ function LinkingTab({
5513
5570
  ]
5514
5571
  }
5515
5572
  ),
5516
- !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", padding: "10px 12px", lineHeight: 1.55, background: "rgba(0,93,172,0.04)", borderRadius: 8, border: "1px solid rgba(0,93,172,0.12)" }, children: [
5517
- /* @__PURE__ */ jsx14("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5518
- /* @__PURE__ */ jsx14("div", { style: { color: "#4b5563" }, children: "Linking searched your publication for articles on this topic and did not find a strong match. As more related content is published, suggestions will appear here." })
5573
+ !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", padding: "10px 12px", lineHeight: 1.55, background: "rgba(0,93,172,0.04)", borderRadius: 8, border: "1px solid rgba(0,93,172,0.12)" }, children: [
5574
+ /* @__PURE__ */ jsx15("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5575
+ /* @__PURE__ */ jsx15("div", { style: { color: "#4b5563" }, children: "Linking checked related and recent articles from your publication and did not find a strong match. As more related content is published, suggestions will appear here." })
5519
5576
  ] }),
5520
- suggestions.length > 0 && /* @__PURE__ */ jsx14("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
5577
+ suggestions.length > 0 && /* @__PURE__ */ jsx15("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
5521
5578
  const liveUrl = buildLiveUrl(publication, s.slug);
5522
5579
  const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
5523
- return /* @__PURE__ */ jsxs13(
5580
+ return /* @__PURE__ */ jsxs14(
5524
5581
  "div",
5525
5582
  {
5526
5583
  style: {
@@ -5533,7 +5590,7 @@ function LinkingTab({
5533
5590
  alignItems: "flex-start"
5534
5591
  },
5535
5592
  children: [
5536
- /* @__PURE__ */ jsx14(
5593
+ /* @__PURE__ */ jsx15(
5537
5594
  ScoreDonut,
5538
5595
  {
5539
5596
  size: 64,
@@ -5543,27 +5600,27 @@ function LinkingTab({
5543
5600
  composite: Math.max(0, Math.min(100, s.compositeScore))
5544
5601
  }
5545
5602
  ),
5546
- /* @__PURE__ */ jsxs13("div", { style: { flex: 1, minWidth: 0 }, children: [
5547
- /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5603
+ /* @__PURE__ */ jsxs14("div", { style: { flex: 1, minWidth: 0 }, children: [
5604
+ /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5548
5605
  freshnessChip(s.freshnessLabel, s.freshnessScore),
5549
- s.publishedAt && /* @__PURE__ */ jsx14("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
5550
- /* @__PURE__ */ jsx14(ClickableBadge, { clickable: !!liveUrl })
5606
+ s.publishedAt && /* @__PURE__ */ jsx15("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
5607
+ /* @__PURE__ */ jsx15(ClickableBadge, { clickable: !!liveUrl })
5551
5608
  ] }),
5552
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5553
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5609
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5610
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5554
5611
  "/",
5555
5612
  s.slug
5556
5613
  ] }),
5557
- (liveUrl || sanityUrl) && /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5558
- sanityUrl && /* @__PURE__ */ jsx14(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5559
- liveUrl && /* @__PURE__ */ jsx14(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5614
+ (liveUrl || sanityUrl) && /* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5615
+ sanityUrl && /* @__PURE__ */ jsx15(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5616
+ liveUrl && /* @__PURE__ */ jsx15(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5560
5617
  ] }),
5561
- s.relevanceReason && /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5562
- /* @__PURE__ */ jsx14("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5618
+ s.relevanceReason && /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5619
+ /* @__PURE__ */ jsx15("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5563
5620
  " ",
5564
- /* @__PURE__ */ jsx14("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5621
+ /* @__PURE__ */ jsx15("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5565
5622
  ] }),
5566
- s.anchorQuote && /* @__PURE__ */ jsxs13(
5623
+ s.anchorQuote && /* @__PURE__ */ jsxs14(
5567
5624
  "div",
5568
5625
  {
5569
5626
  style: {
@@ -5577,21 +5634,21 @@ function LinkingTab({
5577
5634
  lineHeight: 1.5
5578
5635
  },
5579
5636
  children: [
5580
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5637
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5581
5638
  "Where to link from - paragraph ",
5582
5639
  s.anchorParagraph
5583
5640
  ] }),
5584
- /* @__PURE__ */ jsxs13("div", { style: { fontStyle: "italic" }, children: [
5641
+ /* @__PURE__ */ jsxs14("div", { style: { fontStyle: "italic" }, children: [
5585
5642
  '"',
5586
5643
  s.anchorQuote,
5587
5644
  '"'
5588
5645
  ] }),
5589
- s.anchorReason && /* @__PURE__ */ jsx14("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5646
+ s.anchorReason && /* @__PURE__ */ jsx15("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5590
5647
  ]
5591
5648
  }
5592
5649
  )
5593
5650
  ] }),
5594
- /* @__PURE__ */ jsx14("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx14(
5651
+ /* @__PURE__ */ jsx15("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx15(
5595
5652
  FeedbackButton,
5596
5653
  {
5597
5654
  suggestionType: "internal_link",
@@ -5610,10 +5667,10 @@ function LinkingTab({
5610
5667
 
5611
5668
  // src/components/tabs/MetaTab.tsx
5612
5669
  import { useMemo as useMemo3 } from "react";
5613
- import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5670
+ import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
5614
5671
  var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
5615
5672
  function ExternalLinkChip({ href, label }) {
5616
- return /* @__PURE__ */ jsxs14(
5673
+ return /* @__PURE__ */ jsxs15(
5617
5674
  "a",
5618
5675
  {
5619
5676
  href,
@@ -5636,16 +5693,16 @@ function ExternalLinkChip({ href, label }) {
5636
5693
  },
5637
5694
  children: [
5638
5695
  label,
5639
- /* @__PURE__ */ jsxs14("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5640
- /* @__PURE__ */ jsx15("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5641
- /* @__PURE__ */ jsx15("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5696
+ /* @__PURE__ */ jsxs15("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5697
+ /* @__PURE__ */ jsx16("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5698
+ /* @__PURE__ */ jsx16("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5642
5699
  ] })
5643
5700
  ]
5644
5701
  }
5645
5702
  );
5646
5703
  }
5647
5704
  function FreshnessNotice() {
5648
- return /* @__PURE__ */ jsxs14(
5705
+ return /* @__PURE__ */ jsxs15(
5649
5706
  "div",
5650
5707
  {
5651
5708
  style: {
@@ -5659,11 +5716,11 @@ function FreshnessNotice() {
5659
5716
  lineHeight: 1.5
5660
5717
  },
5661
5718
  children: [
5662
- /* @__PURE__ */ jsx15("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
5719
+ /* @__PURE__ */ jsx16("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
5663
5720
  "Planning to update this article after it's published? Set the ",
5664
- /* @__PURE__ */ jsx15("strong", { children: "Updated on" }),
5721
+ /* @__PURE__ */ jsx16("strong", { children: "Updated on" }),
5665
5722
  " date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
5666
- /* @__PURE__ */ jsx15("strong", { children: "Latest Updated Articles" }),
5723
+ /* @__PURE__ */ jsx16("strong", { children: "Latest Updated Articles" }),
5667
5724
  " and increases its visibility in search engine results."
5668
5725
  ]
5669
5726
  }
@@ -5684,7 +5741,7 @@ function StatusBadge({ status }) {
5684
5741
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
5685
5742
  };
5686
5743
  const c = map[status];
5687
- return /* @__PURE__ */ jsx15(
5744
+ return /* @__PURE__ */ jsx16(
5688
5745
  "span",
5689
5746
  {
5690
5747
  style: {
@@ -5703,12 +5760,12 @@ function StatusBadge({ status }) {
5703
5760
  );
5704
5761
  }
5705
5762
  function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5706
- return /* @__PURE__ */ jsxs14("div", { id: anchorId, style: cardStyle5, children: [
5707
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5708
- /* @__PURE__ */ jsx15("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5709
- /* @__PURE__ */ jsx15(StatusBadge, { status })
5763
+ return /* @__PURE__ */ jsxs15("div", { id: anchorId, style: cardStyle5, children: [
5764
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5765
+ /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5766
+ /* @__PURE__ */ jsx16(StatusBadge, { status })
5710
5767
  ] }),
5711
- /* @__PURE__ */ jsx15(
5768
+ /* @__PURE__ */ jsx16(
5712
5769
  "div",
5713
5770
  {
5714
5771
  style: {
@@ -5721,7 +5778,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5721
5778
  children: value
5722
5779
  }
5723
5780
  ),
5724
- recommendation && /* @__PURE__ */ jsx15(
5781
+ recommendation && /* @__PURE__ */ jsx16(
5725
5782
  "div",
5726
5783
  {
5727
5784
  style: {
@@ -5870,7 +5927,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5870
5927
  } else {
5871
5928
  items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
5872
5929
  }
5873
- items[0].footer = /* @__PURE__ */ jsx15(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
5930
+ items[0].footer = /* @__PURE__ */ jsx16(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
5874
5931
  const factChecker = documentFields?.factCheckerName;
5875
5932
  const factCheckerRef = documentFields?.factCheckerIsReference;
5876
5933
  if (factChecker) {
@@ -5895,7 +5952,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5895
5952
  if (days <= 14) {
5896
5953
  items.push({ label: "Content Freshness", value, status: "good", recommendation: "Recent content gets cited and ranked more. Re-set the Updated-on date whenever you revise to keep it fresh." });
5897
5954
  } else if (days <= 90) {
5898
- items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Content older than two weeks gets cited less by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
5955
+ items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Recently updated content tends to be cited more by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
5899
5956
  } else {
5900
5957
  items.push({ label: "Content Freshness", value, status: "error", recommendation: "Over 90 days old. Review the facts, update what's stale, and set the Updated-on date in Sanity." });
5901
5958
  }
@@ -5905,21 +5962,21 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5905
5962
  const publishDateItem = useMemo3(() => {
5906
5963
  const published = documentFields?.publishedAt;
5907
5964
  const daysPub = daysSince(published);
5908
- if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Required for healthcare content to be cited by Google and AI search." };
5965
+ if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Helps search engines and AI search judge how current the article is." };
5909
5966
  if (daysPub === null) return { label: "Publish Date", value: "Unrecognized format", status: "warning", recommendation: "A publish date is set but couldn't be read as a valid date. Check the field value." };
5910
5967
  return { label: "Publish Date", value: formatDateShort(published), status: "good" };
5911
5968
  }, [documentFields]);
5912
5969
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
5913
5970
  if (isLoading && !hasAnyField) {
5914
- return /* @__PURE__ */ jsxs14("div", { style: { padding: 24, textAlign: "center" }, children: [
5915
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5916
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5971
+ return /* @__PURE__ */ jsxs15("div", { style: { padding: 24, textAlign: "center" }, children: [
5972
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5973
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5917
5974
  ] });
5918
5975
  }
5919
5976
  const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
5920
- return /* @__PURE__ */ jsxs14("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5921
- /* @__PURE__ */ jsx15(FreshnessNotice, {}),
5922
- /* @__PURE__ */ jsx15(
5977
+ return /* @__PURE__ */ jsxs15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5978
+ /* @__PURE__ */ jsx16(FreshnessNotice, {}),
5979
+ /* @__PURE__ */ jsx16(
5923
5980
  AuditCard,
5924
5981
  {
5925
5982
  anchorId: "anchor-publish-date",
@@ -5929,7 +5986,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5929
5986
  recommendation: publishDateItem.recommendation
5930
5987
  }
5931
5988
  ),
5932
- audits.map((a, i) => /* @__PURE__ */ jsx15(
5989
+ audits.map((a, i) => /* @__PURE__ */ jsx16(
5933
5990
  AuditCard,
5934
5991
  {
5935
5992
  anchorId: auditAnchors[i],
@@ -5940,14 +5997,14 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5940
5997
  },
5941
5998
  i
5942
5999
  )),
5943
- eeatItems.length > 0 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
5944
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
5945
- /* @__PURE__ */ jsx15("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
5946
- /* @__PURE__ */ jsx15("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
5947
- /* @__PURE__ */ jsx15("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
6000
+ eeatItems.length > 0 && /* @__PURE__ */ jsxs15(Fragment8, { children: [
6001
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
6002
+ /* @__PURE__ */ jsx16("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
6003
+ /* @__PURE__ */ jsx16("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
6004
+ /* @__PURE__ */ jsx16("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
5948
6005
  ] }),
5949
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 10, color: "#4b5563", padding: "0 4px", marginTop: -4 }, children: "Google looks for a named author with credentials and recent updates on healthcare content." }),
5950
- eeatItems.map((item, i) => /* @__PURE__ */ jsx15(
6006
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", padding: "0 4px", marginTop: -4 }, children: "Google looks for a named author with credentials and recent updates on healthcare content." }),
6007
+ eeatItems.map((item, i) => /* @__PURE__ */ jsx16(
5951
6008
  AuditCard,
5952
6009
  {
5953
6010
  label: item.label,
@@ -5963,8 +6020,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5963
6020
  }
5964
6021
 
5965
6022
  // src/components/tabs/TechnicalTab.tsx
5966
- import { useMemo as useMemo4, useState as useState16 } from "react";
5967
- import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
6023
+ import { useMemo as useMemo4, useState as useState17 } from "react";
6024
+ import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
5968
6025
  function urlAudit(slug, primaryKeyword, secondaryKeyword) {
5969
6026
  const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
5970
6027
  if (!slug) {
@@ -5999,28 +6056,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
5999
6056
  return { label: "URL Slug", value: `/${slug}`, status: "good" };
6000
6057
  }
6001
6058
  function SlugRedirectNotice() {
6002
- const [expanded, setExpanded] = useState16(false);
6003
- return /* @__PURE__ */ jsx16("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ jsxs15("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
6004
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
6005
- /* @__PURE__ */ jsx16("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
6006
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
6059
+ const [expanded, setExpanded] = useState17(false);
6060
+ return /* @__PURE__ */ jsx17("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ jsxs16("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
6061
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
6062
+ /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
6063
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
6007
6064
  ] }),
6008
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you MUST add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
6009
- /* @__PURE__ */ jsxs15(
6065
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you must add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
6066
+ /* @__PURE__ */ jsxs16(
6010
6067
  "button",
6011
6068
  {
6012
6069
  onClick: () => setExpanded((v) => !v),
6013
6070
  style: { display: "flex", alignItems: "center", gap: 3, marginTop: 6, padding: 0, background: "none", border: "none", cursor: "pointer", fontSize: 10.5, fontWeight: 700, color: "#b45309", fontFamily: "inherit" },
6014
6071
  children: [
6015
6072
  expanded ? "Show less" : "Learn more",
6016
- /* @__PURE__ */ jsx16("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx16("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
6073
+ /* @__PURE__ */ jsx17("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
6017
6074
  ]
6018
6075
  }
6019
6076
  ),
6020
- expanded && /* @__PURE__ */ jsxs15("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
6021
- /* @__PURE__ */ jsx16("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
6022
- /* @__PURE__ */ jsx16("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
6023
- /* @__PURE__ */ jsx16("li", { children: "Set this up using vanity redirects in Sanity." })
6077
+ expanded && /* @__PURE__ */ jsxs16("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
6078
+ /* @__PURE__ */ jsx17("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
6079
+ /* @__PURE__ */ jsx17("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
6080
+ /* @__PURE__ */ jsx17("li", { children: "Set this up using vanity redirects in Sanity." })
6024
6081
  ] })
6025
6082
  ] }) });
6026
6083
  }
@@ -6039,7 +6096,7 @@ function StatusBadge2({ status }) {
6039
6096
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
6040
6097
  };
6041
6098
  const c = map[status];
6042
- return /* @__PURE__ */ jsx16(
6099
+ return /* @__PURE__ */ jsx17(
6043
6100
  "span",
6044
6101
  {
6045
6102
  style: {
@@ -6065,12 +6122,12 @@ function AuditCard2({
6065
6122
  anchorId,
6066
6123
  footer
6067
6124
  }) {
6068
- return /* @__PURE__ */ jsxs15("div", { id: anchorId, style: cardStyle6, children: [
6069
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6070
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
6071
- /* @__PURE__ */ jsx16(StatusBadge2, { status })
6125
+ return /* @__PURE__ */ jsxs16("div", { id: anchorId, style: cardStyle6, children: [
6126
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6127
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
6128
+ /* @__PURE__ */ jsx17(StatusBadge2, { status })
6072
6129
  ] }),
6073
- /* @__PURE__ */ jsx16(
6130
+ /* @__PURE__ */ jsx17(
6074
6131
  "div",
6075
6132
  {
6076
6133
  style: {
@@ -6083,7 +6140,7 @@ function AuditCard2({
6083
6140
  children: value
6084
6141
  }
6085
6142
  ),
6086
- recommendation && /* @__PURE__ */ jsx16(
6143
+ recommendation && /* @__PURE__ */ jsx17(
6087
6144
  "div",
6088
6145
  {
6089
6146
  style: {
@@ -6197,7 +6254,7 @@ function imageTitleAudit(titles, imageCount) {
6197
6254
  label: "Image Titles",
6198
6255
  value: `${withTitle} of ${imageCount} image${imageCount === 1 ? "" : "s"} ${withTitle === 1 ? "has" : "have"} a title`,
6199
6256
  status: "warning",
6200
- recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and sends an SEO signal.`
6257
+ recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and helps readers.`
6201
6258
  };
6202
6259
  }
6203
6260
  const sparse = titles.filter((t) => t.trim().split(/\s+/).filter(Boolean).length < 2);
@@ -6325,7 +6382,7 @@ function HealthBadge({ result }) {
6325
6382
  error: { color: "#dc2626", label: "ERR" }
6326
6383
  };
6327
6384
  const c = map[result.category];
6328
- return /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.04em", padding: "2px 6px", borderRadius: 99, background: "#ffffff", color: c.color, fontVariantNumeric: "tabular-nums", flexShrink: 0, marginTop: 1 }, children: c.label });
6385
+ return /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.04em", padding: "2px 6px", borderRadius: 99, background: "#ffffff", color: c.color, fontVariantNumeric: "tabular-nums", flexShrink: 0, marginTop: 1 }, children: c.label });
6329
6386
  }
6330
6387
  function LinkCheckCard({
6331
6388
  urls,
@@ -6336,7 +6393,7 @@ function LinkCheckCard({
6336
6393
  hasRun,
6337
6394
  onCheck
6338
6395
  }) {
6339
- const [openBucket, setOpenBucket] = useState16(null);
6396
+ const [openBucket, setOpenBucket] = useState17(null);
6340
6397
  const haveTypes = !!linksDetailed;
6341
6398
  const detailByUrl = useMemo4(
6342
6399
  () => new Map((linksDetailed || []).map((d) => [d.url, d])),
@@ -6360,7 +6417,7 @@ function LinkCheckCard({
6360
6417
  const renderLinkRow = (url) => {
6361
6418
  const d = detailByUrl.get(url);
6362
6419
  const r = resultByUrl.get(url);
6363
- return /* @__PURE__ */ jsxs15(
6420
+ return /* @__PURE__ */ jsxs16(
6364
6421
  "a",
6365
6422
  {
6366
6423
  href: url,
@@ -6368,37 +6425,37 @@ function LinkCheckCard({
6368
6425
  rel: "noopener noreferrer",
6369
6426
  style: { display: "flex", gap: 8, alignItems: "flex-start", padding: "6px 8px", background: "rgba(0,0,0,0.025)", borderRadius: 6, textDecoration: "none", marginTop: 4 },
6370
6427
  children: [
6371
- r && /* @__PURE__ */ jsx16(HealthBadge, { result: r }),
6372
- /* @__PURE__ */ jsxs15("div", { style: { minWidth: 0, flex: 1 }, children: [
6373
- d?.anchorText && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
6428
+ r && /* @__PURE__ */ jsx17(HealthBadge, { result: r }),
6429
+ /* @__PURE__ */ jsxs16("div", { style: { minWidth: 0, flex: 1 }, children: [
6430
+ d?.anchorText && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
6374
6431
  "\u201C",
6375
6432
  d.anchorText,
6376
6433
  "\u201D"
6377
6434
  ] }),
6378
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
6435
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
6379
6436
  ] })
6380
6437
  ]
6381
6438
  },
6382
6439
  url
6383
6440
  );
6384
6441
  };
6385
- return /* @__PURE__ */ jsxs15("div", { id: "anchor-link-check", style: cardStyle6, children: [
6386
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6387
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
6388
- hasRun && !isLoading && /* @__PURE__ */ jsx16("button", { onClick: onCheck, style: { background: "none", border: "none", fontSize: 10, fontWeight: 600, color: MJH_BLUE, cursor: "pointer", padding: "2px 4px" }, title: "Run again", children: "Re-check" })
6442
+ return /* @__PURE__ */ jsxs16("div", { id: "anchor-link-check", style: cardStyle6, children: [
6443
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6444
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
6445
+ hasRun && !isLoading && /* @__PURE__ */ jsx17("button", { onClick: onCheck, style: { background: "none", border: "none", fontSize: 10, fontWeight: 600, color: MJH_BLUE, cursor: "pointer", padding: "2px 4px" }, title: "Run again", children: "Re-check" })
6389
6446
  ] }),
6390
- urls.length === 0 ? /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ jsxs15(Fragment9, { children: [
6391
- /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
6447
+ urls.length === 0 ? /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ jsxs16(Fragment9, { children: [
6448
+ /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
6392
6449
  urls.length,
6393
6450
  " link",
6394
6451
  urls.length === 1 ? "" : "s",
6395
6452
  " in the body.",
6396
6453
  tiles.length > 0 ? " Tap a box to see which." : ""
6397
6454
  ] }),
6398
- tiles.length > 0 && /* @__PURE__ */ jsx16("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
6455
+ tiles.length > 0 && /* @__PURE__ */ jsx17("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
6399
6456
  const empty = t.urls.length === 0;
6400
6457
  const active = openBucket === t.key && !empty;
6401
- return /* @__PURE__ */ jsxs15(
6458
+ return /* @__PURE__ */ jsxs16(
6402
6459
  "button",
6403
6460
  {
6404
6461
  type: "button",
@@ -6415,24 +6472,24 @@ function LinkCheckCard({
6415
6472
  opacity: empty ? 0.5 : 1
6416
6473
  },
6417
6474
  children: [
6418
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
6419
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
6475
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
6476
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
6420
6477
  ]
6421
6478
  },
6422
6479
  t.key
6423
6480
  );
6424
6481
  }) }),
6425
- open && open.urls.length > 0 && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 8 }, children: [
6426
- open.note && /* @__PURE__ */ jsx16("div", { style: { fontSize: 10.5, color: "#92400e", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, padding: "6px 9px", lineHeight: 1.45, marginBottom: 2 }, children: open.note }),
6482
+ open && open.urls.length > 0 && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8 }, children: [
6483
+ open.note && /* @__PURE__ */ jsx17("div", { style: { fontSize: 10.5, color: "#92400e", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, padding: "6px 9px", lineHeight: 1.45, marginBottom: 2 }, children: open.note }),
6427
6484
  open.urls.map(renderLinkRow)
6428
6485
  ] }),
6429
- hasRun && blockedUrls.length > 0 && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 8, padding: "6px 10px", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, fontSize: 10.5, color: "#92400e", lineHeight: 1.45 }, children: [
6486
+ hasRun && blockedUrls.length > 0 && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8, padding: "6px 10px", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, fontSize: 10.5, color: "#92400e", lineHeight: 1.45 }, children: [
6430
6487
  blockedUrls.length,
6431
6488
  " link",
6432
6489
  blockedUrls.length === 1 ? "" : "s",
6433
6490
  " couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
6434
6491
  ] }),
6435
- !hasRun && !isLoading && /* @__PURE__ */ jsxs15(
6492
+ !hasRun && !isLoading && /* @__PURE__ */ jsxs16(
6436
6493
  "button",
6437
6494
  {
6438
6495
  onClick: onCheck,
@@ -6446,9 +6503,9 @@ function LinkCheckCard({
6446
6503
  ]
6447
6504
  }
6448
6505
  ),
6449
- isLoading && /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
6450
- /* @__PURE__ */ jsx16(LoadingBars, { size: "xs", color: MJH_BLUE }),
6451
- /* @__PURE__ */ jsxs15("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
6506
+ isLoading && /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
6507
+ /* @__PURE__ */ jsx17(LoadingBars, { size: "xs", color: MJH_BLUE }),
6508
+ /* @__PURE__ */ jsxs16("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
6452
6509
  "Checking ",
6453
6510
  urls.length,
6454
6511
  " link",
@@ -6456,9 +6513,9 @@ function LinkCheckCard({
6456
6513
  "..."
6457
6514
  ] })
6458
6515
  ] }),
6459
- error && !isLoading && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 10, padding: "10px 12px", background: "rgba(220,38,38,0.04)", border: "1px solid rgba(220,38,38,0.18)", borderRadius: 8, fontSize: 11, color: "#b91c1c", lineHeight: 1.5 }, children: [
6516
+ error && !isLoading && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 10, padding: "10px 12px", background: "rgba(220,38,38,0.04)", border: "1px solid rgba(220,38,38,0.18)", borderRadius: 8, fontSize: 11, color: "#b91c1c", lineHeight: 1.5 }, children: [
6460
6517
  error,
6461
- /* @__PURE__ */ jsx16("button", { onClick: onCheck, style: { display: "block", marginTop: 6, padding: "4px 10px", fontSize: 11, fontWeight: 700, color: "#ffffff", background: "#dc2626", border: "none", borderRadius: 5, cursor: "pointer" }, children: "Try again" })
6518
+ /* @__PURE__ */ jsx17("button", { onClick: onCheck, style: { display: "block", marginTop: 6, padding: "4px 10px", fontSize: 11, fontWeight: 700, color: "#ffffff", background: "#dc2626", border: "none", borderRadius: 5, cursor: "pointer" }, children: "Try again" })
6462
6519
  ] })
6463
6520
  ] })
6464
6521
  ] });
@@ -6532,13 +6589,13 @@ function TechnicalTab({
6532
6589
  const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
6533
6590
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
6534
6591
  if (isLoading && !hasAnyField) {
6535
- return /* @__PURE__ */ jsxs15("div", { style: { padding: 24, textAlign: "center" }, children: [
6536
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6537
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6592
+ return /* @__PURE__ */ jsxs16("div", { style: { padding: 24, textAlign: "center" }, children: [
6593
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6594
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6538
6595
  ] });
6539
6596
  }
6540
- return /* @__PURE__ */ jsxs15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6541
- /* @__PURE__ */ jsx16(
6597
+ return /* @__PURE__ */ jsxs16("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6598
+ /* @__PURE__ */ jsx17(
6542
6599
  AuditCard2,
6543
6600
  {
6544
6601
  anchorId: "anchor-url-slug",
@@ -6546,10 +6603,10 @@ function TechnicalTab({
6546
6603
  value: urlSlugAudit.value,
6547
6604
  status: urlSlugAudit.status,
6548
6605
  recommendation: urlSlugAudit.recommendation,
6549
- footer: /* @__PURE__ */ jsx16(SlugRedirectNotice, {})
6606
+ footer: /* @__PURE__ */ jsx17(SlugRedirectNotice, {})
6550
6607
  }
6551
6608
  ),
6552
- /* @__PURE__ */ jsx16(
6609
+ /* @__PURE__ */ jsx17(
6553
6610
  LinkCheckCard,
6554
6611
  {
6555
6612
  urls: bodyLinks,
@@ -6561,7 +6618,7 @@ function TechnicalTab({
6561
6618
  onCheck: onCheckLinks
6562
6619
  }
6563
6620
  ),
6564
- wordAudit && /* @__PURE__ */ jsx16(
6621
+ wordAudit && /* @__PURE__ */ jsx17(
6565
6622
  AuditCard2,
6566
6623
  {
6567
6624
  anchorId: "anchor-word-count",
@@ -6575,7 +6632,7 @@ function TechnicalTab({
6575
6632
  const structIdx = structureAudits.findIndex(
6576
6633
  (a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
6577
6634
  );
6578
- return structureAudits.map((a, i) => /* @__PURE__ */ jsx16(
6635
+ return structureAudits.map((a, i) => /* @__PURE__ */ jsx17(
6579
6636
  AuditCard2,
6580
6637
  {
6581
6638
  anchorId: a.label === "Keywords in Headings" ? "anchor-headings-keyword" : a.label === "Looks Like a Heading" ? "anchor-headings-unstyled" : i === structIdx ? "anchor-headings-structure" : void 0,
@@ -6587,17 +6644,17 @@ function TechnicalTab({
6587
6644
  `structure-${i}`
6588
6645
  ));
6589
6646
  })(),
6590
- (headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ jsxs15("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6591
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6592
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6593
- documentFields?.title && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
6594
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
6647
+ (headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ jsxs16("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6648
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6649
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6650
+ documentFields?.title && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
6651
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
6595
6652
  documentFields.title,
6596
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
6653
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
6597
6654
  ] }),
6598
6655
  (headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
6599
6656
  const isH1 = h.level === 1;
6600
- return /* @__PURE__ */ jsxs15(
6657
+ return /* @__PURE__ */ jsxs16(
6601
6658
  "div",
6602
6659
  {
6603
6660
  style: {
@@ -6609,7 +6666,7 @@ function TechnicalTab({
6609
6666
  paddingLeft: Math.max(0, (h.level - 2) * 12)
6610
6667
  },
6611
6668
  children: [
6612
- /* @__PURE__ */ jsxs15("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
6669
+ /* @__PURE__ */ jsxs16("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
6613
6670
  "H",
6614
6671
  h.level
6615
6672
  ] }),
@@ -6619,15 +6676,15 @@ function TechnicalTab({
6619
6676
  i
6620
6677
  );
6621
6678
  }),
6622
- (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6679
+ (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6623
6680
  "+ ",
6624
6681
  (headingsDetailed ?? headings).length - 12,
6625
6682
  " more"
6626
6683
  ] })
6627
6684
  ] }),
6628
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#6b7280", marginTop: 8, lineHeight: 1.4 }, children: headings.length > 0 ? "The title above is your H1; the tool scans the H2-H6 tags below it. Tip: work your primary and/or secondary keyword into a header where it reads naturally." : "The title above is your H1, and there are no H2-H6 subheadings yet. Tip: work your primary and/or secondary keyword into the title where it reads naturally." })
6685
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#6b7280", marginTop: 8, lineHeight: 1.4 }, children: headings.length > 0 ? "The title above is your H1; the tool scans the H2-H6 tags below it. Tip: work your primary and/or secondary keyword into a header where it reads naturally." : "The title above is your H1, and there are no H2-H6 subheadings yet. Tip: work your primary and/or secondary keyword into the title where it reads naturally." })
6629
6686
  ] }),
6630
- imagesAudit && /* @__PURE__ */ jsx16(
6687
+ imagesAudit && /* @__PURE__ */ jsx17(
6631
6688
  AuditCard2,
6632
6689
  {
6633
6690
  anchorId: "anchor-images",
@@ -6637,7 +6694,7 @@ function TechnicalTab({
6637
6694
  recommendation: imagesAudit.recommendation
6638
6695
  }
6639
6696
  ),
6640
- filenameAudit && /* @__PURE__ */ jsx16(
6697
+ filenameAudit && /* @__PURE__ */ jsx17(
6641
6698
  AuditCard2,
6642
6699
  {
6643
6700
  anchorId: "anchor-image-filenames",
@@ -6647,7 +6704,7 @@ function TechnicalTab({
6647
6704
  recommendation: filenameAudit.recommendation
6648
6705
  }
6649
6706
  ),
6650
- altTextAudit && /* @__PURE__ */ jsx16(
6707
+ altTextAudit && /* @__PURE__ */ jsx17(
6651
6708
  AuditCard2,
6652
6709
  {
6653
6710
  anchorId: "anchor-image-alt",
@@ -6657,7 +6714,7 @@ function TechnicalTab({
6657
6714
  recommendation: altTextAudit.recommendation
6658
6715
  }
6659
6716
  ),
6660
- imgTitleAudit && /* @__PURE__ */ jsx16(
6717
+ imgTitleAudit && /* @__PURE__ */ jsx17(
6661
6718
  AuditCard2,
6662
6719
  {
6663
6720
  anchorId: "anchor-image-titles",
@@ -6671,12 +6728,12 @@ function TechnicalTab({
6671
6728
  }
6672
6729
 
6673
6730
  // src/components/SEOCopilotPanel.tsx
6674
- import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
6731
+ import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
6675
6732
  function LogoIcon2() {
6676
- return /* @__PURE__ */ jsxs16("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6677
- /* @__PURE__ */ jsx17("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6678
- /* @__PURE__ */ jsx17("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6679
- /* @__PURE__ */ jsx17("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6733
+ return /* @__PURE__ */ jsxs17("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6734
+ /* @__PURE__ */ jsx18("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6735
+ /* @__PURE__ */ jsx18("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6736
+ /* @__PURE__ */ jsx18("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6680
6737
  ] });
6681
6738
  }
6682
6739
  function PanelContent({
@@ -6748,8 +6805,8 @@ function PanelContent({
6748
6805
  const onboardSite = publication || "default";
6749
6806
  const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
6750
6807
  const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
6751
- const [popupMode, setPopupMode] = useState17("hidden");
6752
- const [popupClosing, setPopupClosing] = useState17(false);
6808
+ const [popupMode, setPopupMode] = useState18("hidden");
6809
+ const [popupClosing, setPopupClosing] = useState18(false);
6753
6810
  const onboardTimerRef = useRef12(null);
6754
6811
  const onboardFadeRef = useRef12(null);
6755
6812
  useEffect12(() => {
@@ -6824,7 +6881,7 @@ function PanelContent({
6824
6881
  { id: "meta", label: "Meta", beta: true },
6825
6882
  { id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
6826
6883
  ];
6827
- return /* @__PURE__ */ jsxs16(
6884
+ return /* @__PURE__ */ jsxs17(
6828
6885
  "div",
6829
6886
  {
6830
6887
  className: "seo-copilot-panel",
@@ -6839,9 +6896,9 @@ function PanelContent({
6839
6896
  position: "relative"
6840
6897
  },
6841
6898
  children: [
6842
- /* @__PURE__ */ jsx17("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6843
- popupMode !== "hidden" && /* @__PURE__ */ jsx17(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6844
- /* @__PURE__ */ jsxs16(
6899
+ /* @__PURE__ */ jsx18("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6900
+ popupMode !== "hidden" && /* @__PURE__ */ jsx18(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6901
+ /* @__PURE__ */ jsxs17(
6845
6902
  "div",
6846
6903
  {
6847
6904
  onMouseDown: isFloating ? onDragStart : void 0,
@@ -6859,16 +6916,16 @@ function PanelContent({
6859
6916
  flexShrink: 0
6860
6917
  },
6861
6918
  children: [
6862
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6863
- /* @__PURE__ */ jsx17(LogoIcon2, {}),
6864
- /* @__PURE__ */ jsxs16("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6865
- /* @__PURE__ */ jsx17("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6866
- /* @__PURE__ */ jsx17("span", { style: { color: MJH_SLATE }, children: " copilot" })
6919
+ /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6920
+ /* @__PURE__ */ jsx18(LogoIcon2, {}),
6921
+ /* @__PURE__ */ jsxs17("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6922
+ /* @__PURE__ */ jsx18("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6923
+ /* @__PURE__ */ jsx18("span", { style: { color: MJH_SLATE }, children: " copilot" })
6867
6924
  ] })
6868
6925
  ] }),
6869
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6870
- /* @__PURE__ */ jsx17(OnboardingInfoButton, { onClick: openPopupPersistent }),
6871
- /* @__PURE__ */ jsx17(
6926
+ /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6927
+ /* @__PURE__ */ jsx18(OnboardingInfoButton, { onClick: openPopupPersistent }),
6928
+ /* @__PURE__ */ jsx18(
6872
6929
  ReportProblemButton,
6873
6930
  {
6874
6931
  activeTab,
@@ -6878,7 +6935,7 @@ function PanelContent({
6878
6935
  primaryKeyword: effectivePrimary
6879
6936
  }
6880
6937
  ),
6881
- isFloating && onToggleFullscreen && /* @__PURE__ */ jsx17(
6938
+ isFloating && onToggleFullscreen && /* @__PURE__ */ jsx18(
6882
6939
  "button",
6883
6940
  {
6884
6941
  onClick: (e) => {
@@ -6900,16 +6957,16 @@ function PanelContent({
6900
6957
  fontWeight: 600,
6901
6958
  transition: "all 150ms"
6902
6959
  },
6903
- children: isFullscreen ? /* @__PURE__ */ jsxs16(Fragment10, { children: [
6904
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M3.28 2.22a.75.75 0 00-1.06 1.06L5.44 6.5H3.75a.75.75 0 000 1.5h4.5A.75.75 0 009 7.25v-4.5a.75.75 0 00-1.5 0v1.69L4.28 1.22a.75.75 0 00-1 1zM16.72 17.78a.75.75 0 001.06-1.06L14.56 13.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5a.75.75 0 001.5 0v-1.69l3.22 3.22z" }) }),
6960
+ children: isFullscreen ? /* @__PURE__ */ jsxs17(Fragment10, { children: [
6961
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M3.28 2.22a.75.75 0 00-1.06 1.06L5.44 6.5H3.75a.75.75 0 000 1.5h4.5A.75.75 0 009 7.25v-4.5a.75.75 0 00-1.5 0v1.69L4.28 1.22a.75.75 0 00-1 1zM16.72 17.78a.75.75 0 001.06-1.06L14.56 13.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5a.75.75 0 001.5 0v-1.69l3.22 3.22z" }) }),
6905
6962
  "Exit fullscreen"
6906
- ] }) : /* @__PURE__ */ jsxs16(Fragment10, { children: [
6907
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M13.28 7.78l3.22-3.22v1.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h1.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25a.75.75 0 001.5 0v-1.69l3.22 3.22a.75.75 0 001.06-1.06L4.56 14.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5z" }) }),
6963
+ ] }) : /* @__PURE__ */ jsxs17(Fragment10, { children: [
6964
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M13.28 7.78l3.22-3.22v1.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h1.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25a.75.75 0 001.5 0v-1.69l3.22 3.22a.75.75 0 001.06-1.06L4.56 14.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5z" }) }),
6908
6965
  "Fullscreen"
6909
6966
  ] })
6910
6967
  }
6911
6968
  ),
6912
- isFloating && onToggleFloat && /* @__PURE__ */ jsxs16(
6969
+ isFloating && onToggleFloat && /* @__PURE__ */ jsxs17(
6913
6970
  "button",
6914
6971
  {
6915
6972
  onClick: (e) => {
@@ -6932,7 +6989,7 @@ function PanelContent({
6932
6989
  transition: "all 150ms"
6933
6990
  },
6934
6991
  children: [
6935
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17(
6992
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18(
6936
6993
  "path",
6937
6994
  {
6938
6995
  fillRule: "evenodd",
@@ -6944,7 +7001,7 @@ function PanelContent({
6944
7001
  ]
6945
7002
  }
6946
7003
  ),
6947
- !isFloating && onToggleFloat && /* @__PURE__ */ jsx17(
7004
+ !isFloating && onToggleFloat && /* @__PURE__ */ jsx18(
6948
7005
  "button",
6949
7006
  {
6950
7007
  onClick: (e) => {
@@ -6963,13 +7020,13 @@ function PanelContent({
6963
7020
  transition: "color 150ms"
6964
7021
  },
6965
7022
  title: "Pop out",
6966
- children: /* @__PURE__ */ jsxs16("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
6967
- /* @__PURE__ */ jsx17("path", { d: "M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z" }),
6968
- /* @__PURE__ */ jsx17("path", { d: "M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z" })
7023
+ children: /* @__PURE__ */ jsxs17("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
7024
+ /* @__PURE__ */ jsx18("path", { d: "M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z" }),
7025
+ /* @__PURE__ */ jsx18("path", { d: "M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z" })
6969
7026
  ] })
6970
7027
  }
6971
7028
  ),
6972
- isLoading && /* @__PURE__ */ jsx17(
7029
+ isLoading && /* @__PURE__ */ jsx18(
6973
7030
  "div",
6974
7031
  {
6975
7032
  style: {
@@ -6981,7 +7038,7 @@ function PanelContent({
6981
7038
  }
6982
7039
  }
6983
7040
  ),
6984
- onClose && /* @__PURE__ */ jsx17(
7041
+ onClose && /* @__PURE__ */ jsx18(
6985
7042
  "button",
6986
7043
  {
6987
7044
  onClick: (e) => {
@@ -7000,11 +7057,11 @@ function PanelContent({
7000
7057
  transition: "color 150ms"
7001
7058
  },
7002
7059
  title: "Close",
7003
- children: /* @__PURE__ */ jsx17("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
7060
+ children: /* @__PURE__ */ jsx18("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
7004
7061
  }
7005
7062
  )
7006
7063
  ] }),
7007
- /* @__PURE__ */ jsx17(
7064
+ /* @__PURE__ */ jsx18(
7008
7065
  "div",
7009
7066
  {
7010
7067
  style: {
@@ -7023,8 +7080,8 @@ function PanelContent({
7023
7080
  ]
7024
7081
  }
7025
7082
  ),
7026
- /* @__PURE__ */ jsx17(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
7027
- /* @__PURE__ */ jsx17(
7083
+ /* @__PURE__ */ jsx18(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
7084
+ /* @__PURE__ */ jsx18(
7028
7085
  "div",
7029
7086
  {
7030
7087
  style: {
@@ -7040,8 +7097,8 @@ function PanelContent({
7040
7097
  children: "Recommendations are generated by AI. Verify details before publishing."
7041
7098
  }
7042
7099
  ),
7043
- /* @__PURE__ */ jsxs16("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
7044
- /* @__PURE__ */ jsxs16(
7100
+ /* @__PURE__ */ jsxs17("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
7101
+ /* @__PURE__ */ jsxs17(
7045
7102
  "div",
7046
7103
  {
7047
7104
  style: {
@@ -7052,7 +7109,7 @@ function PanelContent({
7052
7109
  background: RECS_ZONE_BG
7053
7110
  },
7054
7111
  children: [
7055
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7112
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7056
7113
  KeywordPanel,
7057
7114
  {
7058
7115
  text,
@@ -7064,11 +7121,12 @@ function PanelContent({
7064
7121
  onSelectSecondary,
7065
7122
  documentFields,
7066
7123
  documentId,
7067
- externalAnalysis: keywordAnalysisState
7124
+ externalAnalysis: keywordAnalysisState,
7125
+ focusKeyword: summaryOps.focusKeyword
7068
7126
  },
7069
7127
  documentId || "default"
7070
7128
  ) }),
7071
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7129
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7072
7130
  SummaryTab,
7073
7131
  {
7074
7132
  text,
@@ -7081,10 +7139,11 @@ function PanelContent({
7081
7139
  linkCheckResults: technicalOps.linkCheckResults,
7082
7140
  isAnyLoading: summaryOps.isAnyLoading,
7083
7141
  onGenerateAll: summaryOps.onGenerateAll,
7084
- onItemClick: summaryOps.onItemClick
7142
+ onItemClick: summaryOps.onItemClick,
7143
+ onKeywordClick: summaryOps.onKeywordClick
7085
7144
  }
7086
7145
  ) }),
7087
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7146
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7088
7147
  AEOTab,
7089
7148
  {
7090
7149
  text,
@@ -7100,7 +7159,7 @@ function PanelContent({
7100
7159
  loadContentSuggestions: aeoOps.loadContentSuggestions
7101
7160
  }
7102
7161
  ) }),
7103
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7162
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7104
7163
  LinkingTab,
7105
7164
  {
7106
7165
  analysis: keywordAnalysisState.analysis,
@@ -7116,8 +7175,8 @@ function PanelContent({
7116
7175
  documentType
7117
7176
  }
7118
7177
  ) }),
7119
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
7120
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7178
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
7179
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7121
7180
  TechnicalTab,
7122
7181
  {
7123
7182
  text,
@@ -7135,7 +7194,7 @@ function PanelContent({
7135
7194
  ]
7136
7195
  }
7137
7196
  ),
7138
- chatOpen && /* @__PURE__ */ jsx17(
7197
+ chatOpen && /* @__PURE__ */ jsx18(
7139
7198
  "div",
7140
7199
  {
7141
7200
  onMouseDown,
@@ -7148,10 +7207,10 @@ function PanelContent({
7148
7207
  justifyContent: "center",
7149
7208
  flexShrink: 0
7150
7209
  },
7151
- children: /* @__PURE__ */ jsx17("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
7210
+ children: /* @__PURE__ */ jsx18("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
7152
7211
  }
7153
7212
  ),
7154
- /* @__PURE__ */ jsxs16(
7213
+ /* @__PURE__ */ jsxs17(
7155
7214
  "div",
7156
7215
  {
7157
7216
  style: {
@@ -7164,7 +7223,7 @@ function PanelContent({
7164
7223
  background: CHAT_ZONE_BG
7165
7224
  },
7166
7225
  children: [
7167
- /* @__PURE__ */ jsxs16(
7226
+ /* @__PURE__ */ jsxs17(
7168
7227
  "button",
7169
7228
  {
7170
7229
  onClick: () => onChatOpenChange(!chatOpen),
@@ -7185,7 +7244,7 @@ function PanelContent({
7185
7244
  flexShrink: 0
7186
7245
  },
7187
7246
  children: [
7188
- /* @__PURE__ */ jsx17(
7247
+ /* @__PURE__ */ jsx18(
7189
7248
  "span",
7190
7249
  {
7191
7250
  style: {
@@ -7198,7 +7257,7 @@ function PanelContent({
7198
7257
  children: "Chat"
7199
7258
  }
7200
7259
  ),
7201
- /* @__PURE__ */ jsx17(
7260
+ /* @__PURE__ */ jsx18(
7202
7261
  "svg",
7203
7262
  {
7204
7263
  width: "12",
@@ -7206,7 +7265,7 @@ function PanelContent({
7206
7265
  viewBox: "0 0 20 20",
7207
7266
  fill: "rgba(0,0,0,0.55)",
7208
7267
  style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
7209
- children: /* @__PURE__ */ jsx17(
7268
+ children: /* @__PURE__ */ jsx18(
7210
7269
  "path",
7211
7270
  {
7212
7271
  fillRule: "evenodd",
@@ -7219,7 +7278,7 @@ function PanelContent({
7219
7278
  ]
7220
7279
  }
7221
7280
  ),
7222
- /* @__PURE__ */ jsx17(
7281
+ /* @__PURE__ */ jsx18(
7223
7282
  "div",
7224
7283
  {
7225
7284
  style: {
@@ -7229,7 +7288,7 @@ function PanelContent({
7229
7288
  flexDirection: "column",
7230
7289
  minHeight: 0
7231
7290
  },
7232
- children: /* @__PURE__ */ jsx17(
7291
+ children: /* @__PURE__ */ jsx18(
7233
7292
  ChatPanel,
7234
7293
  {
7235
7294
  messages: chatState.messages,
@@ -7282,7 +7341,7 @@ function SEOCopilotInner({ config, onClose }) {
7282
7341
  }
7283
7342
  return [];
7284
7343
  }, [seedCacheKey]);
7285
- const [seedKeywords, setSeedKeywordsRaw] = useState17(loadSeedsFromCache);
7344
+ const [seedKeywords, setSeedKeywordsRaw] = useState18(loadSeedsFromCache);
7286
7345
  const setSeedKeywords = useCallback5(
7287
7346
  (seeds) => {
7288
7347
  setSeedKeywordsRaw(seeds);
@@ -7306,7 +7365,13 @@ function SEOCopilotInner({ config, onClose }) {
7306
7365
  }
7307
7366
  setSeedKeywordsRaw(loadSeedsFromCache());
7308
7367
  }, [documentId, loadSeedsFromCache]);
7309
- const [activeTab, setActiveTab] = useState17("keywords");
7368
+ const [activeTab, setActiveTab] = useState18("keywords");
7369
+ const [focusKeyword, setFocusKeyword] = useState18(void 0);
7370
+ const [focusDoc, setFocusDoc] = useState18(documentId);
7371
+ if (focusDoc !== documentId) {
7372
+ setFocusDoc(documentId);
7373
+ setFocusKeyword(void 0);
7374
+ }
7310
7375
  const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
7311
7376
  const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
7312
7377
  const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
@@ -7334,8 +7399,8 @@ function SEOCopilotInner({ config, onClose }) {
7334
7399
  const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
7335
7400
  const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
7336
7401
  const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
7337
- const [isCSLoading, setIsCSLoading] = useState17(false);
7338
- const [csError, setCsError] = useState17(null);
7402
+ const [isCSLoading, setIsCSLoading] = useState18(false);
7403
+ const [csError, setCsError] = useState18(null);
7339
7404
  const aeoOpVersionRef = useRef12(0);
7340
7405
  const csAbortRef = useRef12(null);
7341
7406
  const didInitAeoRef = useRef12(false);
@@ -7373,9 +7438,9 @@ function SEOCopilotInner({ config, onClose }) {
7373
7438
  }, [apiUrl, text, effectivePrimary, effectivePublication]);
7374
7439
  const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
7375
7440
  const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
7376
- const [isLinkingLoading, setIsLinkingLoading] = useState17(false);
7377
- const [linkingError, setLinkingError] = useState17(null);
7378
- const [linkingFetchedText, setLinkingFetchedText] = useState17("");
7441
+ const [isLinkingLoading, setIsLinkingLoading] = useState18(false);
7442
+ const [linkingError, setLinkingError] = useState18(null);
7443
+ const [linkingFetchedText, setLinkingFetchedText] = useState18("");
7379
7444
  const linkingVersionRef = useRef12(0);
7380
7445
  const linkingAbortRef = useRef12(null);
7381
7446
  const didInitLinkingRef = useRef12(false);
@@ -7444,8 +7509,8 @@ function SEOCopilotInner({ config, onClose }) {
7444
7509
  const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
7445
7510
  const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
7446
7511
  const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
7447
- const [isLinkCheckLoading, setIsLinkCheckLoading] = useState17(false);
7448
- const [linkCheckError, setLinkCheckError] = useState17(null);
7512
+ const [isLinkCheckLoading, setIsLinkCheckLoading] = useState18(false);
7513
+ const [linkCheckError, setLinkCheckError] = useState18(null);
7449
7514
  const linkCheckVersionRef = useRef12(0);
7450
7515
  const didInitLinkCheckRef = useRef12(false);
7451
7516
  useEffect12(() => {
@@ -7575,7 +7640,7 @@ function SEOCopilotInner({ config, onClose }) {
7575
7640
  },
7576
7641
  [floatSize]
7577
7642
  );
7578
- const panelContent = /* @__PURE__ */ jsx17(
7643
+ const panelContent = /* @__PURE__ */ jsx18(
7579
7644
  PanelContent,
7580
7645
  {
7581
7646
  initialPublication: effectivePublication,
@@ -7642,6 +7707,11 @@ function SEOCopilotInner({ config, onClose }) {
7642
7707
  summaryOps: {
7643
7708
  isAnyLoading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading || keywordAnalysisState.isDeepLoading || isCSLoading || isLinkingLoading || isLinkCheckLoading,
7644
7709
  onGenerateAll: runAllAnalyses,
7710
+ focusKeyword,
7711
+ onKeywordClick: (term) => {
7712
+ setActiveTab("keywords");
7713
+ setFocusKeyword((prev) => ({ term, nonce: (prev?.nonce ?? 0) + 1 }));
7714
+ },
7645
7715
  onItemClick: (item) => {
7646
7716
  setActiveTab(item.jumpTo.tab);
7647
7717
  const id = item.jumpTo.anchorId;
@@ -7657,7 +7727,7 @@ function SEOCopilotInner({ config, onClose }) {
7657
7727
  }
7658
7728
  }
7659
7729
  );
7660
- const floatingPanel = /* @__PURE__ */ jsxs16(
7730
+ const floatingPanel = /* @__PURE__ */ jsxs17(
7661
7731
  "div",
7662
7732
  {
7663
7733
  style: {
@@ -7675,7 +7745,7 @@ function SEOCopilotInner({ config, onClose }) {
7675
7745
  },
7676
7746
  children: [
7677
7747
  panelContent,
7678
- !isFullscreen && /* @__PURE__ */ jsx17(
7748
+ !isFullscreen && /* @__PURE__ */ jsx18(
7679
7749
  "div",
7680
7750
  {
7681
7751
  onMouseDown: handleResizeStart,
@@ -7690,9 +7760,9 @@ function SEOCopilotInner({ config, onClose }) {
7690
7760
  alignItems: "center",
7691
7761
  justifyContent: "center"
7692
7762
  },
7693
- children: /* @__PURE__ */ jsxs16("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7694
- /* @__PURE__ */ jsx17("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7695
- /* @__PURE__ */ jsx17("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7763
+ children: /* @__PURE__ */ jsxs17("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7764
+ /* @__PURE__ */ jsx18("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7765
+ /* @__PURE__ */ jsx18("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7696
7766
  ] })
7697
7767
  }
7698
7768
  )
@@ -7700,8 +7770,8 @@ function SEOCopilotInner({ config, onClose }) {
7700
7770
  }
7701
7771
  );
7702
7772
  if (isFloating) {
7703
- return /* @__PURE__ */ jsxs16(Fragment10, { children: [
7704
- /* @__PURE__ */ jsx17(
7773
+ return /* @__PURE__ */ jsxs17(Fragment10, { children: [
7774
+ /* @__PURE__ */ jsx18(
7705
7775
  "div",
7706
7776
  {
7707
7777
  style: {
@@ -7711,30 +7781,30 @@ function SEOCopilotInner({ config, onClose }) {
7711
7781
  alignItems: "center",
7712
7782
  justifyContent: "center"
7713
7783
  },
7714
- children: /* @__PURE__ */ jsx17("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7784
+ children: /* @__PURE__ */ jsx18("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7715
7785
  }
7716
7786
  ),
7717
7787
  typeof document !== "undefined" && createPortal(floatingPanel, document.body)
7718
7788
  ] });
7719
7789
  }
7720
- return /* @__PURE__ */ jsx17("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7790
+ return /* @__PURE__ */ jsx18("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7721
7791
  }
7722
7792
  function SEOCopilotPanel({ config, onClose }) {
7723
- return /* @__PURE__ */ jsx17(
7793
+ return /* @__PURE__ */ jsx18(
7724
7794
  Suspense,
7725
7795
  {
7726
- fallback: /* @__PURE__ */ jsxs16("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7727
- /* @__PURE__ */ jsx17(LoadingBars, {}),
7728
- /* @__PURE__ */ jsx17("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7796
+ fallback: /* @__PURE__ */ jsxs17("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7797
+ /* @__PURE__ */ jsx18(LoadingBars, {}),
7798
+ /* @__PURE__ */ jsx18("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7729
7799
  ] }),
7730
- children: /* @__PURE__ */ jsx17(ConfigProvider, { config, children: /* @__PURE__ */ jsx17(SEOCopilotInner, { config, onClose }) })
7800
+ children: /* @__PURE__ */ jsx18(ConfigProvider, { config, children: /* @__PURE__ */ jsx18(SEOCopilotInner, { config, onClose }) })
7731
7801
  }
7732
7802
  );
7733
7803
  }
7734
7804
  function LoadingBars({ size = "sm", color = MJH_GOLD }) {
7735
7805
  const barWidth = size === "xs" ? 4 : 6;
7736
7806
  const containerHeight = size === "xs" ? 10 : 14;
7737
- return /* @__PURE__ */ jsx17("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx17(
7807
+ return /* @__PURE__ */ jsx18("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx18(
7738
7808
  "div",
7739
7809
  {
7740
7810
  style: {
@@ -7795,9 +7865,9 @@ function seoCopilotInspector(config) {
7795
7865
  icon: SEOIcon,
7796
7866
  // Toolbar placement test: showAsAction renders this as a button in the document
7797
7867
  // toolbar (where editors expect it). The original crash came from passing
7798
- // showAsAction WITHOUT a tone; pairing it with a valid string tone is how Sanity's
7868
+ // showAsAction without a tone; pairing it with a valid string tone is how Sanity's
7799
7869
  // own built-in inspectors (Validation, etc.) keep their toolbar button safely.
7800
- // If this still crashes in Nick's studio, remove these two lines to fall back to
7870
+ // If this still crashes in the production Studio, remove these two lines to fall back to
7801
7871
  // the "..." overflow menu (the known-safe placement).
7802
7872
  showAsAction: true,
7803
7873
  tone: "default"
@@ -7809,15 +7879,16 @@ function seoCopilotInspector(config) {
7809
7879
  }
7810
7880
 
7811
7881
  // src/index.ts
7812
- var seoCopilot = definePlugin((config) => ({
7813
- name: "seo-copilot",
7814
- document: {
7815
- inspectors: (prev) => {
7816
- return [...prev, seoCopilotInspector(config)];
7882
+ var seoCopilot = definePlugin((config) => {
7883
+ return {
7884
+ name: "seo-copilot",
7885
+ document: {
7886
+ inspectors: (prev) => {
7887
+ return [...prev, seoCopilotInspector(config)];
7888
+ }
7817
7889
  }
7818
- }
7819
- }));
7890
+ };
7891
+ });
7820
7892
  export {
7821
7893
  seoCopilot
7822
7894
  };
7823
- //# sourceMappingURL=index.mjs.map