sanity-plugin-seo-copilot 0.2.12 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -33,14 +33,14 @@ __export(index_exports, {
33
33
  seoCopilot: () => seoCopilot
34
34
  });
35
35
  module.exports = __toCommonJS(index_exports);
36
- var import_sanity4 = require("sanity");
36
+ var import_sanity5 = require("sanity");
37
37
 
38
38
  // src/inspector.ts
39
- var import_react19 = require("react");
39
+ var import_react20 = require("react");
40
40
 
41
41
  // src/components/SEOCopilotPanel.tsx
42
- var import_react18 = require("react");
43
- var import_sanity3 = require("sanity");
42
+ var import_react19 = require("react");
43
+ var import_sanity4 = require("sanity");
44
44
  var import_react_dom = require("react-dom");
45
45
 
46
46
  // src/hooks/useDocumentContent.ts
@@ -84,30 +84,83 @@ function extractHeadingsDetailed(blocks) {
84
84
  }
85
85
  return out;
86
86
  }
87
- function extractBodyLinks(blocks) {
88
- const urls = /* @__PURE__ */ new Set();
87
+ function normalizeLink(raw) {
88
+ const s = raw.trim().replace(/[.,;:!?]+$/, "");
89
+ if (!s) return null;
90
+ if (/^https?:\/\//i.test(s)) return s;
91
+ if (/^www\.\S+\.\S+/i.test(s) || /^[a-z0-9-]+(\.[a-z0-9-]+)+(\/|$)/i.test(s)) return `https://${s}`;
92
+ return null;
93
+ }
94
+ var UNSTYLED_HEADING_SCAN_CAP = 600;
95
+ function extractUnstyledHeadings(blocks) {
96
+ if (!Array.isArray(blocks)) return [];
97
+ const items = blocks.slice(0, UNSTYLED_HEADING_SCAN_CAP).map((b) => {
98
+ if (!b || b._type !== "block") return null;
99
+ const style = b.style || "normal";
100
+ const text = (b.children || []).map((c) => c.text || "").join("").trim();
101
+ return {
102
+ isHeading: /^h[1-6]$/.test(style),
103
+ isPlain: style === "normal",
104
+ isList: typeof b.listItem === "string" && b.listItem.length > 0,
105
+ text,
106
+ words: text ? text.split(/\s+/).filter(Boolean).length : 0
107
+ };
108
+ });
109
+ const out = [];
110
+ for (let i = 0; i < items.length; i++) {
111
+ const it = items[i];
112
+ if (!it || it.isHeading || it.isList || !it.isPlain) continue;
113
+ if (it.words < 2 || it.words > 9) continue;
114
+ if (/[.!?]$/.test(it.text)) continue;
115
+ if (!/[A-Za-z]/.test(it.text)) continue;
116
+ if (/https?:\/\/|doi:|\baccessed\b|image credit|stock\.adobe|^figure\b|^table\b|^source[:s]?\b|^references?\b/i.test(it.text)) continue;
117
+ let next = null;
118
+ for (let j = i + 1; j < items.length; j++) {
119
+ if (items[j] && items[j].text) {
120
+ next = items[j];
121
+ break;
122
+ }
123
+ }
124
+ if (!next || next.isHeading || next.words < 12) continue;
125
+ out.push(it.text);
126
+ if (out.length >= 8) break;
127
+ }
128
+ return out;
129
+ }
130
+ function extractBodyLinksDetailed(blocks) {
131
+ const linked = /* @__PURE__ */ new Set();
132
+ const all = /* @__PURE__ */ new Set();
133
+ const anchorByUrl = /* @__PURE__ */ new Map();
89
134
  if (Array.isArray(blocks)) {
90
135
  for (const block of blocks) {
91
136
  if (block._type === "block" && Array.isArray(block.markDefs)) {
92
137
  for (const md of block.markDefs) {
93
138
  const href = md.href || md.url;
94
- if (typeof href === "string" && /^https?:\/\//i.test(href)) {
95
- urls.add(href.trim());
96
- }
139
+ if (typeof href !== "string") continue;
140
+ const n = normalizeLink(href);
141
+ if (!n) continue;
142
+ linked.add(n);
143
+ all.add(n);
144
+ const anchor = (block.children || []).filter((c) => Array.isArray(c.marks) && md._key && c.marks.includes(md._key)).map((c) => c.text || "").join("").trim();
145
+ if (anchor && !anchorByUrl.has(n)) anchorByUrl.set(n, anchor);
97
146
  }
98
147
  }
99
148
  }
100
- }
101
- if (Array.isArray(blocks)) {
102
149
  for (const block of blocks) {
103
150
  if (block._type === "block" && Array.isArray(block.children)) {
104
151
  const blockText = block.children.map((c) => c.text || "").join(" ");
105
- const matches = blockText.match(/https?:\/\/[^\s"'<>)\]]+/g);
106
- if (matches) matches.forEach((u) => urls.add(u.replace(/[.,;:!?]+$/, "")));
152
+ const matches = blockText.match(/(?:https?:\/\/|www\.)[^\s"'<>)\]]+/gi);
153
+ if (matches) for (const u of matches) {
154
+ const n = normalizeLink(u);
155
+ if (n) all.add(n);
156
+ }
107
157
  }
108
158
  }
109
159
  }
110
- return Array.from(urls);
160
+ return [...all].map((url) => ({ url, hyperlinked: linked.has(url), anchorText: anchorByUrl.get(url) }));
161
+ }
162
+ function extractBodyLinks(blocks) {
163
+ return extractBodyLinksDetailed(blocks).map((l) => l.url);
111
164
  }
112
165
  function detectSlug(val) {
113
166
  if (!val) return void 0;
@@ -182,6 +235,86 @@ function detectAuthor(val) {
182
235
  }
183
236
  return { authorIsReference: false };
184
237
  }
238
+ var FACT_CHECK_STATUS_WORDS = /* @__PURE__ */ new Set([
239
+ "pending",
240
+ "approved",
241
+ "rejected",
242
+ "done",
243
+ "complete",
244
+ "completed",
245
+ "in review",
246
+ "in progress",
247
+ "not started",
248
+ "draft",
249
+ "review",
250
+ "reviewed",
251
+ "unreviewed",
252
+ "checked",
253
+ "unchecked",
254
+ "verified",
255
+ "unverified",
256
+ "true",
257
+ "false",
258
+ "yes",
259
+ "no",
260
+ "n/a",
261
+ "na",
262
+ "none",
263
+ "tbd",
264
+ "todo",
265
+ "to do"
266
+ ]);
267
+ function isLikelyPersonName(s) {
268
+ const t = s.trim().toLowerCase();
269
+ if (!t || FACT_CHECK_STATUS_WORDS.has(t)) return false;
270
+ return /[a-z]/i.test(s);
271
+ }
272
+ function detectFactChecker(val) {
273
+ if (!val) return { factCheckerIsReference: false };
274
+ const candidateFields = [
275
+ "factChecker",
276
+ "factCheckers",
277
+ "factCheckedBy",
278
+ "reviewer",
279
+ "reviewers",
280
+ "reviewedBy",
281
+ "medicalReviewer",
282
+ "medicallyReviewedBy"
283
+ ];
284
+ const dynamic = Object.keys(val).filter(
285
+ (k) => (
286
+ // Require "checker"/"checked by"/"reviewer"/"reviewed by" - NOT a bare "check" flag.
287
+ /factchecker|fact.?checked.?by|reviewer|reviewed.?by/i.test(k) && // never date/timestamp fields (lastReviewedAt, medicallyReviewedAt, reviewedDate),
288
+ // free-text/status/flag sidecars (reviewerNotes, reviewStatus), nor image/url/id fields.
289
+ !/at$|date$|on$|url|link|count|note|comment|status|flag|bool|photo|image|avatar|picture|id$/i.test(k)
290
+ )
291
+ );
292
+ const fields = Array.from(/* @__PURE__ */ new Set([...candidateFields, ...dynamic]));
293
+ for (const f of fields) {
294
+ const raw = val[f];
295
+ if (!raw) continue;
296
+ if (Array.isArray(raw)) {
297
+ const names = raw.filter((x) => typeof x === "string" && isLikelyPersonName(x)).map((x) => x.trim());
298
+ if (names.length > 0) return { factCheckerName: names.slice(0, 3).join(", "), factCheckerIsReference: false };
299
+ }
300
+ const first = Array.isArray(raw) ? raw[0] : raw;
301
+ if (!first) continue;
302
+ if (typeof first === "string") {
303
+ const trimmed = first.trim();
304
+ if (trimmed && isLikelyPersonName(trimmed)) return { factCheckerName: trimmed, factCheckerIsReference: false };
305
+ continue;
306
+ }
307
+ if (typeof first === "object" && first !== null) {
308
+ const o = first;
309
+ const name = [o.name, o.fullName, o.displayName].find((v) => typeof v === "string" && isLikelyPersonName(v));
310
+ if (name) return { factCheckerName: name, factCheckerIsReference: false };
311
+ if (typeof o._ref === "string" || o._type === "reference") {
312
+ return { factCheckerIsReference: true };
313
+ }
314
+ }
315
+ }
316
+ return { factCheckerIsReference: false };
317
+ }
185
318
  function extractImageMeta(value) {
186
319
  const names = [];
187
320
  const titles = [];
@@ -220,6 +353,7 @@ function buildDocumentFields(value) {
220
353
  const title = typeof val?.title === "string" ? val.title : void 0;
221
354
  const body = val?.body;
222
355
  const { authorName, authorCredentials, authorBioUrl, authorIsReference } = detectAuthor(val);
356
+ const { factCheckerName, factCheckerIsReference } = detectFactChecker(val);
223
357
  const imageMeta = val ? extractImageMeta(val) : { names: [], titles: [], count: 0 };
224
358
  return {
225
359
  title: title || void 0,
@@ -231,13 +365,17 @@ function buildDocumentFields(value) {
231
365
  imageCount: imageMeta.count,
232
366
  headings: extractHeadings(body),
233
367
  headingsDetailed: extractHeadingsDetailed(body),
368
+ unstyledHeadings: extractUnstyledHeadings(body),
234
369
  bodyLinks: extractBodyLinks(body),
370
+ bodyLinksDetailed: extractBodyLinksDetailed(body),
235
371
  contentCategory: typeof val?.contentCategory === "string" ? val.contentCategory : typeof val?.category === "string" ? val.category : void 0,
236
372
  contentPlacement: Array.isArray(val?.contentPlacement) ? val.contentPlacement : void 0,
237
373
  authorName,
238
374
  authorCredentials,
239
375
  authorBioUrl,
240
376
  authorIsReference,
377
+ factCheckerName,
378
+ factCheckerIsReference,
241
379
  // `published` is MJH's date field; `publishedAt`/`publishDate` cover other schemas
242
380
  publishedAt: [val?.publishedAt, val?.publishDate, val?.published, val?._createdAt].find((v) => typeof v === "string" && v.trim().length > 0),
243
381
  // `updatedOn` is MJH's "Updated On" field. `updatedAt` is the standard Sanity convention.
@@ -302,16 +440,15 @@ function safeParseJson(text) {
302
440
  throw new Error("Invalid JSON response from server");
303
441
  }
304
442
  }
305
- async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword, signal) {
443
+ async function fetchAnalysis(apiUrl, content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword, signal) {
306
444
  const response = await fetch(`${apiUrl}/api/seo-copilot/analyze`, {
307
445
  method: "POST",
308
446
  headers: { "Content-Type": "application/json" },
309
- body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword }),
447
+ body: JSON.stringify({ content, mode, publication, seedKeywords, documentFields, focusKeyword, secondaryKeyword }),
310
448
  signal
311
449
  });
312
450
  const text = await response.text();
313
451
  if (!response.ok) {
314
- const err = safeParseJson(text);
315
452
  if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
316
453
  if (response.status >= 500) throw new Error("Could not reach the SEO service.");
317
454
  throw new Error("Something went wrong analyzing this document.");
@@ -326,7 +463,6 @@ async function fetchChatStream(apiUrl, messages, documentContext, publication, k
326
463
  signal
327
464
  });
328
465
  if (!response.ok) {
329
- const err = await response.json().catch(() => ({ error: "Request failed" }));
330
466
  if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
331
467
  if (response.status >= 500) throw new Error("Could not reach the SEO service.");
332
468
  throw new Error("Something went wrong. Please try again.");
@@ -334,11 +470,12 @@ async function fetchChatStream(apiUrl, messages, documentContext, publication, k
334
470
  return response.body;
335
471
  }
336
472
  async function submitFeedback(apiUrl, data) {
337
- await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
473
+ const res = await fetch(`${apiUrl}/api/seo-copilot/feedback`, {
338
474
  method: "POST",
339
475
  headers: { "Content-Type": "application/json" },
340
476
  body: JSON.stringify(data)
341
477
  });
478
+ if (!res.ok) throw new Error(`Feedback submit failed: HTTP ${res.status}`);
342
479
  }
343
480
  async function lookupKeywords(apiUrl, keywords, signal) {
344
481
  const response = await fetch(`${apiUrl}/api/seo-copilot/keywords`, {
@@ -348,7 +485,6 @@ async function lookupKeywords(apiUrl, keywords, signal) {
348
485
  signal
349
486
  });
350
487
  if (!response.ok) {
351
- const err = await response.json().catch(() => ({ error: "Request failed" }));
352
488
  if (response.status === 429) throw new Error("Analysis service is busy. Please try again.");
353
489
  if (response.status >= 500) throw new Error("Could not reach the SEO service.");
354
490
  throw new Error("Something went wrong. Please try again.");
@@ -461,7 +597,7 @@ function mergeVolumes(analysis, volumeMap) {
461
597
  });
462
598
  return updated;
463
599
  }
464
- function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFields, focusPrimary, documentId) {
600
+ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFields, focusPrimary, documentId, focusSecondary) {
465
601
  const cacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
466
602
  const loadCached = (0, import_react2.useCallback)(() => {
467
603
  try {
@@ -514,7 +650,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
514
650
  localStorage.setItem(cacheKey, JSON.stringify({ ...prev, analysis: withVolumes }));
515
651
  } catch {
516
652
  }
517
- }, [cacheKey]);
653
+ }, [cacheKey, loadCached]);
518
654
  const setDeepAnalysis = (0, import_react2.useCallback)((val) => {
519
655
  setDeepAnalysisRaw(val);
520
656
  try {
@@ -522,7 +658,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
522
658
  localStorage.setItem(cacheKey, JSON.stringify({ ...prev, deepAnalysis: val }));
523
659
  } catch {
524
660
  }
525
- }, [cacheKey]);
661
+ }, [cacheKey, loadCached]);
526
662
  const effectiveSeeds = seedKeywords;
527
663
  (0, import_react2.useEffect)(() => {
528
664
  if (deepAnalysis && aeoTextSnapshot && text !== aeoTextSnapshot) {
@@ -590,7 +726,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
590
726
  const controller = new AbortController();
591
727
  setIsLoading(true);
592
728
  setError(null);
593
- fetchAnalysis(apiUrl, text, "realtime", publication, effectiveSeeds, documentFields, focusPrimary, controller.signal).then((result) => {
729
+ fetchAnalysis(apiUrl, text, "realtime", publication, effectiveSeeds, documentFields, focusPrimary, focusSecondary, controller.signal).then((result) => {
594
730
  if (cancelled) return;
595
731
  const analysisResult = result;
596
732
  lastAnalysisRef.current = analysisResult;
@@ -620,7 +756,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
620
756
  cancelled = true;
621
757
  controller.abort();
622
758
  };
623
- }, [text, apiUrl, publication, effectiveSeeds?.join(","), focusPrimary, JSON.stringify(documentFields)]);
759
+ }, [text, apiUrl, publication, effectiveSeeds?.join(","), focusPrimary, focusSecondary, JSON.stringify(documentFields)]);
624
760
  const refreshVolumes = (0, import_react2.useCallback)(() => {
625
761
  const current = lastAnalysisRef.current || analysis;
626
762
  if (!current) return;
@@ -636,7 +772,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
636
772
  deepAbortRef.current?.abort();
637
773
  const deepController = new AbortController();
638
774
  deepAbortRef.current = deepController;
639
- fetchAnalysis(apiUrl, text, "deep", publication, effectiveSeeds, documentFields, focusPrimary, deepController.signal).then((result) => {
775
+ fetchAnalysis(apiUrl, text, "deep", publication, effectiveSeeds, documentFields, focusPrimary, focusSecondary, deepController.signal).then((result) => {
640
776
  if (docVersionRef.current !== myVersion) return;
641
777
  setDeepAnalysis(result);
642
778
  setIsDeepLoading(false);
@@ -646,7 +782,7 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
646
782
  setError(err.message);
647
783
  setIsDeepLoading(false);
648
784
  });
649
- }, [text, apiUrl, publication, effectiveSeeds?.join(","), documentFields, focusPrimary]);
785
+ }, [text, apiUrl, publication, effectiveSeeds?.join(","), documentFields, focusPrimary, focusSecondary]);
650
786
  return {
651
787
  analysis,
652
788
  isLoading,
@@ -991,6 +1127,13 @@ var INJECTED_CSS = `
991
1127
  from { opacity: 1; transform: translateY(0) scale(1); }
992
1128
  to { opacity: 0; transform: translateY(-6px) scale(0.97); }
993
1129
  }
1130
+ @keyframes seo-copilot-sec-float {
1131
+ 0%, 100% { transform: translateY(0); }
1132
+ 50% { transform: translateY(-1.5px); }
1133
+ }
1134
+ @media (prefers-reduced-motion: reduce) {
1135
+ .seo-copilot-sec-circle { animation: none !important; }
1136
+ }
994
1137
  .prose-chat { font-size: 12.5px; line-height: 1.65; color: #475569; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; }
995
1138
  .prose-chat h1 { font-size: 14px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
996
1139
  .prose-chat h2, .prose-chat h3 { font-size: 13px; font-weight: 700; color: #1e293b; margin: 10px 0 5px 0; line-height: 1.35; }
@@ -1740,119 +1883,6 @@ function PrimaryKeywordSelector({
1740
1883
  }) })
1741
1884
  ] });
1742
1885
  }
1743
- function SecondaryKeywordSelector({
1744
- options,
1745
- selectedTerm,
1746
- onSelect
1747
- }) {
1748
- const [customInputOpen, setCustomInputOpen] = (0, import_react9.useState)(false);
1749
- const [customValue, setCustomValue] = (0, import_react9.useState)("");
1750
- const handleCustomSubmit = () => {
1751
- const trimmed = customValue.trim();
1752
- if (trimmed) {
1753
- onSelect(trimmed);
1754
- setCustomValue("");
1755
- setCustomInputOpen(false);
1756
- }
1757
- };
1758
- const opts = selectedTerm && !options.some((o) => o.term.toLowerCase() === selectedTerm.toLowerCase()) ? [...options, { term: selectedTerm, volume: null }] : options;
1759
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: cardStyle, children: [
1760
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1761
- SectionHeader,
1762
- {
1763
- label: "Secondary Keyword",
1764
- iconColor: MJH_BLUE,
1765
- actionButton: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
1766
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.05em", textTransform: "uppercase", color: "#9ca3af" }, children: "Optional" }),
1767
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PencilButton, { onClick: () => setCustomInputOpen(!customInputOpen), active: customInputOpen })
1768
- ] })
1769
- }
1770
- ),
1771
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 8 }, children: "Pick one more keyword to optimize for. Copilot then checks your title, meta, URL, headings, and images against both keywords." }),
1772
- customInputOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { marginBottom: 8, display: "flex", gap: 6 }, children: [
1773
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1774
- "input",
1775
- {
1776
- type: "text",
1777
- value: customValue,
1778
- onChange: (e) => setCustomValue(e.target.value),
1779
- onKeyDown: (e) => {
1780
- if (e.key === "Enter") handleCustomSubmit();
1781
- },
1782
- placeholder: "Type a custom secondary keyword",
1783
- autoFocus: true,
1784
- style: { flex: 1, padding: "5px 8px", fontSize: 12, borderRadius: 8, border: "1px solid #e5e7eb", outline: "none", fontFamily: "inherit" }
1785
- }
1786
- ),
1787
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1788
- "button",
1789
- {
1790
- onClick: handleCustomSubmit,
1791
- disabled: !customValue.trim(),
1792
- style: {
1793
- padding: "5px 10px",
1794
- fontSize: 11,
1795
- fontWeight: 600,
1796
- borderRadius: 6,
1797
- border: "none",
1798
- background: customValue.trim() ? MJH_BLUE : "#e5e7eb",
1799
- color: customValue.trim() ? "#ffffff" : "#9ca3af",
1800
- cursor: customValue.trim() ? "pointer" : "not-allowed"
1801
- },
1802
- children: "Set"
1803
- }
1804
- )
1805
- ] }),
1806
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
1807
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SecondaryOptionRow, { term: "", label: "None", selected: !selectedTerm, onSelect: () => onSelect("") }),
1808
- opts.map((o) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1809
- SecondaryOptionRow,
1810
- {
1811
- term: o.term,
1812
- label: o.term,
1813
- volume: o.volume,
1814
- selected: o.term === selectedTerm,
1815
- onSelect: () => onSelect(o.term)
1816
- },
1817
- o.term
1818
- ))
1819
- ] })
1820
- ] });
1821
- }
1822
- function SecondaryOptionRow({ term, label, volume, selected, onSelect }) {
1823
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1824
- "div",
1825
- {
1826
- onClick: onSelect,
1827
- style: {
1828
- display: "flex",
1829
- alignItems: "center",
1830
- gap: 8,
1831
- padding: "6px 8px",
1832
- borderRadius: 8,
1833
- cursor: "pointer",
1834
- background: selected ? "rgba(0,93,172,0.06)" : "transparent",
1835
- border: selected ? "1px solid rgba(0,93,172,0.2)" : "1px solid transparent",
1836
- transition: "all 150ms"
1837
- },
1838
- children: [
1839
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
1840
- width: 14,
1841
- height: 14,
1842
- borderRadius: "50%",
1843
- border: selected ? "none" : "2px solid #d1d5db",
1844
- background: selected ? MJH_BLUE : "transparent",
1845
- flexShrink: 0,
1846
- display: "flex",
1847
- alignItems: "center",
1848
- justifyContent: "center"
1849
- }, children: selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 6, height: 6, borderRadius: "50%", background: "#ffffff" } }) }),
1850
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 12, fontWeight: selected ? 600 : 400, color: term ? selected ? "#00468a" : "#374151" : "#6b7280", flex: 1, minWidth: 0 }, children: label }),
1851
- volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: volume === 0 ? "N/A" : `${abbrevVol(volume)}/mo` })
1852
- ]
1853
- }
1854
- );
1855
- }
1856
1886
  var PLACEMENT_FILTERS = [
1857
1887
  { key: "inBody", label: "Body", letter: "B" },
1858
1888
  { key: "inTitle", label: "Title", letter: "T" },
@@ -1871,6 +1901,8 @@ function computePlacementClient(term, content, fields) {
1871
1901
  inUrl: fields?.slug?.toLowerCase().includes(lower) ?? false
1872
1902
  };
1873
1903
  }
1904
+ var SECONDARY_PURPLE = "#9B59B6";
1905
+ var SECONDARY_PURPLE_TEXT = "#7D3C98";
1874
1906
  function SuggestedKeywordsCard({
1875
1907
  keywords,
1876
1908
  text,
@@ -1879,7 +1911,10 @@ function SuggestedKeywordsCard({
1879
1911
  documentFields,
1880
1912
  refreshVolumes,
1881
1913
  isVolumesLoading,
1882
- documentId
1914
+ documentId,
1915
+ secondaryKeyword,
1916
+ onSelectSecondary,
1917
+ primaryTerm
1883
1918
  }) {
1884
1919
  const docScope = documentId || "default";
1885
1920
  const [helpData, setHelpData] = usePersistentState(
@@ -1900,6 +1935,11 @@ function SuggestedKeywordsCard({
1900
1935
  []
1901
1936
  );
1902
1937
  const [isGeneratingMore, setIsGeneratingMore] = (0, import_react9.useState)(false);
1938
+ const [secSelecting, setSecSelecting] = (0, import_react9.useState)(false);
1939
+ const startSecSelecting = () => {
1940
+ setExpanded(true);
1941
+ setSecSelecting(true);
1942
+ };
1903
1943
  const [sortAsc, setSortAsc] = usePersistentState("seo-copilot-ui-keywords-sort-asc", false);
1904
1944
  const filtersKey = `seo-copilot-ui-keywords-filters-${docScope}`;
1905
1945
  const [activeFilters, setActiveFiltersRaw] = (0, import_react9.useState)(
@@ -2026,10 +2066,18 @@ function SuggestedKeywordsCard({
2026
2066
  if (pA !== pB) return pB - pA;
2027
2067
  return b.volume - a.volume;
2028
2068
  });
2029
- const allKeywords = [...sorted, ...extraKeywords.filter((ek) => !sorted.some((s) => s.term.toLowerCase() === ek.term.toLowerCase()))];
2069
+ const merged = [...sorted, ...extraKeywords.filter((ek) => !sorted.some((s) => s.term.toLowerCase() === ek.term.toLowerCase()))];
2070
+ const hasVol = (k) => k.volume != null && k.volume > 0;
2071
+ const withVol = merged.filter(hasVol);
2072
+ const allKeywords = isVolumesLoading || withVol.length === 0 ? merged : withVol;
2030
2073
  const visible = expanded ? allKeywords : allKeywords.slice(0, INITIAL_SHOW);
2031
2074
  const hiddenCount = allKeywords.length - INITIAL_SHOW;
2032
2075
  const missingCount = keywords.filter((kw) => !kw.inContent).length;
2076
+ const secLower = (secondaryKeyword || "").toLowerCase();
2077
+ const primaryLower = (primaryTerm || "").toLowerCase();
2078
+ const isSecondaryRow = (term) => secLower !== "" && term.toLowerCase() === secLower;
2079
+ const isPrimaryRow = (term) => primaryLower !== "" && term.toLowerCase() === primaryLower;
2080
+ const secondaryInList = secLower !== "" && allKeywords.some((k) => k.term.toLowerCase() === secLower);
2033
2081
  const generateMoreKeywords = async () => {
2034
2082
  setIsGeneratingMore(true);
2035
2083
  try {
@@ -2052,7 +2100,15 @@ function SuggestedKeywordsCard({
2052
2100
  }
2053
2101
  setIsGeneratingMore(false);
2054
2102
  };
2055
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: cardStyle, children: [
2103
+ const didBackfillRef = (0, import_react9.useRef)(false);
2104
+ (0, import_react9.useEffect)(() => {
2105
+ if (didBackfillRef.current) return;
2106
+ if (isVolumesLoading || isGeneratingMore || keywords.length === 0) return;
2107
+ didBackfillRef.current = true;
2108
+ const volCount = [...keywords, ...extraKeywords].filter((k) => k.volume != null && k.volume > 0).length;
2109
+ if (volCount < 8) generateMoreKeywords();
2110
+ }, [keywords, isVolumesLoading]);
2111
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: secSelecting ? { ...cardStyle, border: `1.5px solid ${SECONDARY_PURPLE}`, boxShadow: [cardStyle.boxShadow, `0 0 0 1px rgba(155,89,182,0.25)`].filter(Boolean).join(", ") } : cardStyle, children: [
2056
2112
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 8 }, children: [
2057
2113
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 6, height: 6, borderRadius: "50%", background: MJH_BLUE, flexShrink: 0 } }),
2058
2114
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 10, textTransform: "uppercase", letterSpacing: "0.05em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: "Supporting Keywords" }),
@@ -2207,6 +2263,86 @@ function SuggestedKeywordsCard({
2207
2263
  ] }),
2208
2264
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PencilButton, { onClick: () => setManualInputOpen(!manualInputOpen), active: manualInputOpen })
2209
2265
  ] }),
2266
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "aria-live": "polite", style: { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap", border: 0 }, children: secSelecting ? "Selection mode on. Pick a keyword below to set it as the secondary keyword." : "" }),
2267
+ onSelectSecondary && (secSelecting ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: {
2268
+ display: "flex",
2269
+ alignItems: "center",
2270
+ justifyContent: "space-between",
2271
+ gap: 8,
2272
+ marginBottom: 8,
2273
+ padding: "5px 10px",
2274
+ borderRadius: 8,
2275
+ background: "rgba(155,89,182,0.08)",
2276
+ border: `1px solid rgba(155,89,182,0.35)`
2277
+ }, children: [
2278
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: SECONDARY_PURPLE_TEXT }, children: "Pick a keyword below to set as secondary." }),
2279
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2280
+ "button",
2281
+ {
2282
+ onClick: () => setSecSelecting(false),
2283
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: 11, fontWeight: 600, color: "#6b7280", padding: 2, fontFamily: "inherit" },
2284
+ children: "Cancel"
2285
+ }
2286
+ )
2287
+ ] }) : secondaryKeyword ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: {
2288
+ display: "flex",
2289
+ alignItems: "center",
2290
+ gap: 8,
2291
+ marginBottom: 8,
2292
+ padding: "5px 10px",
2293
+ borderRadius: 8,
2294
+ background: "rgba(155,89,182,0.08)",
2295
+ border: `1px solid rgba(155,89,182,0.35)`
2296
+ }, children: [
2297
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 8, height: 8, borderRadius: "50%", background: SECONDARY_PURPLE, flexShrink: 0 } }),
2298
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { style: { fontSize: 11, fontWeight: 600, color: SECONDARY_PURPLE_TEXT, flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
2299
+ "Secondary: ",
2300
+ secondaryKeyword
2301
+ ] }),
2302
+ !secondaryInList && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { title: "This keyword is no longer in the list below - re-pick or clear it.", style: { fontSize: 9.5, fontWeight: 600, fontStyle: "italic", color: "#9ca3af", flexShrink: 0 }, children: "not in list" }),
2303
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2304
+ "button",
2305
+ {
2306
+ onClick: startSecSelecting,
2307
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: 11, fontWeight: 600, color: SECONDARY_PURPLE_TEXT, padding: 2, fontFamily: "inherit" },
2308
+ children: "Change"
2309
+ }
2310
+ ),
2311
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2312
+ "button",
2313
+ {
2314
+ onClick: () => onSelectSecondary(""),
2315
+ title: "Clear secondary keyword",
2316
+ "aria-label": "Clear secondary keyword",
2317
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: 14, lineHeight: 1, color: "#9ca3af", padding: 2, fontFamily: "inherit" },
2318
+ children: "\xD7"
2319
+ }
2320
+ )
2321
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2322
+ "button",
2323
+ {
2324
+ onClick: startSecSelecting,
2325
+ style: {
2326
+ display: "inline-flex",
2327
+ alignItems: "center",
2328
+ gap: 6,
2329
+ marginBottom: 8,
2330
+ padding: "4px 10px",
2331
+ borderRadius: 8,
2332
+ cursor: "pointer",
2333
+ background: "rgba(155,89,182,0.08)",
2334
+ border: `1px solid rgba(155,89,182,0.4)`,
2335
+ color: SECONDARY_PURPLE_TEXT,
2336
+ fontSize: 11,
2337
+ fontWeight: 600,
2338
+ fontFamily: "inherit"
2339
+ },
2340
+ children: [
2341
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 11, height: 11, borderRadius: "50%", border: `2px solid ${SECONDARY_PURPLE}`, flexShrink: 0 } }),
2342
+ "Click to choose a secondary keyword."
2343
+ ]
2344
+ }
2345
+ )),
2210
2346
  manualInputOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { marginBottom: 8, display: "flex", gap: 6 }, children: [
2211
2347
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2212
2348
  "input",
@@ -2250,14 +2386,46 @@ function SuggestedKeywordsCard({
2250
2386
  borderBottom: i < visible.length - 1 ? "1px solid #f3f4f6" : "none",
2251
2387
  minHeight: 28
2252
2388
  }, children: [
2253
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
2389
+ secSelecting && onSelectSecondary ? isPrimaryRow(kw.term) ? (
2390
+ // The active primary keyword cannot also be the secondary - show a muted,
2391
+ // non-selectable marker instead of a pickable circle.
2392
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { title: "Already your primary keyword", style: { width: 14, height: 14, borderRadius: "50%", flexShrink: 0, border: "2px solid #e5e7eb", background: "transparent" } })
2393
+ ) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2394
+ "button",
2395
+ {
2396
+ className: "seo-copilot-sec-circle",
2397
+ onClick: () => {
2398
+ onSelectSecondary(kw.term);
2399
+ setSecSelecting(false);
2400
+ },
2401
+ "aria-label": `Set ${kw.term} as the secondary keyword`,
2402
+ title: `Set "${kw.term}" as the secondary keyword`,
2403
+ style: {
2404
+ width: 14,
2405
+ height: 14,
2406
+ borderRadius: "50%",
2407
+ flexShrink: 0,
2408
+ padding: 0,
2409
+ border: `2px solid ${SECONDARY_PURPLE}`,
2410
+ background: "transparent",
2411
+ cursor: "pointer",
2412
+ animation: "seo-copilot-sec-float 1.8s ease-in-out infinite",
2413
+ animationDelay: `${i % 5 * 0.12}s`
2414
+ }
2415
+ }
2416
+ ) : isSecondaryRow(kw.term) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 8, height: 8, borderRadius: "50%", background: SECONDARY_PURPLE, flexShrink: 0 } }) : secondaryKeyword ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { width: 8, height: 8, flexShrink: 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
2254
2417
  width: 8,
2255
2418
  height: 8,
2256
2419
  borderRadius: "50%",
2257
2420
  flexShrink: 0,
2258
2421
  background: kw.inContent ? "#16a34a" : "#d1d5db"
2259
2422
  } }),
2260
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 12, fontWeight: kw.inContent ? 500 : 600, flexGrow: 1, color: "#1f2937" }, children: kw.term }),
2423
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: {
2424
+ fontSize: 12,
2425
+ fontWeight: isSecondaryRow(kw.term) ? 700 : kw.inContent ? 500 : 600,
2426
+ flexGrow: 1,
2427
+ color: !secSelecting && isSecondaryRow(kw.term) ? SECONDARY_PURPLE_TEXT : "#1f2937"
2428
+ }, children: kw.term }),
2261
2429
  enrichingTerms.has(kw.term) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingBars, { size: "xs", color: "#6b7280" }),
2262
2430
  !enrichingTerms.has(kw.term) && kw.volume != null && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 10.5, fontWeight: 600, color: "#1f2937", flexShrink: 0 }, title: "Monthly searches", children: kw.volume === 0 ? "N/A" : `${abbrevVol(kw.volume)}/mo` }),
2263
2431
  kw.placement && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(PlacementIndicators, { placement: kw.placement }),
@@ -2396,26 +2564,10 @@ function KeywordPanel({
2396
2564
  ...c,
2397
2565
  placement: computePlacementClient(c.term, text, documentFields)
2398
2566
  }));
2399
- const activeTerm = candidates.find((c) => c.term === selectedPrimaryTerm) ? selectedPrimaryTerm : candidates[0]?.term ?? "";
2400
- const activeTermLower = activeTerm.toLowerCase();
2401
- const secondaryOptions = [];
2402
- const seenSecondary = /* @__PURE__ */ new Set();
2403
- for (const c of candidates) {
2404
- const key = c.term.toLowerCase();
2405
- if (key === activeTermLower) continue;
2406
- if (!seenSecondary.has(key)) {
2407
- seenSecondary.add(key);
2408
- secondaryOptions.push({ term: c.term, volume: c.volume });
2409
- }
2410
- }
2411
- for (const kw of suggestedKeywords) {
2412
- const key = kw.term.toLowerCase();
2413
- if (key === activeTermLower) continue;
2414
- if (!seenSecondary.has(key)) {
2415
- seenSecondary.add(key);
2416
- secondaryOptions.push({ term: kw.term, volume: kw.volume });
2417
- }
2418
- }
2567
+ const candHasVol = (c) => c.volume != null && c.volume > 0;
2568
+ const candWithVol = candidates.filter(candHasVol);
2569
+ const visibleCandidates = isVolumesLoading || candWithVol.length === 0 ? candidates : candWithVol;
2570
+ const activeTerm = visibleCandidates.find((c) => c.term === selectedPrimaryTerm) ? selectedPrimaryTerm : visibleCandidates[0]?.term ?? "";
2419
2571
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
2420
2572
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: {
2421
2573
  ...cardStyle,
@@ -2428,13 +2580,13 @@ function KeywordPanel({
2428
2580
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Primary" }),
2429
2581
  " keyword (required) and, optionally, one ",
2430
2582
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "Secondary" }),
2431
- " keyword. Copilot optimizes the whole article - title, meta, URL, headings, and images - toward both."
2583
+ " keyword. Copilot then optimizes its recommendations toward both."
2432
2584
  ] }) }),
2433
2585
  onSeedsChange && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SeedKeywordInput, { seeds: seedKeywords, onSeedsChange }),
2434
2586
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2435
2587
  PrimaryKeywordSelector,
2436
2588
  {
2437
- candidates,
2589
+ candidates: visibleCandidates,
2438
2590
  selectedTerm: activeTerm,
2439
2591
  onSelect: (term) => {
2440
2592
  setSelectedPrimaryTerm(term);
@@ -2443,15 +2595,7 @@ function KeywordPanel({
2443
2595
  publication
2444
2596
  }
2445
2597
  ),
2446
- onSelectSecondary && secondaryOptions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2447
- SecondaryKeywordSelector,
2448
- {
2449
- options: secondaryOptions,
2450
- selectedTerm: secondaryKeyword,
2451
- onSelect: (term) => onSelectSecondary(term)
2452
- }
2453
- ),
2454
- suggestedKeywords.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2598
+ (suggestedKeywords.length > 0 || !!onSelectSecondary) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2455
2599
  SuggestedKeywordsCard,
2456
2600
  {
2457
2601
  keywords: suggestedKeywords,
@@ -2461,7 +2605,10 @@ function KeywordPanel({
2461
2605
  documentFields,
2462
2606
  refreshVolumes,
2463
2607
  isVolumesLoading,
2464
- documentId
2608
+ documentId,
2609
+ secondaryKeyword,
2610
+ onSelectSecondary,
2611
+ primaryTerm: activeTerm
2465
2612
  },
2466
2613
  documentId || "default"
2467
2614
  ),
@@ -2469,6 +2616,10 @@ function KeywordPanel({
2469
2616
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingBars, { size: "xs", color: MJH_GOLD }),
2470
2617
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Checking search volumes..." })
2471
2618
  ] }),
2619
+ error && analysis && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { padding: "4px 12px", fontSize: 11, color: "#dc2626" }, children: [
2620
+ "Could not refresh analysis: ",
2621
+ error
2622
+ ] }),
2472
2623
  isLoading && analysis && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, justifyContent: "center" }, children: [
2473
2624
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" }),
2474
2625
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Updating insights..." })
@@ -3141,80 +3292,287 @@ function OnboardingCard({ onDismiss, closing }) {
3141
3292
  ] });
3142
3293
  }
3143
3294
 
3144
- // src/components/tabs/SummaryTab.tsx
3145
- var import_react13 = require("react");
3146
-
3147
- // src/components/ShimmerLoader.tsx
3295
+ // src/components/ReportProblemButton.tsx
3148
3296
  var import_react12 = require("react");
3297
+ var import_sanity3 = require("sanity");
3149
3298
  var import_jsx_runtime9 = require("react/jsx-runtime");
3150
- var keyframesInjected = false;
3151
- var KEYFRAMES = `
3152
- @keyframes seo-copilot-text-shimmer {
3153
- 0% { background-position: -100% center; }
3154
- 100% { background-position: 100% center; }
3155
- }
3156
- `;
3157
- function LoaderBars({ color = MJH_GOLD }) {
3158
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3159
- "div",
3160
- {
3161
- role: "status",
3162
- "aria-label": "Loading",
3163
- style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: 14, flexShrink: 0 },
3164
- children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3165
- "div",
3166
- {
3167
- style: {
3168
- width: 6,
3169
- height: 8,
3170
- borderRadius: 2,
3171
- background: color,
3172
- animation: `bar-shift-${i} 1.4s ease-in-out infinite`
3173
- }
3174
- },
3175
- i
3176
- ))
3177
- }
3178
- );
3179
- }
3180
- function ShimmerLoader({
3181
- messages,
3182
- intervalMs = 1500,
3183
- textSize = 14,
3184
- iconColor = MJH_GOLD
3185
- }) {
3186
- const [idx, setIdx] = (0, import_react12.useState)(0);
3187
- (0, import_react12.useEffect)(() => {
3188
- if (typeof window !== "undefined" && !keyframesInjected) {
3189
- keyframesInjected = true;
3190
- const style = document.createElement("style");
3191
- style.dataset.seoCopilotKeyframes = "1";
3192
- style.innerHTML = KEYFRAMES;
3193
- document.head.appendChild(style);
3194
- }
3299
+ function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
3300
+ const { apiUrl } = useConfig();
3301
+ const sanityUser = (0, import_sanity3.useCurrentUser)();
3302
+ const [open, setOpen] = (0, import_react12.useState)(false);
3303
+ const [text, setText] = (0, import_react12.useState)("");
3304
+ const [submitting, setSubmitting] = (0, import_react12.useState)(false);
3305
+ const [submitted, setSubmitted] = (0, import_react12.useState)(false);
3306
+ const [failed, setFailed] = (0, import_react12.useState)(false);
3307
+ const popRef = (0, import_react12.useRef)(null);
3308
+ const textareaRef = (0, import_react12.useRef)(null);
3309
+ const closeTimer = (0, import_react12.useRef)(null);
3310
+ const mounted = (0, import_react12.useRef)(true);
3311
+ (0, import_react12.useEffect)(() => () => {
3312
+ mounted.current = false;
3313
+ if (closeTimer.current) clearTimeout(closeTimer.current);
3195
3314
  }, []);
3196
3315
  (0, import_react12.useEffect)(() => {
3197
- if (messages.length <= 1) return;
3198
- const id = setInterval(() => {
3199
- setIdx((i) => (i + 1) % messages.length);
3200
- }, intervalMs);
3201
- return () => clearInterval(id);
3202
- }, [messages.length, intervalMs]);
3203
- const text = messages[idx] || messages[0] || "";
3204
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3205
- "div",
3206
- {
3207
- style: {
3208
- display: "inline-flex",
3209
- alignItems: "center",
3316
+ if (!open) return;
3317
+ const handler = (e) => {
3318
+ if (popRef.current && !popRef.current.contains(e.target)) setOpen(false);
3319
+ };
3320
+ document.addEventListener("mousedown", handler);
3321
+ return () => document.removeEventListener("mousedown", handler);
3322
+ }, [open]);
3323
+ (0, import_react12.useEffect)(() => {
3324
+ if (open) setTimeout(() => textareaRef.current?.focus(), 50);
3325
+ }, [open]);
3326
+ const handleSubmit = async () => {
3327
+ const trimmed = text.trim();
3328
+ if (!trimmed || submitting) return;
3329
+ setFailed(false);
3330
+ setSubmitting(true);
3331
+ try {
3332
+ await submitFeedback(apiUrl, {
3333
+ suggestion_type: "bug_report",
3334
+ suggestion_text: trimmed.slice(0, 1e4),
3335
+ vote: "down",
3336
+ document_id: documentId,
3337
+ publication,
3338
+ user_id: sanityUser?.id,
3339
+ context: {
3340
+ surface: "sanity-plugin",
3341
+ activeTab,
3342
+ primaryKeyword: primaryKeyword || void 0,
3343
+ documentType,
3344
+ url: typeof window !== "undefined" && /^https?:\/\//i.test(window.location.href) ? window.location.href.slice(0, 500) : void 0,
3345
+ userAgent: typeof navigator !== "undefined" ? navigator.userAgent.slice(0, 500) : void 0,
3346
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
3347
+ }
3348
+ });
3349
+ } catch (e) {
3350
+ console.error("[SEO Copilot] failed to send problem report:", e);
3351
+ if (mounted.current) {
3352
+ setSubmitting(false);
3353
+ setFailed(true);
3354
+ }
3355
+ return;
3356
+ }
3357
+ if (!mounted.current) return;
3358
+ setSubmitting(false);
3359
+ setSubmitted(true);
3360
+ closeTimer.current = setTimeout(() => {
3361
+ if (!mounted.current) return;
3362
+ setOpen(false);
3363
+ setSubmitted(false);
3364
+ setText("");
3365
+ }, 1500);
3366
+ };
3367
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { position: "relative", display: "flex" }, children: [
3368
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3369
+ "button",
3370
+ {
3371
+ type: "button",
3372
+ onClick: (e) => {
3373
+ e.stopPropagation();
3374
+ if (closeTimer.current) {
3375
+ clearTimeout(closeTimer.current);
3376
+ closeTimer.current = null;
3377
+ }
3378
+ setOpen((o) => !o);
3379
+ },
3380
+ onMouseDown: (e) => e.stopPropagation(),
3381
+ "aria-label": "Report a problem",
3382
+ title: "Report a problem",
3383
+ style: {
3384
+ display: "inline-flex",
3385
+ alignItems: "center",
3386
+ gap: 4,
3387
+ padding: "3px 8px",
3388
+ borderRadius: 99,
3389
+ border: `1px solid ${open ? MJH_BLUE : "#d1d5db"}`,
3390
+ background: open ? "rgba(0,93,172,0.08)" : "rgba(255,255,255,0.6)",
3391
+ cursor: "pointer",
3392
+ fontSize: 10,
3393
+ fontWeight: 600,
3394
+ color: open ? MJH_BLUE : "#6b7280",
3395
+ whiteSpace: "nowrap",
3396
+ transition: "all 150ms"
3397
+ },
3398
+ children: [
3399
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M3 2.75a.75.75 0 00-1.5 0v14.5a.75.75 0 001.5 0v-4.392l1.657-.348a6.449 6.449 0 014.271.572 7.948 7.948 0 005.965.524l2.078-.64A.75.75 0 0017.5 12.25v-8.5a.75.75 0 00-.904-.734l-1.74.348a7.948 7.948 0 01-5.965-.524 6.449 6.449 0 00-4.271-.572L3 2.842V2.75z" }) }),
3400
+ "Report a problem"
3401
+ ]
3402
+ }
3403
+ ),
3404
+ open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3405
+ "div",
3406
+ {
3407
+ ref: popRef,
3408
+ onMouseDown: (e) => e.stopPropagation(),
3409
+ style: {
3410
+ position: "absolute",
3411
+ top: "100%",
3412
+ right: 0,
3413
+ marginTop: 6,
3414
+ width: 260,
3415
+ padding: 12,
3416
+ borderRadius: 10,
3417
+ background: "#ffffff",
3418
+ boxShadow: "0 6px 22px rgba(0,0,0,0.16), 0 1px 4px rgba(0,0,0,0.1)",
3419
+ border: "1px solid #e5e7eb",
3420
+ zIndex: 100
3421
+ },
3422
+ children: submitted ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, color: "#16a34a", textAlign: "center", padding: "6px 0", fontWeight: 600 }, children: "Thanks - we got it." }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
3423
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
3424
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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." }),
3425
+ failed && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { fontSize: 10.5, color: "#dc2626", marginBottom: 8, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - please try again." }),
3426
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3427
+ "textarea",
3428
+ {
3429
+ ref: textareaRef,
3430
+ value: text,
3431
+ onChange: (e) => setText(e.target.value),
3432
+ onKeyDown: (e) => {
3433
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
3434
+ e.preventDefault();
3435
+ handleSubmit();
3436
+ }
3437
+ },
3438
+ placeholder: "What happened? The more detail, the better.",
3439
+ rows: 4,
3440
+ maxLength: 4e3,
3441
+ style: {
3442
+ width: "100%",
3443
+ padding: "6px 8px",
3444
+ fontSize: 11,
3445
+ borderRadius: 6,
3446
+ border: "1px solid #e5e7eb",
3447
+ outline: "none",
3448
+ fontFamily: "inherit",
3449
+ resize: "vertical",
3450
+ boxSizing: "border-box",
3451
+ lineHeight: 1.5
3452
+ }
3453
+ }
3454
+ ),
3455
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: 8, gap: 6 }, children: [
3456
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3457
+ "button",
3458
+ {
3459
+ type: "button",
3460
+ onClick: () => {
3461
+ setOpen(false);
3462
+ setText("");
3463
+ },
3464
+ style: {
3465
+ padding: "4px 10px",
3466
+ fontSize: 10.5,
3467
+ borderRadius: 5,
3468
+ border: "1px solid #e5e7eb",
3469
+ background: "#ffffff",
3470
+ color: "#4b5563",
3471
+ cursor: "pointer"
3472
+ },
3473
+ children: "Cancel"
3474
+ }
3475
+ ),
3476
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3477
+ "button",
3478
+ {
3479
+ type: "button",
3480
+ onClick: handleSubmit,
3481
+ disabled: !text.trim() || submitting,
3482
+ style: {
3483
+ padding: "4px 12px",
3484
+ fontSize: 10.5,
3485
+ borderRadius: 5,
3486
+ border: "none",
3487
+ background: !text.trim() || submitting ? "#cbd5e1" : MJH_BLUE,
3488
+ color: "#ffffff",
3489
+ cursor: !text.trim() || submitting ? "default" : "pointer",
3490
+ fontWeight: 700
3491
+ },
3492
+ children: submitting ? "Sending..." : "Send"
3493
+ }
3494
+ )
3495
+ ] })
3496
+ ] })
3497
+ }
3498
+ )
3499
+ ] });
3500
+ }
3501
+
3502
+ // src/components/tabs/SummaryTab.tsx
3503
+ var import_react14 = require("react");
3504
+
3505
+ // src/components/ShimmerLoader.tsx
3506
+ var import_react13 = require("react");
3507
+ var import_jsx_runtime10 = require("react/jsx-runtime");
3508
+ var keyframesInjected = false;
3509
+ var KEYFRAMES = `
3510
+ @keyframes seo-copilot-text-shimmer {
3511
+ 0% { background-position: -100% center; }
3512
+ 100% { background-position: 100% center; }
3513
+ }
3514
+ `;
3515
+ function LoaderBars({ color = MJH_GOLD }) {
3516
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3517
+ "div",
3518
+ {
3519
+ role: "status",
3520
+ "aria-label": "Loading",
3521
+ style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: 14, flexShrink: 0 },
3522
+ children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3523
+ "div",
3524
+ {
3525
+ style: {
3526
+ width: 6,
3527
+ height: 8,
3528
+ borderRadius: 2,
3529
+ background: color,
3530
+ animation: `bar-shift-${i} 1.4s ease-in-out infinite`
3531
+ }
3532
+ },
3533
+ i
3534
+ ))
3535
+ }
3536
+ );
3537
+ }
3538
+ function ShimmerLoader({
3539
+ messages,
3540
+ intervalMs = 1500,
3541
+ textSize = 14,
3542
+ iconColor = MJH_GOLD
3543
+ }) {
3544
+ const [idx, setIdx] = (0, import_react13.useState)(0);
3545
+ (0, import_react13.useEffect)(() => {
3546
+ if (typeof window !== "undefined" && !keyframesInjected) {
3547
+ keyframesInjected = true;
3548
+ const style = document.createElement("style");
3549
+ style.dataset.seoCopilotKeyframes = "1";
3550
+ style.innerHTML = KEYFRAMES;
3551
+ document.head.appendChild(style);
3552
+ }
3553
+ }, []);
3554
+ (0, import_react13.useEffect)(() => {
3555
+ if (messages.length <= 1) return;
3556
+ const id = setInterval(() => {
3557
+ setIdx((i) => (i + 1) % messages.length);
3558
+ }, intervalMs);
3559
+ return () => clearInterval(id);
3560
+ }, [messages.length, intervalMs]);
3561
+ const text = messages[idx] || messages[0] || "";
3562
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3563
+ "div",
3564
+ {
3565
+ style: {
3566
+ display: "inline-flex",
3567
+ alignItems: "center",
3210
3568
  gap: 8,
3211
3569
  fontSize: textSize,
3212
3570
  fontWeight: 500,
3213
3571
  letterSpacing: "0.01em"
3214
3572
  },
3215
3573
  children: [
3216
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LoaderBars, { color: iconColor }),
3217
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3574
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoaderBars, { color: iconColor }),
3575
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3218
3576
  "span",
3219
3577
  {
3220
3578
  style: {
@@ -3292,9 +3650,9 @@ function calculateContentScoreDetailed(content, analysis, documentFields) {
3292
3650
  detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
3293
3651
  }
3294
3652
  }
3295
- components.push({ label: "Primary keyword", points: pts, max: 25, detail });
3653
+ components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
3296
3654
  } else {
3297
- components.push({ label: "Primary keyword", points: 0, max: 25, detail: "No primary keyword identified yet" });
3655
+ components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
3298
3656
  }
3299
3657
  const supportingKws = analysis.supportingKeywords || [];
3300
3658
  if (supportingKws.length > 0) {
@@ -3302,13 +3660,13 @@ function calculateContentScoreDetailed(content, analysis, documentFields) {
3302
3660
  const coverageRatio = inContentCount / supportingKws.length;
3303
3661
  const pts = Math.round(coverageRatio * 25);
3304
3662
  components.push({
3305
- label: "Supporting keywords",
3663
+ label: "Supporting keyword coverage",
3306
3664
  points: pts,
3307
3665
  max: 25,
3308
3666
  detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
3309
3667
  });
3310
3668
  } else {
3311
- components.push({ label: "Supporting keywords", points: 0, max: 25, detail: "No supporting keywords yet" });
3669
+ components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
3312
3670
  }
3313
3671
  let wcPts = 0;
3314
3672
  let wcDetail;
@@ -3487,7 +3845,7 @@ function buildSummaryItems(input) {
3487
3845
  severity: "warning",
3488
3846
  label: "Meta description is short",
3489
3847
  description: `Meta description is ${len} characters - below the 120-160 ideal.`,
3490
- howToFix: "Expand the description to 120-160 characters so you don't leave SERP space empty.",
3848
+ howToFix: "Expand the description to 120-160 characters so the full description shows in search.",
3491
3849
  jumpTo: { tab: "meta", anchorId: "anchor-meta-description" }
3492
3850
  });
3493
3851
  } else if (len > 160) {
@@ -3618,18 +3976,6 @@ function buildSummaryItems(input) {
3618
3976
  });
3619
3977
  }
3620
3978
  if (headingsDetailed) {
3621
- const bodyH1 = headingsDetailed.filter((h) => h.level === 1).length;
3622
- if (bodyH1 > 0) {
3623
- items.push({
3624
- id: "headings-h1-in-body",
3625
- category: "headings",
3626
- severity: "warning",
3627
- label: "H1 inside the body",
3628
- description: `${bodyH1} H1 heading${bodyH1 === 1 ? "" : "s"} in the body of the article.`,
3629
- howToFix: "The article title is your H1. Body headings should start at H2 so the outline isn't ambiguous.",
3630
- jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
3631
- });
3632
- }
3633
3979
  let prevLevel = 0;
3634
3980
  let skips = 0;
3635
3981
  for (const h of headingsDetailed) {
@@ -3659,6 +4005,23 @@ function buildSummaryItems(input) {
3659
4005
  jumpTo: { tab: "technical", anchorId: "anchor-headings-structure" }
3660
4006
  });
3661
4007
  }
4008
+ const subheads = headingsDetailed.filter((h) => h.level >= 2);
4009
+ if (subheads.length > 0 && (primaryKeyword || secondaryKeyword)) {
4010
+ const subText = subheads.map((h) => h.text).join(" ");
4011
+ const hasP = primaryKeyword ? containsKeywordTokens(subText, primaryKeyword) : false;
4012
+ const hasS = secondaryKeyword ? containsKeywordTokens(subText, secondaryKeyword) : false;
4013
+ if (!hasP && !hasS) {
4014
+ items.push({
4015
+ id: "headings-keyword-missing",
4016
+ category: "headings",
4017
+ severity: "opportunity",
4018
+ label: "Keyword missing from subheadings",
4019
+ description: "No H2/H3 subheading uses your primary or secondary keyword.",
4020
+ howToFix: "Work your primary or secondary keyword into at least one subheading - keywords in headers reinforce relevance for readers and search.",
4021
+ jumpTo: { tab: "technical", anchorId: "anchor-headings-keyword" }
4022
+ });
4023
+ }
4024
+ }
3662
4025
  }
3663
4026
  const images = documentFields?.imageNames || [];
3664
4027
  if (images.length === 0 && wordCount2 > 300) {
@@ -3911,7 +4274,7 @@ function buildSummaryItems(input) {
3911
4274
  }
3912
4275
 
3913
4276
  // src/components/tabs/SummaryTab.tsx
3914
- var import_jsx_runtime10 = require("react/jsx-runtime");
4277
+ var import_jsx_runtime11 = require("react/jsx-runtime");
3915
4278
  var cardStyle2 = {
3916
4279
  borderRadius: 14,
3917
4280
  background: "rgba(255,255,255,0.55)",
@@ -3933,11 +4296,16 @@ function scoreColors(score) {
3933
4296
  if (score >= 40) return { bg: "rgba(230,192,27,0.15)", text: "#8B7310", label: "Decent" };
3934
4297
  return { bg: "rgba(220,38,38,0.08)", text: "#dc2626", label: "Needs work" };
3935
4298
  }
4299
+ function componentTier(pct) {
4300
+ if (pct >= 75) return { label: "Strong", color: "#16a34a", bar: "#16a34a" };
4301
+ if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
4302
+ return { label: "Low", color: "#dc2626", bar: "#dc2626" };
4303
+ }
3936
4304
  function ScoreBadge({ score, breakdown }) {
3937
4305
  const c = scoreColors(score);
3938
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: cardStyle2, children: [
3939
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
3940
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
4306
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle2, children: [
4307
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
4308
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3941
4309
  "div",
3942
4310
  {
3943
4311
  style: {
@@ -3946,37 +4314,28 @@ function ScoreBadge({ score, breakdown }) {
3946
4314
  borderRadius: "50%",
3947
4315
  background: c.bg,
3948
4316
  display: "flex",
3949
- flexDirection: "column",
3950
4317
  alignItems: "center",
3951
4318
  justifyContent: "center",
3952
- flexShrink: 0,
3953
- lineHeight: 1
4319
+ flexShrink: 0
3954
4320
  },
3955
- children: [
3956
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 20, fontWeight: 700, color: c.text }, children: score }),
3957
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 8, fontWeight: 700, color: c.text, opacity: 0.7, letterSpacing: "0.06em", marginTop: 2 }, children: "/ 100" })
3958
- ]
4321
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
3959
4322
  }
3960
4323
  ),
3961
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
3962
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
3963
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 14, fontWeight: 700, color: c.text }, children: c.label })
4324
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
4325
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
4326
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
3964
4327
  ] })
3965
4328
  ] }),
3966
- breakdown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
4329
+ breakdown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
3967
4330
  const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
3968
- const barColor = pct >= 75 ? "#16a34a" : pct >= 40 ? "#E6C01B" : "#dc2626";
3969
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
3970
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
3971
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
3972
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { fontSize: 11, color: "#4b5563", fontVariantNumeric: "tabular-nums" }, children: [
3973
- comp.points,
3974
- " / ",
3975
- comp.max
3976
- ] })
4331
+ const tier = componentTier(pct);
4332
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
4333
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
4334
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
4335
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
3977
4336
  ] }),
3978
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { width: `${pct}%`, height: "100%", background: barColor, transition: "width 200ms" } }) }),
3979
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
4337
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
4338
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
3980
4339
  ] }, i);
3981
4340
  }) })
3982
4341
  ] });
@@ -3990,7 +4349,7 @@ function ItemCard({ item, onClick }) {
3990
4349
  const v = severityVisual(item.severity);
3991
4350
  const tab = item.jumpTo.tab;
3992
4351
  const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
3993
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
4352
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3994
4353
  "div",
3995
4354
  {
3996
4355
  onClick,
@@ -4007,8 +4366,8 @@ function ItemCard({ item, onClick }) {
4007
4366
  cursor: "pointer"
4008
4367
  },
4009
4368
  children: [
4010
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4011
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4369
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4370
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4012
4371
  "div",
4013
4372
  {
4014
4373
  style: {
@@ -4021,12 +4380,12 @@ function ItemCard({ item, onClick }) {
4021
4380
  }
4022
4381
  }
4023
4382
  ),
4024
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
4025
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4026
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4383
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
4384
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4385
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4027
4386
  ] })
4028
4387
  ] }),
4029
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
4388
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4030
4389
  "div",
4031
4390
  {
4032
4391
  style: {
@@ -4038,12 +4397,12 @@ function ItemCard({ item, onClick }) {
4038
4397
  lineHeight: 1.55
4039
4398
  },
4040
4399
  children: [
4041
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4400
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4042
4401
  item.howToFix
4043
4402
  ]
4044
4403
  }
4045
4404
  ),
4046
- item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4405
+ item.jumpTo.tab !== "summary" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4047
4406
  "Go to ",
4048
4407
  tabLabel,
4049
4408
  " \u203A"
@@ -4059,7 +4418,7 @@ function FilterChip({
4059
4418
  count,
4060
4419
  dotColor
4061
4420
  }) {
4062
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
4421
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4063
4422
  "button",
4064
4423
  {
4065
4424
  onClick,
@@ -4078,9 +4437,9 @@ function FilterChip({
4078
4437
  transition: "all 150ms"
4079
4438
  },
4080
4439
  children: [
4081
- dotColor && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4082
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: label }),
4083
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4440
+ dotColor && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4441
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: label }),
4442
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4084
4443
  ]
4085
4444
  }
4086
4445
  );
@@ -4098,13 +4457,13 @@ function SummaryTab({
4098
4457
  onGenerateAll,
4099
4458
  onItemClick
4100
4459
  }) {
4101
- const scoreDetail = (0, import_react13.useMemo)(() => {
4460
+ const scoreDetail = (0, import_react14.useMemo)(() => {
4102
4461
  if (!analysis) return null;
4103
4462
  const scored = primaryKeyword && analysis.primaryKeyword && primaryKeyword !== analysis.primaryKeyword.term ? { ...analysis, primaryKeyword: { ...analysis.primaryKeyword, term: primaryKeyword } } : analysis;
4104
4463
  return calculateContentScoreDetailed(text, scored, documentFields);
4105
4464
  }, [text, analysis, documentFields, primaryKeyword]);
4106
4465
  const score = scoreDetail?.total ?? null;
4107
- const items = (0, import_react13.useMemo)(
4466
+ const items = (0, import_react14.useMemo)(
4108
4467
  () => buildSummaryItems({
4109
4468
  analysis,
4110
4469
  deepAnalysis,
@@ -4118,8 +4477,8 @@ function SummaryTab({
4118
4477
  }),
4119
4478
  [analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
4120
4479
  );
4121
- const [filter, setFilter] = (0, import_react13.useState)("all");
4122
- const counts = (0, import_react13.useMemo)(
4480
+ const [filter, setFilter] = (0, import_react14.useState)("all");
4481
+ const counts = (0, import_react14.useMemo)(
4123
4482
  () => ({
4124
4483
  all: items.length,
4125
4484
  error: items.filter((i) => i.severity === "error").length,
@@ -4130,15 +4489,15 @@ function SummaryTab({
4130
4489
  );
4131
4490
  const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
4132
4491
  if (!analysis) {
4133
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
4134
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4135
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4492
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
4493
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4494
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4136
4495
  ] });
4137
4496
  }
4138
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4139
- score != null && scoreDetail && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScoreBadge, { score, breakdown: scoreDetail.components }),
4140
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: cardStyle2, children: [
4141
- isAnyLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4497
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4498
+ score != null && scoreDetail && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScoreBadge, { score, breakdown: scoreDetail.components }),
4499
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle2, children: [
4500
+ isAnyLoading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4142
4501
  "button",
4143
4502
  {
4144
4503
  onClick: onGenerateAll,
@@ -4166,24 +4525,24 @@ function SummaryTab({
4166
4525
  children: "Run all analyses"
4167
4526
  }
4168
4527
  ),
4169
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4528
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4170
4529
  "Runs the analyses that fill the ",
4171
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "AEO/GEO" }),
4530
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "AEO/GEO" }),
4172
4531
  ", ",
4173
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "Linking" }),
4532
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Linking" }),
4174
4533
  ", and ",
4175
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { children: "Other Recs" }),
4534
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "Other Recs" }),
4176
4535
  " tabs. New issues they find appear in this Summary as each one finishes."
4177
4536
  ] })
4178
4537
  ] }),
4179
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4180
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4181
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4182
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4183
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4538
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4539
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4540
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4541
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4542
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4184
4543
  ] }),
4185
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
4186
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
4544
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
4545
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4187
4546
  "div",
4188
4547
  {
4189
4548
  style: {
@@ -4196,21 +4555,21 @@ function SummaryTab({
4196
4555
  justifyContent: "center",
4197
4556
  margin: "0 auto 8px"
4198
4557
  },
4199
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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" }) })
4558
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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" }) })
4200
4559
  }
4201
4560
  ),
4202
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4203
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4204
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4205
- isAnyLoading && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4206
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
4207
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4561
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4562
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4563
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4564
+ isAnyLoading && items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4565
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
4566
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4208
4567
  ] })
4209
4568
  ] });
4210
4569
  }
4211
4570
 
4212
4571
  // src/components/tabs/AEOTab.tsx
4213
- var import_react14 = require("react");
4572
+ var import_react15 = require("react");
4214
4573
 
4215
4574
  // src/lib/geoAnalysis.ts
4216
4575
  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;
@@ -4284,7 +4643,7 @@ function analyzeGEO(text, headings) {
4284
4643
  }
4285
4644
 
4286
4645
  // src/components/tabs/AEOTab.tsx
4287
- var import_jsx_runtime11 = require("react/jsx-runtime");
4646
+ var import_jsx_runtime12 = require("react/jsx-runtime");
4288
4647
  var AEO_PURPLE = "#005DAC";
4289
4648
  var GEO_TEAL = "#C9A716";
4290
4649
  var cardStyle3 = {
@@ -4296,7 +4655,7 @@ var cardStyle3 = {
4296
4655
  padding: "14px"
4297
4656
  };
4298
4657
  function AiPill() {
4299
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4658
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4300
4659
  "span",
4301
4660
  {
4302
4661
  style: {
@@ -4315,16 +4674,16 @@ function AiPill() {
4315
4674
  );
4316
4675
  }
4317
4676
  function SectionHeader2({ label, iconColor, ai }) {
4318
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4319
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4320
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4321
- ai && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AiPill, {})
4677
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4678
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4679
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4680
+ ai && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AiPill, {})
4322
4681
  ] });
4323
4682
  }
4324
4683
  function CopyButton({ text }) {
4325
- const [copied, setCopied] = (0, import_react14.useState)(false);
4326
- const copyTimerRef = (0, import_react14.useRef)(null);
4327
- (0, import_react14.useEffect)(() => {
4684
+ const [copied, setCopied] = (0, import_react15.useState)(false);
4685
+ const copyTimerRef = (0, import_react15.useRef)(null);
4686
+ (0, import_react15.useEffect)(() => {
4328
4687
  return () => {
4329
4688
  if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
4330
4689
  };
@@ -4337,7 +4696,7 @@ function CopyButton({ text }) {
4337
4696
  } catch {
4338
4697
  }
4339
4698
  };
4340
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4699
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4341
4700
  "button",
4342
4701
  {
4343
4702
  onClick: handleCopy,
@@ -4356,9 +4715,9 @@ function CopyButton({ text }) {
4356
4715
  transition: "color 150ms"
4357
4716
  },
4358
4717
  title: copied ? "Copied!" : "Copy to clipboard",
4359
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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__ */ (0, import_jsx_runtime11.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4360
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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" }),
4361
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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" })
4718
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4719
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }),
4720
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" })
4362
4721
  ] })
4363
4722
  }
4364
4723
  );
@@ -4373,13 +4732,13 @@ function GEOCard({ geo, publication }) {
4373
4732
  const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
4374
4733
  const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
4375
4734
  const totalHeadings = geo.headingAudit.length;
4376
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
4377
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4378
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4379
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4735
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
4736
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4737
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4738
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4380
4739
  ] }),
4381
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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." }),
4382
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4740
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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." }),
4741
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4383
4742
  "div",
4384
4743
  {
4385
4744
  style: {
@@ -4392,7 +4751,7 @@ function GEOCard({ geo, publication }) {
4392
4751
  marginBottom: 8
4393
4752
  },
4394
4753
  children: [
4395
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4754
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4396
4755
  "div",
4397
4756
  {
4398
4757
  style: {
@@ -4408,17 +4767,17 @@ function GEOCard({ geo, publication }) {
4408
4767
  boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
4409
4768
  },
4410
4769
  children: [
4411
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4412
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4770
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4771
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4413
4772
  ]
4414
4773
  }
4415
4774
  ),
4416
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
4417
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4775
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
4776
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4418
4777
  "Fact density: ",
4419
4778
  fdLabel
4420
4779
  ] }),
4421
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4780
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4422
4781
  fd.factCount,
4423
4782
  " specific stat",
4424
4783
  fd.factCount === 1 ? "" : "s",
@@ -4434,7 +4793,7 @@ function GEOCard({ geo, publication }) {
4434
4793
  ]
4435
4794
  }
4436
4795
  ),
4437
- fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4796
+ fd.driftPassages > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4438
4797
  "div",
4439
4798
  {
4440
4799
  style: {
@@ -4448,15 +4807,15 @@ function GEOCard({ geo, publication }) {
4448
4807
  lineHeight: 1.45
4449
4808
  },
4450
4809
  children: [
4451
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: fd.driftPassages }),
4810
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: fd.driftPassages }),
4452
4811
  " passage",
4453
4812
  fd.driftPassages === 1 ? "" : "s",
4454
4813
  " over 200 words with no specific stats or citations. AI engines tend to skip these."
4455
4814
  ]
4456
4815
  }
4457
4816
  ),
4458
- totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { marginTop: 4 }, children: [
4459
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4817
+ totalHeadings > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { marginTop: 4 }, children: [
4818
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4460
4819
  "button",
4461
4820
  {
4462
4821
  onClick: () => setShowDetails((v) => !v),
@@ -4475,22 +4834,22 @@ function GEOCard({ geo, publication }) {
4475
4834
  color: GEO_TEAL
4476
4835
  },
4477
4836
  children: [
4478
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { children: [
4837
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
4479
4838
  "Short-answer paragraphs: ",
4480
4839
  goodCount,
4481
4840
  "/",
4482
4841
  totalHeadings,
4483
4842
  " headings have one"
4484
4843
  ] }),
4485
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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" }) })
4844
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }) })
4486
4845
  ]
4487
4846
  }
4488
4847
  ),
4489
- showDetails && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4490
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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." }),
4848
+ showDetails && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4849
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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." }),
4491
4850
  geo.headingAudit.map((h, i) => {
4492
4851
  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" };
4493
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4852
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4494
4853
  "div",
4495
4854
  {
4496
4855
  style: {
@@ -4504,8 +4863,8 @@ function GEOCard({ geo, publication }) {
4504
4863
  gap: 8
4505
4864
  },
4506
4865
  children: [
4507
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4508
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4866
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4867
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4509
4868
  ]
4510
4869
  },
4511
4870
  i
@@ -4528,7 +4887,7 @@ function AEOTab({
4528
4887
  csError,
4529
4888
  loadContentSuggestions
4530
4889
  }) {
4531
- const geo = (0, import_react14.useMemo)(() => analyzeGEO(text, headings), [text, headings]);
4890
+ const geo = (0, import_react15.useMemo)(() => analyzeGEO(text, headings), [text, headings]);
4532
4891
  const geoWordCount = text ? text.trim().split(/\s+/).filter(Boolean).length : 0;
4533
4892
  const hasEnoughTextForGEO = geoWordCount >= 150;
4534
4893
  const hasEnoughText = text && text.trim().length >= 50;
@@ -4542,11 +4901,19 @@ function AEOTab({
4542
4901
  originalHeading: void 0,
4543
4902
  rationale: h.rationale
4544
4903
  })) ?? [];
4545
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4546
- aeoContentChanged && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4904
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4905
+ aeoContentChanged && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4547
4906
  "div",
4548
4907
  {
4549
4908
  onClick: runDeepAnalysis,
4909
+ role: "button",
4910
+ tabIndex: 0,
4911
+ onKeyDown: (e) => {
4912
+ if (e.key === "Enter" || e.key === " ") {
4913
+ e.preventDefault();
4914
+ runDeepAnalysis();
4915
+ }
4916
+ },
4550
4917
  style: {
4551
4918
  padding: "8px 12px",
4552
4919
  background: "#fffbeb",
@@ -4558,30 +4925,30 @@ function AEOTab({
4558
4925
  cursor: "pointer"
4559
4926
  },
4560
4927
  children: [
4561
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4562
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4928
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4929
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4563
4930
  ]
4564
4931
  }
4565
4932
  ),
4566
- hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(GEOCard, { geo, publication }),
4567
- hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4568
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4933
+ hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GEOCard, { geo, publication }),
4934
+ hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4935
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4569
4936
  " needs at least 150 words to read fact density.",
4570
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
4571
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: { color: "#4b5563" }, children: [
4937
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {}),
4938
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { color: "#4b5563" }, children: [
4572
4939
  "Current: ",
4573
4940
  geoWordCount,
4574
4941
  " word",
4575
4942
  geoWordCount === 1 ? "" : "s"
4576
4943
  ] })
4577
4944
  ] }) }),
4578
- !deepAnalysis && isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4579
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4580
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4945
+ !deepAnalysis && isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4946
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4947
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4581
4948
  ] }),
4582
- !deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4583
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4584
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
4949
+ !deepAnalysis && !isDeepLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4950
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4951
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4585
4952
  "button",
4586
4953
  {
4587
4954
  onClick: runDeepAnalysis,
@@ -4601,11 +4968,11 @@ function AEOTab({
4601
4968
  }
4602
4969
  )
4603
4970
  ] }),
4604
- deepAnalysis && !aeo && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4605
- questionHeadings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
4606
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4607
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4608
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
4971
+ deepAnalysis && !aeo && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4972
+ questionHeadings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
4973
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4974
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4975
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4609
4976
  "div",
4610
4977
  {
4611
4978
  style: {
@@ -4615,26 +4982,26 @@ function AEOTab({
4615
4982
  borderLeft: `3px solid ${AEO_PURPLE}`
4616
4983
  },
4617
4984
  children: [
4618
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4619
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { flex: 1 }, children: [
4620
- h.originalHeading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
4621
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
4985
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4986
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { flex: 1 }, children: [
4987
+ h.originalHeading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
4988
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
4622
4989
  ] }),
4623
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4624
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: h.heading }),
4625
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
4990
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4991
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: h.heading }),
4992
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
4626
4993
  ] })
4627
4994
  ] }),
4628
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
4995
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
4629
4996
  ]
4630
4997
  },
4631
4998
  i
4632
4999
  )) })
4633
5000
  ] }),
4634
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: cardStyle3, children: [
4635
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
4636
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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." }),
4637
- !contentSuggestions && !isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5001
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: cardStyle3, children: [
5002
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
5003
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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." }),
5004
+ !contentSuggestions && !isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4638
5005
  "button",
4639
5006
  {
4640
5007
  onClick: loadContentSuggestions,
@@ -4658,15 +5025,15 @@ function AEOTab({
4658
5025
  children: "Generate suggestions"
4659
5026
  }
4660
5027
  ),
4661
- isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
4662
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4663
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
5028
+ isCSLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
5029
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LoadingBars, { size: "xs", color: AEO_PURPLE }),
5030
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
4664
5031
  ] }),
4665
- csError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
4666
- contentSuggestions && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
4667
- contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
4668
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
4669
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5032
+ csError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
5033
+ contentSuggestions && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
5034
+ contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
5035
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
5036
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4670
5037
  "div",
4671
5038
  {
4672
5039
  style: {
@@ -4679,19 +5046,19 @@ function AEOTab({
4679
5046
  alignItems: "flex-start"
4680
5047
  },
4681
5048
  children: [
4682
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
4683
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4684
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: kt }),
4685
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
5049
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
5050
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5051
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: kt }),
5052
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
4686
5053
  ] })
4687
5054
  ]
4688
5055
  },
4689
5056
  i
4690
5057
  )) })
4691
5058
  ] }),
4692
- contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
4693
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
4694
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5059
+ contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
5060
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
5061
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
4695
5062
  "div",
4696
5063
  {
4697
5064
  style: {
@@ -4701,23 +5068,23 @@ function AEOTab({
4701
5068
  borderLeft: `2px solid ${AEO_PURPLE}`
4702
5069
  },
4703
5070
  children: [
4704
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4705
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
4706
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
5071
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5072
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
5073
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
4707
5074
  ] }),
4708
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
5075
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
4709
5076
  ]
4710
5077
  },
4711
5078
  i
4712
5079
  )) })
4713
5080
  ] }),
4714
- contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { children: [
4715
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
4716
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4717
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
4718
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4719
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
4720
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5081
+ contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
5082
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
5083
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5084
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
5085
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5086
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
5087
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4721
5088
  FeedbackButton,
4722
5089
  {
4723
5090
  suggestionType: "aeo_bullets",
@@ -4728,7 +5095,7 @@ function AEOTab({
4728
5095
  ] })
4729
5096
  ] })
4730
5097
  ] }),
4731
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5098
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
4732
5099
  "button",
4733
5100
  {
4734
5101
  onClick: loadContentSuggestions,
@@ -4757,8 +5124,8 @@ function AEOTab({
4757
5124
  }
4758
5125
 
4759
5126
  // src/components/ScoreDonut.tsx
4760
- var import_react15 = require("react");
4761
- var import_jsx_runtime12 = require("react/jsx-runtime");
5127
+ var import_react16 = require("react");
5128
+ var import_jsx_runtime13 = require("react/jsx-runtime");
4762
5129
  var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
4763
5130
  var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
4764
5131
  var TRACK = "#eef2f7";
@@ -4770,7 +5137,7 @@ function ScoreDonut({
4770
5137
  sectionFit,
4771
5138
  composite
4772
5139
  }) {
4773
- const [hovered, setHovered] = (0, import_react15.useState)(false);
5140
+ const [hovered, setHovered] = (0, import_react16.useState)(false);
4774
5141
  const radius = (size - strokeWidth) / 2;
4775
5142
  const circumference = 2 * Math.PI * radius;
4776
5143
  const cTopic = topic * W.topic;
@@ -4783,7 +5150,7 @@ function ScoreDonut({
4783
5150
  const topicLen = seg(cTopic);
4784
5151
  const freshLen = seg(cFresh);
4785
5152
  const sectionLen = seg(cSection);
4786
- const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5153
+ const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4787
5154
  "circle",
4788
5155
  {
4789
5156
  cx: size / 2,
@@ -4797,20 +5164,20 @@ function ScoreDonut({
4797
5164
  strokeDashoffset: -offset
4798
5165
  }
4799
5166
  );
4800
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5167
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4801
5168
  "div",
4802
5169
  {
4803
5170
  style: { position: "relative", width: size, height: size, flexShrink: 0 },
4804
5171
  onMouseEnter: () => setHovered(true),
4805
5172
  onMouseLeave: () => setHovered(false),
4806
5173
  children: [
4807
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
4808
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
4809
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
4810
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
4811
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
5174
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
5175
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
5176
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
5177
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
5178
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
4812
5179
  ] }),
4813
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5180
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4814
5181
  "div",
4815
5182
  {
4816
5183
  style: {
@@ -4824,15 +5191,15 @@ function ScoreDonut({
4824
5191
  lineHeight: 1
4825
5192
  },
4826
5193
  children: [
4827
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
5194
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
4828
5195
  compositeValue,
4829
5196
  "%"
4830
5197
  ] }),
4831
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
5198
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
4832
5199
  ]
4833
5200
  }
4834
5201
  ),
4835
- hovered && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5202
+ hovered && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
4836
5203
  "div",
4837
5204
  {
4838
5205
  role: "tooltip",
@@ -4853,9 +5220,9 @@ function ScoreDonut({
4853
5220
  pointerEvents: "none"
4854
5221
  },
4855
5222
  children: [
4856
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
4857
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
4858
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
5223
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
5224
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
5225
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
4859
5226
  ]
4860
5227
  }
4861
5228
  )
@@ -4864,31 +5231,31 @@ function ScoreDonut({
4864
5231
  );
4865
5232
  }
4866
5233
  function SubScoreRow({ color, label, value }) {
4867
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
4868
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
4869
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { flex: 1 }, children: label }),
4870
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
5234
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
5235
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
5236
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { flex: 1 }, children: label }),
5237
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
4871
5238
  Math.round(value),
4872
5239
  "/100"
4873
5240
  ] })
4874
5241
  ] });
4875
5242
  }
4876
5243
  function ScoreDonutLegend() {
4877
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
4878
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
4879
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
4880
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
5244
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
5245
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
5246
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
5247
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
4881
5248
  ] });
4882
5249
  }
4883
5250
  function LegendDot({ color, label }) {
4884
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
4885
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
5251
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5252
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
4886
5253
  label
4887
5254
  ] });
4888
5255
  }
4889
5256
 
4890
5257
  // src/components/tabs/LinkingTab.tsx
4891
- var import_jsx_runtime13 = require("react/jsx-runtime");
5258
+ var import_jsx_runtime14 = require("react/jsx-runtime");
4892
5259
  function buildLiveUrl(publication, slug) {
4893
5260
  if (!slug) return null;
4894
5261
  const pub = (publication || "").trim().toLowerCase();
@@ -4904,7 +5271,7 @@ function buildSanityUrl(baseUrl, id, type) {
4904
5271
  return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
4905
5272
  }
4906
5273
  function LinkChip({ href, label, color }) {
4907
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5274
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4908
5275
  "a",
4909
5276
  {
4910
5277
  href,
@@ -4926,14 +5293,38 @@ function LinkChip({ href, label, color }) {
4926
5293
  },
4927
5294
  children: [
4928
5295
  label,
4929
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
4930
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" }),
4931
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" })
5296
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5297
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }),
5298
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" })
4932
5299
  ] })
4933
5300
  ]
4934
5301
  }
4935
5302
  );
4936
5303
  }
5304
+ function ClickableBadge({ clickable }) {
5305
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5306
+ "span",
5307
+ {
5308
+ style: {
5309
+ fontSize: 9,
5310
+ fontWeight: 700,
5311
+ textTransform: "uppercase",
5312
+ letterSpacing: "0.04em",
5313
+ padding: "2px 7px",
5314
+ borderRadius: 99,
5315
+ display: "inline-flex",
5316
+ alignItems: "center",
5317
+ gap: 4,
5318
+ background: clickable ? "rgba(22,163,74,0.12)" : "rgba(0,0,0,0.05)",
5319
+ color: clickable ? "#16a34a" : "#9ca3af"
5320
+ },
5321
+ children: [
5322
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
5323
+ clickable ? "Clickable link" : "No live link"
5324
+ ]
5325
+ }
5326
+ );
5327
+ }
4937
5328
  var cardStyle4 = {
4938
5329
  borderRadius: 14,
4939
5330
  background: "rgba(255,255,255,0.55)",
@@ -4943,7 +5334,7 @@ var cardStyle4 = {
4943
5334
  padding: "14px"
4944
5335
  };
4945
5336
  function AiPill2() {
4946
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5337
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4947
5338
  "span",
4948
5339
  {
4949
5340
  style: {
@@ -4967,10 +5358,10 @@ function SectionHeader3({
4967
5358
  ai,
4968
5359
  action
4969
5360
  }) {
4970
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
4971
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4972
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4973
- ai && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AiPill2, {}),
5361
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
5362
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
5363
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
5364
+ ai && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AiPill2, {}),
4974
5365
  action
4975
5366
  ] });
4976
5367
  }
@@ -4991,7 +5382,7 @@ function freshnessChip(label, score) {
4991
5382
  };
4992
5383
  const c = map[label];
4993
5384
  if (!c) return null;
4994
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5385
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
4995
5386
  "span",
4996
5387
  {
4997
5388
  style: {
@@ -5011,8 +5402,8 @@ function freshnessChip(label, score) {
5011
5402
  );
5012
5403
  }
5013
5404
  function RefreshIcon({ spinning }) {
5014
- if (spinning) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" });
5015
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" }) });
5405
+ if (spinning) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingBars, { size: "xs", color: "#9ca3af" });
5406
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }) });
5016
5407
  }
5017
5408
  function LinkingTab({
5018
5409
  analysis,
@@ -5028,21 +5419,21 @@ function LinkingTab({
5028
5419
  documentType
5029
5420
  }) {
5030
5421
  if (!analysis) {
5031
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
5032
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5033
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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." })
5422
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
5423
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5424
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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." })
5034
5425
  ] });
5035
5426
  }
5036
5427
  const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
5037
5428
  const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
5038
5429
  const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
5039
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5040
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5430
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5431
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5041
5432
  SectionHeader3,
5042
5433
  {
5043
5434
  label: "Suggested Links",
5044
5435
  iconColor: MJH_BLUE,
5045
- action: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5436
+ action: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5046
5437
  "button",
5047
5438
  {
5048
5439
  onClick: onRefresh,
@@ -5057,20 +5448,20 @@ function LinkingTab({
5057
5448
  fontSize: 10
5058
5449
  },
5059
5450
  title: "Refresh",
5060
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RefreshIcon, { spinning: isLoading })
5451
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RefreshIcon, { spinning: isLoading })
5061
5452
  }
5062
5453
  )
5063
5454
  }
5064
5455
  ),
5065
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5456
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5066
5457
  "Other articles on this site that fit this topic.",
5067
- wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
5458
+ wordCount2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5068
5459
  " ",
5069
5460
  "For a ",
5070
5461
  wordCount2.toLocaleString(),
5071
5462
  "-word article, aim for",
5072
5463
  " ",
5073
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("strong", { children: [
5464
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("strong", { children: [
5074
5465
  recommendedMin,
5075
5466
  "-",
5076
5467
  recommendedMax,
@@ -5079,17 +5470,17 @@ function LinkingTab({
5079
5470
  "."
5080
5471
  ] })
5081
5472
  ] }),
5082
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5473
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5083
5474
  "Each suggestion gets a 0-100% match score from three signals - ",
5084
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "topic match" }),
5475
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "topic match" }),
5085
5476
  ", ",
5086
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "freshness" }),
5477
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "freshness" }),
5087
5478
  ", and ",
5088
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: "section fit" }),
5479
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: "section fit" }),
5089
5480
  " (where in your article the link belongs). The percentage on each card is the weighted total:"
5090
5481
  ] }),
5091
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScoreDonutLegend, {}) }),
5092
- isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5482
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ScoreDonutLegend, {}) }),
5483
+ isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5093
5484
  "div",
5094
5485
  {
5095
5486
  role: "button",
@@ -5114,16 +5505,16 @@ function LinkingTab({
5114
5505
  cursor: "pointer"
5115
5506
  },
5116
5507
  children: [
5117
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5118
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5508
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5509
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5119
5510
  ]
5120
5511
  }
5121
5512
  ),
5122
- isLoading && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5123
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
5124
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5513
+ isLoading && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5514
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
5515
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5125
5516
  ] }),
5126
- !isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5517
+ !isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5127
5518
  "div",
5128
5519
  {
5129
5520
  style: {
@@ -5134,9 +5525,9 @@ function LinkingTab({
5134
5525
  textAlign: "center"
5135
5526
  },
5136
5527
  children: [
5137
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5138
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5139
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5528
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5529
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5530
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5140
5531
  "button",
5141
5532
  {
5142
5533
  onClick: onRefresh,
@@ -5156,104 +5547,162 @@ function LinkingTab({
5156
5547
  ]
5157
5548
  }
5158
5549
  ),
5159
- !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("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: [
5160
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5161
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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." })
5550
+ !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("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: [
5551
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5552
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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." })
5162
5553
  ] }),
5163
- suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5164
- "div",
5165
- {
5166
- style: {
5167
- padding: "10px 12px",
5168
- background: "rgba(0,93,172,0.03)",
5169
- borderRadius: 10,
5170
- borderLeft: `2px solid ${MJH_BLUE}`,
5171
- display: "flex",
5172
- gap: 12,
5173
- alignItems: "flex-start"
5174
- },
5175
- children: [
5176
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5177
- ScoreDonut,
5178
- {
5179
- size: 64,
5180
- topic: Math.max(0, Math.min(100, s.topicScore)),
5181
- freshness: Math.max(0, Math.min(100, s.freshnessScore)),
5182
- sectionFit: Math.max(0, Math.min(100, s.sectionFitScore)),
5183
- composite: Math.max(0, Math.min(100, s.compositeScore))
5184
- }
5185
- ),
5186
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
5187
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5188
- freshnessChip(s.freshnessLabel, s.freshnessScore),
5189
- s.publishedAt && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) })
5190
- ] }),
5191
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5192
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5193
- "/",
5194
- s.slug
5195
- ] }),
5196
- (() => {
5197
- const liveUrl = buildLiveUrl(publication, s.slug);
5198
- const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
5199
- if (!liveUrl && !sanityUrl) return null;
5200
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5201
- sanityUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5202
- liveUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5203
- ] });
5204
- })(),
5205
- s.relevanceReason && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5206
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5207
- " ",
5208
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5554
+ suggestions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
5555
+ const liveUrl = buildLiveUrl(publication, s.slug);
5556
+ const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
5557
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5558
+ "div",
5559
+ {
5560
+ style: {
5561
+ padding: "10px 12px",
5562
+ background: "rgba(0,93,172,0.03)",
5563
+ borderRadius: 10,
5564
+ borderLeft: `2px solid ${MJH_BLUE}`,
5565
+ display: "flex",
5566
+ gap: 12,
5567
+ alignItems: "flex-start"
5568
+ },
5569
+ children: [
5570
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5571
+ ScoreDonut,
5572
+ {
5573
+ size: 64,
5574
+ topic: Math.max(0, Math.min(100, s.topicScore)),
5575
+ freshness: Math.max(0, Math.min(100, s.freshnessScore)),
5576
+ sectionFit: Math.max(0, Math.min(100, s.sectionFitScore)),
5577
+ composite: Math.max(0, Math.min(100, s.compositeScore))
5578
+ }
5579
+ ),
5580
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [
5581
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5582
+ freshnessChip(s.freshnessLabel, s.freshnessScore),
5583
+ s.publishedAt && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
5584
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ClickableBadge, { clickable: !!liveUrl })
5585
+ ] }),
5586
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5587
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5588
+ "/",
5589
+ s.slug
5590
+ ] }),
5591
+ (liveUrl || sanityUrl) && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5592
+ sanityUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5593
+ liveUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5594
+ ] }),
5595
+ s.relevanceReason && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5596
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5597
+ " ",
5598
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5599
+ ] }),
5600
+ s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
5601
+ "div",
5602
+ {
5603
+ style: {
5604
+ marginTop: 4,
5605
+ padding: "6px 9px",
5606
+ background: "rgba(0,0,0,0.025)",
5607
+ borderRadius: 6,
5608
+ borderLeft: "2px solid #cbd5e1",
5609
+ fontSize: 11,
5610
+ color: "#1f2937",
5611
+ lineHeight: 1.5
5612
+ },
5613
+ children: [
5614
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5615
+ "Where to link from - paragraph ",
5616
+ s.anchorParagraph
5617
+ ] }),
5618
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { fontStyle: "italic" }, children: [
5619
+ '"',
5620
+ s.anchorQuote,
5621
+ '"'
5622
+ ] }),
5623
+ s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5624
+ ]
5625
+ }
5626
+ )
5209
5627
  ] }),
5210
- s.anchorQuote && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
5211
- "div",
5628
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5629
+ FeedbackButton,
5212
5630
  {
5213
- style: {
5214
- marginTop: 4,
5215
- padding: "6px 9px",
5216
- background: "rgba(0,0,0,0.025)",
5217
- borderRadius: 6,
5218
- borderLeft: "2px solid #cbd5e1",
5219
- fontSize: 11,
5220
- color: "#1f2937",
5221
- lineHeight: 1.5
5222
- },
5223
- children: [
5224
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5225
- "Where to link from - paragraph ",
5226
- s.anchorParagraph
5227
- ] }),
5228
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: { fontStyle: "italic" }, children: [
5229
- '"',
5230
- s.anchorQuote,
5231
- '"'
5232
- ] }),
5233
- s.anchorReason && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5234
- ]
5631
+ suggestionType: "internal_link",
5632
+ suggestionText: s.title,
5633
+ publication,
5634
+ documentId
5235
5635
  }
5236
- )
5237
- ] }),
5238
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5239
- FeedbackButton,
5240
- {
5241
- suggestionType: "internal_link",
5242
- suggestionText: s.title,
5243
- publication,
5244
- documentId
5245
- }
5246
- ) })
5247
- ]
5248
- },
5249
- s._id
5250
- )) })
5636
+ ) })
5637
+ ]
5638
+ },
5639
+ s._id
5640
+ );
5641
+ }) })
5251
5642
  ] }) });
5252
5643
  }
5253
5644
 
5254
5645
  // src/components/tabs/MetaTab.tsx
5255
- var import_react16 = require("react");
5256
- var import_jsx_runtime14 = require("react/jsx-runtime");
5646
+ var import_react17 = require("react");
5647
+ var import_jsx_runtime15 = require("react/jsx-runtime");
5648
+ var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
5649
+ function ExternalLinkChip({ href, label }) {
5650
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5651
+ "a",
5652
+ {
5653
+ href,
5654
+ target: "_blank",
5655
+ rel: "noopener noreferrer",
5656
+ style: {
5657
+ display: "inline-flex",
5658
+ alignItems: "center",
5659
+ gap: 4,
5660
+ marginTop: 8,
5661
+ padding: "3px 9px",
5662
+ borderRadius: 99,
5663
+ fontSize: 10.5,
5664
+ fontWeight: 700,
5665
+ color: MJH_BLUE,
5666
+ background: "rgba(255,255,255,0.7)",
5667
+ border: `1px solid ${MJH_BLUE}33`,
5668
+ textDecoration: "none",
5669
+ lineHeight: 1.2
5670
+ },
5671
+ children: [
5672
+ label,
5673
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5674
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" }),
5675
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" })
5676
+ ] })
5677
+ ]
5678
+ }
5679
+ );
5680
+ }
5681
+ function FreshnessNotice() {
5682
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5683
+ "div",
5684
+ {
5685
+ style: {
5686
+ padding: "9px 12px",
5687
+ background: "rgba(0,93,172,0.05)",
5688
+ border: "1px solid rgba(0,93,172,0.15)",
5689
+ borderLeft: `3px solid ${MJH_BLUE}`,
5690
+ borderRadius: 8,
5691
+ fontSize: 11,
5692
+ color: "#1f2937",
5693
+ lineHeight: 1.5
5694
+ },
5695
+ children: [
5696
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
5697
+ "Planning to update this article after it's published? Set the ",
5698
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Updated on" }),
5699
+ " date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
5700
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: "Latest Updated Articles" }),
5701
+ " and increases its visibility in search engine results."
5702
+ ]
5703
+ }
5704
+ );
5705
+ }
5257
5706
  var cardStyle5 = {
5258
5707
  borderRadius: 14,
5259
5708
  background: "rgba(255,255,255,0.55)",
@@ -5269,7 +5718,7 @@ function StatusBadge({ status }) {
5269
5718
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
5270
5719
  };
5271
5720
  const c = map[status];
5272
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5721
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5273
5722
  "span",
5274
5723
  {
5275
5724
  style: {
@@ -5288,12 +5737,12 @@ function StatusBadge({ status }) {
5288
5737
  );
5289
5738
  }
5290
5739
  function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5291
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { id: anchorId, style: cardStyle5, children: [
5292
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5293
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5294
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StatusBadge, { status })
5740
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: anchorId, style: cardStyle5, children: [
5741
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5742
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5743
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusBadge, { status })
5295
5744
  ] }),
5296
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5745
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5297
5746
  "div",
5298
5747
  {
5299
5748
  style: {
@@ -5306,7 +5755,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5306
5755
  children: value
5307
5756
  }
5308
5757
  ),
5309
- recommendation && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5758
+ recommendation && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5310
5759
  "div",
5311
5760
  {
5312
5761
  style: {
@@ -5432,13 +5881,13 @@ function formatDateShort(iso) {
5432
5881
  return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
5433
5882
  }
5434
5883
  function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }) {
5435
- const audits = (0, import_react16.useMemo)(() => {
5884
+ const audits = (0, import_react17.useMemo)(() => {
5436
5885
  const list = [];
5437
5886
  list.push(titleAudit(documentFields?.title, primaryKeyword));
5438
5887
  list.push(metaDescriptionAudit(documentFields?.metaDescription, primaryKeyword, secondaryKeyword));
5439
5888
  return list;
5440
5889
  }, [documentFields, primaryKeyword, secondaryKeyword]);
5441
- const eeatItems = (0, import_react16.useMemo)(() => {
5890
+ const eeatItems = (0, import_react17.useMemo)(() => {
5442
5891
  const items = [];
5443
5892
  const author = documentFields?.authorName;
5444
5893
  const creds = documentFields?.authorCredentials;
@@ -5455,41 +5904,66 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5455
5904
  } else {
5456
5905
  items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
5457
5906
  }
5458
- const published = documentFields?.publishedAt;
5459
- const updated = documentFields?.updatedAt;
5460
- const reviewed = documentFields?.lastReviewedAt;
5461
- const daysPub = daysSince(published);
5462
- const daysUpd = daysSince(updated);
5463
- const daysRev = daysSince(reviewed);
5464
- const freshness = Math.min(...[daysUpd, daysRev, daysPub].filter((d) => d !== null));
5465
- if (!published) {
5466
- items.push({ 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." });
5467
- } else if (daysPub === null) {
5468
- items.push({ 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." });
5907
+ items[0].footer = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
5908
+ const factChecker = documentFields?.factCheckerName;
5909
+ const factCheckerRef = documentFields?.factCheckerIsReference;
5910
+ if (factChecker) {
5911
+ items.push({ label: "Fact-Checker", value: factChecker, status: "good" });
5912
+ } else if (factCheckerRef) {
5913
+ items.push({ label: "Fact-Checker", value: "Set (reference)", status: "good", recommendation: "A fact-checker is linked as a reference. Open the linked person to confirm the name shows on the published page." });
5469
5914
  } else {
5470
- items.push({ label: "Publish Date", value: formatDateShort(published), status: "good" });
5915
+ items.push({ label: "Fact-Checker", value: "Not set", status: "warning", recommendation: 'Add a second named person as a fact-checker, separate from the author. A visible "Fact checked by" line is a strong trust signal for healthcare content.' });
5471
5916
  }
5472
- if (Number.isFinite(freshness)) {
5473
- if (freshness <= 14) {
5474
- items.push({ label: "Last Updated", value: `${freshness} day${freshness === 1 ? "" : "s"} ago`, status: "good" });
5475
- } else if (freshness <= 90) {
5476
- items.push({ label: "Last Updated", value: `${freshness} days ago`, status: "warning", recommendation: "Articles older than two weeks get cited less by AI search. If the content is still accurate, refresh stats or add a last-reviewed date." });
5917
+ const dated = [];
5918
+ const addDate = (verb, days) => {
5919
+ if (days !== null) dated.push({ verb, days });
5920
+ };
5921
+ addDate("Updated", daysSince(documentFields?.updatedAt));
5922
+ addDate("Reviewed", daysSince(documentFields?.lastReviewedAt));
5923
+ addDate("Published", daysSince(documentFields?.publishedAt));
5924
+ if (dated.length > 0) {
5925
+ const freshest = dated.reduce((a, b) => b.days < a.days ? b : a);
5926
+ const days = freshest.days;
5927
+ const ago = days <= 0 ? "today" : days === 1 ? "1 day ago" : `${days} days ago`;
5928
+ const value = `${freshest.verb} ${ago}`;
5929
+ if (days <= 14) {
5930
+ 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." });
5931
+ } else if (days <= 90) {
5932
+ 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." });
5477
5933
  } else {
5478
- items.push({ label: "Last Updated", value: `${freshness} days ago`, status: "error", recommendation: "Older than 90 days. Review the facts, update what's stale, and timestamp the refresh." });
5934
+ 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." });
5479
5935
  }
5480
5936
  }
5481
5937
  return items;
5482
5938
  }, [documentFields]);
5939
+ const publishDateItem = (0, import_react17.useMemo)(() => {
5940
+ const published = documentFields?.publishedAt;
5941
+ const daysPub = daysSince(published);
5942
+ 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." };
5943
+ 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." };
5944
+ return { label: "Publish Date", value: formatDateShort(published), status: "good" };
5945
+ }, [documentFields]);
5483
5946
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
5484
5947
  if (isLoading && !hasAnyField) {
5485
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
5486
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5487
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5948
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
5949
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5950
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5488
5951
  ] });
5489
5952
  }
5490
5953
  const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
5491
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5492
- audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5954
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5955
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FreshnessNotice, {}),
5956
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5957
+ AuditCard,
5958
+ {
5959
+ anchorId: "anchor-publish-date",
5960
+ label: publishDateItem.label,
5961
+ value: publishDateItem.value,
5962
+ status: publishDateItem.status,
5963
+ recommendation: publishDateItem.recommendation
5964
+ }
5965
+ ),
5966
+ audits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5493
5967
  AuditCard,
5494
5968
  {
5495
5969
  anchorId: auditAnchors[i],
@@ -5500,20 +5974,21 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5500
5974
  },
5501
5975
  i
5502
5976
  )),
5503
- eeatItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
5504
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
5505
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
5506
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
5507
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
5977
+ eeatItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
5978
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
5979
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
5980
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
5981
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
5508
5982
  ] }),
5509
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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." }),
5510
- eeatItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
5983
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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." }),
5984
+ eeatItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5511
5985
  AuditCard,
5512
5986
  {
5513
5987
  label: item.label,
5514
5988
  value: item.value,
5515
5989
  status: item.status,
5516
- recommendation: item.recommendation
5990
+ recommendation: item.recommendation,
5991
+ footer: item.footer
5517
5992
  },
5518
5993
  `eeat-${i}`
5519
5994
  ))
@@ -5522,8 +5997,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5522
5997
  }
5523
5998
 
5524
5999
  // src/components/tabs/TechnicalTab.tsx
5525
- var import_react17 = require("react");
5526
- var import_jsx_runtime15 = require("react/jsx-runtime");
6000
+ var import_react18 = require("react");
6001
+ var import_jsx_runtime16 = require("react/jsx-runtime");
5527
6002
  function urlAudit(slug, primaryKeyword, secondaryKeyword) {
5528
6003
  const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
5529
6004
  if (!slug) {
@@ -5558,28 +6033,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
5558
6033
  return { label: "URL Slug", value: `/${slug}`, status: "good" };
5559
6034
  }
5560
6035
  function SlugRedirectNotice() {
5561
- const [expanded, setExpanded] = (0, import_react17.useState)(false);
5562
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
5563
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
5564
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" }) }),
5565
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
6036
+ const [expanded, setExpanded] = (0, import_react18.useState)(false);
6037
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
6038
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
6039
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) }),
6040
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
5566
6041
  ] }),
5567
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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." }),
5568
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6042
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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." }),
6043
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5569
6044
  "button",
5570
6045
  {
5571
6046
  onClick: () => setExpanded((v) => !v),
5572
6047
  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" },
5573
6048
  children: [
5574
6049
  expanded ? "Show less" : "Learn more",
5575
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("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" }) })
6050
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) })
5576
6051
  ]
5577
6052
  }
5578
6053
  ),
5579
- expanded && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
5580
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
5581
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
5582
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
6054
+ expanded && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
6055
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
6056
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
6057
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: "Set this up using vanity redirects in Sanity." })
5583
6058
  ] })
5584
6059
  ] }) });
5585
6060
  }
@@ -5598,7 +6073,7 @@ function StatusBadge2({ status }) {
5598
6073
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
5599
6074
  };
5600
6075
  const c = map[status];
5601
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6076
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5602
6077
  "span",
5603
6078
  {
5604
6079
  style: {
@@ -5624,12 +6099,12 @@ function AuditCard2({
5624
6099
  anchorId,
5625
6100
  footer
5626
6101
  }) {
5627
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: anchorId, style: cardStyle6, children: [
5628
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5629
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5630
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatusBadge2, { status })
6102
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: anchorId, style: cardStyle6, children: [
6103
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6104
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
6105
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StatusBadge2, { status })
5631
6106
  ] }),
5632
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6107
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5633
6108
  "div",
5634
6109
  {
5635
6110
  style: {
@@ -5642,7 +6117,7 @@ function AuditCard2({
5642
6117
  children: value
5643
6118
  }
5644
6119
  ),
5645
- recommendation && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6120
+ recommendation && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
5646
6121
  "div",
5647
6122
  {
5648
6123
  style: {
@@ -5774,7 +6249,7 @@ function imageTitleAudit(titles, imageCount) {
5774
6249
  status: "good"
5775
6250
  };
5776
6251
  }
5777
- function computeHeadingStructureAudits(headings, wordCount2) {
6252
+ function computeHeadingStructureAudits(headings, wordCount2, primaryKeyword, secondaryKeyword, unstyledHeadings) {
5778
6253
  const audits = [];
5779
6254
  const sectionCount = headings.filter((h) => h.level === 2 || h.level === 3).length;
5780
6255
  let densityFired = false;
@@ -5803,26 +6278,27 @@ function computeHeadingStructureAudits(headings, wordCount2) {
5803
6278
  });
5804
6279
  densityFired = true;
5805
6280
  }
6281
+ if (unstyledHeadings && unstyledHeadings.length > 0) {
6282
+ const n = unstyledHeadings.length;
6283
+ const examples = unstyledHeadings.slice(0, 2).map((t) => `"${t}"`).join(", ");
6284
+ audits.push({
6285
+ label: "Looks Like a Heading",
6286
+ value: `${n} line${n === 1 ? "" : "s"} read${n === 1 ? "s" : ""} like a heading but ${n === 1 ? "isn't" : "aren't"} styled`,
6287
+ status: "warning",
6288
+ recommendation: `${examples}${n > 2 ? ", and more," : ""} ${n === 1 ? "looks" : "look"} like a section heading typed as plain text. In Sanity, select the line and apply the "Heading 2" style so it counts as a real heading.`
6289
+ });
6290
+ }
5806
6291
  if (headings.length === 0) {
5807
6292
  if (!densityFired) {
5808
6293
  audits.push({
5809
6294
  label: "Heading Structure",
5810
6295
  value: "No headings in body",
5811
6296
  status: "warning",
5812
- recommendation: "Add H2 headings to break the article into scannable sections."
6297
+ recommendation: "Consider adding H2-H6 subheadings to structure the article into scannable sections."
5813
6298
  });
5814
6299
  }
5815
6300
  return audits;
5816
6301
  }
5817
- const h1s = headings.filter((h) => h.level === 1);
5818
- if (h1s.length > 0) {
5819
- audits.push({
5820
- label: "H1 in body",
5821
- value: `${h1s.length} H1 heading${h1s.length === 1 ? "" : "s"} in the body`,
5822
- status: "warning",
5823
- recommendation: "The article title is your H1. Body headings should start at H2 so the outline isn't ambiguous."
5824
- });
5825
- }
5826
6302
  let prevLevel = 0;
5827
6303
  const skips = [];
5828
6304
  for (const h of headings) {
@@ -5856,266 +6332,171 @@ function computeHeadingStructureAudits(headings, wordCount2) {
5856
6332
  status: "good"
5857
6333
  });
5858
6334
  }
6335
+ const subheads = headings.filter((h) => h.level >= 2);
6336
+ const subheadingText = subheads.map((h) => h.text).join(" ");
6337
+ const hasPrimaryInHeads = primaryKeyword ? containsKeywordTokens(subheadingText, primaryKeyword) : false;
6338
+ const hasSecondaryInHeads = secondaryKeyword ? containsKeywordTokens(subheadingText, secondaryKeyword) : false;
6339
+ if (subheads.length > 0 && (primaryKeyword || secondaryKeyword) && !hasPrimaryInHeads && !hasSecondaryInHeads) {
6340
+ const kw = [
6341
+ primaryKeyword ? `primary keyword "${primaryKeyword}"` : "",
6342
+ secondaryKeyword ? `secondary keyword "${secondaryKeyword}"` : ""
6343
+ ].filter(Boolean).join(" or ");
6344
+ audits.push({
6345
+ label: "Keywords in Headings",
6346
+ value: "No subheading uses your target keyword",
6347
+ status: "warning",
6348
+ recommendation: `Work your ${kw} into at least one H2 or H3. Keywords in headers reinforce relevance for readers and search engines.`
6349
+ });
6350
+ }
5859
6351
  return audits;
5860
6352
  }
6353
+ function HealthBadge({ result }) {
6354
+ const map = {
6355
+ ok: { color: "#16a34a", label: "OK" },
6356
+ redirect: { color: "#8B7310", label: result.status > 0 ? String(result.status) : "REDIR" },
6357
+ broken: { color: "#dc2626", label: result.status > 0 ? String(result.status) : "404" },
6358
+ unverified: { color: "#b45309", label: result.status > 0 ? String(result.status) : "BLOCKED" },
6359
+ error: { color: "#dc2626", label: "ERR" }
6360
+ };
6361
+ const c = map[result.category];
6362
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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 });
6363
+ }
5861
6364
  function LinkCheckCard({
5862
6365
  urls,
6366
+ linksDetailed,
5863
6367
  results,
5864
6368
  isLoading,
5865
6369
  error,
5866
6370
  hasRun,
5867
6371
  onCheck
5868
6372
  }) {
5869
- const counts = (0, import_react17.useMemo)(() => {
5870
- const total = results.length;
5871
- const valid = results.filter((r) => r.category === "ok").length;
5872
- const redirects = results.filter((r) => r.category === "redirect").length;
5873
- const broken = results.filter((r) => r.category === "broken").length;
5874
- const errored = results.filter((r) => r.category === "error").length;
5875
- const unverified = results.filter((r) => r.category === "unverified").length;
5876
- const issues = results.filter((r) => r.category !== "ok");
5877
- return { total, valid, redirects, broken, errored, unverified, issues };
5878
- }, [results]);
5879
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: "anchor-link-check", style: cardStyle6, children: [
5880
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5881
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
5882
- hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5883
- "button",
5884
- {
5885
- onClick: onCheck,
5886
- style: {
5887
- background: "none",
5888
- border: "none",
5889
- fontSize: 10,
5890
- fontWeight: 600,
5891
- color: MJH_BLUE,
5892
- cursor: "pointer",
5893
- padding: "2px 4px"
5894
- },
5895
- title: "Run again",
5896
- children: "Re-check"
5897
- }
5898
- )
5899
- ] }),
5900
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginBottom: 10 }, children: urls.length === 0 ? "No external links found in the body." : `${urls.length} link${urls.length === 1 ? "" : "s"} found in the body.` }),
5901
- urls.length > 0 && !hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5902
- "button",
6373
+ const [openBucket, setOpenBucket] = (0, import_react18.useState)(null);
6374
+ const haveTypes = !!linksDetailed;
6375
+ const detailByUrl = (0, import_react18.useMemo)(
6376
+ () => new Map((linksDetailed || []).map((d) => [d.url, d])),
6377
+ [linksDetailed]
6378
+ );
6379
+ const resultByUrl = (0, import_react18.useMemo)(() => new Map(results.map((r) => [r.url, r])), [results]);
6380
+ const blockedUrls = results.filter((r) => r.category === "unverified").map((r) => r.url);
6381
+ const tiles = (0, import_react18.useMemo)(() => {
6382
+ const hyper = (linksDetailed || []).filter((l) => l.hyperlinked).map((l) => l.url);
6383
+ const plain = (linksDetailed || []).filter((l) => !l.hyperlinked).map((l) => l.url);
6384
+ const working = results.filter((r) => r.category === "ok" || r.category === "redirect").map((r) => r.url);
6385
+ const broken = results.filter((r) => r.category === "broken" || r.category === "error").map((r) => r.url);
6386
+ const t = [];
6387
+ if (hasRun) t.push({ key: "working", label: "Working", color: "#16a34a", urls: working });
6388
+ if (haveTypes) t.push({ key: "linked", label: "Linked", color: "#16a34a", urls: hyper });
6389
+ if (hasRun) t.push({ key: "broken", label: "Broken", color: "#dc2626", urls: broken });
6390
+ if (haveTypes) t.push({ key: "notlinked", label: "Not linked", color: "#dc2626", urls: plain, note: "Not links yet - hyperlink these so readers can click them and search engines can follow them." });
6391
+ return t;
6392
+ }, [haveTypes, linksDetailed, hasRun, results]);
6393
+ const open = tiles.find((t) => t.key === openBucket) || null;
6394
+ const renderLinkRow = (url) => {
6395
+ const d = detailByUrl.get(url);
6396
+ const r = resultByUrl.get(url);
6397
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6398
+ "a",
5903
6399
  {
5904
- onClick: onCheck,
5905
- style: {
5906
- width: "100%",
5907
- padding: "8px 12px",
5908
- fontSize: 11,
5909
- fontWeight: 700,
5910
- color: "#1f2937",
5911
- background: MJH_GOLD,
5912
- border: "none",
5913
- borderRadius: 6,
5914
- cursor: "pointer",
5915
- letterSpacing: "0.01em"
5916
- },
6400
+ href: url,
6401
+ target: "_blank",
6402
+ rel: "noopener noreferrer",
6403
+ style: { display: "flex", gap: 8, alignItems: "flex-start", padding: "6px 8px", background: "rgba(0,0,0,0.025)", borderRadius: 6, textDecoration: "none", marginTop: 4 },
5917
6404
  children: [
5918
- "Check ",
5919
- urls.length,
5920
- " link",
5921
- urls.length === 1 ? "" : "s",
5922
- " for 404s"
6405
+ r && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(HealthBadge, { result: r }),
6406
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { minWidth: 0, flex: 1 }, children: [
6407
+ d?.anchorText && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
6408
+ "\u201C",
6409
+ d.anchorText,
6410
+ "\u201D"
6411
+ ] }),
6412
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
6413
+ ] })
5923
6414
  ]
5924
- }
5925
- ),
5926
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5927
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
5928
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
5929
- "Checking ",
6415
+ },
6416
+ url
6417
+ );
6418
+ };
6419
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: "anchor-link-check", style: cardStyle6, children: [
6420
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6421
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
6422
+ hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" })
6423
+ ] }),
6424
+ urls.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
6425
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
5930
6426
  urls.length,
5931
6427
  " link",
5932
6428
  urls.length === 1 ? "" : "s",
5933
- "..."
5934
- ] })
5935
- ] }),
5936
- error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5937
- "div",
5938
- {
5939
- style: {
5940
- padding: "10px 12px",
5941
- background: "rgba(220,38,38,0.04)",
5942
- border: "1px solid rgba(220,38,38,0.18)",
5943
- borderRadius: 8,
5944
- fontSize: 11,
5945
- color: "#b91c1c",
5946
- lineHeight: 1.5
5947
- },
5948
- children: [
5949
- error,
5950
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5951
- "button",
5952
- {
5953
- onClick: onCheck,
5954
- style: {
5955
- display: "block",
5956
- marginTop: 6,
5957
- padding: "4px 10px",
5958
- fontSize: 11,
5959
- fontWeight: 700,
5960
- color: "#ffffff",
5961
- background: "#dc2626",
5962
- border: "none",
5963
- borderRadius: 5,
5964
- cursor: "pointer"
5965
- },
5966
- children: "Try again"
5967
- }
5968
- )
5969
- ]
5970
- }
5971
- ),
5972
- hasRun && !isLoading && !error && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
5973
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "grid", gridTemplateColumns: counts.unverified > 0 ? "repeat(5, 1fr)" : "repeat(4, 1fr)", gap: 6 }, children: [
5974
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Checked", value: counts.total, color: "#475569" }),
5975
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Valid", value: counts.valid, color: "#16a34a" }),
5976
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Redirects", value: counts.redirects, color: "#8B7310" }),
5977
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Broken", value: counts.broken + counts.errored, color: "#dc2626" }),
5978
- counts.unverified > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StatTile, { label: "Blocked", value: counts.unverified, color: "#b45309" })
6429
+ " in the body.",
6430
+ tiles.length > 0 ? " Tap a box to see which." : ""
5979
6431
  ] }),
5980
- counts.unverified > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
5981
- "div",
5982
- {
5983
- style: {
5984
- marginTop: 8,
5985
- padding: "6px 10px",
5986
- background: "rgba(245,158,11,0.08)",
5987
- border: "1px solid rgba(245,158,11,0.25)",
5988
- borderRadius: 6,
5989
- fontSize: 10.5,
5990
- color: "#92400e",
5991
- lineHeight: 1.45
6432
+ tiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
6433
+ const empty = t.urls.length === 0;
6434
+ const active = openBucket === t.key && !empty;
6435
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6436
+ "button",
6437
+ {
6438
+ type: "button",
6439
+ onClick: () => !empty && setOpenBucket(active ? null : t.key),
6440
+ "aria-expanded": active,
6441
+ "aria-label": `${t.urls.length} ${t.label} links`,
6442
+ style: {
6443
+ padding: "8px 4px",
6444
+ background: active ? "rgba(0,93,172,0.08)" : "rgba(0,0,0,0.025)",
6445
+ border: active ? `1px solid ${MJH_BLUE}55` : "1px solid transparent",
6446
+ borderRadius: 8,
6447
+ textAlign: "center",
6448
+ cursor: empty ? "default" : "pointer",
6449
+ opacity: empty ? 0.5 : 1
6450
+ },
6451
+ children: [
6452
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
6453
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
6454
+ ]
5992
6455
  },
6456
+ t.key
6457
+ );
6458
+ }) }),
6459
+ open && open.urls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { marginTop: 8 }, children: [
6460
+ open.note && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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 }),
6461
+ open.urls.map(renderLinkRow)
6462
+ ] }),
6463
+ hasRun && blockedUrls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("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: [
6464
+ blockedUrls.length,
6465
+ " link",
6466
+ blockedUrls.length === 1 ? "" : "s",
6467
+ " couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
6468
+ ] }),
6469
+ !hasRun && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6470
+ "button",
6471
+ {
6472
+ onClick: onCheck,
6473
+ style: { width: "100%", marginTop: 10, padding: "8px 12px", fontSize: 11, fontWeight: 700, color: "#1f2937", background: MJH_GOLD, border: "none", borderRadius: 6, cursor: "pointer", letterSpacing: "0.01em" },
5993
6474
  children: [
5994
- counts.unverified,
6475
+ "Check ",
6476
+ urls.length,
5995
6477
  " link",
5996
- counts.unverified === 1 ? "" : "s",
5997
- " were blocked from our auto-check (likely anti-bot rules on the destination site). They may still work fine for human readers - click each to confirm."
6478
+ urls.length === 1 ? "" : "s",
6479
+ " for broken / redirects"
5998
6480
  ]
5999
6481
  }
6000
6482
  ),
6001
- counts.issues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 6 }, children: [
6002
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em" }, children: [
6003
- counts.issues.length,
6483
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
6484
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingBars, { size: "xs", color: MJH_BLUE }),
6485
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
6486
+ "Checking ",
6487
+ urls.length,
6004
6488
  " link",
6005
- counts.issues.length === 1 ? "" : "s",
6006
- " need",
6007
- counts.issues.length === 1 ? "s" : "",
6008
- " attention"
6009
- ] }),
6010
- counts.issues.map((r) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(LinkIssueRow, { result: r }, r.url))
6011
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6012
- "div",
6013
- {
6014
- style: {
6015
- marginTop: 12,
6016
- padding: "8px 10px",
6017
- background: "rgba(22,163,74,0.05)",
6018
- border: "1px solid rgba(22,163,74,0.15)",
6019
- borderRadius: 8,
6020
- fontSize: 11,
6021
- color: "#16a34a",
6022
- fontWeight: 600,
6023
- textAlign: "center"
6024
- },
6025
- children: [
6026
- "All ",
6027
- counts.total,
6028
- " link",
6029
- counts.total === 1 ? "" : "s",
6030
- " resolve cleanly."
6031
- ]
6032
- }
6033
- )
6489
+ urls.length === 1 ? "" : "s",
6490
+ "..."
6491
+ ] })
6492
+ ] }),
6493
+ error && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("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: [
6494
+ error,
6495
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" })
6496
+ ] })
6034
6497
  ] })
6035
6498
  ] });
6036
6499
  }
6037
- function StatTile({ label, value, color }) {
6038
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6039
- "div",
6040
- {
6041
- style: {
6042
- padding: "8px 4px",
6043
- background: "rgba(0,0,0,0.025)",
6044
- borderRadius: 8,
6045
- textAlign: "center"
6046
- },
6047
- children: [
6048
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 18, fontWeight: 700, color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: value }),
6049
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", marginTop: 4 }, children: label })
6050
- ]
6051
- }
6052
- );
6053
- }
6054
- function LinkIssueRow({ result }) {
6055
- const map = {
6056
- ok: { bg: "rgba(22,163,74,0.06)", color: "#16a34a", label: "OK" },
6057
- redirect: { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: result.status > 0 ? String(result.status) : "REDIR" },
6058
- broken: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: result.status > 0 ? String(result.status) : "404" },
6059
- // Amber for unverified - the link may work fine, our server just couldn't confirm.
6060
- unverified: { bg: "rgba(245,158,11,0.10)", color: "#b45309", label: result.status > 0 ? String(result.status) : "BLOCKED" },
6061
- error: { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "ERR" }
6062
- };
6063
- const c = map[result.category];
6064
- const tooltip = result.category === "unverified" ? `${result.url} (couldn't auto-check; likely anti-bot blocking - open manually to verify)` : result.error ? `${result.url} (${result.error})` : result.url;
6065
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6066
- "a",
6067
- {
6068
- href: result.url,
6069
- target: "_blank",
6070
- rel: "noopener noreferrer",
6071
- style: {
6072
- display: "flex",
6073
- alignItems: "center",
6074
- gap: 8,
6075
- padding: "6px 10px",
6076
- background: c.bg,
6077
- borderRadius: 6,
6078
- textDecoration: "none"
6079
- },
6080
- children: [
6081
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6082
- "span",
6083
- {
6084
- style: {
6085
- fontSize: 9,
6086
- fontWeight: 700,
6087
- letterSpacing: "0.04em",
6088
- padding: "2px 6px",
6089
- borderRadius: 99,
6090
- background: "#ffffff",
6091
- color: c.color,
6092
- fontVariantNumeric: "tabular-nums",
6093
- flexShrink: 0
6094
- },
6095
- children: c.label
6096
- }
6097
- ),
6098
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6099
- "span",
6100
- {
6101
- style: {
6102
- fontSize: 11,
6103
- color: "#1f2937",
6104
- fontFamily: "ui-monospace, SFMono-Regular, monospace",
6105
- flex: 1,
6106
- minWidth: 0,
6107
- overflow: "hidden",
6108
- textOverflow: "ellipsis",
6109
- whiteSpace: "nowrap"
6110
- },
6111
- title: tooltip,
6112
- children: result.url
6113
- }
6114
- )
6115
- ]
6116
- }
6117
- );
6118
- }
6119
6500
  function TechnicalTab({
6120
6501
  text,
6121
6502
  documentFields,
@@ -6128,37 +6509,37 @@ function TechnicalTab({
6128
6509
  hasRunLinkCheck,
6129
6510
  onCheckLinks
6130
6511
  }) {
6131
- const urlSlugAudit = (0, import_react17.useMemo)(
6512
+ const urlSlugAudit = (0, import_react18.useMemo)(
6132
6513
  () => urlAudit(documentFields?.slug, primaryKeyword, secondaryKeyword),
6133
6514
  [documentFields?.slug, primaryKeyword, secondaryKeyword]
6134
6515
  );
6135
6516
  const headings = documentFields?.headings || [];
6136
6517
  const headingsDetailed = documentFields?.headingsDetailed;
6137
- const headingsForStructure = (0, import_react17.useMemo)(
6518
+ const headingsForStructure = (0, import_react18.useMemo)(
6138
6519
  () => headingsDetailed ? headingsDetailed : headings.map((text2) => ({ text: text2, level: 2 })),
6139
6520
  [headingsDetailed, headings]
6140
6521
  );
6141
6522
  const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
6142
- const structureAudits = (0, import_react17.useMemo)(
6143
- () => computeHeadingStructureAudits(headingsForStructure, wordCount2),
6144
- [headingsForStructure, wordCount2]
6523
+ const structureAudits = (0, import_react18.useMemo)(
6524
+ () => computeHeadingStructureAudits(headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings),
6525
+ [headingsForStructure, wordCount2, primaryKeyword, secondaryKeyword, documentFields?.unstyledHeadings]
6145
6526
  );
6146
6527
  const imageNames = documentFields?.imageNames || [];
6147
- const { filenames: imageFilenames, altTexts: imageAltTexts } = (0, import_react17.useMemo)(
6528
+ const { filenames: imageFilenames, altTexts: imageAltTexts } = (0, import_react18.useMemo)(
6148
6529
  () => classifyImageNames(imageNames),
6149
6530
  [imageNames]
6150
6531
  );
6151
- const filenameAudit = (0, import_react17.useMemo)(
6532
+ const filenameAudit = (0, import_react18.useMemo)(
6152
6533
  () => imageFilenameAudit(imageFilenames),
6153
6534
  [imageFilenames]
6154
6535
  );
6155
- const altTextAudit = (0, import_react17.useMemo)(
6536
+ const altTextAudit = (0, import_react18.useMemo)(
6156
6537
  () => imageAltTextAudit(imageAltTexts),
6157
6538
  [imageAltTexts]
6158
6539
  );
6159
6540
  const imageTitles = documentFields?.imageTitles || [];
6160
6541
  const imageCount = documentFields?.imageCount ?? 0;
6161
- const imgTitleAudit = (0, import_react17.useMemo)(
6542
+ const imgTitleAudit = (0, import_react18.useMemo)(
6162
6543
  () => imageTitleAudit(imageTitles, imageCount),
6163
6544
  [imageTitles, imageCount]
6164
6545
  );
@@ -6182,15 +6563,16 @@ function TechnicalTab({
6182
6563
  recommendation: "Above the 450-word floor. For competitive clinical content, push past 1,500 words."
6183
6564
  } : { label: "Word Count", value: `${wordCount2} words`, status: "good" };
6184
6565
  const bodyLinks = documentFields?.bodyLinks || [];
6566
+ const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
6185
6567
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
6186
6568
  if (isLoading && !hasAnyField) {
6187
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
6188
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6189
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6569
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 24, textAlign: "center" }, children: [
6570
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6571
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6190
6572
  ] });
6191
6573
  }
6192
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6193
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6574
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6575
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6194
6576
  AuditCard2,
6195
6577
  {
6196
6578
  anchorId: "anchor-url-slug",
@@ -6198,10 +6580,22 @@ function TechnicalTab({
6198
6580
  value: urlSlugAudit.value,
6199
6581
  status: urlSlugAudit.status,
6200
6582
  recommendation: urlSlugAudit.recommendation,
6201
- footer: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SlugRedirectNotice, {})
6583
+ footer: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SlugRedirectNotice, {})
6202
6584
  }
6203
6585
  ),
6204
- wordAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6586
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6587
+ LinkCheckCard,
6588
+ {
6589
+ urls: bodyLinks,
6590
+ linksDetailed: bodyLinksDetailed,
6591
+ results: linkCheckResults,
6592
+ isLoading: isLinkCheckLoading,
6593
+ error: linkCheckError,
6594
+ hasRun: hasRunLinkCheck,
6595
+ onCheck: onCheckLinks
6596
+ }
6597
+ ),
6598
+ wordAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6205
6599
  AuditCard2,
6206
6600
  {
6207
6601
  anchorId: "anchor-word-count",
@@ -6211,48 +6605,63 @@ function TechnicalTab({
6211
6605
  recommendation: wordAudit.recommendation
6212
6606
  }
6213
6607
  ),
6214
- structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6215
- AuditCard2,
6216
- {
6217
- anchorId: i === 0 ? "anchor-headings-structure" : void 0,
6218
- label: a.label,
6219
- value: a.value,
6220
- status: a.status,
6221
- recommendation: a.recommendation
6222
- },
6223
- `structure-${i}`
6224
- )),
6225
- headings.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6226
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6227
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6228
- (headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6229
- "div",
6230
- {
6231
- style: {
6232
- fontSize: 11,
6233
- color: h.text ? "#4b5563" : "#dc2626",
6234
- fontStyle: h.text ? "normal" : "italic",
6235
- lineHeight: 1.4,
6236
- paddingLeft: Math.max(0, (h.level - 2) * 12)
6608
+ (() => {
6609
+ const structIdx = structureAudits.findIndex(
6610
+ (a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
6611
+ );
6612
+ return structureAudits.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6613
+ AuditCard2,
6614
+ {
6615
+ 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,
6616
+ label: a.label,
6617
+ value: a.value,
6618
+ status: a.status,
6619
+ recommendation: a.recommendation
6620
+ },
6621
+ `structure-${i}`
6622
+ ));
6623
+ })(),
6624
+ (headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6625
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6626
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6627
+ documentFields?.title && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
6628
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
6629
+ documentFields.title,
6630
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
6631
+ ] }),
6632
+ (headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
6633
+ const isH1 = h.level === 1;
6634
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6635
+ "div",
6636
+ {
6637
+ style: {
6638
+ fontSize: 11,
6639
+ color: !h.text ? "#dc2626" : isH1 ? MJH_BLUE : "#4b5563",
6640
+ fontWeight: isH1 ? 700 : 400,
6641
+ fontStyle: h.text ? "normal" : "italic",
6642
+ lineHeight: 1.4,
6643
+ paddingLeft: Math.max(0, (h.level - 2) * 12)
6644
+ },
6645
+ children: [
6646
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
6647
+ "H",
6648
+ h.level
6649
+ ] }),
6650
+ h.text || "(empty)"
6651
+ ]
6237
6652
  },
6238
- children: [
6239
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", marginRight: 6 }, children: [
6240
- "H",
6241
- h.level
6242
- ] }),
6243
- h.text || "(empty)"
6244
- ]
6245
- },
6246
- i
6247
- )),
6248
- (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6653
+ i
6654
+ );
6655
+ }),
6656
+ (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6249
6657
  "+ ",
6250
6658
  (headingsDetailed ?? headings).length - 12,
6251
6659
  " more"
6252
6660
  ] })
