@canonry/canonry 4.150.0 → 4.151.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/assets/assets/{AuditHistoryPanel-DRZk9o6L.js → AuditHistoryPanel-OMu-hEqT.js} +1 -1
  2. package/assets/assets/{BacklinksPage-Dqkq_a-l.js → BacklinksPage-qadojXWF.js} +1 -1
  3. package/assets/assets/ChartPrimitives-DXVLCdBi.js +1 -0
  4. package/assets/assets/{HistoryPage-BWoRO7wp.js → HistoryPage-DJQbxQr4.js} +1 -1
  5. package/assets/assets/MeasurementPropertyPage-3-oL5JIi.js +1 -0
  6. package/assets/assets/ProjectPage-D300FAEv.js +12 -0
  7. package/assets/assets/{RunRow-DOZDMB1T.js → RunRow-CaCdexBB.js} +1 -1
  8. package/assets/assets/{RunsPage-BTEUz9dP.js → RunsPage-Cx_sLTg5.js} +1 -1
  9. package/assets/assets/{SettingsPage-CtFaqFam.js → SettingsPage-Y1J2OIpj.js} +1 -1
  10. package/assets/assets/{TrafficPage-P-T5se9o.js → TrafficPage-O4oT28EH.js} +1 -1
  11. package/assets/assets/TrafficSourceDetailPage-De6Yq1Dk.js +1 -0
  12. package/assets/assets/{arrow-left-DzZGGujh.js → arrow-left-PM9P2PAY.js} +1 -1
  13. package/assets/assets/{extract-error-message-Dftl6C6Y.js → extract-error-message-RWIQhk6G.js} +1 -1
  14. package/assets/assets/{index-CC5bfdzz.css → index-CLt6zzLW.css} +1 -1
  15. package/assets/assets/{index-BMymPeRH.js → index-bcpm37b9.js} +74 -74
  16. package/assets/assets/refresh-cw-qn1tCFGx.js +1 -0
  17. package/assets/assets/{trash-2-DHAtpDut.js → trash-2-Bbp_L6NV.js} +1 -1
  18. package/assets/index.html +2 -2
  19. package/dist/{chunk-6XY6MRPN.js → chunk-G7P5CJJS.js} +77 -56
  20. package/dist/{chunk-GJOACSPY.js → chunk-JWTFZG7Q.js} +9 -9
  21. package/dist/cli.js +2 -2
  22. package/dist/index.js +2 -2
  23. package/dist/{intelligence-service-CEEBCERV.js → intelligence-service-KBFVQOPO.js} +1 -1
  24. package/package.json +8 -8
  25. package/assets/assets/ChartPrimitives-CithLZJb.js +0 -1
  26. package/assets/assets/MeasurementPropertyPage-DUDpWj6i.js +0 -1
  27. package/assets/assets/ProjectPage-IZcPVJDc.js +0 -12
  28. package/assets/assets/TrafficSourceDetailPage-DUjwNhWm.js +0 -1
@@ -0,0 +1 @@
1
+ import{c as e}from"./index-bcpm37b9.js";const o=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],a=e("chevron-left",o);const t=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],h=e("refresh-cw",t);export{a as C,h as R};
@@ -1 +1 @@
1
- import{c as a}from"./index-BMymPeRH.js";const t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],h=a("circle-question-mark",t);const e=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],d=a("download",e);const o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a("external-link",o);const c=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],s=a("trash-2",c);export{h as C,d as D,p as E,s as T};
1
+ import{c as a}from"./index-bcpm37b9.js";const t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],h=a("circle-question-mark",t);const e=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],d=a("download",e);const o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a("external-link",o);const c=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],s=a("trash-2",c);export{h as C,d as D,p as E,s as T};
package/assets/index.html CHANGED
@@ -12,12 +12,12 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-BMymPeRH.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-bcpm37b9.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-BjS7iY3g.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-DnzzbllM.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-33ACLxsD.js">
19
19
  <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-CpDJch4G.js">
20
- <link rel="stylesheet" crossorigin href="./assets/index-CC5bfdzz.css">
20
+ <link rel="stylesheet" crossorigin href="./assets/index-CLt6zzLW.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -126,7 +126,7 @@ import {
126
126
  siteAuditSnapshots,
127
127
  toAlertView,
128
128
  usageCounters
