@canonry/canonry 7.97.8 → 7.99.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.
- package/assets/agent-workspace/skills/aero/references/site-health.md +11 -1
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +2 -0
- package/assets/assets/{AgentSetupPage-DiX4GptZ.js → AgentSetupPage-yOqSVJ-e.js} +1 -1
- package/assets/assets/{AuditHistoryPanel-de0zJkNC.js → AuditHistoryPanel-CiTzFgbw.js} +1 -1
- package/assets/assets/{BacklinksPage-BFfksR1M.js → BacklinksPage-DmRdQsFQ.js} +1 -1
- package/assets/assets/{HistoryPage-DQnGncRE.js → HistoryPage-DNE76LNh.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-DYCBQSnh.js → MeasurementPropertyPage-Cx64Fnmz.js} +1 -1
- package/assets/assets/{ProjectPage-BwwkYgfJ.js → ProjectPage-DNfgC82V.js} +1 -1
- package/assets/assets/{RunsPage-VeWCiQeM.js → RunsPage-BmPKBKKr.js} +1 -1
- package/assets/assets/{SettingsPage-BXPhnRMo.js → SettingsPage-Dl0TNeVK.js} +1 -1
- package/assets/assets/{SiteHealthSection-Ch9tNd8P.js → SiteHealthSection-DxQPaR--.js} +2 -2
- package/assets/assets/ToneBadge-BhjTBHi-.js +60 -0
- package/assets/assets/{TrafficPage-CIzz7gmK.js → TrafficPage-CJp0pS01.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-6IbzMhJ6.js → TrafficSourceDetailPage-DKE8tSw5.js} +1 -1
- package/assets/assets/{account-context-DIWdmpj6.js → account-context-j3asaevn.js} +1 -1
- package/assets/assets/{agent-trust-copy-2Os0XoaQ.js → agent-trust-copy--U_DFYQE.js} +1 -1
- package/assets/assets/{card-CoYH9h6o.js → card-CQAQ-c3g.js} +1 -1
- package/assets/assets/{format-helpers-cRaGEIxc.js → format-helpers-BPugHeIX.js} +1 -1
- package/assets/assets/{index-vfNb458q.js → index-xlDLvgRC.js} +4 -4
- package/assets/assets/{query-client-Bf1oywTZ.js → query-client-CwZpfiiD.js} +1 -1
- package/assets/assets/{react-query-DYI08wkz.js → react-query-CBpNFR4t.js} +1 -1
- package/assets/assets/{react-sigma_core.esm.min-BEhi6Q9o.js → react-sigma_core.esm.min-BAq_-iP1.js} +1 -1
- package/assets/assets/{server-traffic-tgMckYtk.js → server-traffic-jKXLZyeC.js} +1 -1
- package/assets/assets/{service-CN0y5nRe.js → service-DFumlmXt.js} +1 -1
- package/assets/index.html +7 -7
- package/dist/{ads-F7ACQA6Z.js → ads-EYDUTG4U.js} +3 -3
- package/dist/{agent-FBSRQSUX.js → agent-KTK2IDB3.js} +7 -7
- package/dist/{agent-ask-VYSXDUCL.js → agent-ask-KPZOH6RY.js} +3 -3
- package/dist/{agent-conversations-IKAS3RE6.js → agent-conversations-BCWA4JJL.js} +3 -3
- package/dist/{agent-journeys-L3ABBCNC.js → agent-journeys-UBVLQ7JV.js} +3 -3
- package/dist/{agent-memory-SKWZDBMQ.js → agent-memory-24SYEGEX.js} +3 -3
- package/dist/{agent-providers-JBTFE5TJ.js → agent-providers-E7EWFE5P.js} +3 -3
- package/dist/{agent-transcript-YGLXXFF7.js → agent-transcript-QGJ45NW5.js} +3 -3
- package/dist/{analytics-ULDRQRRL.js → analytics-GHVG5CCT.js} +3 -3
- package/dist/{apply-KC4CCHY5.js → apply-7YLB2DPH.js} +3 -3
- package/dist/{backfill-5Y2GMEAH.js → backfill-WNQ6O5WP.js} +10 -10
- package/dist/{backlinks-NXWU4BPY.js → backlinks-ZBZR4D27.js} +3 -3
- package/dist/{bing-E2KM2CW6.js → bing-4VBSKPSX.js} +3 -3
- package/dist/{bootstrap-QYWTDUIZ.js → bootstrap-7ESCLP2G.js} +10 -10
- package/dist/{cdp-E7WXCN5U.js → cdp-WBL6FZTL.js} +7 -7
- package/dist/{chunk-KSB3UZMW.js → chunk-2RW5D55K.js} +2 -2
- package/dist/{chunk-RSJBMQMN.js → chunk-3MFYM2IS.js} +1 -1
- package/dist/{chunk-I6G5K5PM.js → chunk-3MKJ4LP6.js} +6 -6
- package/dist/{chunk-TUBFKC3O.js → chunk-3VPBRGPN.js} +1 -1
- package/dist/{chunk-7737JZP6.js → chunk-3WDQ5GPO.js} +1 -1
- package/dist/{chunk-ZN3KIIMP.js → chunk-47X24IJG.js} +24 -2
- package/dist/{chunk-GMCVZPKO.js → chunk-5ZOM5BJS.js} +1 -1
- package/dist/{chunk-4VSL2CMF.js → chunk-74V5EPZH.js} +7 -7
- package/dist/{chunk-7APKPDOV.js → chunk-AJD252SX.js} +2 -2
- package/dist/{chunk-NPCML7HY.js → chunk-AY7SDX6G.js} +3 -3
- package/dist/{chunk-TUQYYF4G.js → chunk-C55P75G4.js} +2 -2
- package/dist/{chunk-LPSKHUCV.js → chunk-DLOWRO5R.js} +3 -3
- package/dist/{chunk-AI2G7QMW.js → chunk-DMPSA7ZS.js} +4 -4
- package/dist/{chunk-66DTIEWN.js → chunk-L53ZSQN5.js} +28 -1
- package/dist/{chunk-NLN7EGU3.js → chunk-LM7HTNUO.js} +5 -5
- package/dist/{chunk-C3LS3ZKI.js → chunk-O6RXNSNW.js} +1 -1
- package/dist/{chunk-QM4PMS52.js → chunk-P764TJKQ.js} +1 -1
- package/dist/{chunk-FDVCTZXD.js → chunk-PT5HNVCM.js} +1 -1
- package/dist/{chunk-Q4KVK426.js → chunk-RRXLJPBN.js} +5 -5
- package/dist/{chunk-UBF2S3DF.js → chunk-SY3CWJR4.js} +2 -2
- package/dist/{chunk-X4DR2LK7.js → chunk-TVBOK4P2.js} +4 -4
- package/dist/{chunk-JYG3LUXU.js → chunk-UPHHKO3L.js} +357 -357
- package/dist/{chunk-4OGRTTZX.js → chunk-UY6SKAKW.js} +2 -2
- package/dist/{chunk-RABCSQBW.js → chunk-VADVPARO.js} +4 -4
- package/dist/{chunk-7TIX5NHC.js → chunk-VOVT2H25.js} +3 -3
- package/dist/{chunk-YO2OW67H.js → chunk-WA6APXI6.js} +3 -3
- package/dist/{chunk-MAWNTOQE.js → chunk-WXAF7AMC.js} +2 -2
- package/dist/{chunk-22LX5CWD.js → chunk-XPIMVXAI.js} +561 -359
- package/dist/{chunk-MA3ZD7TF.js → chunk-XQP3XHLJ.js} +2 -2
- package/dist/{chunk-RJNAUQSV.js → chunk-YACKJGY4.js} +1 -1
- package/dist/{chunk-5455IRP3.js → chunk-YBWATBX4.js} +1 -1
- package/dist/{chunk-WWGOMPYP.js → chunk-YEUULP44.js} +1 -1
- package/dist/{chunk-5X2N5OOF.js → chunk-YMHN4UIT.js} +1 -1
- package/dist/{chunk-FZIYHP67.js → chunk-ZGBLNKFN.js} +31 -5
- package/dist/{chunk-7CAOGKRV.js → chunk-ZN2TEBBX.js} +3 -3
- package/dist/{citations-CJ5Y3ZET.js → citations-N5MGNKJN.js} +3 -3
- package/dist/{cli-catalog-Z4XQIDYU.js → cli-catalog-FFU7PHW7.js} +3 -3
- package/dist/{cli-commands-3HZFXKVU.js → cli-commands-AMIDEUO2.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-FC43JBCH.js → competitor-GRA2GMZR.js} +3 -3
- package/dist/{content-LS4EAVOS.js → content-YVAPTIV4.js} +3 -3
- package/dist/{dashboard-AZUFESTB.js → dashboard-33ACBR5A.js} +6 -6
- package/dist/{demo-LTVTVYGC.js → demo-AGXWBMR6.js} +1 -1
- package/dist/{demo-server-WHDXTUWQ.js → demo-server-W4YAC7GT.js} +12 -12
- package/dist/{discover-T5D7T5EZ.js → discover-BH33TO4Z.js} +3 -3
- package/dist/{discover-eval-FQWKYZD7.js → discover-eval-3CEA6DEE.js} +3 -3
- package/dist/{doctor-UEFC5WP7.js → doctor-ZAYTD5PC.js} +3 -3
- package/dist/{evidence-FXGHON3E.js → evidence-247GL7UK.js} +3 -3
- package/dist/{export-cmd-AF6KF2GP.js → export-cmd-HLKWFI5Q.js} +3 -3
- package/dist/{ga-RMYK4AQC.js → ga-BMING57Z.js} +3 -3
- package/dist/{gbp-5PAKGLBI.js → gbp-MIB5CXSD.js} +3 -3
- package/dist/{google-6NYRRHIS.js → google-5JP6RYAW.js} +4 -4
- package/dist/{google-marketing-6EVLEHKD.js → google-marketing-25OBMPS6.js} +1 -1
- package/dist/{health-cmd-WXDFHL7O.js → health-cmd-D5XSEL7H.js} +3 -3
- package/dist/{history-MZWTC4OE.js → history-6MDRFPQ3.js} +3 -3
- package/dist/index.d.ts +122 -12
- package/dist/index.js +25 -25
- package/dist/{init-OM64S7AT.js → init-RDR75N2Y.js} +12 -12
- package/dist/{insights-CYE3NXGD.js → insights-QZVMBGVM.js} +3 -3
- package/dist/intelligence-service-KQE7RO5I.js +16 -0
- package/dist/{journeys-YISJ3GH4.js → journeys-TABTZDFZ.js} +3 -3
- package/dist/{keys-L76I5EZI.js → keys-SL5YF7NQ.js} +3 -3
- package/dist/{keyword-54UML7XE.js → keyword-OCDEXRSW.js} +3 -3
- package/dist/{logs-ZG44USRX.js → logs-CSC7O364.js} +3 -3
- package/dist/{mcp-T7ZNR55S.js → mcp-P725OHAJ.js} +4 -4
- package/dist/mcp.js +9 -9
- package/dist/{measurement-plan-E7FAS5V3.js → measurement-plan-Z42GBJBO.js} +5 -5
- package/dist/{notify-ZB4V7B4L.js → notify-E5JBES4I.js} +5 -4
- package/dist/{organic-evidence-W5BJ37VR.js → organic-evidence-CUA3T64O.js} +3 -3
- package/dist/{overview-MULDZS6B.js → overview-UKQ52I72.js} +4 -4
- package/dist/{project-LFDGHF3H.js → project-2ULM64TV.js} +3 -3
- package/dist/{query-ZV3XX5YW.js → query-Y47IEFKJ.js} +3 -3
- package/dist/{research-HGAKJGVQ.js → research-DPFQZ3TE.js} +3 -3
- package/dist/{results-export-5HCHJGBM.js → results-export-KBHOBQAH.js} +3 -3
- package/dist/{run-5VYP7S3V.js → run-4CYHVIIU.js} +4 -4
- package/dist/{schedule-FD2VIHX7.js → schedule-GY4P3RON.js} +3 -3
- package/dist/{search-6TJJWFJB.js → search-AGVNZMJQ.js} +3 -3
- package/dist/{serve-4QZEQUER.js → serve-5LFKIXNL.js} +26 -26
- package/dist/{session-PA4SLGYI.js → session-YAYEDM3P.js} +13 -13
- package/dist/{settings-NOXPXCAY.js → settings-HUKMWRHY.js} +3 -3
- package/dist/{sitemaps-P52HCBCM.js → sitemaps-APTY7U6H.js} +3 -3
- package/dist/{skills-EBWXL2WN.js → skills-4BUONEIZ.js} +2 -2
- package/dist/{snapshot-IST2UAPI.js → snapshot-BXCWSF5P.js} +3 -3
- package/dist/{src-53VQLBQC.js → src-R7XZUX3D.js} +4 -2
- package/dist/{status-X2RYXIU5.js → status-SB6HPBYJ.js} +4 -4
- package/dist/{technical-aeo-HRQRU2L3.js → technical-aeo-G7UEMWZD.js} +3 -3
- package/dist/{telemetry-KQATCLNR.js → telemetry-H4S4Y7YV.js} +4 -4
- package/dist/{tools-VLQ3GZUE.js → tools-46XX6I4R.js} +11 -11
- package/dist/{traffic-WK6HEQWG.js → traffic-I6WRJN3W.js} +5 -5
- package/dist/{trends-353NF4OU.js → trends-AQK3GLWF.js} +3 -3
- package/dist/{users-YXBFZHVO.js → users-SNTVY6OB.js} +3 -3
- package/dist/{visibility-stats-N4KZ3N4P.js → visibility-stats-44QAD2XS.js} +3 -3
- package/dist/{wordpress-3IPY5TA3.js → wordpress-N7LTOW46.js} +3 -3
- package/package.json +2 -2
- package/assets/assets/ToneBadge-JbnFjl09.js +0 -60
- package/dist/intelligence-service-ILIYUOKY.js +0 -16
|
@@ -102,7 +102,17 @@ multiple Properties; avoid counting the same finding as independent proof
|
|
|
102
102
|
for each one.
|
|
103
103
|
|
|
104
104
|
Rank persisted critical defects and fixes using severity and affected-page
|
|
105
|
-
evidence, with business or link importance where available.
|
|
105
|
+
evidence, with business or link importance where available.
|
|
106
|
+
|
|
107
|
+
On an Advanced project, the critical defect `names-another-entity` marks a
|
|
108
|
+
page that belongs to one Property whose FAQ, title or H1 names another of the
|
|
109
|
+
plan's Properties, usually text copied between Property pages. The page audit
|
|
110
|
+
read carries up to 25 `evidence` entries: the place (`faq-question`,
|
|
111
|
+
`faq-answer`, `title`, `h1`), the FAQ question, the named Property's key and
|
|
112
|
+
name, and a short snippet. Quote those rather than the issue title, and name
|
|
113
|
+
the Property the page belongs to. The check uses the plan revision in the
|
|
114
|
+
scan's `effectiveOptions.entityPlanRevision`; a null revision means the scan
|
|
115
|
+
did not check names, not that no page names another Property. State the run,
|
|
106
116
|
scope, finding, affected page(s), and supported next step. A technical issue
|
|
107
117
|
can be a hypothesis for an AI-visibility gap, but the crawl alone cannot prove
|
|
108
118
|
why an answer engine omitted a Property. Join the corresponding answer
|
|
@@ -753,6 +753,8 @@ Available events: `citation.lost`, `citation.gained`, `run.completed`, `run.fail
|
|
|
753
753
|
|
|
754
754
|
A webhook that lists either event receives **only the health events it lists**, so it is not sent routine warnings; every other webhook keeps receiving `health.degraded` and `health.recovered` as before. An urgent problem is always part of `health.degraded` too, so on the scheduled pass a webhook that lists both gets a message under each name (a website outage is sent once, as `health.degraded`). Example: `cnry notify add <project> --webhook <url> --events health.urgent,health.urgent-resolved`.
|
|
755
755
|
|
|
756
|
+
**Site Health alerts** (`site-health.issue.new`) go only to webhooks that list the event. After each site audit, Canonry sends it when the scan found a critical page problem (no H1, several H1s, no title, or a page that names another property) on pages where that problem was not reported before. The payload lists each problem with `affectedPages`, `newPages` and up to five new example URLs, plus `scanComplete`. A problem that stays unfixed is reported once. An alert no webhook accepted is sent again after the next audit. A complete scan that no longer finds a problem clears it, so it is reported again if it comes back; a partial scan never clears anything. Nothing is recorded while no webhook lists the event, so a new subscriber hears about every current problem after the next audit.
|
|
757
|
+
|
|
756
758
|
> **No mention events yet.** Notification events cover the citation signal only — there are **no** `mention.lost` / `mention.gained` events today. For mention-first monitoring, read `scores.mentionCoverage` / `scores.mentionShare` via `cnry overview` (or the `insight.*` events, which can be driven by mention-side insights); do not wire automation to mention events that aren't emitted.
|
|
757
759
|
|
|
758
760
|
## Provider Settings & Quotas
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,Q as n,W as r,lt as i}from"./vendor-lucide-DuOM7wVi.js";import{r as a}from"./vendor-markdown-BDQ1GKGP.js";import{Jr as o,Qt as s,Tt as c,Xr as l,Yr as u,Zt as d,ct as f,kn as p,r as m,t as h,wt as g}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,Q as n,W as r,lt as i}from"./vendor-lucide-DuOM7wVi.js";import{r as a}from"./vendor-markdown-BDQ1GKGP.js";import{Jr as o,Qt as s,Tt as c,Xr as l,Yr as u,Zt as d,ct as f,kn as p,r as m,t as h,wt as g}from"./ToneBadge-BhjTBHi-.js";import{r as _}from"./account-context-j3asaevn.js";import{t as v}from"./async-handler-Bj3TnIRw.js";import{et as y,it as b}from"./index-xlDLvgRC.js";var x=e(i(),1),S=a(),C=`https://github.com/Canonry/canonry/blob/main/docs/mcp.md`,w=`https://github.com/Canonry/canonry/blob/main/docs/plugins.md`,T=`https://help.openai.com/en/articles/12584461-connecting-custom-mcp-servers-in-chatgpt`,E=`https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp`,D=`codex plugin marketplace add Canonry/canonry
|
|
2
2
|
codex plugin add canonry-remote@canonry`,O={[u[`public-url-required`]]:`Configure this instance’s public URL before connecting a hosted client.`,[u[`https-required`]]:`Configure an HTTPS public URL for this instance.`,[u[`public-host-required`]]:`Use a public HTTPS address that your client can reach. Localhost and private-network addresses do not work for hosted connectors.`,[u[`public-path-mismatch`]]:`Make the publicUrl path match basePath, and preserve that prefix when the proxy forwards requests for hosted OAuth.`,[u[`oauth-unavailable`]]:`The sign-in routes are unavailable. Check this instance’s OAuth configuration.`,[u[`account-required`]]:`Create a named Canonry account on this instance’s server with canonry user create. A shared dashboard password does not provide an OAuth account.`,[u[`transport-unavailable`]]:`Restore the instance’s HTTP MCP service before connecting a hosted client.`},k={codex:{label:`Codex`,command:`codex plugin marketplace add Canonry/canonry
|
|
3
3
|
codex plugin add canonry@canonry`},claude:{label:`Claude Code`,command:`claude plugin marketplace add Canonry/canonry
|
|
4
4
|
claude plugin install canonry@canonry`},other:{label:`Other MCP clients`,command:`canonry-mcp`}};function A({label:e,value:t,showText:i=!1,secondary:a=!1,action:o=`agent_setup.copy`}){let s=(0,x.useId)(),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(!1);async function f(){try{await navigator.clipboard.writeText(t),p(o),l(!0),d(!1)}catch{l(!1),d(!0)}}return(0,S.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[i?(0,S.jsx)(`pre`,{className:`overflow-x-auto material-base p-3 text-copy-14 text-heading`,children:(0,S.jsx)(`code`,{children:t})}):null,(0,S.jsxs)(m,{type:`button`,className:`pointer-coarse:min-h-11`,variant:a?`outline`:`default`,onClick:v(f),children:[c?(0,S.jsx)(n,{className:`size-4`,"aria-hidden":`true`}):(0,S.jsx)(r,{className:`size-4`,"aria-hidden":`true`}),e]}),c?(0,S.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:`Copied.`}):null,!i||u?(0,S.jsxs)(`details`,{open:u||void 0,className:`text-label-14 text-secondary`,children:[(0,S.jsx)(`summary`,{className:`min-h-11 w-fit cursor-pointer py-3`,children:u?`Copy unavailable. Select the text below.`:`Preview text`}),(0,S.jsxs)(`label`,{htmlFor:s,className:`sr-only`,children:[e,` text`]}),(0,S.jsx)(`textarea`,{id:s,readOnly:!0,rows:u&&i?3:8,value:t,className:`mt-2 w-full rounded-md border border-default bg-bg p-3 text-copy-14 text-heading`})]}):null]})}function j(){return g()||c()?(0,S.jsxs)(`div`,{className:`page-container`,children:[(0,S.jsx)(`h1`,{className:`page-title`,children:`Agent setup`}),(0,S.jsx)(`p`,{className:`mt-3 text-copy-14 text-secondary`,children:`Open Agent setup in your own Canonry instance to connect your agent.`}),s()?(0,S.jsx)(`a`,{className:`mt-4 inline-block text-label-14 underline`,href:C,target:`_blank`,rel:`noopener noreferrer`,children:`Read the connection guide`}):null]}):(0,S.jsx)(M,{})}function M(){let e=b(),{isAdmin:n}=_(),r=d(),i=s(),a=y(!e,e?.health),c=a.data?.apiStatus,u=c?.state===`ok`?c.mcp:void 0,p=u?.status===l.available&&u.hosted?.status===o.ready?u.hosted:void 0,m=u?.hosted?.status===o.unavailable?u.hosted.reason:void 0,g=`${window.location.origin}${f()}`,v=`This server has not confirmed a public URL and OAuth sign-in. Ask your administrator to check the connection configuration or update Canonry.`;a.isPending?v=`Checking the instance’s hosted connection settings.`:m?v=n&&r?O[m]:`Ask your Canonry administrator to finish hosted connection setup for this instance.`:c?.state===`error`?v=`The instance’s connection settings could not be checked. Try again after the service is available.`:u?.status===l[`not-supported`]&&(v=`This deployment does not provide hosted MCP connections. Ask your administrator for a supported connection.`);let x=p?`Help me connect this existing Canonry instance to ChatGPT or Claude Desktop using its remote MCP URL: ${p.url}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t}from"./vendor-lucide-DuOM7wVi.js";import{r as n}from"./vendor-markdown-BDQ1GKGP.js";import{b as r}from"./vendor-tanstack-BNuZ37rE.js";import{mt as i,r as a,t as o}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t}from"./vendor-lucide-DuOM7wVi.js";import{r as n}from"./vendor-markdown-BDQ1GKGP.js";import{b as r}from"./vendor-tanstack-BNuZ37rE.js";import{mt as i,r as a,t as o}from"./ToneBadge-BhjTBHi-.js";import{fn as s,i as c,nt as l}from"./react-query-CBpNFR4t.js";import{t as u}from"./card-CQAQ-c3g.js";var d=e(t(),1),f=n(),p=100;function m(e){if(e===`all`)return;let t=Number.parseInt(e,10);return new Date(Date.now()-t*24*60*60*1e3).toISOString()}function h(e){let t=e.userAgent?.toLowerCase()??``;return t.includes(`canonry-mcp`)?`MCP`:t.includes(`canonry-cli`)?`CLI`:t.includes(`mozilla/`)?`Dashboard`:e.actor===`scheduler`?`Scheduler`:e.actor===`agent`?`Agent`:e.actor===`mcp`?`MCP`:e.actor===`cli`?`CLI`:e.actor}function g(e){return/delete|remove|revoke|disconnect|failed|refused/.test(e)?`negative`:/create|add|connect|completed/.test(e)?`positive`:/update|replace|sync|apply/.test(e)?`caution`:`neutral`}function _(e){return[e.action,e.actor,e.entityType,e.entityId,e.actorSession,e.userAgent,e.diff==null?``:JSON.stringify(e.diff)].filter(Boolean).join(` `).toLowerCase()}function v({projectName:e}){let[t,n]=(0,d.useState)(0),[v,y]=(0,d.useState)(`90d`),[b,x]=(0,d.useState)(``),[S,C]=(0,d.useState)(``),w=(0,d.useMemo)(()=>m(v),[v]),T={limit:p,offset:t*p,since:w,actor:b||void 0},E=r({...l({client:i,path:{name:e??``},query:T}),enabled:!!e}),D=r({...c({client:i,query:T}),enabled:!e}),O=r({...s({client:i}),enabled:!e}),k=e?E:D,A=k.data??[],j=(0,d.useMemo)(()=>new Map((O.data??[]).map(e=>[e.id,e.displayName||e.name])),[O.data]),M=S.trim().toLowerCase(),N=(0,d.useMemo)(()=>M?A.filter(e=>_(e).includes(M)):A,[A,M]),P=e=>{n(0),e()};return k.isLoading?(0,f.jsx)(`p`,{className:`supporting-copy mt-6`,role:`status`,children:`Loading change history…`}):(0,f.jsxs)(`section`,{className:`mt-6`,"aria-labelledby":`change-history-heading`,children:[(0,f.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,f.jsxs)(`div`,{children:[(0,f.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Audit trail`}),(0,f.jsx)(`h2`,{id:`change-history-heading`,children:`Change history`}),(0,f.jsx)(`p`,{className:`supporting-copy mt-1 max-w-2xl`,children:`Configuration and operator actions. Execution outcomes remain in Runs.`})]}),(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void k.refetch(),disabled:k.isFetching,children:k.isFetching?`Refreshing…`:`Refresh`})]}),(0,f.jsxs)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-3`,children:[(0,f.jsx)(`input`,{type:`search`,"aria-label":`Search change history`,value:S,onChange:e=>C(e.target.value),placeholder:`Search actions, entities, or details`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by actor`,value:b,onChange:e=>P(()=>x(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:``,children:`All actors`}),(0,f.jsx)(`option`,{value:`api`,children:`API and dashboard`}),(0,f.jsx)(`option`,{value:`cli`,children:`CLI`}),(0,f.jsx)(`option`,{value:`scheduler`,children:`Scheduler`}),(0,f.jsx)(`option`,{value:`agent`,children:`Agent`}),(0,f.jsx)(`option`,{value:`mcp`,children:`MCP`})]}),(0,f.jsxs)(`select`,{"aria-label":`Filter change history by date range`,value:v,onChange:e=>P(()=>y(e.target.value)),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,f.jsx)(`option`,{value:`30d`,children:`Last 30 days`}),(0,f.jsx)(`option`,{value:`90d`,children:`Last 90 days`}),(0,f.jsx)(`option`,{value:`365d`,children:`Last year`}),(0,f.jsx)(`option`,{value:`all`,children:`All retained history`})]})]}),k.isError?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`Change history unavailable`}),(0,f.jsx)(`p`,{children:k.error instanceof Error?k.error.message:`Could not load the audit trail.`})]}):N.length===0?(0,f.jsxs)(u,{className:`surface-card empty-card mt-4`,children:[(0,f.jsx)(`h3`,{children:`No changes match these filters`}),(0,f.jsx)(`p`,{children:`Widen the date range or clear the actor and search filters.`})]}):(0,f.jsx)(`div`,{className:`evidence-table-wrap mt-4`,children:(0,f.jsxs)(`table`,{className:`evidence-table`,children:[(0,f.jsx)(`thead`,{children:(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`th`,{children:`When`}),e?null:(0,f.jsx)(`th`,{children:`Scope`}),(0,f.jsx)(`th`,{children:`Action`}),(0,f.jsx)(`th`,{children:`Entity`}),(0,f.jsx)(`th`,{children:`Origin`}),(0,f.jsx)(`th`,{children:`Details`})]})}),(0,f.jsx)(`tbody`,{children:N.map(t=>(0,f.jsxs)(`tr`,{children:[(0,f.jsx)(`td`,{className:`whitespace-nowrap tabular-nums text-muted`,children:new Date(t.createdAt).toLocaleString()}),e?null:(0,f.jsx)(`td`,{className:`text-secondary`,children:t.projectId?j.get(t.projectId)??`Deleted project · ${t.projectId}`:`Instance settings`}),(0,f.jsx)(`td`,{children:(0,f.jsx)(o,{tone:g(t.action),children:t.action})}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-strong`,children:t.entityType}),t.entityId?(0,f.jsx)(`span`,{className:`mt-0.5 block max-w-48 truncate text-label-12-mono text-faint`,title:t.entityId,children:t.entityId}):null]}),(0,f.jsxs)(`td`,{children:[(0,f.jsx)(`span`,{className:`text-secondary`,children:h(t)}),t.actorSession?(0,f.jsxs)(`span`,{className:`mt-0.5 block max-w-40 truncate text-label-12-mono text-faint`,title:t.actorSession,children:[`Session `,t.actorSession]}):null]}),(0,f.jsx)(`td`,{children:t.diff==null?(0,f.jsx)(`span`,{className:`text-faint`,children:`No field diff`}):(0,f.jsxs)(`details`,{children:[(0,f.jsx)(`summary`,{className:`min-h-11 cursor-pointer py-3 text-label-14 text-secondary hover:text-strong`,children:`View diff`}),(0,f.jsx)(`pre`,{className:`max-h-72 max-w-xl overflow-auto whitespace-pre-wrap break-words rounded-md bg-bg-elevated p-3 text-copy-13 text-secondary`,children:JSON.stringify(t.diff,null,2)})]})})]},t.id))})]})}),!k.isError&&(t>0||A.length===p)?(0,f.jsxs)(`div`,{className:`mt-4 flex items-center justify-between gap-3`,children:[(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,disabled:t===0,onClick:()=>n(e=>Math.max(0,e-1)),children:`Previous`}),(0,f.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`Page `,t+1]}),(0,f.jsx)(a,{type:`button`,variant:`outline`,size:`sm`,disabled:A.length<p,onClick:()=>n(e=>e+1),children:`Next`})]}):null]})}export{v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,U as n,c as r,lt as i,s as a,w as o}from"./vendor-lucide-DuOM7wVi.js";import{r as s}from"./vendor-markdown-BDQ1GKGP.js";import{H as c,L as l,R as u,U as d,a as f,dn as p,jt as m,q as h,r as g,t as _,vt as v,wt as y}from"./ToneBadge-JbnFjl09.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-CoYH9h6o.js";import{t as S}from"./Hint-c4a4W87X.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([l(),d().catch(()=>null),h().catch(()=>[]),u().catch(()=>[]),c().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await v();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await p(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof f&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await m(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Readiness`}),(0,w.jsx)(`h2`,{children:`Backlink source`})]}),e?.duckdbInstalled?(0,w.jsx)(_,{tone:`positive`,children:`Installed`}):(0,w.jsx)(_,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!y()&&(0,w.jsxs)(g,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Latest sync`}),(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})]}),s&&(0,w.jsx)(_,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(x,{className:`surface-card p-5`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`mt-4 material-base p-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!y()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(g,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),y()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!y()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(_,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!y()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(g,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:y()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`History`}),(0,w.jsx)(`h2`,{children:`Past release syncs`})]})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(_,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,U as n,c as r,lt as i,s as a,w as o}from"./vendor-lucide-DuOM7wVi.js";import{r as s}from"./vendor-markdown-BDQ1GKGP.js";import{H as c,L as l,R as u,U as d,a as f,dn as p,jt as m,q as h,r as g,t as _,vt as v,wt as y}from"./ToneBadge-BhjTBHi-.js";import{t as b}from"./async-handler-Bj3TnIRw.js";import{t as x}from"./card-CQAQ-c3g.js";import{t as S}from"./Hint-c4a4W87X.js";var C=e(i(),1),w=s(),T=`https://commoncrawl.org/web-graphs`;function E(e){return e==null?`—`:e>=0xe8d4a51000?`${(e/0xe8d4a51000).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function D(e){if(!e)return`—`;let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`just now`;if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function O(e){switch(e){case`ready`:return`positive`;case`failed`:return`negative`;case`downloading`:case`querying`:case`queued`:return`caution`}}function k(){let[e,i]=(0,C.useState)(null),[s,k]=(0,C.useState)(null),[A,j]=(0,C.useState)([]),[M,N]=(0,C.useState)([]),[P,F]=(0,C.useState)(null),[I,L]=(0,C.useState)(!0),[R,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(!1),[H,U]=(0,C.useState)(``),[W,G]=(0,C.useState)(!1),[K,q]=(0,C.useState)(null),[J,Y]=(0,C.useState)(null),X=(0,C.useCallback)(async()=>{L(!0),q(null);try{let[e,t,n,r,a]=await Promise.all([l(),d().catch(()=>null),h().catch(()=>[]),u().catch(()=>[]),c().catch(()=>null)]);i(e),k(t),j(n),N(r),F(a)}catch(e){q(e instanceof Error?e.message:`Failed to load backlinks status`)}finally{L(!1)}},[]);(0,C.useEffect)(()=>{X()},[X]);async function Z(){z(!0),q(null),Y(null);try{let e=await v();Y(e.alreadyPresent?`DuckDB already installed (${e.version}).`:`Installed DuckDB ${e.version}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to install DuckDB`)}finally{z(!1)}}async function Q(){let e=H.trim()||void 0;V(!0),q(null),Y(null);try{let t=await p(e);Y(e?`Queued sync for ${t.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${t.release}. Download + query runs in the background.`),U(``),G(!1),await X()}catch(e){e instanceof f&&e.code===`MISSING_DEPENDENCY`?q(`DuckDB is not installed. Install it first.`):q(e instanceof Error?e.message:`Failed to trigger sync`)}finally{V(!1)}}async function $(e){q(null),Y(null);try{await m(e),Y(`Pruned cached release ${e}.`),await X()}catch(e){q(e instanceof Error?e.message:`Failed to prune release`)}}let ee=s?.status===`ready`&&M.every(e=>e.release!==s.release);return(0,w.jsxs)(`div`,{className:`page-container`,children:[(0,w.jsx)(`div`,{className:`page-header`,children:(0,w.jsxs)(`div`,{className:`page-header-left`,children:[(0,w.jsx)(`h1`,{className:`page-title`,children:`Backlink data`}),(0,w.jsx)(`p`,{className:`page-subtitle`,children:`Manage the shared backlink source and review its latest data.`})]})}),K&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-negative-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-negative`,children:K})}),J&&(0,w.jsx)(x,{className:`surface-card p-4 mb-4 bg-positive-soft`,children:(0,w.jsx)(`p`,{className:`text-copy-14 text-positive`,children:J})}),(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Readiness`}),(0,w.jsx)(`h2`,{children:`Backlink source`})]}),e?.duckdbInstalled?(0,w.jsx)(_,{tone:`positive`,children:`Installed`}):(0,w.jsx)(_,{tone:`caution`,children:`Not installed`})]}),(0,w.jsx)(x,{className:`surface-card p-4`,children:I?(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Checking…`}):e?.duckdbInstalled?(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Ready to sync a Common Crawl release.`}):(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Install the local query engine to enable release syncs.`}),!y()&&(0,w.jsxs)(g,{type:`button`,size:`sm`,disabled:R,onClick:b(Z),children:[(0,w.jsx)(n,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),R?`Installing…`:`Install DuckDB`]})]})})]}),(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Latest sync`}),(0,w.jsxs)(`h2`,{className:`flex items-center gap-2`,children:[`Release sync`,(0,w.jsx)(S,{label:`What is a release sync?`,children:`A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files.`})]})]}),s&&(0,w.jsx)(_,{tone:O(s.status),children:s.status})]}),(0,w.jsxs)(x,{className:`surface-card p-5`,children:[s?(0,w.jsxs)(`div`,{className:`space-y-2 text-label-14`,children:[(0,w.jsxs)(`p`,{className:`text-strong`,children:[`Release `,(0,w.jsx)(`code`,{className:`text-neutral`,children:s.release})]}),s.phaseDetail&&(0,w.jsx)(`p`,{className:`text-secondary`,children:s.phaseDetail}),(0,w.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4 text-label-12 text-muted pt-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Projects`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.projectsProcessed??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`p`,{className:`text-faint normal-case text-label-12 flex items-center gap-1`,children:[`Rows`,(0,w.jsx)(S,{label:`What are rows?`,children:`Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace.`})]}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:s.domainsDiscovered??`—`})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Started`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.downloadStartedAt??s.createdAt)})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-faint normal-case text-label-12`,children:`Finished`}),(0,w.jsx)(`p`,{className:`text-neutral mt-0.5`,children:D(s.queryFinishedAt)})]})]}),s.error&&(0,w.jsx)(`p`,{className:`text-copy-14 text-negative-400 pt-2`,children:s.error})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`No release sync has run in this workspace yet.`}),ee&&(0,w.jsx)(`div`,{className:`mt-4 rounded border border-caution-800/60 bg-caution-950/20 p-3`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,w.jsx)(a,{className:`h-4 w-4 text-caution-400 shrink-0 mt-0.5`,"aria-hidden":!0}),(0,w.jsxs)(`div`,{className:`text-label-14 text-neutral`,children:[(0,w.jsx)(`p`,{className:`text-copy-14-strong text-caution-200`,children:`Cached files for this release are missing.`}),(0,w.jsx)(`p`,{className:`mt-1 text-secondary`,children:`Sync this release again, or sync the newest release, before refreshing individual projects.`})]})]})}),(0,w.jsxs)(`div`,{className:`mt-4 material-base p-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-3`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-label-12 normal-case text-muted`,children:`Auto-detected release`}),P?(0,w.jsxs)(`p`,{className:`text-copy-14 text-strong mt-0.5`,children:[(0,w.jsx)(`code`,{className:`text-heading`,children:P.release}),(0,w.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[`Vertex `,E(P.vertexBytes),`, edges `,E(P.edgesBytes)]})]}):(0,w.jsx)(`p`,{className:`text-copy-14 text-muted mt-0.5`,children:I?`Checking Common Crawl…`:`Could not find a release. Choose one below.`}),(0,w.jsxs)(`a`,{href:T,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1 text-label-12 text-secondary hover:text-strong focus:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:[`Browse all Common Crawl web-graph releases`,(0,w.jsx)(t,{className:`h-3 w-3`,"aria-hidden":!0})]})]}),!y()&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,w.jsxs)(g,{type:`button`,size:`sm`,disabled:B||!e?.duckdbInstalled||!P&&!H.trim(),onClick:b(Q),children:[(0,w.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),B?`Queuing…`:`Run sync`]}),(0,w.jsxs)(S,{label:`What does Run sync do?`,children:[(0,w.jsxs)(`span`,{className:`block`,children:[`Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to`,` `,(0,w.jsx)(`code`,{className:`text-neutral`,children:`~/.canonry/cache/commoncrawl/`}),`, then runs a single DuckDB query that extracts referring domains for every project in this workspace.`]}),(0,w.jsxs)(`span`,{className:`mt-2 block text-secondary`,children:[`First time for a release: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`~10–20 min download + ~5 min query`}),`. Re-running the same release later: `,(0,w.jsx)(`span`,{className:`text-strong`,children:`skips download, just re-queries`}),` (~5 min).`]})]})]})]}),y()?null:W?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`input`,{type:`text`,className:`flex-1 min-w-[240px] rounded border border-strong bg-transparent px-2.5 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`cc-main-2026-jan-feb-mar`,value:H,onChange:e=>U(e.target.value),disabled:B,autoFocus:!0}),(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>{U(``),G(!1)},disabled:B,children:`Cancel`})]}):(0,w.jsx)(`button`,{type:`button`,className:`text-button-14 text-secondary hover:text-neutral focus:text-neutral focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,onClick:()=>G(!0),disabled:B,children:`Use a different release →`})]}),!e?.duckdbInstalled&&(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mt-2`,children:`Install DuckDB first to enable sync.`})]})]}),(0,w.jsxs)(`details`,{className:`page-section-divider group`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-500 rounded`,children:`Technical details and cache`}),(0,w.jsxs)(`div`,{className:`mt-4`,children:[(0,w.jsx)(`p`,{className:`text-copy-14 text-secondary mb-3`,children:`Cached releases support project re-extracts. Pruning a release does not remove saved backlink results.`}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Sync status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Size`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Last used`}),!y()&&(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong sr-only`,children:`Actions`})]})}),(0,w.jsxs)(`tbody`,{children:[M.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:e.syncStatus?(0,w.jsx)(_,{tone:O(e.syncStatus),children:e.syncStatus}):(0,w.jsx)(`span`,{className:`text-faint`,children:`—`})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:E(e.bytes)}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.lastUsedAt)}),!y()&&(0,w.jsx)(`td`,{className:`px-4 py-2 text-right`,children:(0,w.jsxs)(`div`,{className:`inline-flex items-center gap-1`,children:[(0,w.jsxs)(g,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{$(e.release)},children:[(0,w.jsx)(r,{className:`h-4 w-4 mr-1.5`,"aria-hidden":!0}),`Prune`]}),(0,w.jsx)(S,{label:`What does Prune do?`,placement:`top`,children:`Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download).`})]})})]},e.release)),M.length===0&&(0,w.jsx)(`tr`,{children:(0,w.jsx)(`td`,{className:`px-4 py-4 text-label-14 text-muted`,colSpan:y()?4:5,children:`No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts.`})})]})]})}),(0,w.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:`Common Crawl files are stored locally. DuckDB reads them; Canonry stores results in its normal database.`})]})]}),A.length>1&&(0,w.jsxs)(`section`,{className:`page-section-divider`,children:[(0,w.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`History`}),(0,w.jsx)(`h2`,{children:`Past release syncs`})]})}),(0,w.jsx)(x,{className:`surface-card overflow-hidden`,children:(0,w.jsxs)(`table`,{className:`w-full text-label-14`,children:[(0,w.jsx)(`thead`,{children:(0,w.jsxs)(`tr`,{className:`border-b border-base text-left text-label-12 normal-case text-faint`,children:[(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Release`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Status`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Projects`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-right text-label-12-strong`,children:`Rows`}),(0,w.jsx)(`th`,{className:`px-4 py-2 text-label-12-strong`,children:`Finished`})]})}),(0,w.jsx)(`tbody`,{children:A.map(e=>(0,w.jsxs)(`tr`,{className:`border-b border-mono-900 last:border-0`,children:[(0,w.jsx)(`td`,{className:`px-4 py-2 text-strong`,children:(0,w.jsx)(`code`,{children:e.release})}),(0,w.jsx)(`td`,{className:`px-4 py-2`,children:(0,w.jsx)(_,{tone:O(e.status),children:e.status})}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.projectsProcessed??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-right text-secondary tabular-nums`,children:e.domainsDiscovered??`—`}),(0,w.jsx)(`td`,{className:`px-4 py-2 text-secondary`,children:D(e.queryFinishedAt??e.updatedAt)})]},e.id))})]})})]})]})}export{k as BacklinksPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor-markdown-BDQ1GKGP.js";import{t}from"./AuditHistoryPanel-
|
|
1
|
+
import{r as e}from"./vendor-markdown-BDQ1GKGP.js";import{t}from"./AuditHistoryPanel-CiTzFgbw.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`page-container`,children:[(0,n.jsx)(`div`,{className:`page-header`,children:(0,n.jsxs)(`div`,{className:`page-header-left`,children:[(0,n.jsx)(`h1`,{className:`page-title`,children:`History`}),(0,n.jsx)(`p`,{className:`page-subtitle`,children:`Changes to projects and settings.`})]})}),(0,n.jsx)(t,{})]})}export{r as HistoryPage};
|
package/assets/assets/{MeasurementPropertyPage-DYCBQSnh.js → MeasurementPropertyPage-Cx64Fnmz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t,st as n}from"./vendor-lucide-DuOM7wVi.js";import{r}from"./vendor-markdown-BDQ1GKGP.js";import{_ as i,b as a,d as o,f as s,g as c,p as l,u}from"./vendor-tanstack-BNuZ37rE.js";import{Ct as d,Ui as ee,_i as f,ci as te,mt as p,ni as ne,ot as m,r as h,t as g,ti as _}from"./ToneBadge-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{lt as t,st as n}from"./vendor-lucide-DuOM7wVi.js";import{r}from"./vendor-markdown-BDQ1GKGP.js";import{_ as i,b as a,d as o,f as s,g as c,p as l,u}from"./vendor-tanstack-BNuZ37rE.js";import{Ct as d,Ui as ee,_i as f,ci as te,mt as p,ni as ne,ot as m,r as h,t as g,ti as _}from"./ToneBadge-BhjTBHi-.js";import{g as v,i as y,y as b}from"./format-helpers-BPugHeIX.js";import{r as re}from"./account-context-j3asaevn.js";import{_t as x,ct as ie,dn as S,dt as C,lt as ae,mt as w,st as T,ut as E}from"./react-query-CBpNFR4t.js";import{f as D,h as O}from"./ChartPrimitives-CvK6CQrj.js";import{t as k}from"./InfoTooltip-Drnst4ML.js";import{I as A,K as j,L as M,Q as oe,U as N,X as P,Y as se,fn as ce,gn as le,lt as F,mn as ue,st as I,z as de}from"./index-xlDLvgRC.js";import{c as fe,r as L,s as pe,t as R}from"./service-DFumlmXt.js";var z=e(t(),1),B=r(),V={heading:`Names that count as this Property`,help:`An answer mentions this Property when its text contains one of these names as whole words. Source titles and source links never count, but a link in the answer whose text is one of these names does. Qualified names are longer forms, such as the name with its street or city, for a name that other places share.`,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. Each must include one of the names above plus more words, such as a street or city.`,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 H(e){return[...new Set(e.split(`
|
|
2
2
|
`).map(e=>e.trim()).filter(Boolean))]}function U(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function W(e,t){return U(e.aliases,t.aliases)&&U(e.identityAliases??[],t.identityAliases??[])}function me(e,t,n){let{identityAliases:r,...i}=e;return n.length>0?{...i,aliases:t,identityAliases:n}:{...i,aliases:t}}function he({label:e,names:t}){return(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e}),(0,B.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,B.jsx)(`li`,{className:`text-label-14 text-secondary`,children:e},e))})]})}function G({id:e,issues:t}){return t.length===0?null:(0,B.jsx)(`ul`,{id:e,className:`mt-2 space-y-1`,"aria-label":`Name warnings`,children:t.map(e=>(0,B.jsx)(`li`,{className:`text-label-14 text-caution`,children:_(e)},`${e.field}:${e.index}`))})}function ge({projectName:e,targetKey:t,published:n,activeRevision:r,publishedBrandNames:o,service:s=R}){let{canWrite:c}=re(),l=(0,z.useId)(),d=a({...ie({client:p,path:{name:e}}),enabled:c}),ee=a({...x({client:p,path:{name:e}}),enabled:c}),f=d.data?.draft?.authoring.targets.find(e=>e.stableKey===t),m=n.identityAliases??[],g=f!==void 0&&d.data?.draft?.baseActiveRevision===r&&!W(f,n),_=!d.isFetching&&!ee.isPending,v=ee.data,y=(0,z.useMemo)(()=>v?te(v):o,[v,o]),[b,S]=(0,z.useState)(!1),[C,ae]=(0,z.useState)(``),[w,T]=(0,z.useState)(``),[E,D]=(0,z.useState)(n),[O,A]=(0,z.useState)(null),j=`${e}\u0000${t}`,[M,oe]=(0,z.useState)(j);M!==j&&(oe(j),S(!1),ae(``),T(``),D(n),A(null));let N=(0,z.useRef)(j);N.current=j;let P=(0,z.useMemo)(()=>H(C),[C]),se=(0,z.useMemo)(()=>H(w),[w]),ce=(0,z.useMemo)(()=>ne({aliases:P,identityAliases:se,brandNames:y}),[P,se,y]),le=ce.filter(e=>e.field===`aliases`),F=ce.filter(e=>e.field===`identityAliases`);function ue(e){ae(e.aliases.join(`
|
|
3
3
|
`)),T((e.identityAliases??[]).join(`
|
|
4
4
|
`)),D({aliases:[...e.aliases],identityAliases:[...e.identityAliases??[]]})}function I(e){return e.draft?e.draft.authoring.targets.find(e=>e.stableKey===t)??null:n}function fe(){ue(g?f:n),A(null),S(!0)}function pe(e){e&&ue(e),A({tone:`negative`,text:V.conflict,review:!1})}let U=i({mutationFn:async i=>{let a=await s.loadDraft(e);if(!a.draft){if(W(i.names,n))return{outcome:`unchanged`};if(!W(i.base,n))return{outcome:`conflict`,latest:n};await s.createDraft(e,r),a=await s.loadDraft(e)}let o=a.draft;if(!o||!a.etag)throw Error(V.failed);if(o.baseActiveRevision!==r)return{outcome:`stale`};let c=o.authoring.targets.find(e=>e.stableKey===t);return!c||c.status!==`included`?{outcome:`missing`}:W(i.names,c)?{outcome:`unchanged`}:W(i.base,c)?(await s.upsertTarget(e,a.etag,me(c,i.names.aliases,i.names.identityAliases)),{outcome:`saved`}):{outcome:`conflict`,latest:c}},meta:{skipGlobalErrorToast:!0},onSuccess:(e,t)=>{if(t.openFor===N.current)switch(e.outcome){case`saved`:S(!1),A({tone:`positive`,text:V.saved,review:!0});return;case`unchanged`:S(!1),A({tone:`positive`,text:V.noChanges,review:!1});return;case`stale`:A({tone:`negative`,text:V.staleDraft,review:!0});return;case`missing`:A({tone:`negative`,text:V.missingFromDraft,review:!0});return;case`conflict`:pe(e.latest),d.refetch();return}},onError:(e,t)=>{t.openFor===N.current&&(L(e)?(pe(null),d.refetch().then(e=>{e.isSuccess&&pe(I(e.data))})):A({tone:`negative`,text:V.failed,review:!1}))}}),ge=(0,B.jsx)(u,{to:`/projects/$projectName/portfolio`,params:{projectName:e},className:`text-link underline-offset-2 hover:underline`,children:V.review}),K=n.aliases.length+m.length;return(0,B.jsxs)(`section`,{"aria-labelledby":`property-names`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`h2`,{id:`property-names`,className:`text-heading-16 text-heading`,children:V.heading}),(0,B.jsx)(k,{text:V.help})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsxs)(`p`,{className:`supporting-copy`,children:[K,` `,K===1?`name`:`names`]}),c&&!b?(0,B.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:!_,onClick:fe,children:V.edit}):null]})]}),O?(0,B.jsxs)(`p`,{role:O.tone===`negative`?`alert`:`status`,className:`mb-3 text-copy-14 ${O.tone===`negative`?`text-negative`:`text-positive`}`,children:[O.text,O.review?(0,B.jsxs)(B.Fragment,{children:[` `,ge]}):null]}):g&&!b?(0,B.jsxs)(`p`,{role:`status`,className:`mb-3 text-copy-14 text-caution`,children:[V.pending,` `,ge]}):null,b?(0,B.jsxs)(`form`,{className:`space-y-4`,"aria-label":`Edit names`,onSubmit:e=>{e.preventDefault(),!U.isPending&&U.mutate({names:{aliases:P,identityAliases:se},base:E,openFor:j})},children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{htmlFor:`${l}-names`,className:`block text-label-14-strong text-heading`,children:V.names}),(0,B.jsx)(`p`,{id:`${l}-names-hint`,className:`text-copy-14 text-secondary`,children:V.namesHint}),(0,B.jsx)(`textarea`,{id:`${l}-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":`${l}-names-hint${le.length?` ${l}-names-issues`:``}`,value:C,onChange:e=>ae(e.target.value)}),(0,B.jsx)(G,{id:`${l}-names-issues`,issues:le}),P.length===0?(0,B.jsx)(`p`,{className:`mt-2 text-copy-14 text-caution`,children:V.noNames}):null]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`label`,{htmlFor:`${l}-qualified`,className:`block text-label-14-strong text-heading`,children:V.qualifiedNames}),(0,B.jsx)(`p`,{id:`${l}-qualified-hint`,className:`text-copy-14 text-secondary`,children:V.qualifiedHint}),(0,B.jsx)(`textarea`,{id:`${l}-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":`${l}-qualified-hint ${l}-qualified-note${F.length?` ${l}-qualified-issues`:``}`,value:w,onChange:e=>T(e.target.value)}),(0,B.jsx)(G,{id:`${l}-qualified-issues`,issues:F}),(0,B.jsx)(`p`,{id:`${l}-qualified-note`,className:`mt-2 max-w-3xl text-copy-14 text-secondary`,children:V.qualifiedNote})]}),(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:V.draftOnly}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,B.jsx)(de,{type:`submit`,className:`h-11 px-4 text-label-14 md:h-11`,disabled:U.isPending,children:U.isPending?V.saving:V.save}),(0,B.jsx)(h,{type:`button`,variant:`ghost`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:U.isPending,onClick:()=>{S(!1),A(null)},children:V.cancel})]})]}):K===0?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:V.noNames}):(0,B.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[n.aliases.length>0?(0,B.jsx)(he,{label:V.names,names:n.aliases}):null,m.length>0?(0,B.jsx)(he,{label:V.qualifiedNames,names:m}):null]})]})}var K=50,q={branded:{headline:`When they know your name`,technical:`Branded queries`},"non-brand":{headline:`When they don't`,technical:`Non-brand queries`}},_e={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:b,not_applicable:`Not applicable for this Property`},ve={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`}},J={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 Y(e){return[...e].sort((e,t)=>Number(t.classification===`assigned`)-Number(e.classification===`assigned`))}function ye(e){return`${e.expectedSlotId}:${e.usageEdgeId}`}function be({row:e}){return e.mentioned===null?(0,B.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,B.jsx)(g,{tone:`neutral`,children:`Not measured`}),(0,B.jsx)(`span`,{className:`text-label-12 text-muted`,children:`No mention signal for this Property`})]}):!e.mentioned&&e.mentionIdentity===`wrong-subject`?(0,B.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,B.jsx)(g,{tone:`neutral`,children:`Not mentioned`}),(0,B.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-label-12 text-muted`,children:[F.label,(0,B.jsx)(k,{text:F.property})]})]}):(0,B.jsx)(g,{tone:e.mentioned?`positive`:`neutral`,children:e.mentioned?`Mentioned`:`Not mentioned`})}var xe=`—`;function Se({row:e}){return e.cited===null?(0,B.jsxs)(`span`,{className:`inline-flex flex-col items-start gap-0.5`,children:[(0,B.jsx)(g,{tone:`neutral`,children:`Not measured`}),(0,B.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Sources were not fully captured`})]}):(0,B.jsx)(g,{tone:e.cited?`positive`:`neutral`,children:e.cited?`Cited`:`Not cited`})}function Ce({row:e}){return e.cited===null&&e.sources.length===0?(0,B.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,B.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer returned no source URLs at all.`}):(0,B.jsxs)(`details`,{className:`mt-2`,"data-answer-sources":!0,children:[(0,B.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:[A,` (`,e.sources.length,`)`]}),(0,B.jsx)(`div`,{className:`overflow-x-auto`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,B.jsxs)(`caption`,{className:`sr-only`,children:[`Source URLs for `,e.queryText]}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Match`}),(0,B.jsx)(`th`,{children:`URL`})]})}),(0,B.jsx)(`tbody`,{children:Y(e.sources).map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(g,{tone:J[e.classification].tone,children:J[e.classification].label})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(I,{url:e.sourceUrl})})]},e.sourceUrl))})]})})]})}function we({project:e,targetKey:t,resultId:n}){let r=a({...w({client:p,path:{name:e},query:{targetKey:t,resultId:n}})});if(r.isPending)return(0,B.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,role:`status`,"aria-live":`polite`,children:`Loading the answer…`});if(r.isError)return(0,B.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,B.jsx)(`p`,{className:`py-2 text-copy-14 text-secondary`,children:`This answer was measured, but its text was not stored.`}):(0,B.jsx)(`div`,{className:`py-2`,children:(0,B.jsx)(M,{headingLevel:4,copyable:!0,children:i})})}function Te(e){return _e[e.reason]??`Not measured`}function X({metric:e,signal:t,emphasis:n=!1}){if(e.state===`unavailable`)return(0,B.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5`,children:[(0,B.jsx)(`span`,{className:n?`text-label-18-strong text-secondary`:`text-label-14-strong text-secondary`,children:`Not measured`}),(0,B.jsx)(`span`,{className:`text-label-14 text-secondary`,children:Te(e)})]});let r=f(e.value),i=e.numerator===void 0||e.denominator===void 0?null:`${e.numerator} of ${e.denominator}`,a=y(e,t);return(0,B.jsxs)(`span`,{className:`inline-flex flex-col gap-0.5 tabular-nums`,children:[(0,B.jsx)(`span`,{className:n?`text-label-18-strong text-heading`:`text-label-14-strong text-primary`,children:r}),i?(0,B.jsx)(`span`,{className:`text-label-12 text-muted`,children:i}):null,a?(0,B.jsx)(`span`,{className:`-ml-2 flex`,children:(0,B.jsx)(k,{tone:`caution`,placement:`bottom`,label:a.label,text:a.text})}):null]})}function Ee(e,t,n){return T({client:p,path:{name:e},query:{scope:`property`,targetKey:t,queryClass:n}})}function De(e){return e?.properties.items.at(0)}function Oe({measuredAt:e,unmeasuredReason:t,queryClass:n}){let r=e===void 0?null:e===null?`No completed check yet`:`Measured ${D(O(e))}`;return r===null&&t===void 0?null:(0,B.jsxs)(`p`,{className:`supporting-copy`,children:[[r,t].filter(Boolean).join(` · `),r!==null&&t===void 0?` · ${q[n].technical.toLocaleLowerCase()} only`:``]})}function ke({project:e,groups:t}){return t.length===0?null:(0,B.jsxs)(`section`,{"aria-labelledby":`property-market`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Competitive comparison`}),(0,B.jsxs)(`h2`,{id:`property-market`,className:`text-heading-16 text-heading`,children:[`Measured at the market level`,(0,B.jsx)(k,{text:`Competitors are attached to a market rather than to a single Property, because one building has nobody to be compared against. Share of voice and competitor pressure are reported for the market this Property sits in.`})]})]}),(0,B.jsx)(h,{asChild:!0,type:`button`,size:`sm`,variant:`outline`,children:(0,B.jsx)(u,{to:`/projects/$projectName`,params:{projectName:e},search:e=>P(j(e),{measurementScope:`project`}),children:`Open measurement overview`})})]}),(0,B.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:t.map(e=>(0,B.jsxs)(`li`,{className:`rounded-md border border-default px-3 py-1.5 text-label-14 text-strong`,children:[e.label,(0,B.jsxs)(`span`,{className:`ml-2 text-label-12 text-muted`,children:[e.competitors.length,` `,e.competitors.length===1?`competitor`:`competitors`]})]},e.stableKey))})]})}function Z({label:e,metric:t,signal:n,failed:r=!1}){if(t===void 0)return(0,B.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,B.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,B.jsx)(`p`,{className:`aeo-hero-row-value text-copy-16-strong text-secondary`,children:r?`Unavailable`:`…`}),r?(0,B.jsx)(`div`,{}):(0,B.jsx)(`div`,{className:`aeo-hero-row-bar`,"aria-hidden":`true`}),(0,B.jsx)(`p`,{className:`aeo-hero-row-detail`,children:r?`Could not be loaded`:`Loading`})]});if(t.state===`unavailable`){let n=Te(t);return(0,B.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,B.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,B.jsx)(`p`,{className:`aeo-hero-row-value text-copy-16-strong text-secondary`,children:`Not measured`}),(0,B.jsx)(`div`,{}),(0,B.jsx)(`p`,{className:`aeo-hero-row-detail`,children:n===`Not measured`?``:n})]})}let{figure:i,sign:a}=v(f(t.value)),o=t.numerator===void 0||t.denominator===void 0?null:`${t.numerator} of ${t.denominator}`,s=y(t,n);return(0,B.jsxs)(`div`,{className:`aeo-hero-row`,children:[(0,B.jsx)(`p`,{className:`aeo-hero-row-label`,children:e}),(0,B.jsxs)(`p`,{className:`aeo-hero-row-value text-heading`,children:[i,a?(0,B.jsx)(`span`,{className:`text-faint`,children:a}):null]}),(0,B.jsx)(`div`,{className:`aeo-hero-row-bar`,"aria-hidden":`true`,children:(0,B.jsx)(`div`,{className:`metric-card-bar-fill progress-fill-neutral`,style:{width:`${t.value*100}%`}})}),(0,B.jsxs)(`p`,{className:`aeo-hero-row-detail tabular-nums`,children:[o??``,s?(0,B.jsx)(`span`,{className:`block`,children:(0,B.jsx)(k,{tone:`caution`,placement:`bottom`,label:s.label,text:s.text})}):null]})]})}function Ae({branded:e,nonBrand:t,brandedFailed:n=!1,nonBrandFailed:r=!1}){return(0,B.jsxs)(`section`,{"aria-labelledby":`property-coverage-hero`,children:[(0,B.jsx)(`h2`,{id:`property-coverage-hero`,className:`sr-only`,children:`Coverage for this Property`}),(0,B.jsxs)(`div`,{className:`space-y-5`,children:[(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Non-brand · the demand to earn`}),(0,B.jsx)(Z,{label:`Mentioned`,metric:t?.mentionCoverage,signal:`mentioned`,failed:r}),(0,B.jsx)(Z,{label:`Cited`,metric:t?.citationCoverage,signal:`cited`,failed:r})]}),(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Branded · already named`}),(0,B.jsx)(Z,{label:`Mentioned`,metric:e?.mentionCoverage,signal:`mentioned`,failed:n}),(0,B.jsx)(Z,{label:`Cited`,metric:e?.citationCoverage,signal:`cited`,failed:n})]})]})]})}function je({branded:e,nonBrand:t,brandedError:n,nonBrandError:r,onRetry:i}){return(0,B.jsxs)(`section`,{"aria-labelledby":`property-brand-contrast`,children:[(0,B.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`The gap`}),(0,B.jsxs)(`h2`,{id:`property-brand-contrast`,className:`text-heading-16 text-heading`,children:[`Named versus not named`,(0,B.jsx)(k,{text:`Branded queries already contain your name, so an answer engine has an easy path back to you. Non-brand queries describe the need instead, and that is the demand you have to earn. Each row is measured only over the queries assigned to this Property in that class; a class with no assigned query reads Not measured rather than 0%.`})]})]})}),(0,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[560px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Mention and citation coverage for this Property, split by query class`}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Query type`}),(0,B.jsx)(`th`,{children:`Mentioned in the answer`}),(0,B.jsx)(`th`,{children:`Cited as a source`})]})}),(0,B.jsx)(`tbody`,{children:[{queryClass:`branded`,row:e,isError:n},{queryClass:`non-brand`,row:t,isError:r}].map(({queryClass:e,row:t,isError:n})=>(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:q[e].headline}),(0,B.jsx)(`span`,{className:`mt-0.5 block text-label-12 text-muted`,children:q[e].technical}),t&&n?(0,B.jsxs)(`span`,{className:`mt-2 flex flex-wrap items-center gap-2 text-label-14 text-caution`,children:[(0,B.jsx)(`span`,{role:`status`,children:`Refresh failed.`}),(0,B.jsxs)(h,{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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(X,{metric:t.mentionCoverage,signal:`mentioned`,emphasis:!0})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(X,{metric:t.citationCoverage,signal:`cited`,emphasis:!0})})]}):n?(0,B.jsx)(`td`,{colSpan:2,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,B.jsxs)(`span`,{role:`alert`,children:[`Could not load `,q[e].technical.toLocaleLowerCase(),`.`]}),(0,B.jsxs)(h,{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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`td`,{children:(0,B.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Loading…`})})]})]},e))})]})})]})}function Me({row:e,queryClass:t,isError:n}){return(0,B.jsxs)(`section`,{"aria-labelledby":`property-providers`,className:`page-section-divider`,children:[(0,B.jsx)(`div`,{className:`section-head section-head-inline`,children:(0,B.jsx)(`div`,{children:(0,B.jsxs)(`h2`,{id:`property-providers`,className:`text-heading-16 text-heading`,children:[`Which engines answer for this Property`,(0,B.jsx)(k,{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,B.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,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):e.providers.length===0?(0,B.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`?` ${Te(e.mentionCoverage)}.`:``]}):(0,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[520px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Per-engine mention and citation coverage`}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Engine`}),(0,B.jsx)(`th`,{children:`Mentioned`}),(0,B.jsx)(`th`,{children:`Cited`})]})}),(0,B.jsx)(`tbody`,{children:e.providers.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{className:`text-label-14-strong text-heading`,children:e.provider}),(0,B.jsx)(`td`,{children:(0,B.jsx)(X,{metric:e.mentionCoverage,signal:`mentioned`})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(X,{metric:e.citationCoverage,signal:`cited`})})]},e.provider))})]})})]})}function Ne(e){let t=e.questions.join(` · `);return e.questionsTruncated?`${t} +${e.questionTotal-e.questions.length} more`:t}function Pe({project:e,targetKey:t,queryClass:n}){let r=a({...E({client:p,path:{name:e},query:{targetKey:t,queryClass:n}})});if(r.isPending||r.isError)return null;let i=r.data?.competitors??[],o=r.data?.basis;return(0,B.jsxs)(`section`,{"aria-labelledby":`property-named-instead`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`h2`,{id:`property-named-instead`,className:`text-heading-16 text-heading`,children:[`Named instead of this Property`,(0,B.jsx)(k,{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,B.jsxs)(`p`,{className:`supporting-copy`,children:[r.data?.total??i.length,` named`]}):null]}),i.length===0?(0,B.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,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Names the engines gave instead of this Property`}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Named`}),(0,B.jsx)(`th`,{children:`Answers`}),(0,B.jsx)(`th`,{children:`Engines`}),(0,B.jsx)(`th`,{children:`Queries`})]})}),(0,B.jsx)(`tbody`,{children:i.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{className:`text-strong`,children:e.name}),(0,B.jsx)(`td`,{className:`tabular-nums text-secondary`,children:e.occurrences}),(0,B.jsxs)(`td`,{className:`text-secondary`,children:[e.providers.join(`, `),e.providersTruncated?` +${e.providerTotal-e.providers.length}`:``]}),(0,B.jsx)(`td`,{className:`text-right`,children:(0,B.jsxs)(`span`,{className:`inline-flex items-center justify-end gap-1`,children:[(0,B.jsx)(`span`,{className:`tabular-nums text-secondary`,children:e.questionTotal}),(0,B.jsx)(k,{text:Ne(e)})]})})]},e.name))})]})}),o?.state===`available`?(0,B.jsxs)(`p`,{className:`supporting-copy mt-2`,children:[o.targetMissResults,` of `,o.answeredResults,` answers to `,q[n].technical.toLocaleLowerCase(),` did not name this Property.`]}):null]})]})}function Fe({questions:e,queryClass:t}){return(0,B.jsxs)(`section`,{"aria-labelledby":`property-questions`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`h2`,{id:`property-questions`,className:`text-heading-16 text-heading`,children:[q[t].technical,` assigned to this Property`]})}),(0,B.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` assigned`]})]}),e.length===0?(0,B.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,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Queries assigned to this Property`}),(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`th`,{children:`Query`})})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{className:`text-secondary`,children:e})},e))})]})})]})}function Ie({urls:e}){return(0,B.jsxs)(`section`,{"aria-labelledby":`property-urls`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`h2`,{id:`property-urls`,className:`text-heading-16 text-heading`,children:[`URLs that count as this Property`,(0,B.jsx)(k,{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,B.jsxs)(`p`,{className:`supporting-copy`,children:[e.length,` configured`]})]}),e.length===0?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No URLs are configured for this Property.`}):(0,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[420px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`URL matchers configured for this Property`}),(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:(0,B.jsx)(`th`,{children:`URL`})})}),(0,B.jsx)(`tbody`,{children:e.map(e=>(0,B.jsx)(`tr`,{children:(0,B.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 Le({project:e,targetKey:t,queryClass:n,runId:r,targetLabels:i}){let[a,o]=(0,z.useState)(new Set),s={client:p,path:{name:e},query:{targetKey:t,queryClass:n,shape:ee[`other-queries`],limit:K,...r?{runId:r}:{}}},l=c({...C(s),initialPageParam:s,getNextPageParam:e=>e.otherQueries?.nextCursor?{path:s.path,query:{...s.query,cursor:e.otherQueries.nextCursor}}:void 0}),d=l.data?.pages??[];if(d[0]?.measurement.state===`not_measured`)return null;let f=d.flatMap(e=>e.otherQueries?.items??[]),te=d[0]?.otherQueries?.totalEstimate??f.length,ne=e=>`${e.expectedSlotId}:${e.queryClass}`,m=q[n].technical.toLocaleLowerCase();return(0,B.jsxs)(`section`,{"aria-labelledby":`property-other-queries`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,B.jsx)(`h2`,{id:`property-other-queries`,className:`text-heading-16 text-heading`,children:Q.heading}),(0,B.jsx)(k,{text:Q.help})]}),l.data?(0,B.jsxs)(`p`,{className:`supporting-copy`,children:[te,` `,te===1?`answer`:`answers`,` · `,m,` · `,Q.notCounted]}):null]}),l.isPending?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading…`}):l.isError&&f.length===0?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,B.jsx)(`span`,{role:`alert`,children:Q.loadError}),(0,B.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{l.refetch()},children:`Retry`})]}):f.length===0?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:Q.empty}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table min-w-[640px]`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Answers to other properties’ queries that cited this Property’s pages`}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Query`}),(0,B.jsx)(`th`,{children:`Assigned to`}),(0,B.jsx)(`th`,{children:`Pages cited`}),(0,B.jsx)(`th`,{children:(0,B.jsx)(`span`,{className:`sr-only`,children:`Answer`})})]})}),(0,B.jsx)(`tbody`,{children:f.map(t=>{let n=ne(t),r=a.has(n),s=`property-other-query-${encodeURIComponent(n)}`;return(0,B.jsxs)(z.Fragment,{children:[(0,B.jsxs)(`tr`,{children:[(0,B.jsxs)(`td`,{className:`text-secondary`,children:[(0,B.jsx)(`span`,{className:`block text-label-14-strong text-heading`,children:t.queryText}),(0,B.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.provider,t.location].filter(Boolean).join(` · `)})]}),(0,B.jsx)(`td`,{children:(0,B.jsx)(`ul`,{className:`space-y-1`,children:t.assignedTargetKeys.map(t=>(0,B.jsx)(`li`,{children:(0,B.jsx)(u,{to:`/projects/$projectName/properties/$targetKey`,params:{projectName:e,targetKey:t},search:j,className:`text-label-14 text-link hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,children:i.get(t)??t})},t))})}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`ul`,{className:`space-y-1`,children:t.sources.map(e=>(0,B.jsx)(`li`,{className:`min-w-0`,children:(0,B.jsx)(I,{url:e.sourceUrl})},e.sourceUrl))}),t.sourcesTruncated?(0,B.jsxs)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[t.sourceCount,` pages in total`]}):null,t.evidenceComplete?null:(0,B.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:Q.partlySaved})]}),(0,B.jsx)(`td`,{className:`text-right`,children:(0,B.jsx)(h,{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?s:void 0,onClick:()=>o(e=>{let t=new Set(e);return t.delete(n)||t.add(n),t}),children:r?`Hide answer`:`Read answer`})})]}),r?(0,B.jsx)(`tr`,{children:(0,B.jsx)(`td`,{id:s,colSpan:4,className:`bg-surface-subtle px-4`,children:(0,B.jsx)(we,{project:e,targetKey:t.assignedTargetKeys[0],resultId:t.observationId})})}):null]},n)})})]})}),l.hasNextPage?(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,B.jsxs)(`span`,{children:[`Showing `,f.length,` of `,te]}),(0,B.jsx)(h,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:l.isFetchingNextPage,onClick:()=>{l.fetchNextPage()},children:l.isFetchingNextPage?`Loading…`:`Show ${K} more`})]}):null]})]})}function Re(e,t){let n=[e.marketKey?t??`the selected market`:null,e.provider?`the ${e.provider} answer engine`:null,e.model?`the ${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 ${fe.allMarkets.toLocaleLowerCase()} and answer engines.`}function ze(){let{projectName:e,targetKey:t}=l({strict:!1}),r=o(),i=s({strict:!1}),f=(0,z.useMemo)(()=>se(i),[i]),[te,ne]=(0,z.useState)(new Set),_=e??``,v=t??``,y=!!_&&!!v,b=(0,z.useMemo)(()=>ue(`portfolio`,ce(m())),[]),x=y&&b,{canWrite:ie}=re(),w=a({...ae({client:p,path:{name:_}}),enabled:x}),T=w.data?.active?.plan,E=T?.schemaVersion===2?T:null,D=f.queryClass===`branded`||f.queryClass===`non-brand`?f.queryClass:null,O=e=>E?.assignments.some(t=>t.targetKey===v&&t.queryClass===e)??!1,M=D??(!O(`non-brand`)&&O(`branded`)?`branded`:`non-brand`);(0,z.useEffect)(()=>{E&&!D&&r({to:`.`,replace:!0,search:e=>P(e,{queryClass:M})})},[E,D,M,r]);let F=a({...Ee(_,v,`branded`),enabled:x}),I=a({...Ee(_,v,`non-brand`),enabled:x}),de=De(F.data),fe=De(I.data),L=M===`branded`?F.data:I.data,R=M===`branded`?de:fe,V=(M===`branded`?F.isError:I.isError)&&R===void 0,H=L?.measurement.displayedRunId;le(_,{view:`property`,selection:{mode:`advanced`,scope:`property`,scopeKey:v,queryClass:M,limit:10,...H?{runId:H}:{}}});let U=R?.mentionCoverage.state===`unavailable`?Te(R.mentionCoverage):void 0,W=L===void 0?void 0:L.measurement.completedAt??null,me=L!==void 0&&(L.measurement.state===`not_measured`||L.nextAction.kind===`run_measurement`),he=e=>P(j(e),{measurementScope:`property`,measurementScopeKey:v,queryClass:M,measurementRunId:void 0,measurementRevision:void 0,measurementTo:void 0}),G=a({...S({client:p,path:{name:_},query:oe(se(he(i)))}),enabled:x&&me,retry:!1}).data,_e=G!==void 0&&G.selection.measurement.measuredRevision!==null&&(G.populations.find(e=>e.queryClass===M)?.summary.queryCount??0)>0,J={client:p,path:{name:_},query:{targetKey:v,queryClass:M,shape:ee.answers,limit:K,...H?{runId:H}:{}}},Y=c({...C(J),enabled:x&&L!==void 0,initialPageParam:J,getNextPageParam:e=>e.answers?.nextCursor?{path:J.path,query:{...J.query,cursor:e.answers.nextCursor}}:void 0}),X=w.data?.active??null,Z=X?.plan.schemaVersion===2?X.plan:null,Ne=X!==null&&Z===null,Q=Z?.targets.find(e=>e.stableKey===v)??null,ze=Re(f,Z?.reportingScopes?.find(e=>e.stableKey===f.marketKey)?.label),Be=(0,z.useMemo)(()=>{if(!Z)return[];let e=new Map(Z.querySnapshots.map(e=>[e.queryId,e.queryText]));return[...new Set(Z.assignments.filter(e=>e.targetKey===v&&e.queryClass===M).flatMap(t=>{let n=e.get(t.queryId);return n===void 0?[]:[n]}))].sort((e,t)=>e.localeCompare(t))},[Z,v,M]),Ve=(0,z.useMemo)(()=>Q?.urlMatchers.map(pe)??[],[Q]),He=(0,z.useMemo)(()=>new Map((Z?.targets??[]).map(e=>[e.stableKey,e.label])),[Z]),Ue=(0,z.useMemo)(()=>Z?.groups.filter(e=>e.targetKeys.includes(v))??[],[Z,v]),$=(0,z.useMemo)(()=>(Y.data?.pages??[]).flatMap(e=>e.answers?.items??[]),[Y.data]),We=Y.data?.pages[0]?.answers?.totalEstimate??$.length,Ge=(Y.data?.pages??[]).length>0&&(Y.data?.pages??[]).every(e=>e.answers===void 0),Ke=Y.data?.pages[0]?.measurement.state,qe=(0,B.jsxs)(u,{to:`/projects/$projectName`,params:{projectName:_},search:j,className:`inline-flex items-center gap-1 text-label-12 text-muted hover:text-strong`,children:[(0,B.jsx)(n,{className:`size-3.5`,"aria-hidden":`true`}),`Back to AI Visibility`]});if(!y)return(0,B.jsx)(`div`,{className:`page-container`,children:(0,B.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`Missing project name or Property key in URL.`})});if(!b)return(0,B.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,B.jsx)(`p`,{className:`text-copy-14 text-muted`,children:`This view is not available here.`})]});if(w.isPending&&!w.isError)return(0,B.jsx)(`div`,{className:`page-container`,children:(0,B.jsxs)(`div`,{role:`status`,"aria-live":`polite`,children:[(0,B.jsx)(`span`,{className:`sr-only`,children:`Loading Property`}),(0,B.jsx)(`div`,{className:`h-32 animate-pulse rounded-md bg-surface-subtle`,"aria-hidden":`true`})]})});let Je=w.isError&&w.data===void 0,Ye=F.isError&&F.data===void 0,Xe=I.isError&&I.data===void 0;return Je||Ye&&Xe?(0,B.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,B.jsx)(`p`,{role:`alert`,className:`text-copy-14 text-negative`,children:`Could not load this Property.`}),(0,B.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{w.refetch(),F.refetch(),I.refetch()},children:`Try again`})]}):!Z||!Q?(0,B.jsxs)(`div`,{className:`page-container space-y-3`,children:[qe,(0,B.jsx)(`p`,{role:`status`,className:`text-copy-14 text-secondary`,children:Z?`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,B.jsx)(h,{asChild:!0,type:`button`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,B.jsx)(u,{to:`/projects/$projectName/portfolio`,params:{projectName:_},children:ie?Ne?`Republish setup`:`Open measurement setup`:`View measurement setup`})})]}):(0,B.jsxs)(`div`,{className:`page-container space-y-8`,children:[(0,B.jsxs)(`div`,{className:`page-header`,children:[(0,B.jsxs)(`div`,{className:`page-header-left`,children:[qe,(0,B.jsx)(`h1`,{className:`page-title mt-2`,children:Q.label}),(0,B.jsxs)(`p`,{className:`page-subtitle`,children:[`Property in `,_,ze?(0,B.jsxs)(B.Fragment,{children:[` · Filters not applied `,(0,B.jsx)(k,{text:ze})]}):null]})]}),(0,B.jsxs)(`div`,{className:`page-header-right`,children:[L?(0,B.jsx)(g,{tone:ve[L.measurement.state].tone,children:ve[L.measurement.state].label}):null,R&&R.flags>0?(0,B.jsxs)(g,{tone:`caution`,children:[R.flags,` flagged`]}):null]})]}),(0,B.jsx)(Ae,{branded:de,nonBrand:fe,brandedFailed:Ye,nonBrandFailed:Xe}),(0,B.jsx)(je,{branded:de,nonBrand:fe,brandedError:F.isError,nonBrandError:I.isError,onRetry:e=>{e===`branded`?F.refetch():I.refetch()}}),me?(0,B.jsxs)(`section`,{className:`flex flex-wrap items-center justify-between gap-3 border-y border-default py-4`,"aria-label":`Measurement next step`,children:[(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?N:ie?`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,B.jsx)(h,{asChild:!0,type:`button`,className:`h-11 px-4 text-button-14 md:h-11`,children:(0,B.jsx)(u,{to:`/projects/$projectName`,params:{projectName:_},search:_e?he:j,children:_e?`See the last results`:ie?`Go to AI Visibility`:`View AI Visibility`})})]}):null,(0,B.jsxs)(`div`,{className:`flex flex-wrap items-end gap-4 border-y border-default py-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsx)(`label`,{htmlFor:`property-query-class`,className:`block text-label-14-strong text-heading`,children:`Query type`}),(0,B.jsxs)(`select`,{id:`property-query-class`,value:M,onChange:e=>{let t=e.target.value===`branded`?`branded`:`non-brand`;r({to:`.`,search:e=>P(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,B.jsx)(`option`,{value:`non-brand`,children:q[`non-brand`].technical}),(0,B.jsx)(`option`,{value:`branded`,children:q.branded.technical})]})]}),(0,B.jsx)(Oe,{measuredAt:W,unmeasuredReason:U,queryClass:M})]}),(0,B.jsx)(Me,{row:R,queryClass:M,isError:V}),(0,B.jsx)(Pe,{project:_,targetKey:v,queryClass:M}),(0,B.jsx)(Fe,{questions:Be,queryClass:M}),(0,B.jsx)(ge,{projectName:_,targetKey:v,published:Q,activeRevision:X.revision,publishedBrandNames:Z.identities.projectBrand.names}),(0,B.jsx)(Ie,{urls:Ve}),(0,B.jsx)(ke,{project:_,groups:Ue}),(0,B.jsxs)(`section`,{"aria-labelledby":`property-evidence`,className:`page-section-divider`,children:[(0,B.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,B.jsx)(`div`,{children:(0,B.jsxs)(`h2`,{id:`property-evidence`,className:`text-heading-16 text-heading`,children:[`Answers the engines gave`,(0,B.jsx)(k,{text:`One row per answer an engine gave for the queries 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. Open a row to read what the engine actually said, followed by the source URLs it returned, this Property's own first. The answer is where a miss becomes actionable: a query this Property was not named in may still have named a sibling building.`})]})}),$.length>0?(0,B.jsxs)(`p`,{className:`supporting-copy`,children:[$.length,` of `,We]}):null]}),V?(0,B.jsxs)(`p`,{className:`text-copy-14 text-secondary`,children:[`Evidence for `,q[M].technical.toLocaleLowerCase(),` is unavailable. Retry that query type above.`]}):Y.isPending&&$.length===0?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Loading evidence…`}):Y.isError&&$.length===0?(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,B.jsx)(`span`,{role:`alert`,children:`Evidence could not be loaded.`}),(0,B.jsx)(h,{type:`button`,size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,onClick:()=>{Y.refetch()},children:`Retry evidence`})]}):Ke===`not_measured`?(0,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:d()?N:`Not measured yet. Run a measurement to collect the answers for this Property.`}):Ge?(0,B.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,B.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No answers matched this Property in the displayed measurement.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{className:`property-answer-table-container overflow-x-auto rounded-md border border-default`,children:(0,B.jsxs)(`table`,{className:`evidence-table property-evidence-table`,children:[(0,B.jsx)(`caption`,{className:`sr-only`,children:`Answers measured for this Property`}),(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Query`}),(0,B.jsx)(`th`,{children:`Mentioned in the answer`}),(0,B.jsx)(`th`,{children:`Cited as a source`}),(0,B.jsx)(`th`,{children:`Sources`}),(0,B.jsx)(`th`,{children:(0,B.jsx)(`span`,{className:`sr-only`,children:`Sources detail`})})]})}),(0,B.jsx)(`tbody`,{children:$.map(e=>{let t=ye(e),n=te.has(t),r=`property-answer-${encodeURIComponent(t)}`;return(0,B.jsxs)(z.Fragment,{children:[(0,B.jsxs)(`tr`,{className:`property-answer-summary`,children:[(0,B.jsxs)(`td`,{className:`text-secondary`,children:[(0,B.jsx)(`h3`,{className:`text-heading-14 text-heading`,children:e.queryText}),(0,B.jsx)(`span`,{className:`mt-1 block text-label-12 text-muted`,children:[e.provider,e.location].filter(Boolean).join(` · `)}),e.historical||e.bridged?(0,B.jsx)(`span`,{className:`mt-1 flex`,children:(0,B.jsx)(g,{tone:`caution`,children:`Historical`})}):null]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Mentioned`}),(0,B.jsx)(be,{row:e})]}),(0,B.jsxs)(`td`,{children:[(0,B.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:`Cited`}),(0,B.jsx)(Se,{row:e})]}),(0,B.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,B.jsx)(`span`,{className:`property-evidence-mobile-label`,"aria-hidden":`true`,children:A}),e.cited===null?xe:e.sources.length]}),(0,B.jsx)(`td`,{className:`text-right`,children:(0,B.jsx)(h,{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:()=>ne(e=>{let n=new Set(e);return n.delete(t)||n.add(t),n}),children:n?`Hide answer`:`Read answer`})})]}),n?(0,B.jsx)(`tr`,{className:`property-answer-detail`,children:(0,B.jsxs)(`td`,{id:r,colSpan:5,className:`bg-surface-subtle px-4`,children:[(0,B.jsx)(we,{project:_,targetKey:v,resultId:e.observationId}),(0,B.jsx)(Ce,{row:e})]})}):null]},t)})})]})}),Y.hasNextPage?(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,B.jsxs)(`span`,{children:[`Showing `,$.length,` of `,We]}),Y.isFetchNextPageError?(0,B.jsx)(`span`,{role:`alert`,children:`Could not load more evidence.`}):null,(0,B.jsx)(h,{size:`sm`,variant:`outline`,className:`h-11 px-4 text-button-14 md:h-11`,disabled:Y.isFetchingNextPage,onClick:()=>{Y.fetchNextPage()},children:Y.isFetchingNextPage?`Loading…`:Y.isFetchNextPageError?`Retry more evidence`:`Show ${K} more`})]}):null]})]}),L?(0,B.jsx)(Le,{project:_,targetKey:v,queryClass:M,runId:H,targetLabels:He}):null]})}export{J as EVIDENCE_LABELS,ze as MeasurementPropertyPage,Q as OTHER_QUERIES_COPY};
|