@canonry/canonry 7.127.0 → 7.128.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 (40) hide show
  1. package/assets/assets/{AccessControls-2bimiIhw.js → AccessControls-QW1RtXqK.js} +2 -2
  2. package/assets/assets/{AgentSetupPage-BGAU8xzj.js → AgentSetupPage-BFO6Jx36.js} +4 -4
  3. package/assets/assets/{AuditHistoryPanel-Br4LNvcM.js → AuditHistoryPanel-Cn9Tnnxo.js} +1 -1
  4. package/assets/assets/{BacklinksPage-BBh43gcY.js → BacklinksPage-Bv12EM38.js} +1 -1
  5. package/assets/assets/{ChartPrimitives-ChO_4pZz.js → ChartPrimitives-DIAAi1Eq.js} +1 -1
  6. package/assets/assets/{HistoryPage-okXPylcp.js → HistoryPage-Bfn3nVjo.js} +1 -1
  7. package/assets/assets/MeasurementPropertyPage-Cwyl4MS5.js +4 -0
  8. package/assets/assets/ProjectPage-JCH068IS.js +15 -0
  9. package/assets/assets/{RunsPage-4u1VBVOW.js → RunsPage-B56n3Xwl.js} +1 -1
  10. package/assets/assets/{ServerTrafficSection-Bl0HTTwh.js → ServerTrafficSection-JZ7tID1A.js} +3 -3
  11. package/assets/assets/{SettingsPage-C05qxsby.js → SettingsPage-C1XRb6UB.js} +1 -1
  12. package/assets/assets/{ToneBadge-BE2H103M.js → ToneBadge-DSr49xyr.js} +1 -1
  13. package/assets/assets/{TrafficPage-Bd3ey_0C.js → TrafficPage-BIbFPquR.js} +1 -1
  14. package/assets/assets/{TrafficSourceDetailPage-B6Gi-qBP.js → TrafficSourceDetailPage-DpJyjmCY.js} +1 -1
  15. package/assets/assets/{account-context-y7mzU3Ko.js → account-context-CRwUczVQ.js} +1 -1
  16. package/assets/assets/{agent-trust-copy-CHQ9IAa3.js → agent-trust-copy-DduiTpc0.js} +1 -1
  17. package/assets/assets/{card-BmJz19vt.js → card-DtN_FyC4.js} +1 -1
  18. package/assets/assets/index-CmdxqiD3.js +43 -0
  19. package/assets/assets/{preload-helper-BLaGg0Jn.js → preload-helper-CqQPtzI4.js} +1 -1
  20. package/assets/assets/{query-client-DmQlVZMA.js → query-client-BcqjBQN8.js} +1 -1
  21. package/assets/assets/react-query-Bt-PaSFW.js +1 -0
  22. package/assets/assets/{react-sigma_core.esm.min-DNPGgfTG.js → react-sigma_core.esm.min-BTRnvmn2.js} +1 -1
  23. package/assets/assets/{server-traffic-ALYWW6k0.js → server-traffic-D598cM_v.js} +1 -1
  24. package/assets/assets/service--wSlHsiA.js +1 -0
  25. package/assets/index.html +9 -9
  26. package/dist/{chunk-2IU7GJCX.js → chunk-6TXHNNKW.js} +1 -1
  27. package/dist/{chunk-PUEARV37.js → chunk-DWFCDUE2.js} +3 -3
  28. package/dist/{chunk-JRWHQVA6.js → chunk-GW4CL5ZO.js} +66 -2
  29. package/dist/{cli-commands-UH3DRBPC.js → cli-commands-IM2ISRXZ.js} +1 -1
  30. package/dist/cli.js +2 -2
  31. package/dist/index.d.ts +24 -24
  32. package/dist/index.js +1 -1
  33. package/dist/{init-HZANRCMW.js → init-GGKLWNRS.js} +1 -1
  34. package/dist/{serve-E4N2XMIC.js → serve-VV4SVEJW.js} +7 -5
  35. package/package.json +1 -1
  36. package/assets/assets/MeasurementPropertyPage-C2otbn5d.js +0 -4
  37. package/assets/assets/ProjectPage-DGrfKxfG.js +0 -15
  38. package/assets/assets/index-s7MwkxGB.js +0 -43
  39. package/assets/assets/react-query-BnTbVX2a.js +0 -1
  40. package/assets/assets/service-BKTlKu2x.js +0 -1
package/dist/index.d.ts CHANGED
@@ -1834,7 +1834,7 @@ declare const seoProfiles: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1834
1834
  languageCode: string;
1835
1835
  limit: number;
1836
1836
  scope: {
1837
- kind: "project" | "property" | "market" | "group";
1837
+ kind: "project" | "market" | "group" | "property";
1838
1838
  key?: string | undefined;
1839
1839
  expectedPlanRevision?: number | undefined;
1840
1840
  };
@@ -1879,7 +1879,7 @@ declare const seoProfiles: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
1879
1879
  languageCode: string;
1880
1880
  limit: number;
1881
1881
  scope: {
1882
- kind: "project" | "property" | "market" | "group";
1882
+ kind: "project" | "market" | "group" | "property";
1883
1883
  key?: string | undefined;
1884
1884
  expectedPlanRevision?: number | undefined;
1885
1885
  };
@@ -2076,7 +2076,7 @@ declare const seoJobs: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2076
2076
  languageCode: string;
2077
2077
  limit: number;
2078
2078
  scope: {
2079
- kind: "project" | "property" | "market" | "group";
2079
+ kind: "project" | "market" | "group" | "property";
2080
2080
  key?: string | undefined;
2081
2081
  expectedPlanRevision?: number | undefined;
2082
2082
  };
@@ -2121,7 +2121,7 @@ declare const seoJobs: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
2121
2121
  languageCode: string;
2122
2122
  limit: number;
2123
2123
  scope: {
2124
- kind: "project" | "property" | "market" | "group";
2124
+ kind: "project" | "market" | "group" | "property";
2125
2125
  key?: string | undefined;
2126
2126
  expectedPlanRevision?: number | undefined;
2127
2127
  };
@@ -3300,7 +3300,7 @@ declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3300
3300
  tableName: "projects";