6253
- ] })
6661
+ ] }),
6662
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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." })
6254
6663
  ] }),
6255
- imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6664
+ imagesAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6256
6665
  AuditCard2,
6257
6666
  {
6258
6667
  anchorId: "anchor-images",
@@ -6262,7 +6671,7 @@ function TechnicalTab({
6262
6671
  recommendation: imagesAudit.recommendation
6263
6672
  }
6264
6673
  ),
6265
- filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6674
+ filenameAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6266
6675
  AuditCard2,
6267
6676
  {
6268
6677
  anchorId: "anchor-image-filenames",
@@ -6272,7 +6681,7 @@ function TechnicalTab({
6272
6681
  recommendation: filenameAudit.recommendation
6273
6682
  }
6274
6683
  ),
6275
- altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6684
+ altTextAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6276
6685
  AuditCard2,
6277
6686
  {
6278
6687
  anchorId: "anchor-image-alt",
@@ -6282,7 +6691,7 @@ function TechnicalTab({
6282
6691
  recommendation: altTextAudit.recommendation
6283
6692
  }
6284
6693
  ),
6285
- imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6694
+ imgTitleAudit && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6286
6695
  AuditCard2,
6287
6696
  {
6288
6697
  anchorId: "anchor-image-titles",
@@ -6291,28 +6700,17 @@ function TechnicalTab({
6291
6700
  status: imgTitleAudit.status,
6292
6701
  recommendation: imgTitleAudit.recommendation
6293
6702
  }
6294
- ),
6295
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6296
- LinkCheckCard,
6297
- {
6298
- urls: bodyLinks,
6299
- results: linkCheckResults,
6300
- isLoading: isLinkCheckLoading,
6301
- error: linkCheckError,
6302
- hasRun: hasRunLinkCheck,
6303
- onCheck: onCheckLinks
6304
- }
6305
6703
  )
6306
6704
  ] });