129
- } from "./chunk-GJOACSPY.js";
129
+ } from "./chunk-JWTFZG7Q.js";
130
130
  import {
131
131
  AGENT_MEMORY_VALUE_MAX_BYTES,
132
132
  AGENT_PROVIDER_IDS,
@@ -5674,6 +5674,7 @@ async function inspectUrlsPaced(urls, cb, deps = {}) {
5674
5674
  const sleep3 = deps.sleep ?? defaultSleep;
5675
5675
  const jitter = deps.jitter ?? Math.random;
5676
5676
  const concurrency = Math.max(1, Math.min(deps.concurrency ?? INSPECT_MAX_CONCURRENCY, urls.length || 1));
5677
+ const isRetryable = deps.isRetryable ?? isRetryableGscInspectError;
5677
5678
  let inspected = 0;
5678
5679
  let errors = 0;
5679
5680
  let consecutiveRetryableFailures = 0;
@@ -5699,7 +5700,7 @@ async function inspectUrlsPaced(urls, cb, deps = {}) {
5699
5700
  maxRetries: INSPECT_MAX_RETRIES,
5700
5701
  baseDelayMs: INSPECT_BASE_DELAY_MS,
5701
5702
  maxDelayMs: INSPECT_MAX_BACKOFF_MS,
5702
- isRetryable: isRetryableGscInspectError,
5703
+ isRetryable,
5703
5704
  sleep: sleep3,
5704
5705
  onRetry: ({ attempt, delayMs, err }) => deps.log?.info("inspect.retry", {
5705
5706
  url,
@@ -5714,7 +5715,7 @@ async function inspectUrlsPaced(urls, cb, deps = {}) {
5714
5715
  } catch (err) {
5715
5716
  errors++;
5716
5717
  cb.onError(url, err, index);
5717
- if (isRetryableGscInspectError(err)) {
5718
+ if (isRetryable(err)) {
5718
5719
  consecutiveRetryableFailures++;
5719
5720
  if (consecutiveRetryableFailures >= INSPECT_FAILFAST_THRESHOLD) {
5720
5721
  deps.log?.error("inspect.circuit-break", {
@@ -5918,61 +5919,81 @@ async function executeBingInspectSitemap(db, runId, projectId, opts) {
5918
5919
  });
5919
5920
  blockedUrls = /* @__PURE__ */ new Set();
5920
5921
  }
5922
+ const skipped = Math.max(0, sitemapUrls.length - INSPECT_SWEEP_MAX_URLS);
5923
+ const targetUrls = skipped > 0 ? sitemapUrls.slice(0, INSPECT_SWEEP_MAX_URLS) : sitemapUrls;
5924
+ if (skipped > 0) {
5925
+ log7.warn("sitemap.over-budget", {
5926
+ runId,
5927
+ projectId,
5928
+ sitemapUrls: sitemapUrls.length,
5929
+ inspecting: targetUrls.length,
5930
+ skipped,
5931
+ dailyQuota: INSPECT_DAILY_QUOTA,
5932
+ note: `Sitemap has ${sitemapUrls.length} pages; inspecting the first ${targetUrls.length}. ${skipped} pages will not have a verdict from this run.`
5933
+ });
5934
+ }
5935
+ const siteUrl = conn.siteUrl;
5921
5936
  let inspected = 0;
5922
5937
  let errors = 0;
5923
- for (const pageUrl of sitemapUrls) {
5924
- try {
5925
- const result = await getUrlInfo(conn.apiKey, conn.siteUrl, pageUrl);
5926
- const inspectedAt = (/* @__PURE__ */ new Date()).toISOString();
5927
- const httpCode = result.HttpStatus ?? result.HttpCode ?? null;
5928
- const lastCrawledDate = parseBingDate(result.LastCrawledDate);
5929
- const inIndexDate = parseBingDate(result.InIndexDate);
5930
- const discoveryDate = parseBingDate(result.DiscoveryDate);
5931
- let derivedInIndex = null;
5932
- if (result.DocumentSize != null && result.DocumentSize > 0) {
5933
- derivedInIndex = true;
5934
- } else if (lastCrawledDate != null) {
5935
- derivedInIndex = httpCode != null && httpCode >= 400 ? false : true;
5936
- } else if (discoveryDate != null) {
5937
- derivedInIndex = false;
5938
- }
5939
- if (derivedInIndex === true && blockedUrls.has(pageUrl)) {
5940
- derivedInIndex = false;
5938
+ const outcome = await inspectUrlsPaced(
5939
+ targetUrls,
5940
+ {
5941
+ inspectOne: (pageUrl) => getUrlInfo(conn.apiKey, siteUrl, pageUrl),
5942
+ onResult: (pageUrl, result) => {
5943
+ const inspectedAt = (/* @__PURE__ */ new Date()).toISOString();
5944
+ const httpCode = result.HttpStatus ?? result.HttpCode ?? null;
5945
+ const lastCrawledDate = parseBingDate(result.LastCrawledDate);
5946
+ const inIndexDate = parseBingDate(result.InIndexDate);
5947
+ const discoveryDate = parseBingDate(result.DiscoveryDate);
5948
+ let derivedInIndex = null;
5949
+ if (result.DocumentSize != null && result.DocumentSize > 0) {
5950
+ derivedInIndex = true;
5951
+ } else if (lastCrawledDate != null) {
5952
+ derivedInIndex = httpCode != null && httpCode >= 400 ? false : true;
5953
+ } else if (discoveryDate != null) {
5954
+ derivedInIndex = false;
5955
+ }
5956
+ if (derivedInIndex === true && blockedUrls.has(pageUrl)) {
5957
+ derivedInIndex = false;
5958
+ }
5959
+ db.insert(bingUrlInspections).values({
5960
+ id: crypto10.randomUUID(),
5961
+ projectId,
5962
+ url: pageUrl,
5963
+ httpCode,
5964
+ inIndex: derivedInIndex,
5965
+ lastCrawledDate,
5966
+ inIndexDate,
5967
+ inspectedAt,
5968
+ syncRunId: runId,
5969
+ createdAt: inspectedAt,
5970
+ documentSize: result.DocumentSize ?? null,
5971
+ anchorCount: result.AnchorCount ?? null,
5972
+ discoveryDate
5973
+ }).run();
5974
+ inspected++;
5975
+ log7.info("inspect.url-done", { runId, projectId, url: pageUrl, progress: `${inspected}/${targetUrls.length}` });
5976
+ },
5977
+ onError: (pageUrl, err) => {
5978
+ errors++;
5979
+ log7.error("inspect.url-failed", {
5980
+ runId,
5981
+ projectId,
5982
+ url: pageUrl,
5983
+ error: err instanceof Error ? err.message : String(err)
5984
+ });
5941
5985
  }
5942
- db.insert(bingUrlInspections).values({
5943
- id: crypto10.randomUUID(),
5944
- projectId,
5945
- url: pageUrl,
5946
- httpCode,
5947
- inIndex: derivedInIndex,
5948
- lastCrawledDate,
5949
- inIndexDate,
5950
- inspectedAt,
5951
- syncRunId: runId,
5952
- createdAt: inspectedAt,
5953
- documentSize: result.DocumentSize ?? null,
5954
- anchorCount: result.AnchorCount ?? null,
5955
- discoveryDate
5956
- }).run();
5957
- inspected++;
5958
- log7.info("inspect.url-done", {
5959
- runId,
5960
- projectId,
5961
- url: pageUrl,
5962
- progress: `${inspected}/${sitemapUrls.length}`
5963
- });
5964
- } catch (err) {
5965
- errors++;
5966
- log7.error("inspect.url-failed", {
5967
- runId,
5968
- projectId,
5969
- url: pageUrl,
5970
- error: err instanceof Error ? err.message : String(err)
5971
- });
5972
- }
5973
- if (inspected + errors < sitemapUrls.length) {
5974
- await new Promise((r) => setTimeout(r, 1e3));
5975
- }
5986
+ },
5987
+ { isRetryable: isRetryableHttpError, concurrency: 1, log: log7, ...opts.pacedDeps }
5988
+ );
5989
+ if (outcome.aborted) {
5990
+ log7.error("inspect.circuit-break", {
5991
+ runId,
5992
+ projectId,
5993
+ inspected,
5994
+ errors,
5995
+ note: "Bing inspection stopped early after sustained failures; the remaining pages were not attempted."
5996
+ });
5976
5997
  }
5977
5998
  const allInspections = db.select().from(bingUrlInspections).where(eq8(bingUrlInspections.projectId, projectId)).orderBy(desc3(bingUrlInspections.inspectedAt)).all();
5978
5999
  const latestByUrl = /* @__PURE__ */ new Map();
@@ -7411,7 +7432,7 @@ function readStoredGroundingSources(rawResponse) {
7411
7432
  return result;
7412
7433
  }
7413
7434
  async function backfillInsightsCommand(project, opts) {
7414
- const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-CEEBCERV.js");
7435
+ const { IntelligenceService: IntelligenceService2 } = await import("./intelligence-service-KBFVQOPO.js");
7415
7436
  const config = loadConfig();
7416
7437
  const db = createClient(config.database);
7417
7438
  migrate(db);
@@ -21165,7 +21165,7 @@ function renderWinsLosses(insights2, heading, emptyMessage, audience) {
21165
21165
  <td>${escapeHtml(isClient ? providerDisplayName(i.provider) : i.provider)}</td>
21166
21166
  </tr>`;
21167
21167
  }).join("");
21168
- const headers = isClient ? `<tr><th>What changed</th><th>Customer question</th><th>AI tool</th></tr>` : `<tr><th>Severity</th><th>Title</th><th>Query</th><th>Provider</th></tr>`;
21168
+ const headers = isClient ? `<tr><th>What changed</th><th>Customer query</th><th>AI tool</th></tr>` : `<tr><th>Severity</th><th>Title</th><th>Query</th><th>Provider</th></tr>`;
21169
21169
  return `<div class="chart-card"><h3>${escapeHtml(heading)}</h3>
21170
21170
  <table class="report-table">
21171
21171
  <thead>${headers}</thead>
@@ -21188,7 +21188,7 @@ function renderWhatsChanged(report, audience) {
21188
21188
  const rateTiles = `<div class="metric-grid">
21189
21189
  ${renderRateDeltaTile(isClient ? "AI mentions your name" : "Citation rate", isClient ? w.mentionRate : w.citationRate, "%")}
21190
21190
  ${renderRateDeltaTile(isClient ? "AI links to your website" : "Mention rate", isClient ? w.citationRate : w.mentionRate, "%")}
21191
- ${renderRateDeltaTile(isClient ? "Questions AI mentioned you in" : "Cited queries", isClient ? w.mentionedQueryCount : w.citedQueryCount, "count")}
21191
+ ${renderRateDeltaTile(isClient ? "Queries AI mentioned you in" : "Cited queries", isClient ? w.mentionedQueryCount : w.citedQueryCount, "count")}
21192
21192
  ${renderTrafficDeltaTile(isClient ? "Visitors from Google" : "GSC clicks", w.gscClicksDelta, isClient ? "visits" : "clicks", w.comparisonWindowDays)}
21193
21193
  ${renderTrafficDeltaTile(isClient ? "Visitors from AI tools" : "AI referral sessions", w.aiReferralsDelta, isClient ? "visits" : "sessions", w.comparisonWindowDays)}
21194
21194
  </div>`;
@@ -22082,7 +22082,7 @@ function renderClientSummary(report) {
22082
22082
  const sc = report.citationScorecard;
22083
22083
  const totalQ = s.totalQueryCount;
22084
22084
  const heroNumber = totalQ > 0 ? `${s.mentionRate}%` : "\u2014";
22085
- const heroSentence = totalQ > 0 ? `When customers asked AI ${totalQ} ${pluralize(totalQ, "question")} about your industry, AI mentioned you in ${s.mentionedQueryCount} of ${totalQ === 1 ? "them" : "those answers"}.` : "No AI check has been run yet. Run a check to see how AI tools answer customer questions about your business.";
22085
+ const heroSentence = totalQ > 0 ? `When customers asked AI ${totalQ} ${pluralize(totalQ, "query", "queries")} about your industry, AI mentioned you in ${s.mentionedQueryCount} of ${totalQ === 1 ? "them" : "those answers"}.` : "No AI check has been run yet. Run a check to see how AI tools answer customer queries about your business.";
22086
22086
  const trend = clientTrendCopy(report.whatsChanged.mentionRate);
22087
22087
  const heroTrend = trend ? `<p class="client-hero-trend tone-${trend.tone}"><span style="margin-right:6px;">${trend.arrow}</span>${escapeHtml(trend.text)}</p>` : "";
22088
22088
  const hero = `<div class="client-hero">
@@ -22091,7 +22091,7 @@ function renderClientSummary(report) {
22091
22091
  <p class="client-hero-sentence">${escapeHtml(heroSentence)}</p>
22092
22092
  ${heroTrend}
22093
22093
  </div>`;
22094
- const providerSubtitle = sc.providers.length > 0 ? sc.providers.map(providerDisplayName).join(", ") : `${formatNumber(s.queryCount)} ${pluralize(s.queryCount, "question")} tested`;
22094
+ const providerSubtitle = sc.providers.length > 0 ? sc.providers.map(providerDisplayName).join(", ") : `${formatNumber(s.queryCount)} ${pluralize(s.queryCount, "query", "queries")} tested`;
22095
22095
  const tiles = `<div class="client-metric-grid">
22096
22096
  <div class="client-metric-tile">
22097
22097
  <div class="label">AI mentions your name</div>
@@ -22116,15 +22116,15 @@ function renderClientSummary(report) {
22116
22116
  AI can do either, both, or neither \u2014 that's why we track both.
22117
22117
  </div>`;
22118
22118
  const questions = sc.queries.length > 0 ? `<div class="client-card">
22119
- <h3>Customer questions we tested</h3>
22120
- <p class="card-subtitle">These are the ${sc.queries.length} ${pluralize(sc.queries.length, "question we asked", "questions we asked")} every AI tool. The numbers above measure how often you came up.</p>
22119
+ <h3>Customer queries we tested</h3>
22120
+ <p class="card-subtitle">These are the ${sc.queries.length} ${pluralize(sc.queries.length, "query we asked", "queries we asked")} every AI tool. The numbers above measure how often you came up.</p>
22121
22121
  <ol class="client-questions-list">
22122
22122
  ${sc.queries.map((q, i) => `<li><span class="qnum">${String(i + 1).padStart(2, "0")}</span><span>"${escapeHtml(q)}"</span></li>`).join("")}
22123
22123
  </ol>
22124
22124
  </div>` : "";
22125
22125
  const providerBars = sc.providerRates.length > 0 ? `<div class="client-card">
22126
22126
  <h3>How often each AI tool mentions you</h3>
22127
- <p class="card-subtitle">Higher is better. Each bar shows the share of customer questions where the AI named you in the answer.</p>
22127
+ <p class="card-subtitle">Higher is better. Each bar shows the share of customer queries where the AI named you in the answer.</p>
22128
22128
  <div class="client-bar-list">
22129
22129
  ${sc.providerRates.map((r) => {
22130
22130
  const pct = Math.max(r.mentionRate, 1.5);
@@ -22150,7 +22150,7 @@ function renderClientEvidenceSummary(report) {
22150
22150
  if (ai.length > 0) {
22151
22151
  cards.push(`<div class="client-card">
22152
22152
  <h3>Where AI gets its answers</h3>
22153
- <p class="card-subtitle">The websites AI tools cited most often when answering customer questions about your industry.</p>
22153
+ <p class="card-subtitle">The websites AI tools cited most often when answering customer queries about your industry.</p>
22154
22154
  <div class="client-bar-list">
22155
22155
  ${ai.map((d) => {
22156
22156
  const pct = aiMax > 0 ? Math.max(d.count / aiMax * 100, 1.5) : 0;
@@ -22197,7 +22197,7 @@ function renderClientEvidenceSummary(report) {
22197
22197
  if (opportunities.length > 0) {
22198
22198
  cards.push(`<div class="client-card">
22199
22199
  <h3>Topics where you could improve</h3>
22200
- <p class="card-subtitle">Customer questions where better content on your site would help AI cite you.</p>
22200
+ <p class="card-subtitle">Customer queries where better content on your site would help AI cite you.</p>
22201
22201
  <ul class="client-opportunity-list">
22202
22202
  ${opportunities.map((o) => `<li>
22203
22203
  <div class="op-query">${escapeHtml(o.query)}</div>
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  showFirstRunNotice,
31
31
  trackCliCommandFinished,
32
32
  trackEvent
33
- } from "./chunk-6XY6MRPN.js";
33
+ } from "./chunk-G7P5CJJS.js";
34
34
  import {
35
35
  CliError,
36
36
  EXIT_SYSTEM_ERROR,
@@ -58,7 +58,7 @@ import {
58
58
  projects,
59
59
  queries,
60
60
  renderReportHtml
61
- } from "./chunk-GJOACSPY.js";
61
+ } from "./chunk-JWTFZG7Q.js";
62
62
  import {
63
63
  AdsDeliverySnapshotStatuses,
64
64
  AdsHistoricalCampaignRollupStatuses,
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-6XY6MRPN.js";
3
+ } from "./chunk-G7P5CJJS.js";
4
4
  import {
5
5
  loadConfig
6
6
  } from "./chunk-TS3AHKZG.js";
7
- import "./chunk-GJOACSPY.js";
7
+ import "./chunk-JWTFZG7Q.js";
8
8
  import "./chunk-BUAVO37B.js";
9
9
  export {
10
10
  createServer,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  IntelligenceService
3
- } from "./chunk-GJOACSPY.js";
3
+ } from "./chunk-JWTFZG7Q.js";
4
4
  import "./chunk-BUAVO37B.js";
5
5
  export {
6
6
  IntelligenceService
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "4.150.0",
3
+ "version": "4.151.0",
4
4
  "type": "module",
5
5
  "description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
6
6
  "license": "FSL-1.1-ALv2",
@@ -73,20 +73,20 @@
73
73
  "@ainyc/canonry-db": "0.0.0",
74
74
  "@ainyc/canonry-integration-bing": "0.0.0",
75
75
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
76
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
77
76
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
78
- "@ainyc/canonry-integration-google": "0.0.0",
79
77
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
80
- "@ainyc/canonry-integration-traffic": "0.0.0",
78
+ "@ainyc/canonry-integration-google": "0.0.0",
81
79
  "@ainyc/canonry-integration-google-places": "0.0.0",
80
+ "@ainyc/canonry-integration-traffic": "0.0.0",
81
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
82
82
  "@ainyc/canonry-integration-wordpress": "0.0.0",
83
83
  "@ainyc/canonry-intelligence": "0.0.0",
84
- "@ainyc/canonry-provider-claude": "0.0.0",
85
- "@ainyc/canonry-provider-local": "0.0.0",
86
84
  "@ainyc/canonry-provider-cdp": "0.0.0",
87
- "@ainyc/canonry-provider-openai": "0.0.0",
88
85
  "@ainyc/canonry-provider-gemini": "0.0.0",
89
- "@ainyc/canonry-provider-perplexity": "0.0.0"
86
+ "@ainyc/canonry-provider-local": "0.0.0",
87
+ "@ainyc/canonry-provider-claude": "0.0.0",
88
+ "@ainyc/canonry-provider-perplexity": "0.0.0",
89
+ "@ainyc/canonry-provider-openai": "0.0.0"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
@@ -1 +0,0 @@
1
- import{c as n}from"./index-BMymPeRH.js";const c=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],d=n("chevron-left",c);const i=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],v=n("refresh-cw",i),f={contentStyle:{backgroundColor:"var(--chart-tooltip-bg, #18181b)",border:"1px solid var(--chart-tooltip-border, #3f3f46)",borderRadius:8,fontSize:12},labelStyle:{color:"var(--chart-tooltip-label, #e4e4e7)"},itemStyle:{color:"var(--chart-tooltip-item, #a1a1aa)"}},u={fill:"var(--chart-neutral-text-dim, #71717a)",fontSize:11},l="var(--chart-grid, #27272a)",b="var(--chart-axis, #27272a)",r=["var(--chart-series-1, #34d399)","var(--chart-series-2, #60a5fa)","var(--chart-series-3, #f472b6)","var(--chart-series-4, #facc15)","var(--chart-series-5, #a78bfa)","var(--chart-series-6, #fb923c)","var(--chart-series-7, #22d3ee)","var(--chart-series-8, #f87171)"],s={gemini:"#60a5fa",openai:"#34d399",claude:"#fb923c",perplexity:"#22d3ee",local:"#a78bfa"};function m(a,t=0){return s[a]??r[t%r.length]}const p={text:"var(--chart-neutral-text, #a1a1aa)",textDim:"var(--chart-neutral-text-dim, #71717a)",textFaint:"var(--chart-neutral-text-faint, #52525b)",surface:"var(--chart-neutral-surface, #27272a)",trackSubtle:"var(--chart-neutral-track-subtle, rgb(255 255 255 / 0.04))",gridLine:"var(--chart-neutral-grid-line, rgb(255 255 255 / 0.06))"},S={positive:"var(--chart-tone-positive, #34d399)",positiveDeep:"var(--chart-tone-positive-deep, #10b981)",caution:"var(--chart-tone-caution, #fbbf24)",negative:"var(--chart-tone-negative, #fb7185)"};function g(a){return a}function o(a){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(a);return t?{year:Number(t[1]),month:Number(t[2]),day:Number(t[3])}:null}function R(a){const t=String(a),e=o(t);return e?new Date(Date.UTC(e.year,e.month-1,e.day)).toLocaleDateString(void 0,{timeZone:"UTC",month:"short",day:"numeric",year:"numeric"}):t}function C(a){const t=o(String(a));return t?`${t.month}/${t.day}`:String(a)}function T(a){return new Date(a).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function y(a){const t=new Date(a);return`${t.getMonth()+1}/${t.getDate()}`}export{d as C,v as R,b as a,u as b,R as c,f as d,p as e,C as f,r as g,S as h,l as i,y as j,T as k,g as o,m as p};
@@ -1 +0,0 @@
1
- import{C as te,r as v,u as T,D as ne,j as e,L as q}from"./vendor-tanstack-BjS7iY3g.js";import{bL as ae,bS as re,d2 as ie,d3 as oe,bY as le,bM as de,B as b,T as g,I as C,d4 as ce,m as B}from"./index-BMymPeRH.js";import{m as he}from"./v2-overview-adapter-BHmxTmCf.js";import{A as xe}from"./arrow-left-DzZGGujh.js";import"./vendor-radix-DnzzbllM.js";import"./vendor-recharts-33ACLxsD.js";import"./vendor-markdown-CpDJch4G.js";const F=50,l={branded:{headline:"When they know your name",technical:"Branded questions"},"non-brand":{headline:"When they don't",technical:"Non-brand questions"}},me={plan_v1:"Setup update required",no_completed_run:"No completed measurement yet",no_population:"No questions of this type are assigned",evidence_incomplete:"Source evidence is incomplete",not_applicable:"Not applicable for this Property"},O={complete:{label:"Measured",tone:"positive"},partial:{label:"Partly measured",tone:"caution"},running:{label:"Measuring now",tone:"neutral"},queued:{label:"Measurement queued",tone:"neutral"},failed:{label:"Measurement failed",tone:"negative"},not_measured:{label:"Not measured",tone:"neutral"}},V={assigned:{label:"Matches this Property",tone:"positive"},sibling:{label:"Matches another Property",tone:"caution"},ownedUnmapped:{label:"Site URL not in a Property",tone:"caution"},external:{label:"External URL",tone:"neutral"},ambiguous:{label:"Matches multiple Properties",tone:"caution"},invalid:{label:"Invalid URL",tone:"negative"}};function pe(s){return[...s].sort((n,a)=>+(a.classification==="assigned")-+(n.classification==="assigned"))}function ue(s){return`${s.expectedSlotId}:${s.usageEdgeId}`}function je({row:s}){return s.mentioned===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(g,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"No mention signal for this Property"})]}):e.jsx(g,{tone:s.mentioned?"positive":"neutral",children:s.mentioned?"Mentioned":"Not mentioned"})}const ye="—";function be({row:s}){return s.cited===null?e.jsxs("span",{className:"inline-flex flex-col items-start gap-0.5",children:[e.jsx(g,{tone:"neutral",children:"Not measured"}),e.jsx("span",{className:"text-xs text-muted",children:"Sources were not fully captured"})]}):e.jsx(g,{tone:s.cited?"positive":"neutral",children:s.cited?"Cited":"Not cited"})}function ge({row:s}){return s.cited===null&&s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"The sources for this answer were not fully captured, so none can be shown."}):s.sources.length===0?e.jsx("p",{className:"py-2 text-sm text-secondary",children:"This answer returned no source URLs at all."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsxs("caption",{className:"sr-only",children:["Source URLs for ",s.queryText]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Match"}),e.jsx("th",{children:"URL"})]})}),e.jsx("tbody",{children:pe(s.sources).map(n=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(g,{tone:V[n.classification].tone,children:V[n.classification].label})}),e.jsx("td",{className:"break-all text-secondary",children:n.sourceUrl})]},n.sourceUrl))})]})})}function K(s){return me[s.reason]??"Not measured"}function L({metric:s,emphasis:n=!1}){if(s.state==="unavailable")return e.jsxs("span",{className:"inline-flex flex-col gap-0.5",children:[e.jsx("span",{className:n?"text-lg font-semibold text-secondary":"text-sm font-medium text-secondary",children:"Not measured"}),e.jsx("span",{className:"text-sm text-secondary",children:K(s)})]});const a=`${Math.round(s.value*100)}%`,c=s.numerator===void 0||s.denominator===void 0?null:`${s.numerator} of ${s.denominator}`;return e.jsxs("span",{className:"inline-flex flex-col gap-0.5 tabular-nums",children:[e.jsx("span",{className:n?"text-lg font-semibold text-heading":"text-sm font-medium text-primary",children:a}),c?e.jsx("span",{className:"text-xs text-muted",children:c}):null]})}function z(s,n,a){return ce({client:B,path:{name:s},query:{scope:"property",targetKey:n,queryClass:a}})}function D(s){return s?.properties.items.at(0)}function fe({branded:s,nonBrand:n,brandedError:a,nonBrandError:c,onRetry:w}){const S=[{queryClass:"branded",row:s,isError:a},{queryClass:"non-brand",row:n,isError:c}];return e.jsxs("section",{"aria-labelledby":"property-brand-contrast",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"The gap"}),e.jsxs("h2",{id:"property-brand-contrast",className:"text-base font-semibold text-heading",children:["Named versus not named",e.jsx(C,{text:"Branded questions already contain your name, so an answer engine has an easy path back to you. Non-brand questions describe the need instead, and that is the demand you have to earn. Each row is measured only over the questions assigned to this Property in that class; a class with no assigned question reads Not measured rather than 0%."})]})]})}),e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[560px]",children:[e.jsx("caption",{className:"sr-only",children:"Mention and citation coverage for this Property, split by question class"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Question type"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"})]})}),e.jsx("tbody",{children:S.map(({queryClass:r,row:d,isError:x})=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:"block font-medium text-heading",children:l[r].headline}),e.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:l[r].technical}),d&&x?e.jsxs("span",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm text-caution",children:[e.jsx("span",{role:"status",children:"Refresh failed."}),e.jsxs(b,{type:"button",size:"sm",variant:"ghost",className:"h-11 px-3 text-sm md:h-11",onClick:()=>w(r),children:["Retry ",l[r].technical.toLocaleLowerCase()]})]}):null]}),d?e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx(L,{metric:d.mentionCoverage,emphasis:!0})}),e.jsx("td",{children:e.jsx(L,{metric:d.citationCoverage,emphasis:!0})})]}):x?e.jsx("td",{colSpan:2,children:e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{role:"alert",children:["Could not load ",l[r].technical.toLocaleLowerCase(),"."]}),e.jsxs(b,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>w(r),children:["Retry ",l[r].technical.toLocaleLowerCase()]})]})}):e.jsxs(e.Fragment,{children:[e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})}),e.jsx("td",{children:e.jsx("span",{className:"text-sm text-secondary",children:"Loading…"})})]})]},r))})]})})]})}function ve({row:s,queryClass:n,isError:a}){return e.jsxs("section",{"aria-labelledby":"property-providers",className:"page-section-divider",children:[e.jsx("div",{className:"section-head section-head-inline",children:e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"By answer engine"}),e.jsxs("h2",{id:"property-providers",className:"text-base font-semibold text-heading",children:["Which engines answer for this Property",e.jsx(C,{text:"Each row is measured over the questions that engine actually answered for this Property, so the rows are a split of the same population rather than parts that add up to the Property total. An engine that answered nothing for this Property is absent instead of shown at 0%."})]})]})}),s===void 0&&a?e.jsxs("p",{className:"text-sm text-secondary",children:["Details for ",l[n].technical.toLocaleLowerCase()," are unavailable. Retry that question type above."]}):s===void 0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading…"}):s.providers.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No answer engine has measured ",l[n].technical.toLocaleLowerCase()," for this Property.",s.mentionCoverage.state==="unavailable"?` ${K(s.mentionCoverage)}.`:""]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[520px]",children:[e.jsx("caption",{className:"sr-only",children:"Per-engine mention and citation coverage"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Engine"}),e.jsx("th",{children:"Mentioned"}),e.jsx("th",{children:"Cited"})]})}),e.jsx("tbody",{children:s.providers.map(c=>e.jsxs("tr",{children:[e.jsx("td",{className:"font-medium text-heading",children:c.provider}),e.jsx("td",{children:e.jsx(L,{metric:c.mentionCoverage})}),e.jsx("td",{children:e.jsx(L,{metric:c.citationCoverage})})]},c.provider))})]})})]})}function Ne({questions:s,queryClass:n}){return e.jsxs("section",{"aria-labelledby":"property-questions",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Questions"}),e.jsxs("h2",{id:"property-questions",className:"text-base font-semibold text-heading",children:[l[n].technical," assigned to this Property"]})]}),e.jsxs("p",{className:"supporting-copy",children:[s.length," assigned"]})]}),s.length===0?e.jsxs("p",{className:"text-sm text-secondary",children:["No ",l[n].technical.toLocaleLowerCase()," are assigned. Add one in advanced measurement setup to measure this class."]}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"Questions assigned to this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"Question"})})}),e.jsx("tbody",{children:s.map(a=>e.jsx("tr",{children:e.jsx("td",{className:"text-secondary",children:a})},a))})]})})]})}function we({urls:s}){return e.jsxs("section",{"aria-labelledby":"property-urls",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Pages"}),e.jsxs("h2",{id:"property-urls",className:"text-base font-semibold text-heading",children:["URLs that count as this Property",e.jsx(C,{text:"A cited source URL is credited to this Property when it matches one of these. The most specific matcher wins, so a URL covered by two Properties at the same specificity is flagged for review instead of being credited to either."})]})]}),e.jsxs("p",{className:"supporting-copy",children:[s.length," configured"]})]}),s.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No URLs are configured for this Property."}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[420px]",children:[e.jsx("caption",{className:"sr-only",children:"URL matchers configured for this Property"}),e.jsx("thead",{children:e.jsx("tr",{children:e.jsx("th",{children:"URL"})})}),e.jsx("tbody",{children:s.map(n=>e.jsx("tr",{children:e.jsx("td",{className:"break-all text-secondary",children:n})},n))})]})})]})}function ke(){const{projectName:s,targetKey:n}=te({strict:!1}),[a,c]=v.useState("non-brand"),[w,S]=v.useState(new Set),r=s??"",d=n??"",x=!!r&&!!d,{canWrite:M}=ae(),f=T({...re({client:B,path:{name:r}}),enabled:x}),m=T({...z(r,d,"branded"),enabled:x}),p=T({...z(r,d,"non-brand"),enabled:x}),U=D(m.data),I=D(p.data),u=a==="branded"?m.data:p.data,N=a==="branded"?U:I,_=(a==="branded"?m.isError:p.isError)&&N===void 0,Q=u?.measurement.displayedRunId,P={client:B,path:{name:r},query:{targetKey:d,queryClass:a,shape:ie.answers,limit:F,...Q?{runId:Q}:{}}},i=ne({...oe(P),enabled:x&&u!==void 0,initialPageParam:P,getNextPageParam:t=>t.answers?.nextCursor?{path:P.path,query:{...P.query,cursor:t.answers.nextCursor}}:void 0}),R=f.data?.active??null,j=R?.plan.schemaVersion===2?R.plan:null,W=R!==null&&j===null,E=j?.targets.find(t=>t.stableKey===d)??null,H=v.useMemo(()=>{if(!j)return[];const t=new Map(j.querySnapshots.map(o=>[o.queryId,o.queryText]));return[...new Set(j.assignments.filter(o=>o.targetKey===d&&o.queryClass===a).flatMap(o=>{const h=t.get(o.queryId);return h===void 0?[]:[h]}))].sort((o,h)=>o.localeCompare(h))},[j,d,a]),G=v.useMemo(()=>E?.urlMatchers.map(he)??[],[E]),y=v.useMemo(()=>(i.data?.pages??[]).flatMap(h=>h.answers?.items??[]),[i.data]),$=i.data?.pages[0]?.answers?.totalEstimate??y.length,Y=(i.data?.pages??[]).length>0&&(i.data?.pages??[]).every(t=>t.answers===void 0),Z=i.data?.pages[0]?.measurement.state,A=e.jsxs(q,{to:"/projects/$projectName",params:{projectName:r},className:"inline-flex items-center gap-1 text-xs text-muted hover:text-strong",children:[e.jsx(xe,{className:"size-3.5","aria-hidden":"true"}),"Back to measurement overview"]});if(!x)return e.jsx("div",{className:"page-container",children:e.jsx("p",{className:"text-sm text-muted",children:"Missing project name or Property key in URL."})});if(!le("portfolio",de()?.projectTabs))return e.jsx("div",{className:"page-container",children:e.jsx("p",{className:"text-sm text-muted",children:"This view is not available here."})});if(f.isPending&&!f.isError)return e.jsx("div",{className:"page-container",children:e.jsxs("div",{role:"status","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading Property"}),e.jsx("div",{className:"h-32 animate-pulse rounded-md bg-surface-subtle","aria-hidden":"true"})]})});const J=f.isError&&f.data===void 0,X=m.isError&&m.data===void 0,ee=p.isError&&p.data===void 0;return J||X&&ee?e.jsxs("div",{className:"page-container space-y-3",children:[A,e.jsx("p",{role:"alert",className:"text-sm text-negative",children:"Could not load this Property."}),e.jsx(b,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{f.refetch(),m.refetch(),p.refetch()},children:"Try again"})]}):!j||!E?e.jsxs("div",{className:"page-container space-y-3",children:[A,e.jsx("p",{role:"status",className:"text-sm text-secondary",children:j?"This Property is not in the published setup. It may have been renamed or removed.":"A Property page needs a published advanced measurement setup. Republish setup from the project Portfolio tab."}),e.jsx(b,{asChild:!0,type:"button",variant:"outline",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(q,{to:"/projects/$projectName/portfolio",params:{projectName:r},children:M?W?"Republish setup":"Open measurement setup":"View measurement setup"})})]}):e.jsxs("div",{className:"page-container space-y-8",children:[e.jsxs("div",{className:"page-header",children:[e.jsxs("div",{className:"page-header-left",children:[A,e.jsx("h1",{className:"page-title mt-2",children:E.label}),e.jsxs("p",{className:"page-subtitle",children:["Property in ",r]})]}),e.jsxs("div",{className:"page-header-right",children:[u?e.jsx(g,{tone:O[u.measurement.state].tone,children:O[u.measurement.state].label}):null,N&&N.flags>0?e.jsxs(g,{tone:"caution",children:[N.flags," flagged"]}):null]})]}),e.jsx(fe,{branded:U,nonBrand:I,brandedError:m.isError,nonBrandError:p.isError,onRetry:t=>{t==="branded"?m.refetch():p.refetch()}}),u&&(u.measurement.state==="not_measured"||u.nextAction.kind==="run_measurement")?e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-y border-default py-4","aria-label":"Measurement next step",children:[e.jsx("p",{className:"text-sm text-secondary",children:M?"Run a measurement from the project overview to collect this Property’s coverage and source evidence.":"This Property needs a new measurement before coverage and source evidence are available."}),e.jsx(b,{asChild:!0,type:"button",className:"h-11 px-4 text-sm md:h-11",children:e.jsx(q,{to:"/projects/$projectName",params:{projectName:r},children:M?"Go to measurement overview":"View measurement overview"})})]}):null,e.jsxs("div",{className:"flex flex-wrap items-end gap-4 border-y border-default py-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"property-query-class",className:"block text-sm font-medium text-heading",children:"Question type"}),e.jsxs("select",{id:"property-query-class",value:a,onChange:t=>c(t.target.value==="branded"?"branded":"non-brand"),className:"h-11 rounded-md border border-default bg-surface px-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-mono-400",children:[e.jsx("option",{value:"non-brand",children:l["non-brand"].technical}),e.jsx("option",{value:"branded",children:l.branded.technical})]})]}),e.jsxs("p",{className:"supporting-copy",children:["Everything below is measured over ",l[a].technical.toLocaleLowerCase()," only."]})]}),e.jsx(ve,{row:N,queryClass:a,isError:_}),e.jsx(Ne,{questions:H,queryClass:a}),e.jsx(we,{urls:G}),e.jsxs("section",{"aria-labelledby":"property-evidence",className:"page-section-divider",children:[e.jsxs("div",{className:"section-head section-head-inline",children:[e.jsxs("div",{children:[e.jsx("p",{className:"eyebrow eyebrow-soft",children:"Evidence"}),e.jsxs("h2",{id:"property-evidence",className:"text-base font-semibold text-heading",children:["Answers the engines gave",e.jsx(C,{text:"One row per answer an engine gave for the questions assigned to this Property in the displayed measurement. Mentioned and cited are independent: an answer can name this Property without linking it, or link it without naming it. Answers that did neither are listed first, because those are what a gap is made of. Where the answer text was not stored the mention reads Not measured, never a zero. Expand a row for the source URLs the engine returned, this Property's own first."})]})]}),y.length>0?e.jsxs("p",{className:"supporting-copy",children:[y.length," of ",$]}):null]}),_?e.jsxs("p",{className:"text-sm text-secondary",children:["Evidence for ",l[a].technical.toLocaleLowerCase()," is unavailable. Retry that question type above."]}):i.isPending&&y.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"Loading evidence…"}):i.isError&&y.length===0?e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsx("span",{role:"alert",children:"Evidence could not be loaded."}),e.jsx(b,{type:"button",size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",onClick:()=>{i.refetch()},children:"Retry evidence"})]}):Z==="not_measured"?e.jsx("p",{className:"text-sm text-secondary",children:"Not measured yet. Run a measurement to collect the answers for this Property."}):Y?e.jsx("p",{role:"alert",className:"text-sm text-caution",children:"This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected."}):y.length===0?e.jsx("p",{className:"text-sm text-secondary",children:"No answers matched this Property in the displayed measurement."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto rounded-md border border-default",children:e.jsxs("table",{className:"evidence-table min-w-[720px]",children:[e.jsx("caption",{className:"sr-only",children:"Answers measured for this Property"}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Question"}),e.jsx("th",{children:"Mentioned in the answer"}),e.jsx("th",{children:"Cited as a source"}),e.jsx("th",{children:"Sources"}),e.jsx("th",{children:e.jsx("span",{className:"sr-only",children:"Sources detail"})})]})}),e.jsx("tbody",{children:y.map(t=>{const o=ue(t),h=w.has(o);return e.jsxs(v.Fragment,{children:[e.jsxs("tr",{children:[e.jsxs("td",{className:"text-secondary",children:[e.jsx("span",{className:"block",children:t.queryText}),e.jsx("span",{className:"mt-1 block text-xs text-muted",children:[t.provider,t.location].filter(Boolean).join(" · ")}),t.historical||t.bridged?e.jsx("span",{className:"mt-1 flex",children:e.jsx(g,{tone:"caution",children:"Historical"})}):null]}),e.jsx("td",{children:e.jsx(je,{row:t})}),e.jsx("td",{children:e.jsx(be,{row:t})}),e.jsx("td",{className:"tabular-nums text-secondary",children:t.cited===null?ye:t.sources.length}),e.jsx("td",{className:"text-right",children:e.jsx(b,{type:"button",size:"sm",variant:"ghost","aria-expanded":h,onClick:()=>S(se=>{const k=new Set(se);return k.delete(o)||k.add(o),k}),children:h?`Hide sources for ${t.queryText}`:`Show sources for ${t.queryText}`})})]}),h?e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"bg-surface-subtle px-4",children:e.jsx(ge,{row:t})})}):null]},o)})})]})}),i.hasNextPage?e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-sm text-secondary",children:[e.jsxs("span",{children:["Showing ",y.length," of ",$]}),i.isFetchNextPageError?e.jsx("span",{role:"alert",children:"Could not load more evidence."}):null,e.jsx(b,{size:"sm",variant:"outline",className:"h-11 px-4 text-sm md:h-11",disabled:i.isFetchingNextPage,onClick:()=>{i.fetchNextPage()},children:i.isFetchingNextPage?"Loading…":i.isFetchNextPageError?"Retry more evidence":`Show ${F} more`})]}):null]})]})]})}export{ke as MeasurementPropertyPage};