3301
3301
  dataType: "json";
3302
3302
  columnType: "SQLiteTextJson";
3303
- data: ("x" | "linkedin" | "reddit")[];
3303
+ data: ("linkedin" | "x" | "reddit")[];
3304
3304
  driverParam: string;
3305
3305
  notNull: true;
3306
3306
  hasDefault: true;
@@ -3312,7 +3312,7 @@ declare const projects: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
3312
3312
  identity: undefined;
3313
3313
  generated: undefined;
3314
3314
  }, {}, {
3315
- $type: ("x" | "linkedin" | "reddit")[];
3315
+ $type: ("linkedin" | "x" | "reddit")[];
3316
3316
  }>;
3317
3317
  createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
3318
3318
  name: "created_at";
@@ -6362,7 +6362,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6362
6362
  tableName: "query_snapshots";
6363
6363
  dataType: "string";
6364
6364
  columnType: "SQLiteText";
6365
- data: "unknown" | "not-applicable" | "used" | "not-used";
6365
+ data: "unknown" | "used" | "not-used" | "not-applicable";
6366
6366
  driverParam: string;
6367
6367
  notNull: false;
6368
6368
  hasDefault: false;
@@ -6375,7 +6375,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6375
6375
  generated: undefined;
6376
6376
  }, {}, {
6377
6377
  length: number | undefined;
6378
- $type: "unknown" | "not-applicable" | "used" | "not-used";
6378
+ $type: "unknown" | "used" | "not-used" | "not-applicable";
6379
6379
  }>;
6380
6380
  retrievalContract: drizzle_orm_sqlite_core.SQLiteColumn<{
6381
6381
  name: "retrieval_contract";
@@ -6723,7 +6723,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6723
6723
  status?: string | null | undefined;
6724
6724
  }[];
6725
6725
  searchQueries: string[];
6726
- retrievalStatus: "unknown" | "not-applicable" | "used" | "not-used";
6726
+ retrievalStatus: "unknown" | "used" | "not-used" | "not-applicable";
6727
6727
  citationBasis: "none" | "mixed" | "answer-support" | "explicit-citation";
6728
6728
  citationMeasurable: boolean;
6729
6729
  directSourceUrls: boolean;
@@ -6828,7 +6828,7 @@ declare const querySnapshots: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
6828
6828
  status?: string | null | undefined;
6829
6829
  }[];
6830
6830
  searchQueries: string[];
6831
- retrievalStatus: "unknown" | "not-applicable" | "used" | "not-used";
6831
+ retrievalStatus: "unknown" | "used" | "not-used" | "not-applicable";
6832
6832
  citationBasis: "none" | "mixed" | "answer-support" | "explicit-citation";
6833
6833
  citationMeasurable: boolean;
6834
6834
  directSourceUrls: boolean;
@@ -21425,7 +21425,7 @@ declare const gaMeasurementSyncStates: drizzle_orm_sqlite_core.SQLiteTableWithCo
21425
21425
  tableName: "ga_measurement_sync_state";
21426
21426
  dataType: "string";
21427
21427
  columnType: "SQLiteText";
21428
- data: "error" | "never-synced" | "ready" | "unavailable";
21428
+ data: "error" | "unavailable" | "never-synced" | "ready";
21429
21429
  driverParam: string;
21430
21430
  notNull: true;
21431
21431
  hasDefault: true;
@@ -21438,7 +21438,7 @@ declare const gaMeasurementSyncStates: drizzle_orm_sqlite_core.SQLiteTableWithCo
21438
21438
  generated: undefined;
21439
21439
  }, {}, {
21440
21440
  length: number | undefined;
21441
- $type: "error" | "never-synced" | "ready" | "unavailable";
21441
+ $type: "error" | "unavailable" | "never-synced" | "ready";
21442
21442
  }>;
21443
21443
  searchLandingError: drizzle_orm_sqlite_core.SQLiteColumn<{
21444
21444
  name: "search_landing_error";
@@ -30801,7 +30801,7 @@ declare const researchRuns: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
30801
30801
  dataType: "json";
30802
30802
  columnType: "SQLiteTextJson";
30803
30803
  data: {
30804
- kind: "property" | "market";
30804
+ kind: "market" | "property";
30805
30805
  key: string;
30806
30806
  label: string;
30807
30807
  planRevision: number;
@@ -30818,7 +30818,7 @@ declare const researchRuns: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
30818
30818
  generated: undefined;
30819
30819
  }, {}, {
30820
30820
  $type: {
30821
- kind: "property" | "market";
30821
+ kind: "market" | "property";
30822
30822
  key: string;
30823
30823
  label: string;
30824
30824
  planRevision: number;
@@ -31524,7 +31524,7 @@ declare const researchRunQueries: drizzle_orm_sqlite_core.SQLiteTableWithColumns
31524
31524
  status?: string | null | undefined;
31525
31525
  }[];
31526
31526
  searchQueries: string[];
31527
- retrievalStatus: "unknown" | "not-applicable" | "used" | "not-used";
31527
+ retrievalStatus: "unknown" | "used" | "not-used" | "not-applicable";
31528
31528
  citationBasis: "none" | "mixed" | "answer-support" | "explicit-citation";
31529
31529
  citationMeasurable: boolean;
31530
31530
  directSourceUrls: boolean;
@@ -31629,7 +31629,7 @@ declare const researchRunQueries: drizzle_orm_sqlite_core.SQLiteTableWithColumns
31629
31629
  status?: string | null | undefined;
31630
31630
  }[];
31631
31631
  searchQueries: string[];
31632
- retrievalStatus: "unknown" | "not-applicable" | "used" | "not-used";
31632
+ retrievalStatus: "unknown" | "used" | "not-used" | "not-applicable";
31633
31633
  citationBasis: "none" | "mixed" | "answer-support" | "explicit-citation";
31634
31634
  citationMeasurable: boolean;
31635
31635
  directSourceUrls: boolean;
@@ -34613,7 +34613,7 @@ declare const gbpReviews: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
34613
34613
  tableName: "gbp_reviews";
34614
34614
  dataType: "string";
34615
34615
  columnType: "SQLiteText";
34616
- data: "none" | "baseline" | "stale" | "pending" | "sent" | "skipped" | "suppressed";
34616
+ data: "none" | "baseline" | "stale" | "skipped" | "pending" | "sent" | "suppressed";
34617
34617
  driverParam: string;
34618
34618
  notNull: true;
34619
34619
  hasDefault: true;
@@ -34626,7 +34626,7 @@ declare const gbpReviews: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
34626
34626
  generated: undefined;
34627
34627
  }, {}, {
34628
34628
  length: number | undefined;
34629
- $type: "none" | "baseline" | "stale" | "pending" | "sent" | "skipped" | "suppressed";
34629
+ $type: "none" | "baseline" | "stale" | "skipped" | "pending" | "sent" | "suppressed";
34630
34630
  }>;