6307
6705
  }
6308
6706
 
6309
6707
  // src/components/SEOCopilotPanel.tsx
6310
- var import_jsx_runtime16 = require("react/jsx-runtime");
6708
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6311
6709
  function LogoIcon2() {
6312
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6313
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6314
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6315
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6710
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6711
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6712
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6713
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6316
6714
  ] });
6317
6715
  }
6318
6716
  function PanelContent({
@@ -6354,14 +6752,14 @@ function PanelContent({
6354
6752
  const keywordAnalysisState = externalAnalysis;
6355
6753
  const effectivePrimary = selectedPrimary || externalAnalysis.analysis?.primaryKeyword?.term || "";
6356
6754
  const effectiveSecondary = selectedSecondary || "";
6357
- const containerRef = (0, import_react18.useRef)(null);
6358
- const dragging = (0, import_react18.useRef)(false);
6359
- const onMouseDown = (0, import_react18.useCallback)(() => {
6755
+ const containerRef = (0, import_react19.useRef)(null);
6756
+ const dragging = (0, import_react19.useRef)(false);
6757
+ const onMouseDown = (0, import_react19.useCallback)(() => {
6360
6758
  dragging.current = true;
6361
6759
  document.body.style.cursor = "row-resize";
6362
6760
  document.body.style.userSelect = "none";
6363
6761
  }, []);
6364
- (0, import_react18.useEffect)(() => {
6762
+ (0, import_react19.useEffect)(() => {
6365
6763
  const onMouseMove = (e) => {
6366
6764
  if (!dragging.current || !containerRef.current) return;
6367
6765
  const rect = containerRef.current.getBoundingClientRect();
@@ -6384,11 +6782,11 @@ function PanelContent({
6384
6782
  const onboardSite = publication || "default";
6385
6783
  const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
6386
6784
  const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
6387
- const [popupMode, setPopupMode] = (0, import_react18.useState)("hidden");
6388
- const [popupClosing, setPopupClosing] = (0, import_react18.useState)(false);
6389
- const onboardTimerRef = (0, import_react18.useRef)(null);
6390
- const onboardFadeRef = (0, import_react18.useRef)(null);
6391
- (0, import_react18.useEffect)(() => {
6785
+ const [popupMode, setPopupMode] = (0, import_react19.useState)("hidden");
6786
+ const [popupClosing, setPopupClosing] = (0, import_react19.useState)(false);
6787
+ const onboardTimerRef = (0, import_react19.useRef)(null);
6788
+ const onboardFadeRef = (0, import_react19.useRef)(null);
6789
+ (0, import_react19.useEffect)(() => {
6392
6790
  let onboarded = false;
6393
6791
  let shownThisSession = false;
6394
6792
  try {
@@ -6418,13 +6816,13 @@ function PanelContent({
6418
6816
  if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
6419
6817
  };
6420
6818
  }, [onboardKey, onboardSessionKey]);
6421
- const markOnboarded = (0, import_react18.useCallback)(() => {
6819
+ const markOnboarded = (0, import_react19.useCallback)(() => {
6422
6820
  try {
6423
6821
  localStorage.setItem(onboardKey, "1");
6424
6822
  } catch {
6425
6823
  }
6426
6824
  }, [onboardKey]);
6427
- const dismissPopup = (0, import_react18.useCallback)(() => {
6825
+ const dismissPopup = (0, import_react19.useCallback)(() => {
6428
6826
  if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
6429
6827
  if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
6430
6828
  markOnboarded();
@@ -6434,14 +6832,14 @@ function PanelContent({
6434
6832
  setPopupClosing(false);
6435
6833
  }, 180);
6436
6834
  }, [markOnboarded]);
6437
- const openPopupPersistent = (0, import_react18.useCallback)(() => {
6835
+ const openPopupPersistent = (0, import_react19.useCallback)(() => {
6438
6836
  if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
6439
6837
  if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
6440
6838
  markOnboarded();
6441
6839
  setPopupClosing(false);
6442
6840
  setPopupMode("persistent");
6443
6841
  }, [markOnboarded]);
6444
- const handleTabChange = (0, import_react18.useCallback)((id) => {
6842
+ const handleTabChange = (0, import_react19.useCallback)((id) => {
6445
6843
  markOnboarded();
6446
6844
  if (onboardTimerRef.current) clearTimeout(onboardTimerRef.current);
6447
6845
  if (onboardFadeRef.current) clearTimeout(onboardFadeRef.current);
@@ -6460,7 +6858,7 @@ function PanelContent({
6460
6858
  { id: "meta", label: "Meta", beta: true },
6461
6859
  { id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
6462
6860
  ];
6463
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6861
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6464
6862
  "div",
6465
6863
  {
6466
6864
  className: "seo-copilot-panel",
@@ -6475,9 +6873,9 @@ function PanelContent({
6475
6873
  position: "relative"
6476
6874
  },
6477
6875
  children: [
6478
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6479
- popupMode !== "hidden" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6480
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6876
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6877
+ popupMode !== "hidden" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6878
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6481
6879
  "div",
6482
6880
  {
6483
6881
  onMouseDown: isFloating ? onDragStart : void 0,
@@ -6495,16 +6893,26 @@ function PanelContent({
6495
6893
  flexShrink: 0
6496
6894
  },
6497
6895
  children: [
6498
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6499
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LogoIcon2, {}),
6500
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6501
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6502
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: MJH_SLATE }, children: " copilot" })
6896
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6897
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LogoIcon2, {}),
6898
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6899
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6900
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: MJH_SLATE }, children: " copilot" })
6503
6901
  ] })
6504
6902
  ] }),
6505
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6506
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(OnboardingInfoButton, { onClick: openPopupPersistent }),
6507
- isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6903
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6904
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(OnboardingInfoButton, { onClick: openPopupPersistent }),
6905
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6906
+ ReportProblemButton,
6907
+ {
6908
+ activeTab,
6909
+ publication,
6910
+ documentId,
6911
+ documentType,
6912
+ primaryKeyword: effectivePrimary
6913
+ }
6914
+ ),
6915
+ isFloating && onToggleFullscreen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6508
6916
  "button",
6509
6917
  {
6510
6918
  onClick: (e) => {
@@ -6526,16 +6934,16 @@ function PanelContent({
6526
6934
  fontWeight: 600,
6527
6935
  transition: "all 150ms"
6528
6936
  },
6529
- children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
6530
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) }),
6937
+ children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6938
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" }) }),
6531
6939
  "Exit fullscreen"
6532
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
6533
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) }),
6940
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6941
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" }) }),
6534
6942
  "Fullscreen"
6535
6943
  ] })
6536
6944
  }
6537
6945
  ),
6538
- isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6946
+ isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6539
6947
  "button",
6540
6948
  {
6541
6949
  onClick: (e) => {
@@ -6558,7 +6966,7 @@ function PanelContent({
6558
6966
  transition: "all 150ms"
6559
6967
  },
6560
6968
  children: [
6561
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6969
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6562
6970
  "path",
6563
6971
  {
6564
6972
  fillRule: "evenodd",
@@ -6570,7 +6978,7 @@ function PanelContent({
6570
6978
  ]
6571
6979
  }
6572
6980
  ),
6573
- !isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6981
+ !isFloating && onToggleFloat && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6574
6982
  "button",
6575
6983
  {
6576
6984
  onClick: (e) => {
@@ -6589,13 +6997,13 @@ function PanelContent({
6589
6997
  transition: "color 150ms"
6590
6998
  },
6591
6999
  title: "Pop out",
6592
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
6593
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }),
6594
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" })
7000
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
7001
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" }),
7002
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" })
6595
7003
  ] })
6596
7004
  }
6597
7005
  ),
6598
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7006
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6599
7007
  "div",
6600
7008
  {
6601
7009
  style: {
@@ -6607,7 +7015,7 @@ function PanelContent({
6607
7015
  }
6608
7016
  }
6609
7017
  ),
6610
- onClose && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7018
+ onClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6611
7019
  "button",
6612
7020
  {
6613
7021
  onClick: (e) => {
@@ -6626,11 +7034,11 @@ function PanelContent({
6626
7034
  transition: "color 150ms"
6627
7035
  },
6628
7036
  title: "Close",
6629
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("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" }) })
7037
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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" }) })
6630
7038
  }
6631
7039
  )
6632
7040
  ] }),
6633
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7041
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6634
7042
  "div",
6635
7043
  {
6636
7044
  style: {
@@ -6649,8 +7057,8 @@ function PanelContent({
6649
7057
  ]
6650
7058
  }
6651
7059
  ),
6652
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
6653
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7060
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
7061
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6654
7062
  "div",
6655
7063
  {
6656
7064
  style: {
@@ -6666,8 +7074,8 @@ function PanelContent({
6666
7074
  children: "Recommendations are generated by AI. Verify details before publishing."
6667
7075
  }
6668
7076
  ),
6669
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
6670
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7077
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
7078
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6671
7079
  "div",
6672
7080
  {
6673
7081
  style: {
@@ -6678,7 +7086,7 @@ function PanelContent({
6678
7086
  background: RECS_ZONE_BG
6679
7087
  },
6680
7088
  children: [
6681
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7089
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6682
7090
  KeywordPanel,
6683
7091
  {
6684
7092
  text,
@@ -6694,7 +7102,7 @@ function PanelContent({
6694
7102
  },
6695
7103
  documentId || "default"
6696
7104
  ) }),
6697
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7105
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6698
7106
  SummaryTab,
6699
7107
  {
6700
7108
  text,
@@ -6710,13 +7118,12 @@ function PanelContent({
6710
7118
  onItemClick: summaryOps.onItemClick
6711
7119
  }
6712
7120
  ) }),
6713
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7121
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6714
7122
  AEOTab,
6715
7123
  {
6716
7124
  text,
6717
7125
  deepAnalysis: keywordAnalysisState.deepAnalysis,
6718
7126
  isDeepLoading: keywordAnalysisState.isDeepLoading,
6719
- primaryKeyword: effectivePrimary,
6720
7127
  publication,
6721
7128
  runDeepAnalysis: keywordAnalysisState.runDeepAnalysis,
6722
7129
  aeoContentChanged: keywordAnalysisState.aeoContentChanged,
@@ -6727,7 +7134,7 @@ function PanelContent({
6727
7134
  loadContentSuggestions: aeoOps.loadContentSuggestions
6728
7135
  }
6729
7136
  ) }),
6730
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7137
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6731
7138
  LinkingTab,
6732
7139
  {
6733
7140
  analysis: keywordAnalysisState.analysis,
@@ -6743,8 +7150,8 @@ function PanelContent({
6743
7150
  documentType
6744
7151
  }
6745
7152
  ) }),
6746
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
6747
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7153
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
7154
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6748
7155
  TechnicalTab,
6749
7156
  {
6750
7157
  text,
@@ -6762,7 +7169,7 @@ function PanelContent({
6762
7169
  ]
6763
7170
  }
6764
7171
  ),
6765
- chatOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7172
+ chatOpen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6766
7173
  "div",
6767
7174
  {
6768
7175
  onMouseDown,
@@ -6775,10 +7182,10 @@ function PanelContent({
6775
7182
  justifyContent: "center",
6776
7183
  flexShrink: 0
6777
7184
  },
6778
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
7185
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
6779
7186
  }
6780
7187
  ),
6781
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7188
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6782
7189
  "div",
6783
7190
  {
6784
7191
  style: {
@@ -6791,7 +7198,7 @@ function PanelContent({
6791
7198
  background: CHAT_ZONE_BG
6792
7199
  },
6793
7200
  children: [
6794
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7201
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6795
7202
  "button",
6796
7203
  {
6797
7204
  onClick: () => onChatOpenChange(!chatOpen),
@@ -6812,7 +7219,7 @@ function PanelContent({
6812
7219
  flexShrink: 0
6813
7220
  },
6814
7221
  children: [
6815
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7222
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6816
7223
  "span",
6817
7224
  {
6818
7225
  style: {
@@ -6825,7 +7232,7 @@ function PanelContent({
6825
7232
  children: "Chat"
6826
7233
  }
6827
7234
  ),
6828
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7235
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6829
7236
  "svg",
6830
7237
  {
6831
7238
  width: "12",
@@ -6833,7 +7240,7 @@ function PanelContent({
6833
7240
  viewBox: "0 0 20 20",
6834
7241
  fill: "rgba(0,0,0,0.55)",
6835
7242
  style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
6836
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7243
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6837
7244
  "path",
6838
7245
  {
6839
7246
  fillRule: "evenodd",
@@ -6846,7 +7253,7 @@ function PanelContent({
6846
7253
  ]
6847
7254
  }
6848
7255
  ),
6849
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7256
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6850
7257
  "div",
6851
7258
  {
6852
7259
  style: {
@@ -6856,7 +7263,7 @@ function PanelContent({
6856
7263
  flexDirection: "column",
6857
7264
  minHeight: 0
6858
7265
  },
6859
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7266
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6860
7267
  ChatPanel,
6861
7268
  {
6862
7269
  messages: chatState.messages,
@@ -6887,21 +7294,21 @@ function SEOCopilotInner({ config, onClose }) {
6887
7294
  "seo-copilot-ui-float-size",
6888
7295
  { width: 380, height: typeof window !== "undefined" ? Math.round(window.innerHeight * 0.8) : 600 }
6889
7296
  );
6890
- const dragOffset = (0, import_react18.useRef)(null);
6891
- const resizeStart = (0, import_react18.useRef)(null);
6892
- const activeDragCleanupRef = (0, import_react18.useRef)(null);
6893
- const activeResizeCleanupRef = (0, import_react18.useRef)(null);
7297
+ const dragOffset = (0, import_react19.useRef)(null);
7298
+ const resizeStart = (0, import_react19.useRef)(null);
7299
+ const activeDragCleanupRef = (0, import_react19.useRef)(null);
7300
+ const activeResizeCleanupRef = (0, import_react19.useRef)(null);
6894
7301
  const { text, isLoading: docLoading, documentFields, documentId, documentType } = useDocumentContent();
6895
7302
  const { apiUrl } = useConfig();
6896
- const workspace = (0, import_sanity3.useWorkspace)();
7303
+ const workspace = (0, import_sanity4.useWorkspace)();
6897
7304
  const effectivePublication = config.publication || workspace?.dataset;
6898
- const sanityBaseUrl = (0, import_react18.useMemo)(() => {
7305
+ const sanityBaseUrl = (0, import_react19.useMemo)(() => {
6899
7306
  if (typeof window === "undefined") return void 0;
6900
7307
  const basePath = (workspace?.basePath || "/").replace(/\/+$/, "");
6901
7308
  return `${window.location.origin}${basePath}`;
6902
7309
  }, [workspace?.basePath]);
6903
7310
  const seedCacheKey = documentId ? `seo-copilot-cache-${documentId}` : "seo-copilot-cache-v2";
6904
- const loadSeedsFromCache = (0, import_react18.useCallback)(() => {
7311
+ const loadSeedsFromCache = (0, import_react19.useCallback)(() => {
6905
7312
  try {
6906
7313
  const c = localStorage.getItem(seedCacheKey);
6907
7314
  if (c) return JSON.parse(c).seeds || [];
@@ -6909,8 +7316,8 @@ function SEOCopilotInner({ config, onClose }) {
6909
7316
  }
6910
7317
  return [];
6911
7318
  }, [seedCacheKey]);
6912
- const [seedKeywords, setSeedKeywordsRaw] = (0, import_react18.useState)(loadSeedsFromCache);
6913
- const setSeedKeywords = (0, import_react18.useCallback)(
7319
+ const [seedKeywords, setSeedKeywordsRaw] = (0, import_react19.useState)(loadSeedsFromCache);
7320
+ const setSeedKeywords = (0, import_react19.useCallback)(
6914
7321
  (seeds) => {
6915
7322
  setSeedKeywordsRaw(seeds);
6916
7323
  try {
@@ -6925,25 +7332,25 @@ function SEOCopilotInner({ config, onClose }) {
6925
7332
  const [selectedPrimary, setSelectedPrimary] = usePersistentState(selectedPrimaryKey, void 0);
6926
7333
  const selectedSecondaryKey = documentId ? `seo-copilot-secondary-${documentId}` : "seo-copilot-secondary-default";
6927
7334
  const [selectedSecondary, setSelectedSecondary] = usePersistentState(selectedSecondaryKey, "");
6928
- const seedsInitializedRef = (0, import_react18.useRef)(false);
6929
- (0, import_react18.useEffect)(() => {
7335
+ const seedsInitializedRef = (0, import_react19.useRef)(false);
7336
+ (0, import_react19.useEffect)(() => {
6930
7337
  if (!seedsInitializedRef.current) {
6931
7338
  seedsInitializedRef.current = true;
6932
7339
  return;
6933
7340
  }
6934
7341
  setSeedKeywordsRaw(loadSeedsFromCache());
6935
7342
  }, [documentId, loadSeedsFromCache]);
6936
- const [activeTab, setActiveTab] = (0, import_react18.useState)("keywords");
7343
+ const [activeTab, setActiveTab] = (0, import_react19.useState)("keywords");
6937
7344
  const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
6938
7345
  const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
6939
- const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId);
7346
+ const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
6940
7347
  const effectivePrimary = selectedPrimary || keywordAnalysisState.analysis?.primaryKeyword?.term || "";
6941
- (0, import_react18.useEffect)(() => {
7348
+ (0, import_react19.useEffect)(() => {
6942
7349
  if (selectedSecondary && effectivePrimary && selectedSecondary.toLowerCase() === effectivePrimary.toLowerCase()) {
6943
7350
  setSelectedSecondary("");
6944
7351
  }
6945
7352
  }, [effectivePrimary, selectedSecondary, setSelectedSecondary]);
6946
- const keywordPanelData = (0, import_react18.useMemo)(() => {
7353
+ const keywordPanelData = (0, import_react19.useMemo)(() => {
6947
7354
  const analysis = keywordAnalysisState.analysis;
6948
7355
  if (!analysis) return void 0;
6949
7356
  return {
@@ -6961,12 +7368,12 @@ function SEOCopilotInner({ config, onClose }) {
6961
7368
  const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
6962
7369
  const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
6963
7370
  const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
6964
- const [isCSLoading, setIsCSLoading] = (0, import_react18.useState)(false);
6965
- const [csError, setCsError] = (0, import_react18.useState)(null);
6966
- const aeoOpVersionRef = (0, import_react18.useRef)(0);
6967
- const csAbortRef = (0, import_react18.useRef)(null);
6968
- const didInitAeoRef = (0, import_react18.useRef)(false);
6969
- (0, import_react18.useEffect)(() => {
7371
+ const [isCSLoading, setIsCSLoading] = (0, import_react19.useState)(false);
7372
+ const [csError, setCsError] = (0, import_react19.useState)(null);
7373
+ const aeoOpVersionRef = (0, import_react19.useRef)(0);
7374
+ const csAbortRef = (0, import_react19.useRef)(null);
7375
+ const didInitAeoRef = (0, import_react19.useRef)(false);
7376
+ (0, import_react19.useEffect)(() => {
6970
7377
  if (!didInitAeoRef.current) {
6971
7378
  didInitAeoRef.current = true;
6972
7379
  return;
@@ -6975,7 +7382,7 @@ function SEOCopilotInner({ config, onClose }) {
6975
7382
  setIsCSLoading(false);
6976
7383
  setCsError(null);
6977
7384
  }, [documentId]);
6978
- const loadContentSuggestions = (0, import_react18.useCallback)(async () => {
7385
+ const loadContentSuggestions = (0, import_react19.useCallback)(async () => {
6979
7386
  const myVersion = aeoOpVersionRef.current;
6980
7387
  setIsCSLoading(true);
6981
7388
  setCsError(null);
@@ -7000,14 +7407,14 @@ function SEOCopilotInner({ config, onClose }) {
7000
7407
  }, [apiUrl, text, effectivePrimary, effectivePublication]);
7001
7408
  const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
7002
7409
  const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
7003
- const [isLinkingLoading, setIsLinkingLoading] = (0, import_react18.useState)(false);
7004
- const [linkingError, setLinkingError] = (0, import_react18.useState)(null);
7005
- const [linkingFetchedText, setLinkingFetchedText] = (0, import_react18.useState)("");
7006
- const linkingVersionRef = (0, import_react18.useRef)(0);
7007
- const linkingAbortRef = (0, import_react18.useRef)(null);
7008
- const didInitLinkingRef = (0, import_react18.useRef)(false);
7009
- const lastLinkingFetchKey = (0, import_react18.useRef)("");
7010
- (0, import_react18.useEffect)(() => {
7410
+ const [isLinkingLoading, setIsLinkingLoading] = (0, import_react19.useState)(false);
7411
+ const [linkingError, setLinkingError] = (0, import_react19.useState)(null);
7412
+ const [linkingFetchedText, setLinkingFetchedText] = (0, import_react19.useState)("");
7413
+ const linkingVersionRef = (0, import_react19.useRef)(0);
7414
+ const linkingAbortRef = (0, import_react19.useRef)(null);
7415
+ const didInitLinkingRef = (0, import_react19.useRef)(false);
7416
+ const lastLinkingFetchKey = (0, import_react19.useRef)("");
7417
+ (0, import_react19.useEffect)(() => {
7011
7418
  if (!didInitLinkingRef.current) {
7012
7419
  didInitLinkingRef.current = true;
7013
7420
  return;
@@ -7017,12 +7424,12 @@ function SEOCopilotInner({ config, onClose }) {
7017
7424
  setLinkingError(null);
7018
7425
  lastLinkingFetchKey.current = "";
7019
7426
  }, [documentId]);
7020
- const supportingKeywordsForLinking = (0, import_react18.useMemo)(() => {
7427
+ const supportingKeywordsForLinking = (0, import_react19.useMemo)(() => {
7021
7428
  const base = (keywordAnalysisState.analysis?.supportingKeywords || []).map((kw) => kw.term).filter(Boolean);
7022
7429
  const merged = selectedSecondary ? [selectedSecondary, ...base.filter((t) => t.toLowerCase() !== selectedSecondary.toLowerCase())] : base;
7023
7430
  return merged.slice(0, 5);
7024
7431
  }, [keywordAnalysisState.analysis, selectedSecondary]);
7025
- const refreshLinkingSuggestions = (0, import_react18.useCallback)(async () => {
7432
+ const refreshLinkingSuggestions = (0, import_react19.useCallback)(async () => {
7026
7433
  if (!text || text.trim().length < 50) return;
7027
7434
  if (!effectivePrimary) return;
7028
7435
  const myVersion = linkingVersionRef.current;
@@ -7052,12 +7459,12 @@ function SEOCopilotInner({ config, onClose }) {
7052
7459
  if (linkingVersionRef.current !== myVersion) return;
7053
7460
  setIsLinkingLoading(false);
7054
7461
  }, [apiUrl, text, effectivePrimary, supportingKeywordsForLinking, documentId, effectivePublication]);
7055
- const isLinkingStale = (0, import_react18.useMemo)(() => {
7462
+ const isLinkingStale = (0, import_react19.useMemo)(() => {
7056
7463
  if (!linkingFetchedText || linkingSuggestions.length === 0) return false;
7057
7464
  if (Math.abs(text.length - linkingFetchedText.length) > 150) return true;
7058
7465
  return text.slice(0, 300) !== linkingFetchedText.slice(0, 300);
7059
7466
  }, [text, linkingFetchedText, linkingSuggestions.length]);
7060
- (0, import_react18.useEffect)(() => {
7467
+ (0, import_react19.useEffect)(() => {
7061
7468
  if (!text || text.trim().length < 50 || !effectivePrimary) return;
7062
7469
  const fetchKey = `${documentId || "_"}|${effectivePrimary}|${supportingKeywordsForLinking.join(",")}`;
7063
7470
  if (fetchKey === lastLinkingFetchKey.current) return;
@@ -7071,11 +7478,11 @@ function SEOCopilotInner({ config, onClose }) {
7071
7478
  const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
7072
7479
  const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
7073
7480
  const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
7074
- const [isLinkCheckLoading, setIsLinkCheckLoading] = (0, import_react18.useState)(false);
7075
- const [linkCheckError, setLinkCheckError] = (0, import_react18.useState)(null);
7076
- const linkCheckVersionRef = (0, import_react18.useRef)(0);
7077
- const didInitLinkCheckRef = (0, import_react18.useRef)(false);
7078
- (0, import_react18.useEffect)(() => {
7481
+ const [isLinkCheckLoading, setIsLinkCheckLoading] = (0, import_react19.useState)(false);
7482
+ const [linkCheckError, setLinkCheckError] = (0, import_react19.useState)(null);
7483
+ const linkCheckVersionRef = (0, import_react19.useRef)(0);
7484
+ const didInitLinkCheckRef = (0, import_react19.useRef)(false);
7485
+ (0, import_react19.useEffect)(() => {
7079
7486
  if (!didInitLinkCheckRef.current) {
7080
7487
  didInitLinkCheckRef.current = true;
7081
7488
  return;
@@ -7084,7 +7491,7 @@ function SEOCopilotInner({ config, onClose }) {
7084
7491
  setIsLinkCheckLoading(false);
7085
7492
  setLinkCheckError(null);
7086
7493
  }, [documentId]);
7087
- const runLinkCheck = (0, import_react18.useCallback)(async () => {
7494
+ const runLinkCheck = (0, import_react19.useCallback)(async () => {
7088
7495
  const urls = documentFields?.bodyLinks || [];
7089
7496
  if (urls.length === 0) {
7090
7497
  setHasRunLinkCheck(true);
@@ -7110,7 +7517,7 @@ function SEOCopilotInner({ config, onClose }) {
7110
7517
  if (linkCheckVersionRef.current !== myVersion) return;
7111
7518
  setIsLinkCheckLoading(false);
7112
7519
  }, [apiUrl, documentFields?.bodyLinks, setHasRunLinkCheck, setLinkCheckResults]);
7113
- (0, import_react18.useEffect)(() => {
7520
+ (0, import_react19.useEffect)(() => {
7114
7521
  return () => {
7115
7522
  activeDragCleanupRef.current?.();
7116
7523
  activeResizeCleanupRef.current?.();
@@ -7118,7 +7525,25 @@ function SEOCopilotInner({ config, onClose }) {
7118
7525
  linkingAbortRef.current?.abort();
7119
7526
  };
7120
7527
  }, []);
7121
- const handleDragStart = (0, import_react18.useCallback)(
7528
+ const runAllAnalyses = () => {
7529
+ keywordAnalysisState.runDeepAnalysis();
7530
+ if (text && text.trim().length >= 100) loadContentSuggestions();
7531
+ if (text && text.trim().length >= 50 && effectivePrimary) refreshLinkingSuggestions();
7532
+ if ((documentFields?.bodyLinks || []).length > 0) runLinkCheck();
7533
+ };
7534
+ const runAllRef = (0, import_react19.useRef)(runAllAnalyses);
7535
+ runAllRef.current = runAllAnalyses;
7536
+ const secAutoRunRef = (0, import_react19.useRef)({ doc: documentId, sec: selectedSecondary, init: true });
7537
+ (0, import_react19.useEffect)(() => {
7538
+ const prev = secAutoRunRef.current;
7539
+ const docChanged = prev.doc !== documentId;
7540
+ const secChanged = prev.sec !== selectedSecondary;
7541
+ secAutoRunRef.current = { doc: documentId, sec: selectedSecondary, init: false };
7542
+ if (prev.init || docChanged || !secChanged) return;
7543
+ const t = setTimeout(() => runAllRef.current(), 1500);
7544
+ return () => clearTimeout(t);
7545
+ }, [selectedSecondary, documentId]);
7546
+ const handleDragStart = (0, import_react19.useCallback)(
7122
7547
  (e) => {
7123
7548
  dragOffset.current = {
7124
7549
  dx: e.clientX - floatPos.x,
@@ -7152,7 +7577,7 @@ function SEOCopilotInner({ config, onClose }) {
7152
7577
  },
7153
7578
  [floatPos]
7154
7579
  );
7155
- const handleResizeStart = (0, import_react18.useCallback)(
7580
+ const handleResizeStart = (0, import_react19.useCallback)(
7156
7581
  (e) => {
7157
7582
  e.preventDefault();
7158
7583
  e.stopPropagation();
@@ -7184,7 +7609,7 @@ function SEOCopilotInner({ config, onClose }) {
7184
7609
  },
7185
7610
  [floatSize]
7186
7611
  );
7187
- const panelContent = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7612
+ const panelContent = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7188
7613
  PanelContent,
7189
7614
  {
7190
7615
  initialPublication: effectivePublication,
@@ -7250,12 +7675,7 @@ function SEOCopilotInner({ config, onClose }) {
7250
7675
  },
7251
7676
  summaryOps: {
7252
7677
  isAnyLoading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading || keywordAnalysisState.isDeepLoading || isCSLoading || isLinkingLoading || isLinkCheckLoading,
7253
- onGenerateAll: () => {
7254
- keywordAnalysisState.runDeepAnalysis();
7255
- if (text && text.trim().length >= 100) loadContentSuggestions();
7256
- if (text && text.trim().length >= 50 && effectivePrimary) refreshLinkingSuggestions();
7257
- if ((documentFields?.bodyLinks || []).length > 0) runLinkCheck();
7258
- },
7678
+ onGenerateAll: runAllAnalyses,
7259
7679
  onItemClick: (item) => {
7260
7680
  setActiveTab(item.jumpTo.tab);
7261
7681
  const id = item.jumpTo.anchorId;
@@ -7271,7 +7691,7 @@ function SEOCopilotInner({ config, onClose }) {
7271
7691
  }
7272
7692
  }
7273
7693
  );
7274
- const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7694
+ const floatingPanel = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
7275
7695
  "div",
7276
7696
  {
7277
7697
  style: {
@@ -7289,7 +7709,7 @@ function SEOCopilotInner({ config, onClose }) {
7289
7709
  },
7290
7710
  children: [
7291
7711
  panelContent,
7292
- !isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7712
+ !isFullscreen && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7293
7713
  "div",
7294
7714
  {
7295
7715
  onMouseDown: handleResizeStart,
@@ -7304,9 +7724,9 @@ function SEOCopilotInner({ config, onClose }) {
7304
7724
  alignItems: "center",
7305
7725
  justifyContent: "center"
7306
7726
  },
7307
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7308
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7309
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7727
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7728
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7729
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7310
7730
  ] })
7311
7731
  }
7312
7732
  )
@@ -7314,8 +7734,8 @@ function SEOCopilotInner({ config, onClose }) {
7314
7734
  }
7315
7735
  );
7316
7736
  if (isFloating) {
7317
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
7318
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7737
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
7738
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7319
7739
  "div",
7320
7740
  {
7321
7741
  style: {
@@ -7325,30 +7745,30 @@ function SEOCopilotInner({ config, onClose }) {
7325
7745
  alignItems: "center",
7326
7746
  justifyContent: "center"
7327
7747
  },
7328
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7748
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7329
7749
  }
7330
7750
  ),
7331
7751
  typeof document !== "undefined" && (0, import_react_dom.createPortal)(floatingPanel, document.body)
7332
7752
  ] });
7333
7753
  }
7334
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7754
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7335
7755
  }
7336
7756
  function SEOCopilotPanel({ config, onClose }) {
7337
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7338
- import_react18.Suspense,
7757
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7758
+ import_react19.Suspense,
7339
7759
  {
7340
- fallback: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7341
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingBars, {}),
7342
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7760
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7761
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadingBars, {}),
7762
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7343
7763
  ] }),
7344
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SEOCopilotInner, { config, onClose }) })
7764
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ConfigProvider, { config, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SEOCopilotInner, { config, onClose }) })
7345
7765
  }
7346
7766
  );
7347
7767
  }
7348
7768
  function LoadingBars({ size = "sm", color = MJH_GOLD }) {
7349
7769
  const barWidth = size === "xs" ? 4 : 6;
7350
7770
  const containerHeight = size === "xs" ? 10 : 14;
7351
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7771
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7352
7772
  "div",
7353
7773
  {
7354
7774
  style: {
@@ -7365,11 +7785,11 @@ function LoadingBars({ size = "sm", color = MJH_GOLD }) {
7365
7785
 
7366
7786
  // src/inspector.ts
7367
7787
  function SEOIcon() {
7368
- return (0, import_react19.createElement)(
7788
+ return (0, import_react20.createElement)(
7369
7789
  "svg",
7370
7790
  { viewBox: "0 0 25 25", width: "1em", height: "1em", fill: "none" },
7371
- (0, import_react19.createElement)("circle", { cx: "12.5", cy: "12.5", r: "11.5", fill: "#E6C01B" }),
7372
- (0, import_react19.createElement)("text", {
7791
+ (0, import_react20.createElement)("circle", { cx: "12.5", cy: "12.5", r: "11.5", fill: "#E6C01B" }),
7792
+ (0, import_react20.createElement)("text", {
7373
7793
  x: "12.5",
7374
7794
  y: "7.5",
7375
7795
  textAnchor: "middle",
@@ -7379,7 +7799,7 @@ function SEOIcon() {
7379
7799
  fontWeight: "900",
7380
7800
  fontFamily: "Arial Black, Impact, sans-serif"
7381
7801
  }, "S"),
7382
- (0, import_react19.createElement)("text", {
7802
+ (0, import_react20.createElement)("text", {
7383
7803
  x: "12.5",
7384
7804
  y: "12.8",
7385
7805
  textAnchor: "middle",
@@ -7389,7 +7809,7 @@ function SEOIcon() {
7389
7809
  fontWeight: "900",
7390
7810
  fontFamily: "Arial Black, Impact, sans-serif"
7391
7811
  }, "E"),
7392
- (0, import_react19.createElement)("text", {
7812
+ (0, import_react20.createElement)("text", {
7393
7813
  x: "12.5",
7394
7814
  y: "18",
7395
7815
  textAnchor: "middle",
@@ -7417,13 +7837,13 @@ function seoCopilotInspector(config) {
7417
7837
  tone: "default"
7418
7838
  }),
7419
7839
  component: function SEOCopilotInspector(props) {
7420
- return (0, import_react19.createElement)(SEOCopilotPanel, { ...props, config });
7840
+ return (0, import_react20.createElement)(SEOCopilotPanel, { ...props, config });
7421
7841
  }
7422
7842
  };
7423
7843
  }
7424
7844
 
7425
7845
  // src/index.ts
7426
- var seoCopilot = (0, import_sanity4.definePlugin)((config) => ({
7846
+ var seoCopilot = (0, import_sanity5.definePlugin)((config) => ({
7427
7847
  name: "seo-copilot",
7428
7848
  document: {
7429
7849
  inspectors: (prev) => {