34631
34631
  alertStateAt: drizzle_orm_sqlite_core.SQLiteColumn<{
34632
34632
  name: "alert_state_at";
@@ -34923,7 +34923,7 @@ declare const gbpReviewRatings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
34923
34923
  tableName: "gbp_review_ratings";
34924
34924
  dataType: "string";
34925
34925
  columnType: "SQLiteText";
34926
- data: "none" | "baseline" | "stale" | "pending" | "sent" | "skipped" | "suppressed";
34926
+ data: "none" | "baseline" | "stale" | "skipped" | "pending" | "sent" | "suppressed";
34927
34927
  driverParam: string;
34928
34928
  notNull: true;
34929
34929
  hasDefault: true;
@@ -34936,7 +34936,7 @@ declare const gbpReviewRatings: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
34936
34936
  generated: undefined;
34937
34937
  }, {}, {
34938
34938
  length: number | undefined;
34939
- $type: "none" | "baseline" | "stale" | "pending" | "sent" | "skipped" | "suppressed";
34939
+ $type: "none" | "baseline" | "stale" | "skipped" | "pending" | "sent" | "suppressed";
34940
34940
  }>;
34941
34941
  alertStateAt: drizzle_orm_sqlite_core.SQLiteColumn<{
34942
34942
  name: "alert_state_at";
@@ -42208,7 +42208,7 @@ declare const socialMentions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
42208
42208
  tableName: "social_mentions";
42209
42209
  dataType: "string";
42210
42210
  columnType: "SQLiteText";
42211
- data: "x" | "linkedin" | "reddit";
42211
+ data: "linkedin" | "x" | "reddit";
42212
42212
  driverParam: string;
42213
42213
  notNull: true;
42214
42214
  hasDefault: false;
@@ -42221,7 +42221,7 @@ declare const socialMentions: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
42221
42221
  generated: undefined;
42222
42222
  }, {}, {
42223
42223
  length: number | undefined;
42224
- $type: "x" | "linkedin" | "reddit";
42224
+ $type: "linkedin" | "x" | "reddit";
42225
42225
  }>;
42226
42226
  externalId: drizzle_orm_sqlite_core.SQLiteColumn<{
42227
42227
  name: "external_id";
@@ -42600,7 +42600,7 @@ declare const socialConnections: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
42600
42600
  tableName: "social_connections";
42601
42601
  dataType: "string";
42602
42602
  columnType: "SQLiteText";
42603
- data: "x" | "linkedin" | "reddit";
42603
+ data: "linkedin" | "x" | "reddit";
42604
42604
  driverParam: string;
42605
42605
  notNull: true;
42606
42606
  hasDefault: false;
@@ -42613,7 +42613,7 @@ declare const socialConnections: drizzle_orm_sqlite_core.SQLiteTableWithColumns<
42613
42613
  generated: undefined;
42614
42614
  }, {}, {
42615
42615
  length: number | undefined;
42616
- $type: "x" | "linkedin" | "reddit";
42616
+ $type: "linkedin" | "x" | "reddit";
42617
42617
  }>;
42618
42618
  projectId: drizzle_orm_sqlite_core.SQLiteColumn<{
42619
42619
  name: "project_id";
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createGoogleMarketingCredentialStore,
4
4
  createGoogleMarketingRuntime,
5
5
  createServer
6
- } from "./chunk-JRWHQVA6.js";
6
+ } from "./chunk-GW4CL5ZO.js";
7
7
  import "./chunk-5WDU7ZML.js";
8
8
  import "./chunk-3ZNDJ4OM.js";
9
9
  import "./chunk-QWD3ABAW.js";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  buildSetupState,
9
9
  queueServeHandoff
10
- } from "./chunk-2IU7GJCX.js";
10
+ } from "./chunk-6TXHNNKW.js";
11
11
  import "./chunk-VJWDBFSL.js";
12
12
  import "./chunk-GPPTW3HU.js";
13
13
  import "./chunk-GCBFSIKI.js";
@@ -8,8 +8,9 @@ import {
8
8
  import {
9
9
  allowsKeylessFirstRunSetup,
10
10
  createServer,
11
+ getFirstRunSetupToken,
11
12
  waitForServerRuntimeStartup
12
- } from "./chunk-JRWHQVA6.js";
13
+ } from "./chunk-GW4CL5ZO.js";
13
14
  import "./chunk-5WDU7ZML.js";
14
15
  import "./chunk-3ZNDJ4OM.js";
15
16
  import "./chunk-QWD3ABAW.js";
@@ -482,14 +483,15 @@ function readServeOpenState(db) {
482
483
  }
483
484
  }
484
485
  function buildServeOpenLine(input) {
486
+ const withToken = (url) => input.setupToken ? `${url}${url.includes("?") ? "&" : "?"}token=${input.setupToken}` : url;
485
487
  if (input.projectCount === 0) {
486
- return `Open ${input.url}/setup to set up your first project: a free Agent Readiness audit scan, then AI Visibility.`;
488
+ return `Open ${withToken(`${input.url}/setup`)} to set up your first project: a free Agent Readiness audit scan, then AI Visibility.`;
487
489
  }
488
490
  if (!input.hasSiteAudit && input.firstProjectName) {
489
491
  const firstRun = input.projectCount === 1 ? "&onboarding=first-run" : "";
490
- return `Open ${input.url}/setup?project=${encodeURIComponent(input.firstProjectName)}${firstRun} to run its first Agent Readiness audit scan.`;
492
+ return `Open ${withToken(`${input.url}/setup?project=${encodeURIComponent(input.firstProjectName)}${firstRun}`)} to run its first Agent Readiness audit scan.`;
491
493
  }
492
- return `Open ${input.url}`;
494
+ return `Open ${withToken(input.url)}`;
493
495
  }
494
496
  async function serveCommand(format = "text") {
495
497
  const configPath = getConfigPath();
@@ -571,7 +573,7 @@ Received ${signal}, stopping server...`);
571
573
  if (!isMachineFormat(format)) {
572
574
  console.log(`
573
575
  Canonry server running at ${url}`);
574
- console.log(buildServeOpenLine({ url, ...readServeOpenState(db) }));
576
+ console.log(buildServeOpenLine({ url, ...readServeOpenState(db), setupToken: getFirstRunSetupToken(app) ?? void 0 }));
575
577
  if (!allowsKeylessFirstRunSetup(app)) {
576
578
  console.log(isLoopbackBindHost(host) ? "This server is configured to be reached through a proxy or external URL (publicUrl, apiUrl, basePath, or CANONRY_TRUST_PROXY), so first-run dashboard password setup requires the root API key (apiKey in config.yaml)." : "This server is not bound to loopback, so first-run dashboard password setup requires the root API key (apiKey in config.yaml).");
577
579
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "7.127.0",
3
+ "version": "7.128.0",
4
4
  "type": "module",
5
5
  "description": "Self-hosted AI visibility (AEO) platform: track how ChatGPT, Claude, Gemini, and Perplexity cite your domain, join it with Search Console, GA4, server-side traffic, and paid media, and fix what you find through agent tools (CLI, REST, MCP). Local SQLite.",
6
6
  "keywords": [
@@ -1,4 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t,st as n}from"./vendor-lucide-C3F7vHjd.js";import{r}from"./vendor-markdown-DMxglFrF.js";import{_ as i,d as a,f as o,p as s,u as c,v as l,x as u}from"./vendor-tanstack-ZnWhYpCU.js";import{At as d,Fc as f,Ic as p,Is as m,Ls as ee,Rs as h,Zs as g,pt as te,r as _,t as v,xt as y}from"./ToneBadge-BE2H103M.js";import{R as b,S as x,f as S,h as C,z as w}from"./ChartPrimitives-ChO_4pZz.js";import{r as ne}from"./account-context-y7mzU3Ko.js";import{Dt as re,Et as ie,Ft as ae,Mt as T,Ot as oe,Tt as E,kt as D,yn as O}from"./react-query-BnTbVX2a.js";import{E as k,n as A}from"./AccessControls-2bimiIhw.js";import{t as j}from"./InfoTooltip-Dm4gYO4N.js";import{Dt as se,G as ce,J as M,Q as N,Z as P,dt as F,et as le,jt as ue,kt as de,lt as I,mt as L,ut as R}from"./index-s7MwkxGB.js";import{c as z,r as B,s as fe,t as pe,u as V}from"./service-BKTlKu2x.js";var H=e(t(),1),U=r(),W={heading:`Names that count as this Property`,help:`These names identify this Property in answer text. Source titles and URLs do not count as mentions. Qualified names add distinguishing words when several Properties share a name, such as a product line, service, or location.`,names:`Names`,qualifiedNames:`Qualified names`,noNames:`No names are set, so answers can cite this Property but never mention it.`,edit:`Edit names`,save:`Save to draft`,saving:`Saving…`,cancel:`Cancel`,namesHint:`One name per line.`,qualifiedHint:`One per line. Include a name above plus words that identify this specific Property.`,qualifiedNote:`With qualified names set, an answer that uses only a plain name counts as a mention only when it also cites this Property’s own page. Otherwise it is left out as not tied to one property.`,draftOnly:`Saving changes the draft only. Nothing is measured differently until the setup is published.`,saved:`Saved to the draft. Publish the setup to start using these names.`,pending:`Name changes are saved in the draft and not published yet.`,review:`Review and publish`,noChanges:`No changes to save.`,staleDraft:`The draft is based on an older published setup. Open measurement setup to restart it before editing names.`,missingFromDraft:`This Property is not included in the current draft. Open measurement setup to review it.`,conflict:`The draft changed in another session. The latest names are loaded; review them and save again.`,failed:`Could not save these names. Try again.`};function me(e){return[...new Set(e.split(`
2
- `).map(e=>e.trim()).filter(Boolean))]}function he(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function G(e,t){return he(e.aliases,t.aliases)&&he(e.identityAliases??[],t.identityAliases??[])}function ge(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function _e({label:e,names:t}){return(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e}),(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-secondary`,children:e},e))})]})}function K({id:e,issues:t}){return t.length===0?null:(0,U.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,U.jsx)(`li`,{className:`text-label-14 text-caution`,children:m(e)},`${e.field}:${e.index}`))})}function ve({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:i,service:a=pe}){let{canWrite:o}=ne(),s=(0,H.useId)(),d=u({...ie({client:y,path:{name:e}}),enabled:o}),f=u({...ae({client:y,path:{name:e}}),enabled:o}),p=d.data?.draft?.authoring.targets.find(e=>e.stableKey===t),m=n.identityAliases??[],g=p!==void 0&&d.data?.draft?.baseActiveRevision===r&&!G(p,n),te=!d.isFetching&&!f.isPending,v=f.data,b=(0,H.useMemo)(()=>v?h(v):i,[v,i]),[x,S]=(0,H.useState)(!1),[C,w]=(0,H.useState)(``),[re,T]=(0,H.useState)(``),[oe,E]=(0,H.useState)(n),[D,O]=(0,H.useState)(null),k=`${e}\u0000${t}`,[se,ce]=(0,H.useState)(k);se!==k&&(ce(k),S(!1),w(``),T(``),E(n),O(null));let M=(0,H.useRef)(k);M.current=k;let N=(0,H.useMemo)(()=>me(C),[C]),P=(0,H.useMemo)(()=>me(re),[re]),F=(0,H.useMemo)(()=>ee({aliases:N,identityAliases:P,brandNames:b}),[N,P,b]),le=F.filter(e=>e.field===`aliases`),ue=F.filter(e=>e.field===`identityAliases`);function de(e){w(e.aliases.join(`
3
- `)),T((e.identityAliases??[]).join(`
4
- `)),E({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function I(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function L(){de(g?p:n),O(null),S(!0)}function R(e){e&&de(e),O({tone:`negative`,text:W.conflict,review:!1})}let z=l({mutationFn:async i=>{let o=await a.loadDraft(e);if(!o.draft){if(G(i.names,n))return{outcome:`unchanged`};if(!G(i.base,n))return{outcome:`conflict`,latest:n};await a.createDraft(e,r),o=await a.loadDraft(e)}let s=o.draft;if(!s||!o.etag)throw Error(W.failed);if(s.baseActiveRevision!==r)return{outcome:`stale`};let c=s.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:G(i.names,c)?{outcome:`unchanged`}:G(i.base,c)?(await a.upsertTarget(e,o.etag,ge(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===M.current)switch(e.outcome){case`saved`:S(!1),O({tone:`positive`,text:W.saved,review:!0});return;case`unchanged`:S(!1),O({tone:`positive`,text:W.noChanges,review:!1});return;case`stale`:O({tone:`negative`,text:W.staleDraft,review:!0});return;case`missing`:O({tone:`negative`,text:W.missingFromDraft,review:!0});return;case`conflict`:R(e.latest),d.refetch();return}},onError:(e,t)=>{t.openFor===M.current&&(B(e)?(R(null),d.refetch().then(e=>{e.isSuccess&&R(I(e.data))})):O({tone:`negative`,text:W.failed,review:!1}))}}),fe=(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:W.review}),V=n.aliases.length+m.length;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-names`,className:`text-heading-16 text-heading`,children:W.heading}),(0,U.jsx)(j,{text:W.help})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[V,` `,V===1?`name`:`names`]}),o&&!x?(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!te,onClick:L,children:W.edit}):null]})]}),D?(0,U.jsxs)(`p`,{role:D.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${D.tone===`negative`?`text-negative`:`text-positive`}`,children:[D.text,D.review?(0,U.jsxs)(U.Fragment,{children:[` `,fe]}):null]}):g&&!x?(0,U.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[W.pending,` `,fe]}):null,x?(0,U.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!z.isPending&&z.mutate({names:{aliases:N,identityAliases:P},base:oe,openFor:k})},children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-names`,className:`block text-label-14-strong text-heading`,children:W.names}),(0,U.jsx)(`p`,{id:`${s}-names-hint`,className:`text-copy-14 text-secondary`,children:W.namesHint}),(0,U.jsx)(`textarea`,{id:`${s}-names`,className:`mt-1 min-h-24 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-names-hint${le.length?` ${s}-names-issues`:``}`,value:C,onChange:e=>w(e.target.value)}),(0,U.jsx)(K,{id:`${s}-names-issues`,issues:le}),N.length===0?(0,U.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:W.noNames}):null]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{htmlFor:`${s}-qualified`,className:`block text-label-14-strong text-heading`,children:W.qualifiedNames}),(0,U.jsx)(`p`,{id:`${s}-qualified-hint`,className:`text-copy-14 text-secondary`,children:W.qualifiedHint}),(0,U.jsx)(`textarea`,{id:`${s}-qualified`,className:`mt-1 min-h-20 w-full rounded-md border border-strong bg-transparent px-3 py-2 text-copy-14 text-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,"aria-describedby":`${s}-qualified-hint ${s}-qualified-note${ue.length?` ${s}-qualified-issues`:``}`,value:re,onChange:e=>T(e.target.value)}),(0,U.jsx)(K,{id:`${s}-qualified-issues`,issues:ue}),(0,U.jsx)(`p`,{id:`${s}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:W.qualifiedNote})]}),(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.draftOnly}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,U.jsx)(A,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:z.isPending,children:z.isPending?W.saving:W.save}),(0,U.jsx)(_,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:z.isPending,onClick:()=>{S(!1),O(null)},children:W.cancel})]})]}):V===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:W.noNames}):(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,U.jsx)(_e,{label:W.names,names:n.aliases}):null,m.length>0?(0,U.jsx)(_e,{label:W.qualifiedNames,names:m}):null]})]})}var ye=50,q={branded:{technical:`Branded queries`},"non-brand":{technical:`Non-brand queries`}},J={plan_v1:`Setup update required`,no_completed_run:`No completed measurement yet`,no_population:`No queries of this type are assigned`,evidence_incomplete:`Source evidence is incomplete`,identity_ambiguous:w,not_applicable:`Not applicable for this Property`,citation_not_measured:`The engines return no sources`},be={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`}},Y={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 X(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function xe(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function Se({row:e}){return e.mentioned===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not mentioned`}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[L.label,(0,U.jsx)(j,{text:L.property})]})]}):(0,U.jsx)(v,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var Ce=`—`;function we({row:e}){return e.cited===null?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,U.jsx)(v,{tone:`neutral`,children:`Not measured`}),(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:e.citationMeasured===!1?`The engine returns no sources`:`Sources were not fully captured`})]}):(0,U.jsx)(v,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Te({row:e}){return e.citationMeasured===!1?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:b}):e.cited===null&&e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`The sources for this answer were not fully captured, so none can be shown.`}):e.sources.length===0?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer returned no source URLs at all.`}):(0,U.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,U.jsxs)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:[R,` (`,e.sources.length,`)`]}),(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Match`}),(0,U.jsx)(`th`,{children:`URL`})]})}),(0,U.jsx)(`tbody`,{children:X(e.sources).map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(v,{tone:Y[e.classification].tone,children:Y[e.classification].label})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(I,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function Ee({project:e,targetKey:t,resultId:n}){let r=u({...T({client:y,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`alert`,children:`Could not load this answer.`});let i=r.data?.answer;return i==null||i.trim()===``?(0,U.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,U.jsx)(`div`,{className:`py-2`,children:(0,U.jsx)(F,{headingLevel:4,copyable:!0,children:i})})}function De(e){return J[e.reason]??`Not measured`}function Oe({metric:e,signal:t,queryClass:n,emphasis:r=!1,compact:i=!1}){if(e.state===`unavailable`)return(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:De(e)})]});let a=g(e.value),o=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,s=x(e,t);return i?(0,U.jsxs)(`span`,{className:`inline-flex flex-col items-end gap-0.5`,children:[(0,U.jsxs)(`span`,{className:`engine-comparison-metric`,children:[(0,U.jsx)(`span`,{className:`text-label-14-strong text-primary`,children:a}),o?(0,U.jsxs)(`span`,{className:`text-label-13 text-secondary`,"aria-hidden":`true`,children:[e.numerator,`/`,e.denominator]}):null,(0,U.jsxs)(`span`,{className:`sr-only`,children:[o?` · ${o} answers`:``,` · `,n,` queries`]})]}),s?(0,U.jsx)(`span`,{className:`flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]}):(0,U.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,U.jsx)(`span`,{className:r?`text-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:a}),(0,U.jsxs)(`span`,{className:`sr-only`,children:[` · `,n,` queries`]}),o?(0,U.jsx)(`span`,{className:`text-label-12 text-muted`,children:o}):null,s?(0,U.jsx)(`span`,{className:`-ml-2 flex`,children:(0,U.jsx)(j,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]})}function ke(e,t,n){return E({client:y,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function Ae(e){return e?.properties.items.at(0)}function je({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${S(C(e))}`;return r===null&&t===void 0?null:(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function Me({project:e,groups:t}){return t.length===0?null:(0,U.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-market`,className:`text-heading-16 text-heading`,children:`Measured at the market level`}),(0,U.jsx)(j,{text:`Competitors are attached to groups. Share of voice and competitor pressure use the group or market that includes this Property.`})]})}),(0,U.jsx)(_,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:e},search:e=>N(M(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,U.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,U.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-label-14 text-strong`,children:[e.label,(0,U.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Ne({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-brand-contrast`,className:`text-heading-16 text-heading`,children:`Coverage for this Property`}),(0,U.jsx)(j,{text:`Non-brand queries do not name this Property. Branded queries name it. Each rate uses only the measured answers for that query type. Mentioned means the Property was named in the answer; cited means its URL appeared in the sources. Unchecked sources are not counted as a citation miss.`})]})}),(0,U.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query type`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`})]})}),(0,U.jsx)(`tbody`,{children:[{queryClass:`non-brand`,row:t,isError:r},{queryClass:`branded`,row:e,isError:n}].map(({queryClass:e,row:t,isError:n})=>(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:q[e].technical}),t&&n?(0,U.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,U.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-11 px-3 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]}):null]}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.mentionCoverage,signal:`mentioned`,queryClass:e,emphasis:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:t.citationCoverage,signal:`cited`,queryClass:e,emphasis:!0})})]}):n?(0,U.jsx)(`td`,{colSpan:2,children:(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,U.jsxs)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>i(e),children:[`Retry `,q[e].technical.toLocaleLowerCase()]})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Pe({row:e,queryClass:t,isError:n}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,U.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-providers`,className:`text-heading-16 text-heading`,children:`Which engines answer for this Property`}),(0,U.jsx)(j,{text:`Each row is measured over the queries 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%.`})]})})}),e===void 0&&n?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Details for `,q[t].technical.toLocaleLowerCase(),` are unavailable. Retry that query type above.`]}):e===void 0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No answer engine has measured `,q[t].technical.toLocaleLowerCase(),` for this Property.`,e.mentionCoverage.state===`unavailable`?` ${De(e.mentionCoverage)}.`:``]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`engine-comparison`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{scope:`col`,children:`Engine`}),(0,U.jsx)(`th`,{scope:`col`,children:`Mentioned`}),(0,U.jsx)(`th`,{scope:`col`,children:`Cited`})]})}),(0,U.jsx)(`tbody`,{children:e.providers.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{children:(0,U.jsx)(V,{provider:e.provider})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.mentionCoverage,signal:`mentioned`,queryClass:t,compact:!0})}),(0,U.jsx)(`td`,{children:(0,U.jsx)(Oe,{metric:e.citationCoverage,signal:`cited`,queryClass:t,compact:!0})})]},e.provider))})]})})]})}function Z(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Fe({project:e,targetKey:t,queryClass:n}){let r=u({...oe({client:y,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],a=r.data?.basis;return(0,U.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-named-instead`,className:`text-heading-16 text-heading`,children:`Named instead of this Property`}),(0,U.jsx)(j,{text:`Counted from the answers that did not name this Property, so a name here is one an engine recommended in its place. Occurrences count answers, not positions: an engine naming the same rival in two answers counts twice, and one naming it twice in a single answer counts once.`})]})}),i.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No rival was named in the answers this Property missed. Nothing to compete with here yet.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Named`}),(0,U.jsx)(`th`,{children:`Answers`}),(0,U.jsx)(`th`,{children:`Engines`}),(0,U.jsx)(`th`,{children:`Queries`})]})}),(0,U.jsx)(`tbody`,{children:i.map(e=>(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,U.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,U.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.map(e=>k(e)).join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,U.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,U.jsx)(j,{text:Z(e)})]})})]},e.name))})]})}),a?.state===`available`?(0,U.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[a.targetMissResults,` of `,a.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Ie({questions:e,queryClass:t}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`h2`,{id:`property-questions`,className:`text-heading-16 text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`No `,q[t].technical.toLocaleLowerCase(),` are assigned. Add one in advanced measurement setup to measure this class.`]}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`Query`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Le({urls:e}){return(0,U.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-urls`,className:`text-heading-16 text-heading`,children:`URLs that count as this Property`}),(0,U.jsx)(j,{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.`})]})}),(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No URLs are configured for this Property.`}):(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsx)(`tr`,{children:(0,U.jsx)(`th`,{children:`URL`})})}),(0,U.jsx)(`tbody`,{children:e.map(e=>(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{className:`break-all text-secondary`,children:e})},e))})]})})]})}var Q={heading:`Cited on other queries`,help:`Answers to queries assigned to other properties that still cited one of this Property’s own pages. This Property was not measured on those queries, so these answers are not in its Mentioned or Cited rates.`,notCounted:`not in this Property’s rates`,empty:`No answer to a query assigned elsewhere cited this Property’s pages in the displayed measurement.`,loadError:`Citations from other queries could not be loaded.`,partlySaved:`Sources partly saved`};function Re({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:a}){let[o,s]=(0,H.useState)(new Set),l={client:y,path:{name:e},query:{targetKey:t,queryClass:n,shape:p[`other-queries`],limit:ye,...r?{runId:r}:{}}},u=i({...D(l),initialPageParam:l,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:l.path,query:{...l.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=u.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),m=d[0]?.otherQueries?.totalEstimate??f.length,ee=e=>`${e.expectedSlotId}:${e.queryClass}`,h=q[n].technical.toLocaleLowerCase();return(0,U.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-other-queries`,className:`text-heading-16 text-heading`,children:Q.heading}),(0,U.jsx)(j,{text:Q.help})]}),u.data?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[m,` `,m===1?`answer`:`answers`,` · `,h,` · `,Q.notCounted]}):null]}),u.isPending?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):u.isError&&f.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{u.refetch()},children:`Retry`})]}):f.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:Q.empty}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Assigned to`}),(0,U.jsx)(`th`,{children:`Pages cited`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,U.jsx)(`tbody`,{children:f.map(t=>{let n=ee(t),r=o.has(n),i=`property-other-query-${encodeURIComponent(n)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:t.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(t.provider),t.location].filter(Boolean).join(` · `)})]}),(0,U.jsx)(`td`,{children:(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,U.jsx)(`li`,{children:(0,U.jsx)(c,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:M,className:`text-label-14 text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:a.get(t)??t})},t))})}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,U.jsx)(`li`,{className:`min-w-0`,children:(0,U.jsx)(I,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,U.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":r,"aria-label":r?`Hide the answer for ${t.queryText}`:`Read the answer for ${t.queryText}`,"aria-controls":r?i:void 0,onClick:()=>s(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{id:i,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,U.jsx)(Ee,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),u.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,f.length,` of `,m]}),(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:u.isFetchingNextPage,onClick:()=>{u.fetchNextPage()},children:u.isFetchingNextPage?`Loading…`:`Show ${ye} more`})]}):null]})]})}function ze(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${k(e.provider)} answer engine`:null,e.model?`the ${f(e.model)} model`:null,e.location?`location ${e.location}`:null,e.from||e.to?`a date range`:null,e.measurementRunId?`a saved check`:null].filter(e=>e!==null);return n.length===0?null:`AI Visibility is filtered to ${n.join(`, `)}. This page shows the latest measurement for ${z.allMarkets.toLocaleLowerCase()} and answer engines.`}function Be(){let{projectName:e,targetKey:t}=s({strict:!1}),r=a(),l=o({strict:!1}),f=(0,H.useMemo)(()=>P(l),[l]),[m,ee]=(0,H.useState)(new Set),h=e??``,g=t??``,b=!!h&&!!g,x=(0,H.useMemo)(()=>de(`portfolio`,se(te())),[]),S=b&&x,{canWrite:C}=ne(),w=u({...re({client:y,path:{name:h}}),enabled:S}),ie=w.data?.active?.plan,ae=ie?.schemaVersion===2?ie:null,T=f.queryClass===`branded`||f.queryClass===`non-brand`?f.queryClass:null,oe=e=>ae?.assignments.some(t=>t.targetKey===g&&t.queryClass===e)??!1,E=T??(!oe(`non-brand`)&&oe(`branded`)?`branded`:`non-brand`);(0,H.useEffect)(()=>{ae&&!T&&r({to:`.`,replace:!0,search:e=>N(e,{queryClass:E})})},[ae,T,E,r]);let A=u({...ke(h,g,`branded`),enabled:S}),F=u({...ke(h,g,`non-brand`),enabled:S}),I=Ae(A.data),L=Ae(F.data),z=E===`branded`?A.data:F.data,B=E===`branded`?I:L,pe=(E===`branded`?A.isError:F.isError)&&B===void 0,V=z?.measurement.displayedRunId;ue(h,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:g,queryClass:E,limit:10,...V?{runId:V}:{}}});let W=B?.mentionCoverage.state===`unavailable`?De(B.mentionCoverage):void 0,me=z===void 0?void 0:z.measurement.completedAt??null,he=z!==void 0&&(z.measurement.state===`not_measured`||z.nextAction.kind===`run_measurement`),G=e=>N(M(e),{measurementScope:`property`,measurementScopeKey:g,queryClass:E,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),ge=u({...O({client:y,path:{name:h},query:le(P(G(l)))}),enabled:S&&he,retry:!1}).data,_e=ge!==void 0&&ge.selection.measurement.measuredRevision!==null&&(ge.populations.find(e=>e.queryClass===E)?.summary.queryCount??0)>0,K={client:y,path:{name:h},query:{targetKey:g,queryClass:E,shape:p.answers,limit:ye,...V?{runId:V}:{}}},J=i({...D(K),enabled:S&&z!==void 0,initialPageParam:K,getNextPageParam:e=>e.answers?.nextCursor?{path:K.path,query:{...K.query,cursor:e.answers.nextCursor}}:void 0}),Y=w.data?.active??null,X=Y?.plan.schemaVersion===2?Y.plan:null,Oe=Y!==null&&X===null,Z=X?.targets.find(e=>e.stableKey===g)??null,Q=ze(f,X?.reportingScopes?.find(e=>e.stableKey===f.marketKey)?.label),Be=(0,H.useMemo)(()=>{if(!X)return[];let e=new Map(X.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(X.assignments.filter(e=>e.targetKey===g&&e.queryClass===E).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[X,g,E]),Ve=(0,H.useMemo)(()=>Z?.urlMatchers.map(fe)??[],[Z]),He=(0,H.useMemo)(()=>new Map((X?.targets??[]).map(e=>[e.stableKey,e.label])),[X]),Ue=(0,H.useMemo)(()=>X?.groups.filter(e=>e.targetKeys.includes(g))??[],[X,g]),$=(0,H.useMemo)(()=>(J.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[J.data]),We=J.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(J.data?.pages??[]).length>0&&(J.data?.pages??[]).every(e=>e.answers===void 0),Ke=J.data?.pages[0]?.measurement.state,qe=(0,U.jsxs)(c,{to:`/projects/$projectName`,params:{projectName:h},search:M,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,U.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!b)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!x)return(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(w.isPending&&!w.isError)return(0,U.jsx)(`div`,{className:`page-container`,children:(0,U.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,U.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,U.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=w.isError&&w.data===void 0,Ye=A.isError&&A.data===void 0,Xe=F.isError&&F.data===void 0;return Je||Ye&&Xe?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative`,children:`Could not load this Property.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{w.refetch(),A.refetch(),F.refetch()},children:`Try again`})]}):!X||!Z?(0,U.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,U.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:X?`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.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName/portfolio`,params:{projectName:h},children:C?Oe?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,U.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,U.jsxs)(`div`,{className:`page-header`,children:[(0,U.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,U.jsx)(`h1`,{className:`page-title mt-2`,children:Z.label}),(0,U.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,h,Q?(0,U.jsxs)(U.Fragment,{children:[` · Filters not applied `,(0,U.jsx)(j,{text:Q})]}):null]})]}),(0,U.jsxs)(`div`,{className:`page-header-right`,children:[z?(0,U.jsx)(v,{tone:be[z.measurement.state].tone,children:be[z.measurement.state].label}):null,B&&B.flags>0?(0,U.jsxs)(v,{tone:`caution`,children:[B.flags,` flagged`]}):null]})]}),(0,U.jsx)(Ne,{branded:I,nonBrand:L,brandedError:A.isError,nonBrandError:F.isError,onRetry:e=>{e===`branded`?A.refetch():F.refetch()}}),he?(0,U.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 py-4`,"aria-label":`Measurement next step`,children:[(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:C?`Run a measurement from the project overview to collect this Property’s coverage and source evidence.${_e?` AI Visibility still shows the last results.`:``}`:`This Property needs a new measurement before coverage and source evidence are available.`}),(0,U.jsx)(_,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,U.jsx)(c,{to:`/projects/$projectName`,params:{projectName:h},search:_e?G:M,children:_e?`See the last results`:C?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,U.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 py-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-label-14-strong text-heading`,children:`Query type`}),(0,U.jsxs)(`select`,{id:`property-query-class`,value:E,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>N(e,{queryClass:t})})},className:`h-11 rounded-md border border-default bg-surface px-3 text-label-14 text-primary focus:outline-none focus:ring-2 focus:ring-mono-400`,children:[(0,U.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,U.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,U.jsx)(je,{measuredAt:me,unmeasuredReason:W,queryClass:E})]}),(0,U.jsx)(Pe,{row:B,queryClass:E,isError:pe}),(0,U.jsx)(Fe,{project:h,targetKey:g,queryClass:E}),(0,U.jsx)(Ie,{questions:Be,queryClass:E}),(0,U.jsx)(ve,{projectName:h,targetKey:g,published:Z,activeRevision:Y.revision,publishedBrandNames:X.identities.projectBrand.names}),(0,U.jsx)(Le,{urls:Ve}),(0,U.jsx)(Me,{project:h,groups:Ue}),(0,U.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,U.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,U.jsx)(`div`,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`h2`,{id:`property-evidence`,className:`text-heading-16 text-heading`,children:`Answers the engines gave`}),(0,U.jsx)(j,{text:`Answers for the queries assigned to this Property in the displayed measurement. Mentioned and cited are independent. Missing answer text shows Not measured. Open an answer to read its text and sources, including any other Property it named.`})]})}),$.length>0?(0,U.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),pe?(0,U.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Evidence for `,q[E].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):J.isPending&&$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):J.isError&&$.length===0?(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{J.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?ce:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,U.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-caution`,children:`This measurement was returned in an older format, so the answers cannot be shown here. The numbers above are unaffected.`}):$.length===0?(0,U.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,U.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{children:[(0,U.jsx)(`th`,{children:`Query`}),(0,U.jsx)(`th`,{children:`Mentioned in the answer`}),(0,U.jsx)(`th`,{children:`Cited as a source`}),(0,U.jsx)(`th`,{children:`Sources`}),(0,U.jsx)(`th`,{children:(0,U.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,U.jsx)(`tbody`,{children:$.map(e=>{let t=xe(e),n=m.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,U.jsxs)(H.Fragment,{children:[(0,U.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,U.jsxs)(`td`,{className:`text-secondary`,children:[(0,U.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e.queryText}),(0,U.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[k(e.provider),e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,U.jsx)(`span`,{className:`mt-1 flex`,children:(0,U.jsx)(v,{tone:`caution`,children:`Historical`})}):null]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,U.jsx)(Se,{row:e})]}),(0,U.jsxs)(`td`,{children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,U.jsx)(we,{row:e})]}),(0,U.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,U.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:R}),e.cited===null?Ce:e.sources.length]}),(0,U.jsx)(`td`,{className:`text-right`,children:(0,U.jsx)(_,{type:`button`,size:`sm`,variant:`ghost`,className:`h-auto pointer-coarse:min-h-11 max-w-full whitespace-normal py-2 text-left md:h-auto`,"aria-expanded":n,"aria-label":n?`Hide the answer for ${e.queryText}`:`Read the answer for ${e.queryText}`,"aria-controls":n?r:void 0,onClick:()=>ee(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,U.jsx)(`tr`,{className:`property-answer-detail`,children:(0,U.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,U.jsx)(Ee,{project:h,targetKey:g,resultId:e.observationId}),(0,U.jsx)(Te,{row:e})]})}):null]},t)})})]})}),J.hasNextPage?(0,U.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),J.isFetchNextPageError?(0,U.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,U.jsx)(_,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:J.isFetchingNextPage,onClick:()=>{J.fetchNextPage()},children:J.isFetchingNextPage?`Loading…`:J.isFetchNextPageError?`Retry more evidence`:`Show ${ye} more`})]}):null]})]}),z?(0,U.jsx)(Re,{project:h,targetKey:g,queryClass:E,runId:V,targetLabels:He}):null]})}export{Y as EVIDENCE_LABELS,Be as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};