@ainyc/canonry 5.2.1 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +2 -2
  2. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -0
  3. package/assets/assets/{AuditHistoryPanel-CkBLHz2H.js → AuditHistoryPanel-D5cOFMKE.js} +1 -1
  4. package/assets/assets/{BacklinksPage-D2YWJUf9.js → BacklinksPage-BiOj8ztV.js} +1 -1
  5. package/assets/assets/{HistoryPage-C9j3RzMN.js → HistoryPage-DDBCwooU.js} +1 -1
  6. package/assets/assets/MeasurementPropertyPage-CMoU2yA_.js +1 -0
  7. package/assets/assets/ProjectPage-CrFybBls.js +8 -0
  8. package/assets/assets/{RunRow-DTJuJ8mb.js → RunRow-BLBAwIot.js} +1 -1
  9. package/assets/assets/{RunsPage-CdKorpOj.js → RunsPage-BVgBbE1M.js} +1 -1
  10. package/assets/assets/{SettingsPage-BOjZh2vW.js → SettingsPage-DYtN-1_-.js} +1 -1
  11. package/assets/assets/{SiteHealthSection-D7sPztpW.js → SiteHealthSection-ElUwcAS4.js} +3 -3
  12. package/assets/assets/{TrafficPage-BCodKdgN.js → TrafficPage-D6QT_2hU.js} +1 -1
  13. package/assets/assets/{TrafficSourceDetailPage-D_zueOK5.js → TrafficSourceDetailPage-BnLzF82w.js} +1 -1
  14. package/assets/assets/{extract-error-message-BZYGBapN.js → extract-error-message-DIzjGZxl.js} +1 -1
  15. package/assets/assets/{index-aZ69fB-u.js → index-CoQVOsWw.js} +3 -3
  16. package/assets/assets/{react-sigma_core.esm.min-m72qsd73.js → react-sigma_core.esm.min-DTbIcdn4.js} +1 -1
  17. package/assets/assets/v2-overview-adapter-B_N4ilQV.js +1 -0
  18. package/assets/assets/{vendor-lucide-D_WBzb76.js → vendor-lucide-nVpYViBH.js} +1 -1
  19. package/assets/index.html +2 -2
  20. package/dist/{chunk-AGUCTX7L.js → chunk-HOOU4NS2.js} +194 -56
  21. package/dist/{chunk-5VONCLVQ.js → chunk-MNUFMEAX.js} +1 -1
  22. package/dist/{chunk-YQNKULAD.js → chunk-QAGZWYPI.js} +815 -366
  23. package/dist/cli.js +6 -6
  24. package/dist/{demo-server-BIPT53EY.js → demo-server-Y7YWLPU7.js} +2 -2
  25. package/dist/index.js +3 -3
  26. package/dist/{intelligence-service-SJO5E7WN.js → intelligence-service-PR6T6JKY.js} +1 -1
  27. package/package.json +8 -8
  28. package/assets/assets/MeasurementPropertyPage-Ci3CUr7Q.js +0 -1
  29. package/assets/assets/ProjectPage-Bdq_KTXX.js +0 -8
  30. package/assets/assets/v2-overview-adapter-BgsdlByS.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SiteHealthSection-D7sPztpW.js","./vendor-tanstack-ZXXkndVj.js","./vendor-lucide-D_WBzb76.js","./ChartPrimitives-Bxa_vFmq.js","./vendor-recharts-D-cUuLZo.js","./ProjectPage-Bdq_KTXX.js","./RunRow-DTJuJ8mb.js","./extract-error-message-BZYGBapN.js","./v2-overview-adapter-BgsdlByS.js","./vendor-markdown-B-Oq2NYq.js","./AuditHistoryPanel-CkBLHz2H.js","./vendor-radix-twS1M3FF.js","./vendor-yaml-GWJz5H2G.js","./RunsPage-CdKorpOj.js","./HistoryPage-C9j3RzMN.js","./SettingsPage-BOjZh2vW.js","./BacklinksPage-D2YWJUf9.js","./TrafficPage-BCodKdgN.js","./TrafficSourceDetailPage-D_zueOK5.js","./MeasurementPropertyPage-Ci3CUr7Q.js"])))=>i.map(i=>d[i]);
2
- import{c as M4,d as I4,r as T,j as c,Q as V4,M as L4,q as pe,e as Dl,L as tt,a as U4,t as Io,u as Et,f as G4,h as da,k as Hs,l as Dx,m as $4,n as Ox,O as hh,o as ns,p as K4,s as St,v as qx,x as as,y as H4,z as Q4,A as F4}from"./vendor-tanstack-ZXXkndVj.js";import{S as Z4,O as Zh,P as Bx,C as Yh,a as Px,T as Xh,D as Mx,R as Ix}from"./vendor-radix-twS1M3FF.js";import{c as Vx}from"./vendor-recharts-D-cUuLZo.js";import{A as Y4,X as sr,S as X4,a as J4,G as Lx,C as Xu,L as Zo,R as du,b as Ux,M as W4,c as eA,d as tA,e as Jh,T as Gx,W as nA,f as Wh,g as $x,h as aA,i as iA,P as sA,H as oA,j as rA,k as lA,l as cA,m as uA,B as dA,F as mA,n as pA,o as hA,p as fA,q as sb,E as gA}from"./vendor-lucide-D_WBzb76.js";import{M as yA}from"./vendor-markdown-B-Oq2NYq.js";import{p as bA}from"./vendor-yaml-GWJz5H2G.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function r(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();var Mp={exports:{}},dl={},Ip={exports:{}},Vp={};var ob;function vA(){return ob||(ob=1,(function(e){function a(P,ae){var he=P.length;P.push(ae);e:for(;0<he;){var je=he-1>>>1,X=P[je];if(0<u(X,ae))P[je]=ae,P[he]=X,he=je;else break e}}function s(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var ae=P[0],he=P.pop();if(he!==ae){P[0]=he;e:for(var je=0,X=P.length,Ie=X>>>1;je<Ie;){var Ne=2*(je+1)-1,Ae=P[Ne],ne=Ne+1,V=P[ne];if(0>u(Ae,he))ne<X&&0>u(V,Ae)?(P[je]=V,P[ne]=he,je=ne):(P[je]=Ae,P[Ne]=he,je=Ne);else if(ne<X&&0>u(V,he))P[je]=V,P[ne]=he,je=ne;else break e}}return ae}function u(P,ae){var he=P.sortIndex-ae.sortIndex;return he!==0?he:P.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var g=Date,b=g.now();e.unstable_now=function(){return g.now()-b}}var v=[],k=[],S=1,A=null,N=3,E=!1,Z=!1,_=!1,G=!1,K=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function re(P){for(var ae=s(k);ae!==null;){if(ae.callback===null)r(k);else if(ae.startTime<=P)r(k),ae.sortIndex=ae.expirationTime,a(v,ae);else break;ae=s(k)}}function W(P){if(_=!1,re(P),!Z)if(s(v)!==null)Z=!0,oe||(oe=!0,Re());else{var ae=s(k);ae!==null&&be(W,ae.startTime-P)}}var oe=!1,H=-1,$=5,Te=-1;function Ke(){return G?!0:!(e.unstable_now()-Te<$)}function Fe(){if(G=!1,oe){var P=e.unstable_now();Te=P;var ae=!0;try{e:{Z=!1,_&&(_=!1,te(H),H=-1),E=!0;var he=N;try{t:{for(re(P),A=s(v);A!==null&&!(A.expirationTime>P&&Ke());){var je=A.callback;if(typeof je=="function"){A.callback=null,N=A.priorityLevel;var X=je(A.expirationTime<=P);if(P=e.unstable_now(),typeof X=="function"){A.callback=X,re(P),ae=!0;break t}A===s(v)&&r(v),re(P)}else r(v);A=s(v)}if(A!==null)ae=!0;else{var Ie=s(k);Ie!==null&&be(W,Ie.startTime-P),ae=!1}}break e}finally{A=null,N=he,E=!1}ae=void 0}}finally{ae?Re():oe=!1}}}var Re;if(typeof Q=="function")Re=function(){Q(Fe)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Ue=ve.port2;ve.port1.onmessage=Fe,Re=function(){Ue.postMessage(null)}}else Re=function(){K(Fe,0)};function be(P,ae){H=K(function(){P(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function(P){switch(N){case 1:case 2:case 3:var ae=3;break;default:ae=N}var he=N;N=ae;try{return P()}finally{N=he}},e.unstable_requestPaint=function(){G=!0},e.unstable_runWithPriority=function(P,ae){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var he=N;N=P;try{return ae()}finally{N=he}},e.unstable_scheduleCallback=function(P,ae,he){var je=e.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?je+he:je):he=je,P){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=he+X,P={id:S++,callback:ae,priorityLevel:P,startTime:he,expirationTime:X,sortIndex:-1},he>je?(P.sortIndex=he,a(k,P),s(v)===null&&P===s(k)&&(_?(te(H),H=-1):_=!0,be(W,he-je))):(P.sortIndex=X,a(v,P),Z||E||(Z=!0,oe||(oe=!0,Re()))),P},e.unstable_shouldYield=Ke,e.unstable_wrapCallback=function(P){var ae=N;return function(){var he=N;N=ae;try{return P.apply(this,arguments)}finally{N=he}}}})(Vp)),Vp}var rb;function xA(){return rb||(rb=1,Ip.exports=vA()),Ip.exports}var lb;function kA(){if(lb)return dl;lb=1;var e=xA(),a=M4(),s=I4();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function g(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function b(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function v(t){if(f(t)!==t)throw Error(r(188))}function k(t){var n=t.alternate;if(!n){if(n=f(t),n===null)throw Error(r(188));return n!==t?null:t}for(var i=t,l=n;;){var p=i.return;if(p===null)break;var h=p.alternate;if(h===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===h.child){for(h=p.child;h;){if(h===i)return v(p),t;if(h===l)return v(p),n;h=h.sibling}throw Error(r(188))}if(i.return!==l.return)i=p,l=h;else{for(var x=!1,w=p.child;w;){if(w===i){x=!0,i=p,l=h;break}if(w===l){x=!0,l=p,i=h;break}w=w.sibling}if(!x){for(w=h.child;w;){if(w===i){x=!0,i=h,l=p;break}if(w===l){x=!0,l=h,i=p;break}w=w.sibling}if(!x)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?t:n}function S(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=S(t),n!==null)return n;t=t.sibling}return null}var A=Object.assign,N=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Ke=Symbol.for("react.memo_cache_sentinel"),Fe=Symbol.iterator;function Re(t){return t===null||typeof t!="object"?null:(t=Fe&&t[Fe]||t["@@iterator"],typeof t=="function"?t:null)}var ve=Symbol.for("react.client.reference");function Ue(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ve?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case K:return"Profiler";case G:return"StrictMode";case W:return"Suspense";case oe:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Z:return"Portal";case Q:return t.displayName||"Context";case te:return(t._context.displayName||"Context")+".Consumer";case re:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return n=t.displayName||null,n!==null?n:Ue(t.type)||"Memo";case $:n=t._payload,t=t._init;try{return Ue(t(n))}catch{}}return null}var be=Array.isArray,P=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},je=[],X=-1;function Ie(t){return{current:t}}function Ne(t){0>X||(t.current=je[X],je[X]=null,X--)}function Ae(t,n){X++,je[X]=t.current,t.current=n}var ne=Ie(null),V=Ie(null),q=Ie(null),le=Ie(null);function De(t,n){switch(Ae(q,n),Ae(V,t),Ae(ne,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?_y(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=_y(n),t=zy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ne(ne),Ae(ne,t)}function ye(){Ne(ne),Ne(V),Ne(q)}function Je(t){t.memoizedState!==null&&Ae(le,t);var n=ne.current,i=zy(n,t.type);n!==i&&(Ae(V,t),Ae(ne,i))}function Ge(t){V.current===t&&(Ne(ne),Ne(V)),le.current===t&&(Ne(le),rl._currentValue=he)}var Be,de;function Me(t){if(Be===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Be=n&&n[1]||"",de=-1<i.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SiteHealthSection-ElUwcAS4.js","./vendor-tanstack-ZXXkndVj.js","./vendor-lucide-nVpYViBH.js","./ChartPrimitives-Bxa_vFmq.js","./vendor-recharts-D-cUuLZo.js","./ProjectPage-CrFybBls.js","./v2-overview-adapter-B_N4ilQV.js","./vendor-markdown-B-Oq2NYq.js","./RunRow-BLBAwIot.js","./extract-error-message-DIzjGZxl.js","./AuditHistoryPanel-D5cOFMKE.js","./vendor-radix-twS1M3FF.js","./vendor-yaml-GWJz5H2G.js","./RunsPage-BVgBbE1M.js","./HistoryPage-DDBCwooU.js","./SettingsPage-DYtN-1_-.js","./BacklinksPage-BiOj8ztV.js","./TrafficPage-D6QT_2hU.js","./TrafficSourceDetailPage-BnLzF82w.js","./MeasurementPropertyPage-CMoU2yA_.js"])))=>i.map(i=>d[i]);
2
+ import{c as M4,d as I4,r as T,j as c,Q as V4,M as L4,q as pe,e as Dl,L as tt,a as U4,t as Io,u as Et,f as G4,h as da,k as Hs,l as Dx,m as $4,n as Ox,O as hh,o as ns,p as K4,s as St,v as qx,x as as,y as H4,z as Q4,A as F4}from"./vendor-tanstack-ZXXkndVj.js";import{S as Z4,O as Zh,P as Bx,C as Yh,a as Px,T as Xh,D as Mx,R as Ix}from"./vendor-radix-twS1M3FF.js";import{c as Vx}from"./vendor-recharts-D-cUuLZo.js";import{A as Y4,X as sr,S as X4,a as J4,G as Lx,C as Xu,L as Zo,R as du,b as Ux,M as W4,c as eA,d as tA,e as Jh,T as Gx,W as nA,f as Wh,g as $x,h as aA,i as iA,P as sA,H as oA,j as rA,k as lA,l as cA,m as uA,B as dA,F as mA,n as pA,o as hA,p as fA,q as sb,E as gA}from"./vendor-lucide-nVpYViBH.js";import{M as yA}from"./vendor-markdown-B-Oq2NYq.js";import{p as bA}from"./vendor-yaml-GWJz5H2G.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function r(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();var Mp={exports:{}},dl={},Ip={exports:{}},Vp={};var ob;function vA(){return ob||(ob=1,(function(e){function a(P,ae){var he=P.length;P.push(ae);e:for(;0<he;){var je=he-1>>>1,X=P[je];if(0<u(X,ae))P[je]=ae,P[he]=X,he=je;else break e}}function s(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var ae=P[0],he=P.pop();if(he!==ae){P[0]=he;e:for(var je=0,X=P.length,Ie=X>>>1;je<Ie;){var Ne=2*(je+1)-1,Ae=P[Ne],ne=Ne+1,V=P[ne];if(0>u(Ae,he))ne<X&&0>u(V,Ae)?(P[je]=V,P[ne]=he,je=ne):(P[je]=Ae,P[Ne]=he,je=Ne);else if(ne<X&&0>u(V,he))P[je]=V,P[ne]=he,je=ne;else break e}}return ae}function u(P,ae){var he=P.sortIndex-ae.sortIndex;return he!==0?he:P.id-ae.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var g=Date,b=g.now();e.unstable_now=function(){return g.now()-b}}var v=[],k=[],S=1,A=null,N=3,E=!1,Z=!1,_=!1,G=!1,K=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function re(P){for(var ae=s(k);ae!==null;){if(ae.callback===null)r(k);else if(ae.startTime<=P)r(k),ae.sortIndex=ae.expirationTime,a(v,ae);else break;ae=s(k)}}function W(P){if(_=!1,re(P),!Z)if(s(v)!==null)Z=!0,oe||(oe=!0,Re());else{var ae=s(k);ae!==null&&be(W,ae.startTime-P)}}var oe=!1,H=-1,$=5,Te=-1;function Ke(){return G?!0:!(e.unstable_now()-Te<$)}function Fe(){if(G=!1,oe){var P=e.unstable_now();Te=P;var ae=!0;try{e:{Z=!1,_&&(_=!1,te(H),H=-1),E=!0;var he=N;try{t:{for(re(P),A=s(v);A!==null&&!(A.expirationTime>P&&Ke());){var je=A.callback;if(typeof je=="function"){A.callback=null,N=A.priorityLevel;var X=je(A.expirationTime<=P);if(P=e.unstable_now(),typeof X=="function"){A.callback=X,re(P),ae=!0;break t}A===s(v)&&r(v),re(P)}else r(v);A=s(v)}if(A!==null)ae=!0;else{var Ie=s(k);Ie!==null&&be(W,Ie.startTime-P),ae=!1}}break e}finally{A=null,N=he,E=!1}ae=void 0}}finally{ae?Re():oe=!1}}}var Re;if(typeof Q=="function")Re=function(){Q(Fe)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Ue=ve.port2;ve.port1.onmessage=Fe,Re=function(){Ue.postMessage(null)}}else Re=function(){K(Fe,0)};function be(P,ae){H=K(function(){P(e.unstable_now())},ae)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function(P){switch(N){case 1:case 2:case 3:var ae=3;break;default:ae=N}var he=N;N=ae;try{return P()}finally{N=he}},e.unstable_requestPaint=function(){G=!0},e.unstable_runWithPriority=function(P,ae){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var he=N;N=P;try{return ae()}finally{N=he}},e.unstable_scheduleCallback=function(P,ae,he){var je=e.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?je+he:je):he=je,P){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=he+X,P={id:S++,callback:ae,priorityLevel:P,startTime:he,expirationTime:X,sortIndex:-1},he>je?(P.sortIndex=he,a(k,P),s(v)===null&&P===s(k)&&(_?(te(H),H=-1):_=!0,be(W,he-je))):(P.sortIndex=X,a(v,P),Z||E||(Z=!0,oe||(oe=!0,Re()))),P},e.unstable_shouldYield=Ke,e.unstable_wrapCallback=function(P){var ae=N;return function(){var he=N;N=ae;try{return P.apply(this,arguments)}finally{N=he}}}})(Vp)),Vp}var rb;function xA(){return rb||(rb=1,Ip.exports=vA()),Ip.exports}var lb;function kA(){if(lb)return dl;lb=1;var e=xA(),a=M4(),s=I4();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var n=t,i=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(i=n.return),t=n.return;while(t)}return n.tag===3?i:null}function g(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function b(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function v(t){if(f(t)!==t)throw Error(r(188))}function k(t){var n=t.alternate;if(!n){if(n=f(t),n===null)throw Error(r(188));return n!==t?null:t}for(var i=t,l=n;;){var p=i.return;if(p===null)break;var h=p.alternate;if(h===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===h.child){for(h=p.child;h;){if(h===i)return v(p),t;if(h===l)return v(p),n;h=h.sibling}throw Error(r(188))}if(i.return!==l.return)i=p,l=h;else{for(var x=!1,w=p.child;w;){if(w===i){x=!0,i=p,l=h;break}if(w===l){x=!0,l=p,i=h;break}w=w.sibling}if(!x){for(w=h.child;w;){if(w===i){x=!0,i=h,l=p;break}if(w===l){x=!0,l=h,i=p;break}w=w.sibling}if(!x)throw Error(r(189))}}if(i.alternate!==l)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?t:n}function S(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=S(t),n!==null)return n;t=t.sibling}return null}var A=Object.assign,N=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),K=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),re=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Te=Symbol.for("react.activity"),Ke=Symbol.for("react.memo_cache_sentinel"),Fe=Symbol.iterator;function Re(t){return t===null||typeof t!="object"?null:(t=Fe&&t[Fe]||t["@@iterator"],typeof t=="function"?t:null)}var ve=Symbol.for("react.client.reference");function Ue(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ve?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case _:return"Fragment";case K:return"Profiler";case G:return"StrictMode";case W:return"Suspense";case oe:return"SuspenseList";case Te:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Z:return"Portal";case Q:return t.displayName||"Context";case te:return(t._context.displayName||"Context")+".Consumer";case re:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case H:return n=t.displayName||null,n!==null?n:Ue(t.type)||"Memo";case $:n=t._payload,t=t._init;try{return Ue(t(n))}catch{}}return null}var be=Array.isArray,P=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},je=[],X=-1;function Ie(t){return{current:t}}function Ne(t){0>X||(t.current=je[X],je[X]=null,X--)}function Ae(t,n){X++,je[X]=t.current,t.current=n}var ne=Ie(null),V=Ie(null),q=Ie(null),le=Ie(null);function De(t,n){switch(Ae(q,n),Ae(V,t),Ae(ne,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?_y(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=_y(n),t=zy(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ne(ne),Ae(ne,t)}function ye(){Ne(ne),Ne(V),Ne(q)}function Je(t){t.memoizedState!==null&&Ae(le,t);var n=ne.current,i=zy(n,t.type);n!==i&&(Ae(V,t),Ae(ne,i))}function Ge(t){V.current===t&&(Ne(ne),Ne(V)),le.current===t&&(Ne(le),rl._currentValue=he)}var Be,de;function Me(t){if(Be===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);Be=n&&n[1]||"",de=-1<i.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Be+t+de}var $t=!1;function Sn(t,n){if(!t||$t)return"";$t=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(F){var L=F}Reflect.construct(t,[],ie)}else{try{ie.call()}catch(F){L=F}t.call(ie.prototype)}}else{try{throw Error()}catch(F){L=F}(ie=t())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(F){if(F&&L&&typeof F.stack=="string")return[F.stack,L.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=l.DetermineComponentFrameRoot(),x=h[0],w=h[1];if(x&&w){var z=x.split(`
5
5
  `),I=w.split(`
@@ -83,4 +83,4 @@ spec:
83
83
  `);ut(Pe),Js(!0)}}catch(U){Xl(U instanceof Error?U.message:"Failed to generate queries"),K({flowVersion:st,onboardingSessionId:_,event:"onboarding.blocked",step:"queries",action:"generate_queries",reasonCode:Al(U,"unknown")},"onboarding.blocked:queries:generate")}finally{eo(!1)}}},Id=async()=>{if(!Be)return;const U=qa;if(U.length!==0){qt(!0),wi(null);try{await RI(Be,U),ki(!0),await r(),K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:"competitors",method:"manual",countBucket:La(U.length)},"onboarding.step_completed:competitors"),P(4)}catch(Pe){wi(Pe instanceof Error?Pe.message:"Failed to save competitors"),K({flowVersion:st,onboardingSessionId:_,event:"onboarding.blocked",step:"competitors",action:"save",reasonCode:"unknown"},"onboarding.blocked:competitors:save")}finally{qt(!1)}}},oo=async()=>{const U=Sr.trim();if(U){fs(!0),gn(null);try{await BS("gemini",{apiKey:U}),rn({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),io(""),await r(),Ha(b.providerStatuses.find(Pe=>Pe.name.toLowerCase()==="gemini")?.name??"gemini"),K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:"system",method:"inline"},"onboarding.step_completed:system")}catch(Pe){gn(Pe instanceof Error?Pe.message:"Failed to save Gemini key"),K({flowVersion:st,onboardingSessionId:_,event:"onboarding.blocked",step:"system",action:"configure_provider",reasonCode:"provider_save_failed"},"onboarding.blocked:system:provider_save_failed")}finally{fs(!1)}}},Wn=async()=>{if(!Ps()){if(!Be||_n){Si(_n??"Complete setup before launching the first sweep.");const U=In??(Be?Jn===0?"no_queries":"run_rejected":"unknown");un||K({flowVersion:st,onboardingSessionId:_,event:"run.requested",origin:"dashboard_setup",result:"rejected",providerCountBucket:La(bi),queryCountBucket:La(Jn),reasonCode:U});return}wr(!0),Si(null);try{const U=await Nn.mutateAsync({projectName:Be,projectLabel:Ne||X||Be,sourceAction:"setup-launch"});ba(U.id),Bd(!0),_3(Be,U.id),Ra.current=U.id,un||K({flowVersion:st,onboardingSessionId:_,event:"run.requested",origin:"dashboard_setup",result:"queued",providerCountBucket:La(bi),queryCountBucket:La(Jn)}),await r()}catch(U){Si(U instanceof Error?U.message:"Failed to queue the visibility sweep. Retry when the instance is ready."),un||K({flowVersion:st,onboardingSessionId:_,event:"run.requested",origin:"dashboard_setup",result:"rejected",providerCountBucket:La(bi),queryCountBucket:La(Jn),reasonCode:Al(U,"run_rejected")})}finally{wr(!1)}}},ea=()=>P(U=>N?2:Math.max(0,U-1)),ys=(U,Pe,yn)=>{K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:U,method:"existing",...yn===void 0?{}:{countBucket:La(yn)}},`onboarding.step_completed:${U}`),P(Pe)},ji=()=>{if(K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:"queries",method:"skipped",countBucket:"0"},"onboarding.step_completed:queries"),N){ln();return}P(3)},Ai=()=>{K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:"competitors",method:"skipped",countBucket:"0"},"onboarding.step_completed:competitors"),P(4)},ic=N?"section":ua,ro=Kt!==!0||Ka===!0?c.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"min-h-11",onClick:()=>{r(),Wt&&Ws.refetch()},children:"Check again"}):null,sc=(Kt===!1||ms)&&!!An,bs=N&&(be===2||be===4)?v?c.jsxs("section",{"aria-labelledby":"setup-provider-heading",className:"space-y-3 border-b border-default pb-6 mb-6",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("h2",{id:"setup-provider-heading",className:"text-lg font-semibold text-heading",children:Kt===!1?"Connect a provider":"Answer engine provider"}),c.jsx(pn,{tone:Kt===!0?"positive":"neutral",children:Kt===!0?"Configured":Kt===!1?"Not connected":"Checking"})]}),c.jsx("p",{className:"max-w-prose text-sm text-secondary",children:Kt===!0?Pn.length>0?`${Pn.map(U=>U.displayName??U.name).join(", ")} available for this project. Research and sweeps use your provider account.`:"ChatGPT in Chrome is configured for sweeps. Query Research needs an API provider.":Kt===!1?"An answer engine is required for visibility sweeps. You can save queries now and connect later.":"Checking available providers. You can choose queries while this finishes."}),Kt===!1||ms?An?c.jsx("div",{children:c.jsx(hK,{compact:!0,leadingField:c.jsxs("div",{className:"min-w-0 space-y-1.5",children:[c.jsx("label",{className:"block text-sm font-medium text-secondary",htmlFor:"setup-provider",children:"Provider to connect"}),c.jsx("select",{ref:vr,id:"setup-provider",className:"setup-input",value:An.name,onChange:U=>{U.target.value!==An.name&&(to.current=document.activeElement===U.currentTarget,Wl(U.target.value))},children:ya.map(U=>c.jsx("option",{value:U.name,children:U.displayName??U.name},U.name))})]}),secondaryActions:ro,providerName:An.name,keyUrl:An.keyUrl,modelHint:An.modelHint,onSaved:()=>{xr(!1),r()}},An.name)}):c.jsx("p",{className:"max-w-prose text-sm text-secondary",children:Xn.length>0?`This project's provider selection is ${Xn.join(", ")}. Configure an allowed provider in Settings, or change the selection in project Settings.`:"Provider configuration is unavailable here. Open Settings to connect an answer engine, then check again."}):null,c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Kt===!0&&!ms&&An?c.jsx(fe,{type:"button",variant:"outline",size:"sm",onClick:()=>xr(!0),children:"Configure a provider"}):null,!An||Ka===!0?c.jsx(fe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:c.jsx(tt,{to:"/settings",target:"_blank",rel:"noopener noreferrer",children:"Open provider settings"})}):null,sc?null:ro]})]}):c.jsxs("section",{"aria-labelledby":"setup-provider-heading",className:"space-y-2 border-b border-default pb-6 mb-6",children:[c.jsx("h2",{id:"setup-provider-heading",className:"text-lg font-semibold text-heading",children:"Answer engine provider"}),c.jsx("p",{className:"max-w-prose text-sm text-secondary",children:"Provider settings are managed by an administrator."}),yr?c.jsx("p",{role:"alert",className:"text-sm text-negative",children:"Provider readiness could not be checked. Try again."}):c.jsx("p",{className:"max-w-prose text-sm text-secondary",role:"status",children:Kt===!0?"An answer engine is available for this project.":Kt===!1?"Ask an administrator to connect an answer engine for this project. You can save queries now.":"Checking provider readiness. You can save queries now."}),c.jsx(fe,{type:"button",variant:"ghost",size:"sm",className:"min-h-11",disabled:Rt.isFetching,onClick:()=>{Rt.refetch()},children:yr?"Retry provider check":"Check again"})]}):null,xa=(()=>{switch(be){case 0:return c.jsxs(ua,{className:"surface-card step-card",children:[c.jsx("div",{className:"section-head",children:c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),c.jsx("h2",{children:"System check"})]})}),c.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),c.jsx("div",{className:"compact-stack",children:A.healthChecks.map(U=>c.jsxs("div",{className:"health-check-row",children:[c.jsxs("div",{children:[c.jsx("p",{className:"run-row-title",children:U.label}),c.jsx("p",{className:"supporting-copy",children:U.detail}),U.id==="provider"&&U.state!=="ready"&&c.jsxs("div",{className:"mt-3 rounded-md border border-default bg-bg-elevated/40 p-3 space-y-2",children:[c.jsxs("p",{className:"text-xs text-secondary",children:["Paste a Gemini key to enable visibility checks (free at"," ",c.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"aistudio.google.com"}),")."]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"password",value:Sr,onChange:Pe=>io(Pe.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-sm text-heading placeholder:text-faint focus:border-mono-600 focus:outline-none font-mono",disabled:so}),c.jsx(fe,{type:"button",size:"sm",disabled:so||!Sr.trim(),onClick:Ft(oo),children:so?"Saving...":"Save"})]}),nc&&c.jsxs("div",{role:"alert",className:"space-y-1 text-xs text-negative",children:[c.jsx("p",{children:nc}),c.jsx("p",{children:"Check that the key is complete, then retry Save."})]}),c.jsxs("p",{className:"text-sm text-secondary",children:["Connect more answer engines later in"," ",c.jsx(tt,{to:"/settings",className:"text-link hover:underline",children:"Settings"}),"."]})]})]}),c.jsx(pn,{tone:U.state==="ready"?"positive":"caution",title:U.id==="api"?ar(S.apiStatus):U.id==="worker"?ar(S.workerStatus):U.detail,children:U.state==="ready"?"Ready":"Attention"})]},U.id))}),c.jsxs("div",{className:"setup-nav",children:[A.launchState.blockedReason?c.jsx("p",{role:"status",className:"supporting-copy text-negative",children:A.launchState.blockedReason}):c.jsx("span",{}),c.jsx(fe,{type:"button",disabled:!A.launchState.enabled,title:A.launchState.blockedReason,onClick:()=>{K({flowVersion:st,onboardingSessionId:_,event:"onboarding.step_completed",step:"system",method:"automatic"},"onboarding.step_completed:system"),P(Ue)},children:"Continue"})]})]});case 1:return c.jsxs(ua,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),c.jsx("h2",{children:"Create project"})]}),Be?c.jsx(pn,{tone:"positive",children:"Created"}):null]}),Be?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-neutral",children:["Project ",c.jsx("span",{className:"text-heading font-medium",children:Be})," created successfully."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsx(fe,{type:"button",onClick:()=>ys("project",2),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),c.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:X,onChange:U=>Ie(U.target.value)}),va&&va!==X?c.jsxs("p",{className:"supporting-copy",children:["Slug: ",va]}):null]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),c.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:Ne,onChange:U=>Ae(U.target.value)})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),c.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:ne,onChange:U=>V(U.target.value)})]}),c.jsxs("div",{className:"setup-field-row",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),c.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:q,onChange:U=>le(U.target.value.toUpperCase())})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),c.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:De,onChange:U=>ye(U.target.value.toLowerCase())})]})]}),c.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-default bg-surface p-3 cursor-pointer hover:border-strong",children:[c.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-strong bg-bg",checked:Je,onChange:U=>Ge(U.target.checked)}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm text-heading",children:"Auto-extract backlinks"}),c.jsxs("span",{className:"block text-xs text-muted mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",c.jsx(tt,{to:"/backlinks",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"Manage backlinks"})]})]})]}),Me?c.jsx("p",{className:"text-negative-400 text-sm",children:Me}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsx(fe,{type:"button",disabled:!va||!ne||Sn,onClick:Ft(ac),children:Sn?"Creating...":"Create project"})]})]})]});case 2:return c.jsxs(ic,{className:N?"visibility-setup-section step-card":"surface-card step-card","aria-labelledby":"setup-queries-heading",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:N?"Step 1 of 2":"Step 3 of 5"}),c.jsx("h2",{id:"setup-queries-heading",children:"Add queries"})]}),je?c.jsx(pn,{tone:"neutral",children:"Loading"}):oe.isError?c.jsx(pn,{tone:"negative",children:"Load failed"}):Jt?c.jsxs(pn,{tone:"positive",children:[Mn.length," saved"]}):c.jsxs(pn,{tone:"neutral",children:[Mn.length," quer",Mn.length!==1?"ies":"y"]})]}),c.jsx("p",{className:"supporting-copy",children:"Add the queries your customers use, one per line. You can refine your list later."}),c.jsxs("div",{className:"space-y-2 border-b border-default pb-4",children:[c.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[c.jsxs("div",{className:"min-w-0 space-y-1",children:[c.jsx("h3",{className:"text-sm font-semibold text-heading",children:"Research queries with your agent"}),c.jsx("p",{className:"max-w-prose text-sm text-secondary",children:"Ask your agent to compare answers and available sources with Canonry Research, then recommend queries. Research does not change your tracked queries."})]}),c.jsx(fe,{type:"button",variant:"outline",size:"sm",className:"min-h-11 shrink-0 self-start",onClick:Ft(Od),children:ec?"Research prompt copied":"Copy research prompt"})]}),c.jsxs("details",{open:Mt||void 0,className:"text-sm text-secondary",children:[c.jsx("summary",{className:"min-h-11 cursor-pointer py-3 text-link",children:"View agent prompt"}),c.jsx("textarea",{"aria-label":"Agent query research prompt",readOnly:!0,className:"setup-textarea mt-2 w-full",rows:8,value:tc})]}),Mt?c.jsx("p",{role:"alert",className:"text-sm text-negative",children:"Could not copy. Select and copy the prompt above."}):null]}),je?c.jsx("div",{className:"rounded-md border border-default bg-bg-elevated/40 p-4 text-sm text-secondary",role:"status",children:"Loading saved queries…"}):oe.isError?c.jsxs("div",{className:"compact-stack",children:[c.jsx("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:"Saved queries could not be loaded. Retry before changing the query basket."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:N?ln:ea,children:"Back"}),c.jsx(fe,{type:"button",onClick:()=>{oe.refetch()},children:"Retry loading queries"})]})]}):Jt?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:Mn.map(U=>c.jsx("li",{children:U},U))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:N?ln:ea,children:"Back"}),c.jsx(fe,{type:"button",variant:"outline",onClick:()=>us(!1),children:"Edit queries"}),c.jsx(fe,{type:"button",onClick:()=>ys("queries",N?4:3,Mn.length),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[Pn.length>0?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-base"}),"auto-generate",c.jsx("span",{className:"flex-1 border-t border-base"})]}),c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsxs("div",{className:"setup-field flex-1",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),c.jsx("select",{id:"gen-provider",className:"setup-input",value:jn,onChange:U=>Ha(U.target.value),children:Pn.map(U=>c.jsxs("option",{value:U.name,children:[U.displayName??U.name,U.model?` (${U.model})`:""]},U.name))})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),c.jsx("select",{id:"gen-count",className:"setup-input",value:vi,onChange:U=>Dd(Number(U.target.value)),children:[3,5,10,15,20].map(U=>c.jsx("option",{value:U,children:U},U))})]}),c.jsx(fe,{type:"button",variant:"outline",disabled:br||!jn,onClick:Ft(Md),children:br?"Analyzing site...":"Generate"})]}),xi?c.jsx("p",{className:"text-negative-400 text-sm",children:xi}):null]}):null,N?null:c.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[c.jsx("span",{className:"flex-1 border-t border-base"}),"or type manually",c.jsx("span",{className:"flex-1 border-t border-base"})]}),c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),c.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
84
84
  best invisalign downtown brooklyn
85
85
  pediatric dentist brooklyn heights`,value:Ve,onChange:U=>ut(U.target.value)})]}),Hl?c.jsx("p",{className:"text-negative-400 text-sm",children:Hl}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:N?ln:ea,children:"Back"}),c.jsx(fe,{type:"button",variant:"ghost",onClick:ji,children:N?"Finish without AI Visibility":"Skip for now"}),c.jsx(fe,{type:"button",disabled:Mn.length===0||Ql,onClick:Ft(jr),children:Ql?"Saving...":`Save ${Mn.length} quer${Mn.length!==1?"ies":"y"}`})]})]})]});case 3:return c.jsxs(ua,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),c.jsx("h2",{children:"Add competitors"})]}),no?c.jsx(pn,{tone:"positive",children:"Saved"}):null]}),c.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),no?c.jsxs("div",{className:"compact-stack",children:[c.jsx("ul",{className:"detail-list",children:qa.map(U=>c.jsx("li",{children:U},U))}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsx(fe,{type:"button",onClick:()=>ys("competitors",4,qa.length),children:"Continue"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{className:"setup-field",children:[c.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),c.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
86
- competitor2.com`,value:kr,onChange:U=>ps(U.target.value)})]}),Qa?c.jsx("p",{className:"text-negative-400 text-sm",children:Qa}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:Ai,children:"Skip"}),c.jsx(fe,{type:"button",disabled:qa.length===0||Fa,onClick:Ft(Id),children:Fa?"Saving...":`Save ${qa.length} competitor${qa.length!==1?"s":""}`})]})]})]})]});case 4:{const U=Oa.data,Pe=U?.status??(Da===Ke?.id?Ke.status:void 0),yn=Pe==="completed"||Pe==="partial"||Pe==="failed"||Pe==="cancelled",Ba=U?.snapshots??[],lo=Ba.filter(ta=>ta.citationState==="cited").length,oc=Ba.filter(ta=>ta.answerMentioned===!0).length,vs=new Set(Ba.map(ta=>ta.query).filter(ta=>!!ta)).size,xs=Pe?_x(Pe,Ba.length):!1,Ar=Fe&&!Cn,dn=Za??(U?.error?cV(U.error):Pe==="cancelled"?"The sweep was cancelled before it produced a baseline.":(Pe==="completed"||Pe==="partial")&&Ba.length===0?"The sweep finished without producing any snapshots.":Ke?.statusDetail||"The sweep did not produce a baseline.");let Vn=null;return Ar||xs?Vn=c.jsx(pn,{tone:"positive",children:"Complete"}):Za&&!Cn?Vn=c.jsx(pn,{tone:"negative",children:"Failed"}):yn?Vn=c.jsx(pn,{tone:"negative",children:Pe==="cancelled"?"Cancelled":"Failed"}):Cn&&(Vn=c.jsx(pn,{tone:"caution",children:"Running"})),c.jsxs(ua,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:N?"Step 2 of 2":"Step 5 of 5"}),c.jsx("h2",{children:Ps()?"AI Visibility":"Launch first run"})]}),Vn]}),Ar?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-secondary",children:["Setup is complete. ",c.jsx("span",{className:"text-strong font-medium",children:Be})," already has a successful answer-visibility baseline."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:g?"Finish and open project":"Open project dashboard →"})]})]}):!Cn&&Ps()?c.jsxs("div",{className:"compact-stack",children:[Be?c.jsx(v$,{projectName:Be}):c.jsx("p",{className:"text-sm text-secondary",children:Hh}),Za&&c.jsx("p",{role:"alert",className:"text-sm text-negative",children:Za}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:"Open project dashboard →"})]})]}):Cn?yn?xs?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-neutral",children:["Sweep complete. Your first answer-visibility snapshot for"," ",c.jsx("span",{className:"text-heading font-medium",children:Be}),":"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Mentioned"}),c.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[oc,c.jsxs("span",{className:"text-faint text-lg",children:[" / ",vs]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries naming your brand"})]}),c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Cited"}),c.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[lo,c.jsxs("span",{className:"text-faint text-lg",children:[" / ",vs]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries citing your site"})]}),c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Results"}),c.jsx("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:Ba.length}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"completed engine checks"})]})]}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:g?"Your project is ready. Review the evidence in the project.":"Open the project to review the evidence."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:g?"Finish and open project":"Open project dashboard →"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:dn}),c.jsx("p",{className:"mt-1 text-xs text-secondary",children:Ps()?Hh:v?"Fix provider or query configuration if needed, then retry without leaving setup.":"Ask an administrator to review the provider and query configuration."})]}),c.jsxs("div",{className:"setup-nav",children:[v&&!Ps()?c.jsx(fe,{type:"button",variant:"outline",asChild:!0,children:c.jsx(tt,{to:"/settings",children:"Configure providers"})}):c.jsx("span",{}),Ps()||!v?c.jsx(fe,{type:"button",onClick:ln,children:"Open project dashboard →"}):c.jsx(fe,{type:"button",disabled:hs||!!_n,onClick:Ft(Wn),children:hs?"Retrying...":"Retry visibility sweep"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsx("p",{className:"text-neutral",children:"Sweep running. This usually takes 30 to 60 seconds."}),c.jsx("div",{className:"rounded-md border border-default bg-surface p-3 text-xs text-muted",children:c.jsxs("p",{children:["Status: ",c.jsx("span",{className:"text-neutral",children:Pe??"queued"})]})}),Oa.isError&&c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:Oa.error instanceof Error?Oa.error.message:"Could not refresh the sweep status."}),c.jsx(fe,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>{Oa.refetch()},children:"Retry status check"})]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",variant:"outline",onClick:ln,children:g?"Finish and open project":"Watch on project page"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"supporting-copy",children:["Your queries are saved. Run a first sweep to get a baseline for"," ",c.jsx("span",{className:"text-heading font-medium",children:Be}),", or finish and run it later from the project. A sweep calls the answer engines, so it costs provider usage."]}),(_n||Za)&&c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:Za??_n}),c.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Resolve the blocker above, then retry the sweep here."})]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsx(fe,{type:"button",variant:"ghost",onClick:ln,children:"Finish without running"}),In==="no_provider"&&!N?c.jsx(fe,{type:"button",asChild:!0,children:c.jsx(tt,{to:"/settings",children:"Configure a provider"})}):c.jsx(fe,{type:"button",disabled:hs||!!_n,title:_n,onClick:Ft(Wn),children:hs?"Launching...":Za?"Retry visibility sweep":"Launch visibility sweep"})]})]})]})}default:return null}})();return c.jsxs("div",{className:N?"page-container visibility-setup":"page-container",children:[g?c.jsx(ir,{current:"visibility"}):null,c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{ref:u?f:void 0,tabIndex:u?-1:void 0,className:"page-title",children:u?"Set up AI Visibility":"Setup"}),c.jsx("p",{className:"page-subtitle",children:u?"Connect an answer engine, then choose queries for your first sweep.":"Create a project and run its first visibility check."})]}),g?c.jsx("div",{className:"page-header-right",children:c.jsx(fe,{type:"button",variant:"outline",className:"min-h-11",onClick:ln,children:"Skip AI Visibility"})}):null]}),g?null:c.jsx(vK,{current:N?be===4?1:0:be,labels:N?yK:gK}),c.jsxs("section",{className:"setup-wizard",children:[bs,xa]})]})}const wK=T.lazy(async()=>({default:(await yi(()=>import("./SiteHealthSection-D7sPztpW.js").then(a=>a.d),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).SiteHealthSection})),SK=1800,jK="https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent",AK="Help me set up Canonry for my public site.\n\nUse Canonry's official docs:\n- Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent\n- CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md\n- Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md\n- MCP setup: https://github.com/Canonry/canonry/blob/main/docs/mcp.md\n\nUse an existing Canonry installation or connected plugin/MCP if one is already available. Do not create a duplicate. The `cnry` and `canonry` commands are interchangeable.\n\n1. Ask for my public domain, country, and language. Do not create or scan anything yet.\n2. Check the local setup with `command -v cnry`, `cnry --version`, `cnry doctor --format json`, and `cnry project list --format json`. If Canonry is missing, propose `npm install -g @canonry/canonry` and wait for approval. If initialization is required, tell me to run `cnry bootstrap` in my private terminal and wait. Never ask me to paste passwords, API keys, OAuth credentials, or `cnry bootstrap` output.\n3. Show the normalized domain, proposed project name, exact `cnry project create ...` command, and wait for explicit approval before creating it.\n4. Propose a bounded Site Health scan, including `--max-pages` and whether dead-link checking is enabled. Show the exact `cnry technical-aeo run ... --wait --format json` command and wait for separate approval before scanning.\n5. After the crawl, summarize the findings and propose AI Visibility setup. Ask before adding queries, connecting providers, starting any provider-backed or quota-consuming run, editing files, or publishing.";function CK(e,a){return e==="legacy"?"legacy":e==="platform"?"platform":a.state==="success"?a.projectCount===0?"platform":"legacy":a.state==="error"?"retry":"loading"}const R3=[{value:"US",label:"United States"},{value:"CA",label:"Canada"},{value:"GB",label:"United Kingdom"},{value:"AU",label:"Australia"},{value:"NZ",label:"New Zealand"},{value:"IE",label:"Ireland"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"ES",label:"Spain"},{value:"IT",label:"Italy"},{value:"NL",label:"Netherlands"},{value:"BR",label:"Brazil"},{value:"MX",label:"Mexico"},{value:"IN",label:"India"},{value:"SG",label:"Singapore"},{value:"JP",label:"Japan"}],D3=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"nl",label:"Dutch"},{value:"ja",label:"Japanese"}];function NK(e,a){try{const s=new Intl.DisplayNames(["en"],{type:"region"}),r=new Intl.DisplayNames(["en"],{type:"language"}),u=e.length===2?s.of(e.toUpperCase()):void 0,f=a?r.of(a.toLowerCase()):void 0;return`${u??(e||"Country")} · ${f??(a||"Language")}`}catch{return`${e||"Country"} · ${a||"Language"}`}}function _K(e,a){const s=e.trim().toUpperCase(),r=a.trim().toLowerCase();return{countryValid:R3.some(u=>u.value===s),languageValid:D3.some(u=>u.value===r)}}function zK(e){const a=e.replace(/^\[|\]$/g,"");return/^(?:\d{1,3}\.){3}\d{1,3}$/.test(a)||a.includes(":")}function EK(e){const a=e.trim();if(!a)return null;const s=/^[a-z][a-z\d+.-]*:\/\//i.test(a)?a:`https://${a}`;let r;try{r=new URL(s)}catch{return null}if(r.protocol!=="http:"&&r.protocol!=="https:")return null;const u=r.hostname.toLowerCase().replace(/^www\./,"");if(!u||u==="localhost"||zK(u)||!u.includes("."))return null;const f=u.replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return f?{canonicalDomain:u,projectName:f,displayName:u}:null}async function TK(e,a=SK){let s;const r=new Promise(f=>{s=setTimeout(()=>f({state:"timed-out"}),a)}),u=await Promise.race([e.then(f=>({state:"queued",run:f})),r]);return s&&clearTimeout(s),u}function RK(e,a){e.catch(()=>{rn({title:"Site Health scan did not start",detail:"The project is safe. Choose Run scan in Site Health to retry.",tone:"negative",dedupeKey:`site-health-dispatch:${a}`})})}function O3(e){const a=T.useRef(A3()).current,s=T.useRef(new Set),r=T.useCallback((u,f)=>{if(f){if(s.current.has(f))return;s.current.add(f)}PS({...u,surface:e,eventId:C3()})},[e]);return{onboardingSessionId:a,emit:r}}function Tx(e,a){return e instanceof fn&&e.statusCode===409?"A project with this name already exists. Change the project name, or open the existing project.":e instanceof Error&&e.message?e.message:a}function DK(){return c.jsxs("div",{className:"page-container max-w-3xl","aria-busy":"true","aria-live":"polite",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Preparing setup"}),c.jsx("p",{className:"page-subtitle",children:"Checking the projects already on this install."})]})}),c.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-default bg-surface p-4 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading projects…"]})]})}function OK({onRetry:e}){return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Can’t load projects"}),c.jsx("p",{className:"page-subtitle",children:"Canonry could not confirm whether this install already has a project."})]})}),c.jsxs("div",{className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:"Setup is paused to protect existing projects."}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:"Check the connection or sign in again, then retry."}),c.jsx(fe,{type:"button",className:"mt-4",variant:"secondary",onClick:e,children:"Retry project check"})]})]})}function qK({projectName:e,initialRunId:a}){return c.jsx(Ef,{title:"Site Health setup",children:c.jsx(BK,{projectName:e,initialRunId:a})})}function BK({projectName:e,initialRunId:a}){const s=Hs(),r=Et({...Zs({client:se}),enabled:!!e,retry:!1,refetchOnMount:"always"}),{onboardingSessionId:u,emit:f}=O3("site_health");T.useEffect(()=>{e&&f({flowVersion:st,onboardingSessionId:u,event:"onboarding.started",step:"run",resumed:!!a},"onboarding.started")},[f,a,u,e]),T.useEffect(()=>{!e||!a||z3(e)?.runId!==a&&_3(e,a)},[a,e]);const b=Et({...bf({client:se,path:{id:a??""}}),enabled:!!a,refetchInterval:({state:N})=>{const E=N.data?.status;return E==="completed"||E==="partial"||E==="failed"||E==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}).data?.status;if(T.useEffect(()=>{if(!e||!a||!b)return;if(b==="completed"||b==="partial"){f({flowVersion:st,onboardingSessionId:u,event:"onboarding.step_completed",step:"run",method:"automatic"},"onboarding.step_completed:run"),Zu(a);return}if(b!=="failed"&&b!=="cancelled")return;const N=b==="cancelled"?"run_cancelled":"run_failed";f({flowVersion:st,onboardingSessionId:u,event:"onboarding.blocked",step:"run",action:"retry_run",reasonCode:N},`onboarding.blocked:run:${N}`),Zu(a)},[f,a,u,e,b]),!e)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project not found"}),c.jsx("p",{className:"page-subtitle",children:"This setup link does not identify a project."})]})}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{s({to:"/projects"})},children:"View projects"})]});if(r.isPending)return c.jsxs("div",{className:"page-container max-w-3xl","aria-busy":"true","aria-live":"polite",children:[c.jsx(ir,{current:"site"}),c.jsxs("div",{className:"mt-8 flex items-center gap-3 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading Site Health setup…"]})]});if(r.isError)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Can’t resume setup"}),c.jsx("p",{className:"page-subtitle",children:"Canonry could not load the project for this Site Health scan."})]})}),c.jsxs("div",{className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",children:[c.jsx("p",{className:"text-sm text-secondary",children:"Check the connection or sign in again, then retry."}),c.jsx(fe,{type:"button",className:"mt-4",variant:"secondary",onClick:()=>{r.refetch()},children:"Retry project check"})]})]});const v=r.data.find(N=>N.name===e);if(!v)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project not found"}),c.jsxs("p",{className:"page-subtitle",children:["Canonry could not find ",e,". It will not open a different project."]})]})}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{s({to:"/projects"})},children:"View projects"})]});const k=()=>{s({to:"/setup",search:{onboarding:"site-health",setupProject:v.name},replace:!0})},S=()=>{s({to:"/setup",search:{experience:"legacy",onboarding:"site-health",setupProject:v.name},replace:!0})},A=()=>{f({flowVersion:st,onboardingSessionId:u,event:"onboarding.step_completed",step:"run",method:"skipped"},"onboarding.step_completed:run"),s({to:"/projects/$projectName/technical-aeo",params:{projectName:v.name},replace:!0})};return c.jsxs("div",{className:"page-container max-w-7xl py-8 md:py-10",children:[c.jsx("h1",{className:"sr-only",children:"Set up Canonry"}),c.jsx(T.Suspense,{fallback:c.jsxs("div",{className:"space-y-5",children:[c.jsx(ir,{current:"site"}),c.jsxs("div",{className:"flex min-h-72 items-center justify-center gap-3 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading Site Health…"]})]}),children:c.jsx(wK,{projectName:v.name,projectId:v.id,initialRunId:a,onReleaseInitialRun:k,showOnboardingActions:!0,onContinueOnboarding:S,onSkipOnboarding:A})})]})}function PK(){const e=Dx({from:"/setup"}),a=e.onboarding==="site-health"&&!e.setupProject,s=e.onboarding==="site-health"&&e.experience!=="legacy",r=lI(),u=e.experience==="legacy"?"legacy":e.experience==="platform"?"platform":r,[f,g]=T.useState(!1),b=Et({...Zs({client:se}),enabled:u==="auto",retry:!1,refetchOnMount:"always"}),v=u==="auto"&&b.isSuccess&&b.isFetchedAfterMount&&b.data.length===0;T.useEffect(()=>{v&&g(!0)},[v]);const k=u!=="auto"?{state:"idle"}:b.isSuccess&&b.isFetchedAfterMount?{state:"success",projectCount:b.data.length}:b.isError?{state:"error"}:{state:"loading"},S=u==="legacy"?"legacy":f||v?"platform":CK(u,k);return a||s?c.jsx(qK,{projectName:e.setupProject,initialRunId:e.siteHealthRunId}):S==="legacy"?c.jsx(xK,{visibilityProjectName:e.setupProject,siteHealthOnboarding:e.onboarding==="site-health"}):S==="loading"?c.jsx(DK,{}):S==="retry"?c.jsx(OK,{onRetry:()=>{b.refetch()}}):c.jsx(MK,{onActivationStarted:()=>g(!0),skipSiteScan:e.siteScan==="skip"})}function MK({onActivationStarted:e,skipSiteScan:a}){return c.jsx(Ef,{title:"Site Health setup",children:c.jsx(IK,{onActivationStarted:e,skipSiteScan:a})})}function IK({onActivationStarted:e,skipSiteScan:a}){const s=Hs(),r=da(),u=pK(),f=Et({...FV({client:se}),retry:!1}),g=ns(ZV()),[b,v]=T.useState(""),[k,S]=T.useState(""),[A,N]=T.useState(""),[E,Z]=T.useState("US"),[_,G]=T.useState("en"),[K,te]=T.useState(!1),[Q,re]=T.useState("idle"),[W,oe]=T.useState(null),[H,$]=T.useState(null),[Te,Ke]=T.useState(!1),[Fe,Re]=T.useState(null),[ve,Ue]=T.useState(!1),be=f.isError?void 0:f.data,P=typeof be?.enabled=="boolean"?be.enabled:null,ae=g.isPending?g.variables.body.enabled:P,[he,je]=T.useState(null),X=T.useRef(null),{onboardingSessionId:Ie,emit:Ne}=O3("platform");T.useEffect(()=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.started",step:"project",resumed:!1},"onboarding.started")},[Ne,Ie]);const Ae=EK(b),ne=k||Ae?.projectName||"",V=A||Ae?.displayName||"",q=Q==="creating"||Q==="dispatching",le=H??Fe,De=NK(E,_),{countryValid:ye,languageValid:Je}=_K(E,_),Ge=ye&&Je;T.useEffect(()=>{le&&X.current?.focus()},[le]);const Be=(Ve,ut)=>s({to:"/setup",search:{...ut?{siteHealthRunId:ut}:{},onboarding:"site-health",setupProject:Ve.name},replace:!0}),de=async Ve=>{re("dispatching"),Re(null);try{const ut=u.mutateAsync({projectName:Ve.name,projectId:Ve.id,projectLabel:Ve.displayName||Ve.name,suppressErrorToast:!0,body:{checkDeadLinks:!0}}),Jt=await TK(ut);if(Jt.state==="queued"){Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"queued",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0"}),await Be(Ve,Jt.run.runId);return}ut.then(()=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"queued",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0"})},us=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"rejected",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0",reasonCode:Al(us,"run_rejected")})}),RK(ut,Ve.id),await Be(Ve)}catch(ut){re("recovery"),Re(Tx(ut,"The project was created, but the Site Health scan could not be started."));const Jt=Al(ut,"run_rejected");Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"rejected",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0",reasonCode:Jt}),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.blocked",step:"run",action:"retry_run",reasonCode:Jt},`onboarding.blocked:run:${Jt}`)}},Me=async Ve=>{if(Ve.preventDefault(),!(!Ae||!a&&!K||!Ge||q)){re("creating"),$(null),Ke(!1),Re(null);try{const ut=await _I({name:ne,displayName:V,canonicalDomain:Ae.canonicalDomain,country:E,language:_});if(e(),oe(ut),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.step_completed",step:"project",method:"manual"},"onboarding.step_completed:project"),await r.invalidateQueries({queryKey:ts({client:se})}),a){await s({to:"/setup",search:{experience:"legacy",onboarding:"first-run",setupProject:ut.name},replace:!0});return}await de(ut)}catch(ut){re("idle");const Jt=ut instanceof fn&&ut.statusCode===409;Ke(Jt),$(Tx(ut,"Could not create the project. Try again.")),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.blocked",step:"project",action:"save",reasonCode:Al(ut,"project_create_failed")},"onboarding.blocked:project"),Jt&&(e(),r.invalidateQueries({queryKey:ts({client:se})}))}}},$t=()=>{W&&!q&&de(W)},Sn=()=>{q||s({to:"/projects"})},ga=async()=>{try{await navigator.clipboard.writeText(AK),Ue(!0)}catch{rn({tone:"negative",title:"Could not copy setup request",detail:"Open the agent quickstart to continue with the CLI instead."})}},ln=async Ve=>{je(null);try{const ut=await g.mutateAsync({client:se,body:{enabled:Ve}});r.setQueryData(KS({client:se}),ut),ut.enabled!==Ve&&je(`The server kept telemetry ${ut.enabled?"on":"off"}. Check its telemetry settings.`)}catch{je("Could not update telemetry. Try again.")}};return W&&Q==="recovery"?c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx(ir,{current:"site"}),c.jsx("div",{className:"page-header mt-8",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project created"}),c.jsxs("p",{className:"page-subtitle",children:[W.displayName||W.name," is ready. The Site Health scan needs another try."]})]})}),c.jsxs("div",{ref:X,className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:Fe}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:"You can retry the scan or continue setup and retry from Site Health."}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[c.jsx(fe,{type:"button",onClick:$t,children:"Retry Site Health scan"}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{Be(W)},children:"Continue setup"})]})]})]}):c.jsxs("div",{className:"page-container max-w-xl py-8 md:py-12",children:[a?null:c.jsx(ir,{current:"site"}),c.jsxs("header",{className:`mb-8 ${a?"":"mt-8"}`,children:[c.jsx("h1",{id:"site-map-setup-title",className:"text-2xl font-semibold tracking-[-0.025em] text-heading",children:a?"Create a project":"Map your site"}),c.jsx("p",{className:"mt-2 max-w-lg text-sm leading-6 text-secondary",children:a?"Add a public domain, then choose the queries you want to track. No site scan will run.":"Enter your public website to see its pages, structure, internal links, and technical SEO scores."})]}),c.jsxs("form",{"aria-labelledby":"site-map-setup-title",className:"space-y-6",onSubmit:Ft(Me),noValidate:!0,children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-heading",htmlFor:"launchpad-domain",children:"Website URL"}),c.jsx("input",{id:"launchpad-domain",className:"h-11 w-full rounded-md border border-strong bg-bg-elevated/50 px-3 text-base text-heading outline-none transition placeholder:text-muted focus:border-mono-500 focus:ring-1 focus:ring-mono-500",type:"text",inputMode:"url",autoComplete:"url",autoCapitalize:"none",spellCheck:!1,required:!0,"aria-invalid":!!(b&&!Ae),"aria-describedby":b&&!Ae?"launchpad-domain-hint launchpad-domain-error":"launchpad-domain-hint",placeholder:"https://example.com",value:b,onChange:Ve=>{v(Ve.target.value),$(null),Ke(!1)}}),c.jsx("p",{id:"launchpad-domain-hint",className:"text-sm text-secondary",children:a?c.jsxs(c.Fragment,{children:["A public domain is still required."," ",c.jsx(tt,{to:"/setup",search:{experience:"platform"},className:"font-medium text-link underline-offset-4 hover:underline",children:"Map with Site Health instead"})]}):c.jsxs(c.Fragment,{children:["Only public pages are scanned."," ",c.jsx(tt,{to:"/setup",search:{experience:"platform",onboarding:"first-run",siteScan:"skip"},className:"font-medium text-link underline-offset-4 hover:underline",children:"Set up without a site scan"})]})}),b&&!Ae?c.jsx("p",{id:"launchpad-domain-error",className:"text-sm text-negative",role:"alert",children:"Enter a public domain, such as example.com."}):null]}),c.jsxs("details",{className:"group border-y border-default",children:[c.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 py-3 text-sm [&::-webkit-details-marker]:hidden",children:[c.jsx("span",{className:"font-medium text-heading",children:"Advanced settings"}),c.jsxs("span",{className:"flex items-center gap-2 text-secondary",children:[De,c.jsx(Xu,{className:"size-4 transition-transform group-open:rotate-180 motion-reduce:transition-none","aria-hidden":"true"})]})]}),c.jsxs("div",{className:"space-y-5 border-t border-default py-4",children:[Ae?c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-medium text-heading",children:"Project"}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-project-name",children:"Project name"}),c.jsx("input",{id:"launchpad-project-name",className:"setup-input h-10",type:"text",value:ne,onChange:Ve=>S(Ve.target.value)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-display-name",children:"Display name"}),c.jsx("input",{id:"launchpad-display-name",className:"setup-input h-10",type:"text",value:V,onChange:Ve=>N(Ve.target.value)})]})]})]}):null,c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-medium text-heading",children:"Locale"}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-country",children:"Country"}),c.jsx("select",{id:"launchpad-country",className:"setup-input h-10",value:E,onChange:Ve=>Z(Ve.target.value),children:R3.map(Ve=>c.jsx("option",{value:Ve.value,children:Ve.label},Ve.value))})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-language",children:"Language"}),c.jsx("select",{id:"launchpad-language",className:"setup-input h-10",value:_,onChange:Ve=>G(Ve.target.value),children:D3.map(Ve=>c.jsx("option",{value:Ve.value,children:Ve.label},Ve.value))})]})]})]})]})]}),a?null:c.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start gap-3 py-2",children:[c.jsx("input",{className:"mt-0.5 size-4 shrink-0 rounded border-strong bg-bg",type:"checkbox",checked:K,onChange:Ve=>te(Ve.target.checked),"aria-label":"Allow Canonry to scan this public site.","aria-describedby":"local-crawl-note"}),c.jsxs("span",{className:"grid gap-0.5",children:[c.jsx("span",{className:"text-sm leading-5 text-heading",children:"Allow Canonry to scan this public site."}),c.jsx("span",{id:"local-crawl-note",className:"text-sm leading-5 text-secondary",children:"The crawl runs on this Canonry instance, follows internal links, and stores its results locally."})]})]}),le?c.jsxs("div",{ref:X,className:"rounded-md border border-negative bg-negative-soft p-3",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:le}),Te?c.jsx(fe,{type:"button",variant:"secondary",size:"sm",className:"mt-3",onClick:Sn,children:"View projects"}):null]}):null,c.jsxs("div",{className:"grid gap-2",children:[c.jsx(fe,{className:"h-11 w-full",type:"submit",disabled:!Ae||!a&&!K||!Ge||q,children:Q==="creating"||Q==="dispatching"?c.jsxs(c.Fragment,{children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"})," ",a?"Creating project…":"Mapping site…"]}):a?"Create project":"Map site"}),Q==="dispatching"?c.jsx("span",{className:"text-center text-sm text-secondary",role:"status",children:"Opening Site Health when the scan is ready."}):null]})]}),c.jsxs("section",{className:"mt-8 border-t border-default pt-6","aria-labelledby":"agent-setup-title",children:[c.jsx("p",{id:"agent-setup-title",className:"text-sm font-medium text-heading",children:"Use your agent instead"}),c.jsx("p",{className:"mt-1 text-sm leading-5 text-secondary",children:"Copy a complete CLI setup request into any coding agent."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1",children:[c.jsxs(fe,{type:"button",variant:"ghost",size:"sm",className:"-ml-3",onClick:Ft(ga),children:[ve?c.jsx(Jh,{className:"size-3.5","aria-hidden":"true"}):c.jsx($x,{className:"size-3.5","aria-hidden":"true"}),c.jsx("span",{"aria-live":"polite",children:ve?"Copied setup request":"Copy setup request"})]}),c.jsx(fe,{asChild:!0,variant:"ghost",size:"sm",children:c.jsxs("a",{href:jK,target:"_blank",rel:"noopener noreferrer",children:["Agent quickstart",c.jsx(gA,{className:"size-3.5","aria-hidden":"true"}),c.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})})]})]}),P!==null?c.jsxs("section",{className:"mt-6 border-t border-default pt-5","aria-labelledby":"telemetry-title",children:[c.jsxs("label",{className:`flex min-h-11 items-start gap-3 py-2 ${g.isPending?"cursor-wait":"cursor-pointer"}`,children:[c.jsx("input",{className:"mt-0.5 size-4 shrink-0 rounded border-strong bg-bg accent-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mono-500 disabled:cursor-wait",type:"checkbox",checked:ae??!1,disabled:g.isPending,onChange:Ve=>{ln(Ve.target.checked)},"aria-describedby":"telemetry-detail"}),c.jsxs("span",{className:"grid gap-0.5",children:[c.jsx("span",{id:"telemetry-title",className:"text-sm leading-5 text-heading",children:"Share anonymous product telemetry"}),c.jsx("span",{id:"telemetry-detail",className:"max-w-[70ch] text-sm leading-5 text-secondary",children:"Helps prioritize improvements. Canonry does not send raw domains, URLs, queries, answer content, or credentials."})]})]}),g.isPending?c.jsx("p",{className:"mt-1 text-sm text-secondary",role:"status",children:"Saving preference…"}):null,he?c.jsx("p",{className:"mt-1 text-sm text-negative",role:"alert",children:he}):null]}):null]})}function VK(){return c.jsx("div",{className:"page-container",children:c.jsx("section",{className:"page-section",children:c.jsxs(ua,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Route not found"}),c.jsx("p",{children:"The current path does not map to a dashboard view."}),c.jsx(fe,{asChild:!0,children:c.jsx(tt,{to:"/",children:"Return to overview"})})]})})})}const Yn=as(()=>yi(()=>import("./ProjectPage-Bdq_KTXX.js"),__vite__mapDeps([5,1,2,6,0,3,4,7,8,9,10,11,12]),import.meta.url),"ProjectPage"),LK=as(()=>yi(()=>import("./RunsPage-CdKorpOj.js"),__vite__mapDeps([13,1,6,11,4,2,9,12]),import.meta.url),"RunsPage"),UK=as(()=>yi(()=>import("./HistoryPage-C9j3RzMN.js"),__vite__mapDeps([14,1,10,11,4,2,9,12]),import.meta.url),"HistoryPage"),GK=as(()=>yi(()=>import("./SettingsPage-BOjZh2vW.js"),__vite__mapDeps([15,1,11,4,2,9,12]),import.meta.url),"SettingsPage"),$K=as(()=>yi(()=>import("./BacklinksPage-D2YWJUf9.js"),__vite__mapDeps([16,1,2,11,4,9,12]),import.meta.url),"BacklinksPage"),KK=as(()=>yi(()=>import("./TrafficPage-BCodKdgN.js"),__vite__mapDeps([17,1,7,2,11,4,9,12]),import.meta.url),"TrafficPage"),HK=as(()=>yi(()=>import("./TrafficSourceDetailPage-D_zueOK5.js"),__vite__mapDeps([18,1,7,3,4,2,11,9,12]),import.meta.url),"TrafficSourceDetailPage"),QK=as(()=>yi(()=>import("./MeasurementPropertyPage-Ci3CUr7Q.js"),__vite__mapDeps([19,1,3,4,8,9,2,11,12]),import.meta.url),"MeasurementPropertyPage");function FK(){return c.jsx(K$,{children:c.jsx($$,{})})}const kn=K4()({component:FK,validateSearch:e=>({manageQueries:e.manageQueries===!0||e.manageQueries==="true"?!0:void 0,runId:typeof e.runId=="string"?e.runId:void 0,siteHealthRunId:typeof e.siteHealthRunId=="string"?e.siteHealthRunId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0,runStatus:typeof e.runStatus=="string"?e.runStatus:void 0,runKind:typeof e.runKind=="string"?e.runKind:void 0,runProject:typeof e.runProject=="string"?e.runProject:void 0,runWindow:typeof e.runWindow=="string"?e.runWindow:void 0,runQuery:typeof e.runQuery=="string"?e.runQuery:void 0,onboarding:e.onboarding==="site-health"||e.onboarding==="first-run"?e.onboarding:void 0,experience:e.experience==="legacy"||e.experience==="platform"?e.experience:void 0,siteScan:e.siteScan==="skip"?"skip":void 0,setupProject:typeof e.setupProject=="string"?e.setupProject:void 0,scope:typeof e.scope=="string"?e.scope:void 0,class:typeof e.class=="string"?e.class:void 0,...Object.fromEntries(["queryWorkspace","researchMode","trackingQueryId","measurementScope","measurementScopeKey","measurementMarketKey","queryClass","measurementProvider","measurementModel","measurementLocation","measurementFrom","measurementTo","measurementRevision","measurementRunId","measurementQueryKey","measurementAnswer"].map(a=>[a,typeof e[a]=="string"?e[a]:void 0]))})}),ZK=St({getParentRoute:()=>kn,path:"/",component:Y$,beforeLoad:async({context:e})=>{let a=e.queryClient.getQueryData(ts({client:se}));if(a===void 0)try{a=await e.queryClient.ensureQueryData(Zs({client:se}))}catch{return}if(a.length===0)throw qx({to:"/setup"})}}),YK=St({getParentRoute:()=>kn,path:"/projects",component:eK}),XK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,wn=St({getParentRoute:()=>kn,path:"/projects/$projectName",component:()=>c.jsx(hh,{}),beforeLoad:async({context:e,params:a,location:s})=>{const r=a.projectName;if(!XK.test(r))return;let u=e.queryClient.getQueryData(ts({client:se}));if(!u)try{u=await e.queryClient.ensureQueryData(Zs({client:se}))}catch{return}const f=u.find(g=>g.id===r);if(f)throw qx({to:s.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(f.name)}`),replace:!0})}}),JK=St({getParentRoute:()=>wn,path:"/",component:()=>c.jsx(Yn,{tab:"overview"})}),WK=St({getParentRoute:()=>wn,path:"/portfolio",component:()=>c.jsx(Yn,{tab:"portfolio"})}),eH=St({getParentRoute:()=>wn,path:"/search-console",component:()=>c.jsx(Yn,{tab:"search-console"})}),tH=St({getParentRoute:()=>wn,path:"/conversions",component:()=>c.jsx(Yn,{tab:"conversions"})}),nH=St({getParentRoute:()=>wn,path:"/local",component:()=>c.jsx(Yn,{tab:"local"})}),aH=St({getParentRoute:()=>wn,path:"/discovery",component:()=>c.jsx(Yn,{tab:"discovery"})}),iH=St({getParentRoute:()=>wn,path:"/queries",component:()=>c.jsx(Yn,{tab:"queries"})}),sH=St({getParentRoute:()=>wn,path:"/properties/$targetKey",component:()=>c.jsx(QK,{})}),oH=St({getParentRoute:()=>wn,path:"/report",component:()=>c.jsx(Yn,{tab:"report"})}),rH=St({getParentRoute:()=>wn,path:"/activity",component:()=>c.jsx(Yn,{tab:"activity"})}),lH=St({getParentRoute:()=>wn,path:"/backlinks",component:()=>c.jsx(Yn,{tab:"backlinks"})}),cH=St({getParentRoute:()=>wn,path:"/technical-aeo",component:()=>c.jsx(Yn,{tab:"technical-aeo"})}),uH=St({getParentRoute:()=>wn,path:"/history",component:()=>c.jsx(Yn,{tab:"history"})}),dH=St({getParentRoute:()=>wn,path:"/settings",component:()=>c.jsx(Yn,{tab:"settings"})}),mH=St({getParentRoute:()=>kn,path:"/runs",component:LK}),pH=St({getParentRoute:()=>kn,path:"/history",component:UK}),hH=St({getParentRoute:()=>kn,path:"/settings",component:GK,beforeLoad:({context:e})=>{}}),fH=St({getParentRoute:()=>kn,path:"/setup",component:PK}),gH=St({getParentRoute:()=>kn,path:"/backlinks",component:$K}),yH=St({getParentRoute:()=>kn,path:"/traffic",component:KK}),bH=St({getParentRoute:()=>kn,path:"/traffic/$projectName/$sourceId",component:HK}),vH=St({getParentRoute:()=>kn,path:"*",component:VK}),xH=kn.addChildren([ZK,YK,wn.addChildren([JK,WK,eH,tH,nH,aH,iH,sH,oH,rH,lH,cH,uH,dH]),mH,pH,hH,fH,gH,yH,bH,vH]);function kH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Rx=kH(),wH=Rx==="/"?"":Rx.replace(/\/$/,"");function SH(e,a){return H4({routeTree:xH,basepath:wH||"/",context:{queryClient:e},...a?.initialEntries})}const jH=6e4;function AH(){const e=T.useRef(AI()).current,[a,s]=T.useState(e?"ready":"checking"),[r,u]=T.useState(null),[f,g]=T.useState(null),[b,v]=T.useState(e),[k,S]=T.useState(!1),[A,N]=T.useState(""),[E,Z]=T.useState(""),[_,G]=T.useState(""),[K,te]=T.useState(!1),[Q,re]=T.useState("password"),[W,oe]=T.useState(null),[H,$]=T.useState(!1),[Te,Ke]=T.useState(!1),Fe=T.useRef(null),Re=T.useRef(null),ve=T.useRef(null),Ue=()=>{const q=r?`${r.name}:${r.role}`:e?"api-key:explicit":f?`api-key:${f.id}`:"no-accounts";if(!Fe.current||ve.current!==q){Re.current?.clear();const le=sV();Re.current=le,Fe.current=SH(le),ve.current=q}return{queryClient:Re.current,router:Fe.current}},be=q=>q.authRequired?(S(!0),u(q.user),g(null),v(!1),s(q.user?"ready":"account-login"),!0):!1;T.useEffect(()=>{let q=!1;const le=async(De,ye=!1)=>{try{const Je=await lh();if(q)return;g(Je),v(!1),s("ready")}catch(Je){if(q)return;if(ye&&Je instanceof fn&&Je.statusCode===401)return PI().then(()=>{q||(oe(null),g(null),v(!1),Ke(!0),s("login"))}).catch(Ge=>{q||(oe(Ge instanceof Error?Ge.message:"Could not clear the invalid session"),s(De))});oe(Je instanceof Error?Je.message:"Could not verify API key access"),s(De)}};return e?(le("api-key-error"),()=>{q=!0}):(Promise.allSettled([Gv(),Uv()]).then(([De,ye])=>{if(q||De.status==="fulfilled"&&be(De.value))return;if(ye.status==="rejected"){const Ge=ye.reason;oe(Ge instanceof Error?Ge.message:"Failed to reach the Canonry API"),s("login");return}const Je=ye.value;Je.authenticated?(v(!0),le("api-key-error",!0)):(g(null),v(!1),s(Je.setupRequired?"setup":"login"))}),()=>{q=!0})},[]),T.useEffect(()=>{if(a!=="ready"||e)return;const q=setInterval(()=>{if(k){Gv().then(le=>{le.authRequired&&!le.user&&(Ke(!0),u(null),g(null),s("account-login"))}).catch(()=>{});return}Uv().then(le=>{le.authenticated||(Ke(!0),g(null),s(le.setupRequired?"setup":"login"))}).catch(()=>{})},jH);return Lv(()=>{Ke(!0),u(null),g(null),v(!1),s(k?"account-login":"login")}),()=>{clearInterval(q),Lv(null)}},[a,k,e]);const P=async q=>{if(q.preventDefault(),!E.trim()||E.trim().length<8){oe("Password must be at least 8 characters");return}if(E!==_){oe("Passwords do not match");return}$(!0),oe(null);try{if(!(await OI(E.trim())).authenticated){oe("Setup failed");return}Z(""),G(""),te(!1),Ke(!1),g(null),v(!0),s("checking");try{const De=await lh();g(De),v(!1),s("ready")}catch(De){oe(De instanceof Error?De.message:"Could not verify API key access"),s("api-key-error")}}catch(le){oe(le instanceof fn||le instanceof Error?le.message:"Setup failed")}finally{$(!1)}},ae=q=>{Z(q),oe(null)},he=q=>{G(q),oe(null)},je=async q=>{if(q.preventDefault(),!!E.trim()){$(!0),oe(null);try{if(!(Q==="api-key"?await BI(E.trim()):await qI(E.trim())).authenticated){oe(Q==="api-key"?"Invalid API key":"Incorrect password");return}const De=await lh();g(De),v(!1),Z(""),te(!1),Ke(!1),s("ready")}catch(le){oe(le instanceof fn||le instanceof Error?le.message:"Authentication failed")}finally{$(!1)}}},X=q=>{re(q),Z(""),te(!1),oe(null)},Ie=async q=>{if(q.preventDefault(),!(!A.trim()||!E)){$(!0),oe(null);try{const le=await MI(A.trim(),E);if(!le.user){oe("Incorrect name or password.");return}Z(""),Ke(!1),u(le.user),g(null),v(!1),s("ready")}catch(le){oe(le instanceof fn?le.message:"Incorrect name or password.")}finally{$(!1)}}};if(a==="ready"){const{queryClient:q,router:le}=Ue();return c.jsx(ZI,{account:r,apiKey:f,apiKeyPending:b,children:c.jsx(Q4,{client:q,children:c.jsx(F4,{router:le})})})}const Ne=E.trim(),Ae=E.length>0&&Ne.length<8,ne=_.length>0&&E!==_,V=Ne.length>=8&&E===_;return c.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:c.jsxs("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md flex-col items-center justify-center gap-5",children:[c.jsxs("div",{"data-testid":"auth-brand",className:"flex items-center gap-2.5",children:[c.jsx("img",{className:"size-7",src:"./favicon.svg",alt:"","aria-hidden":"true"}),c.jsx("span",{className:"text-lg font-semibold tracking-tight text-heading",children:"Canonry"})]}),c.jsx(ua,{className:"surface-card w-full",children:a==="checking"?c.jsx(Ms,{className:"py-8",children:c.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):a==="api-key-error"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Could not verify API key access"})]}),c.jsxs(Ms,{className:"space-y-4",children:[c.jsx("p",{className:"supporting-copy",children:W??"Canonry could not verify this session’s access, so the dashboard stayed locked."}),c.jsx(fe,{type:"button",className:"w-full",onClick:()=>{window.location.reload()},children:"Try again"})]})]}):a==="account-login"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Sign in to Canonry"})]}),c.jsxs(Ms,{children:[Te?c.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"You were signed out — please sign in again."}):null,c.jsxs("form",{className:"space-y-4",onSubmit:Ft(Ie),children:[c.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-name",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:"Name"}),c.jsx("input",{autoFocus:!0,id:"account-name",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"text",name:"username",autoComplete:"username",value:A,onChange:q=>{N(q.target.value),oe(null)},"aria-invalid":!!W,"aria-describedby":W?"account-login-error":void 0})]}),c.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-password",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),c.jsx("input",{id:"account-password",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",name:"password",autoComplete:"current-password",value:E,onChange:q=>ae(q.target.value),"aria-invalid":!!W,"aria-describedby":W?"account-login-error":void 0})]}),W?c.jsx("p",{id:"account-login-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!A.trim()||!E,children:H?"Signing in…":"Sign in"})]})]})]}):a==="setup"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Create a dashboard password"}),c.jsx(Qu,{children:"Stored on this Canonry install as a salted, one-way hash. Canonry cannot recover it."})]}),c.jsx(Ms,{children:c.jsxs("form",{className:"space-y-4",onSubmit:Ft(P),children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"block text-xs font-medium text-secondary",htmlFor:"dashboard-password-new",children:"Password"}),c.jsx("input",{autoFocus:!0,id:"dashboard-password-new",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:"new-password",autoComplete:"new-password",minLength:8,required:!0,value:E,onChange:q=>ae(q.target.value),"aria-invalid":Ae,"aria-describedby":"dashboard-password-new-help"}),c.jsx("span",{id:"dashboard-password-new-help","aria-live":"polite",className:Ae?"block text-sm text-negative-400":"block text-sm text-secondary",children:Ae?"Enter at least 8 characters.":"Use at least 8 characters."})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"block text-xs font-medium text-secondary",htmlFor:"dashboard-password-confirm",children:"Confirm password"}),c.jsx("input",{id:"dashboard-password-confirm",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:"confirm-password",autoComplete:"new-password",minLength:8,required:!0,value:_,onChange:q=>he(q.target.value),"aria-invalid":ne,"aria-describedby":"dashboard-password-confirm-help"}),c.jsx("span",{id:"dashboard-password-confirm-help","aria-live":"polite",className:ne?"block text-sm text-negative-400":"block text-sm text-secondary",children:ne?"Passwords do not match.":"Enter the same password again."})]}),c.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary",htmlFor:"dashboard-password-show",children:[c.jsx("input",{id:"dashboard-password-show",type:"checkbox",checked:K,onChange:q=>te(q.target.checked)}),"Show passwords"]}),W?c.jsx("p",{id:"dashboard-password-setup-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!V,children:H?"Creating password…":"Create password and continue"})]})})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Sign in to Canonry"}),c.jsx(Qu,{children:Q==="api-key"?"Enter an API key from this Canonry install. This opens the dashboard with that key’s access and does not change the password.":"Enter your dashboard password to continue."})]}),c.jsxs(Ms,{children:[Te?c.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,c.jsxs("form",{className:"space-y-4",onSubmit:Ft(je),children:[c.jsxs("label",{className:"block space-y-1.5",htmlFor:"dashboard-password-current",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:Q==="api-key"?"Canonry API key":"Password"}),c.jsx("input",{autoFocus:!0,id:"dashboard-password-current",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:Q==="api-key"?"apiKey":"password",autoComplete:Q==="api-key"?"off":"current-password",spellCheck:!1,required:!0,value:E,onChange:q=>ae(q.target.value),"aria-invalid":!!W,"aria-describedby":W?"dashboard-password-login-error":void 0})]}),c.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary",htmlFor:"dashboard-login-password-show",children:[c.jsx("input",{id:"dashboard-login-password-show",type:"checkbox",checked:K,onChange:q=>te(q.target.checked)}),Q==="api-key"?"Show API key":"Show password"]}),W?c.jsx("p",{id:"dashboard-password-login-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!E.trim(),children:H?"Signing in…":"Open dashboard"}),c.jsx(fe,{type:"button",variant:"ghost",onClick:()=>X(Q==="api-key"?"password":"api-key"),children:Q==="api-key"?"Use dashboard password instead":"Forgot password? Use API key"})]})]})]})})]})})}const q3=document.getElementById("root");if(!q3)throw new Error("Expected #root element for web app bootstrap.");SA.createRoot(q3).render(c.jsx(T.StrictMode,{children:c.jsx(AH,{})}));export{HZ as $,GF as A,fe as B,Uu as C,LF as D,$F as E,GQ as F,VF as G,LZ as H,yl as I,$Z as J,GZ as K,JQ as L,MY as M,XQ as N,lF as O,dG as P,rn as Q,QZ as R,lV as S,pn as T,FZ as U,aF as V,ZZ as W,iF as X,eF as Y,nF as Z,KZ as _,PY as a,sF as a$,UZ as a0,WQ as a1,YZ as a2,aY as a3,WZ as a4,tY as a5,eY as a6,nY as a7,CF as a8,vf as a9,RH as aA,nV as aB,nZ as aC,on as aD,kV as aE,$V as aF,lZ as aG,pZ as aH,cZ as aI,rQ as aJ,cQ as aK,EO as aL,uQ as aM,RV as aN,rZ as aO,RO as aP,qh as aQ,lQ as aR,fI as aS,uZ as aT,oZ as aU,OV as aV,dZ as aW,VY as aX,mZ as aY,kY as aZ,wY as a_,ze as aa,JZ as ab,ZS as ac,gi as ad,XZ as ae,HY as af,qT as ag,BT as ah,OH as ai,DH as aj,zF as ak,qF as al,BF as am,fn as an,PF as ao,OQ as ap,cV as aq,fU as ar,Ph as as,MF as at,Tu as au,gY as av,d_ as aw,Hh as ax,Ps as ay,tF as az,$9 as b,eQ as b$,gf as b0,fY as b1,MV as b2,bZ as b3,xZ as b4,_Z as b5,MZ as b6,PZ as b7,CZ as b8,qZ as b9,wQ as bA,fQ as bB,gQ as bC,kQ as bD,xQ as bE,vQ as bF,yQ as bG,bQ as bH,hQ as bI,pQ as bJ,mQ as bK,dQ as bL,uB as bM,ZH as bN,KH as bO,HH as bP,QH as bQ,YH as bR,FH as bS,WH as bT,hY as bU,XH as bV,JH as bW,gF as bX,GH as bY,KY as bZ,nQ as b_,VZ as ba,wZ as bb,EZ as bc,TZ as bd,RZ as be,kZ as bf,zZ as bg,SZ as bh,DZ as bi,jZ as bj,OZ as bk,NZ as bl,BZ as bm,IZ as bn,lK as bo,AZ as bp,ge as bq,TQ as br,EQ as bs,zQ as bt,_Q as bu,AQ as bv,jQ as bw,NQ as bx,CQ as by,SQ as bz,O2 as c,lY as c$,aQ as c0,iQ as c1,$H as c2,tQ as c3,LQ as c4,VQ as c5,IQ as c6,yF as c7,QV as c8,vZ as c9,$Y as cA,mK as cB,hZ as cC,XF as cD,tZ as cE,JF as cF,fZ as cG,IY as cH,WF as cI,xn as cJ,NI as cK,hV as cL,v$ as cM,qQ as cN,EI as cO,BQ as cP,PQ as cQ,MQ as cR,ts as cS,xV as cT,jV as cU,UQ as cV,iY as cW,UI as cX,pF as cY,oY as cZ,rY as c_,QF as ca,Fv as cb,KQ as cc,HQ as cd,KF as ce,HF as cf,QQ as cg,FQ as ch,YQ as ci,ZQ as cj,Kl as ck,Zs as cl,TS as cm,YF as cn,ZF as co,n$ as cp,mG as cq,p3 as cr,yG as cs,h3 as ct,f3 as cu,AV as cv,Is as cw,Yu as cx,XV as cy,fK as cz,IF as d,_Y as d$,sY as d0,UF as d1,cF as d2,uF as d3,dF as d4,hF as d5,mF as d6,nr as d7,yf as d8,LY as d9,vY as dA,J$ as dB,oQ as dC,of as dD,FF as dE,yY as dF,xY as dG,jF as dH,sQ as dI,wF as dJ,SF as dK,kF as dL,bY as dM,K8 as dN,aZ as dO,eZ as dP,sZ as dQ,iZ as dR,PH as dS,yi as dT,fa as dU,BH as dV,hI as dW,SY as dX,AY as dY,jY as dZ,pK as d_,zd as da,wf as db,gZ as dc,yZ as dd,xI as de,RQ as df,DQ as dg,$Q as dh,oF as di,rF as dj,Ef as dk,Ed as dl,Sf as dm,hK as dn,fF as dp,ar as dq,Yv as dr,NF as ds,EF as dt,RF as du,DF as dv,_F as dw,TF as dx,OF as dy,AF as dz,dY as e,f$ as e0,MH as e1,OY as e2,qY as e3,BY as e4,CY as e5,NY as e6,qH as e7,EY as e8,DY as e9,zY as ea,RY as eb,ir as ec,IH as ed,TY as ee,v9 as ef,LH as eg,VH as eh,ua as f,cY as g,rx as h,se as i,gI as j,Sl as k,mn as l,Ft as m,uY as n,pY as o,mY as p,bF as q,xF as r,UH as s,dV as t,jf as u,vF as v,ha as w,UY as x,GY as y,$h as z};
86
+ competitor2.com`,value:kr,onChange:U=>ps(U.target.value)})]}),Qa?c.jsx("p",{className:"text-negative-400 text-sm",children:Qa}):null,c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:Ai,children:"Skip"}),c.jsx(fe,{type:"button",disabled:qa.length===0||Fa,onClick:Ft(Id),children:Fa?"Saving...":`Save ${qa.length} competitor${qa.length!==1?"s":""}`})]})]})]})]});case 4:{const U=Oa.data,Pe=U?.status??(Da===Ke?.id?Ke.status:void 0),yn=Pe==="completed"||Pe==="partial"||Pe==="failed"||Pe==="cancelled",Ba=U?.snapshots??[],lo=Ba.filter(ta=>ta.citationState==="cited").length,oc=Ba.filter(ta=>ta.answerMentioned===!0).length,vs=new Set(Ba.map(ta=>ta.query).filter(ta=>!!ta)).size,xs=Pe?_x(Pe,Ba.length):!1,Ar=Fe&&!Cn,dn=Za??(U?.error?cV(U.error):Pe==="cancelled"?"The sweep was cancelled before it produced a baseline.":(Pe==="completed"||Pe==="partial")&&Ba.length===0?"The sweep finished without producing any snapshots.":Ke?.statusDetail||"The sweep did not produce a baseline.");let Vn=null;return Ar||xs?Vn=c.jsx(pn,{tone:"positive",children:"Complete"}):Za&&!Cn?Vn=c.jsx(pn,{tone:"negative",children:"Failed"}):yn?Vn=c.jsx(pn,{tone:"negative",children:Pe==="cancelled"?"Cancelled":"Failed"}):Cn&&(Vn=c.jsx(pn,{tone:"caution",children:"Running"})),c.jsxs(ua,{className:"surface-card step-card",children:[c.jsxs("div",{className:"section-head",children:[c.jsxs("div",{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:N?"Step 2 of 2":"Step 5 of 5"}),c.jsx("h2",{children:Ps()?"AI Visibility":"Launch first run"})]}),Vn]}),Ar?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-secondary",children:["Setup is complete. ",c.jsx("span",{className:"text-strong font-medium",children:Be})," already has a successful answer-visibility baseline."]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:g?"Finish and open project":"Open project dashboard →"})]})]}):!Cn&&Ps()?c.jsxs("div",{className:"compact-stack",children:[Be?c.jsx(v$,{projectName:Be}):c.jsx("p",{className:"text-sm text-secondary",children:Hh}),Za&&c.jsx("p",{role:"alert",className:"text-sm text-negative",children:Za}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:"Open project dashboard →"})]})]}):Cn?yn?xs?c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"text-neutral",children:["Sweep complete. Your first answer-visibility snapshot for"," ",c.jsx("span",{className:"text-heading font-medium",children:Be}),":"]}),c.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Mentioned"}),c.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[oc,c.jsxs("span",{className:"text-faint text-lg",children:[" / ",vs]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries naming your brand"})]}),c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Cited"}),c.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[lo,c.jsxs("span",{className:"text-faint text-lg",children:[" / ",vs]})]}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries citing your site"})]}),c.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[c.jsx("p",{className:"text-xs font-medium text-secondary",children:"Results"}),c.jsx("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:Ba.length}),c.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"completed engine checks"})]})]}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:g?"Your project is ready. Review the evidence in the project.":"Open the project to review the evidence."}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",onClick:ln,children:g?"Finish and open project":"Open project dashboard →"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:dn}),c.jsx("p",{className:"mt-1 text-xs text-secondary",children:Ps()?Hh:v?"Fix provider or query configuration if needed, then retry without leaving setup.":"Ask an administrator to review the provider and query configuration."})]}),c.jsxs("div",{className:"setup-nav",children:[v&&!Ps()?c.jsx(fe,{type:"button",variant:"outline",asChild:!0,children:c.jsx(tt,{to:"/settings",children:"Configure providers"})}):c.jsx("span",{}),Ps()||!v?c.jsx(fe,{type:"button",onClick:ln,children:"Open project dashboard →"}):c.jsx(fe,{type:"button",disabled:hs||!!_n,onClick:Ft(Wn),children:hs?"Retrying...":"Retry visibility sweep"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsx("p",{className:"text-neutral",children:"Sweep running. This usually takes 30 to 60 seconds."}),c.jsx("div",{className:"rounded-md border border-default bg-surface p-3 text-xs text-muted",children:c.jsxs("p",{children:["Status: ",c.jsx("span",{className:"text-neutral",children:Pe??"queued"})]})}),Oa.isError&&c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:Oa.error instanceof Error?Oa.error.message:"Could not refresh the sweep status."}),c.jsx(fe,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>{Oa.refetch()},children:"Retry status check"})]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx("span",{}),c.jsx(fe,{type:"button",variant:"outline",onClick:ln,children:g?"Finish and open project":"Watch on project page"})]})]}):c.jsxs("div",{className:"compact-stack",children:[c.jsxs("p",{className:"supporting-copy",children:["Your queries are saved. Run a first sweep to get a baseline for"," ",c.jsx("span",{className:"text-heading font-medium",children:Be}),", or finish and run it later from the project. A sweep calls the answer engines, so it costs provider usage."]}),(_n||Za)&&c.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[c.jsx("p",{children:Za??_n}),c.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Resolve the blocker above, then retry the sweep here."})]}),c.jsxs("div",{className:"setup-nav",children:[c.jsx(fe,{type:"button",variant:"outline",onClick:ea,children:"Back"}),c.jsx(fe,{type:"button",variant:"ghost",onClick:ln,children:"Finish without running"}),In==="no_provider"&&!N?c.jsx(fe,{type:"button",asChild:!0,children:c.jsx(tt,{to:"/settings",children:"Configure a provider"})}):c.jsx(fe,{type:"button",disabled:hs||!!_n,title:_n,onClick:Ft(Wn),children:hs?"Launching...":Za?"Retry visibility sweep":"Launch visibility sweep"})]})]})]})}default:return null}})();return c.jsxs("div",{className:N?"page-container visibility-setup":"page-container",children:[g?c.jsx(ir,{current:"visibility"}):null,c.jsxs("div",{className:"page-header",children:[c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{ref:u?f:void 0,tabIndex:u?-1:void 0,className:"page-title",children:u?"Set up AI Visibility":"Setup"}),c.jsx("p",{className:"page-subtitle",children:u?"Connect an answer engine, then choose queries for your first sweep.":"Create a project and run its first visibility check."})]}),g?c.jsx("div",{className:"page-header-right",children:c.jsx(fe,{type:"button",variant:"outline",className:"min-h-11",onClick:ln,children:"Skip AI Visibility"})}):null]}),g?null:c.jsx(vK,{current:N?be===4?1:0:be,labels:N?yK:gK}),c.jsxs("section",{className:"setup-wizard",children:[bs,xa]})]})}const wK=T.lazy(async()=>({default:(await yi(()=>import("./SiteHealthSection-ElUwcAS4.js").then(a=>a.d),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).SiteHealthSection})),SK=1800,jK="https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent",AK="Help me set up Canonry for my public site.\n\nUse Canonry's official docs:\n- Agent quickstart: https://github.com/Canonry/canonry#or-use-any-shell-capable-coding-agent\n- CLI reference: https://github.com/Canonry/canonry/blob/main/skills/canonry/references/canonry-cli.md\n- Plugin setup: https://github.com/Canonry/canonry/blob/main/docs/plugins.md\n- MCP setup: https://github.com/Canonry/canonry/blob/main/docs/mcp.md\n\nUse an existing Canonry installation or connected plugin/MCP if one is already available. Do not create a duplicate. The `cnry` and `canonry` commands are interchangeable.\n\n1. Ask for my public domain, country, and language. Do not create or scan anything yet.\n2. Check the local setup with `command -v cnry`, `cnry --version`, `cnry doctor --format json`, and `cnry project list --format json`. If Canonry is missing, propose `npm install -g @canonry/canonry` and wait for approval. If initialization is required, tell me to run `cnry bootstrap` in my private terminal and wait. Never ask me to paste passwords, API keys, OAuth credentials, or `cnry bootstrap` output.\n3. Show the normalized domain, proposed project name, exact `cnry project create ...` command, and wait for explicit approval before creating it.\n4. Propose a bounded Site Health scan, including `--max-pages` and whether dead-link checking is enabled. Show the exact `cnry technical-aeo run ... --wait --format json` command and wait for separate approval before scanning.\n5. After the crawl, summarize the findings and propose AI Visibility setup. Ask before adding queries, connecting providers, starting any provider-backed or quota-consuming run, editing files, or publishing.";function CK(e,a){return e==="legacy"?"legacy":e==="platform"?"platform":a.state==="success"?a.projectCount===0?"platform":"legacy":a.state==="error"?"retry":"loading"}const R3=[{value:"US",label:"United States"},{value:"CA",label:"Canada"},{value:"GB",label:"United Kingdom"},{value:"AU",label:"Australia"},{value:"NZ",label:"New Zealand"},{value:"IE",label:"Ireland"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"ES",label:"Spain"},{value:"IT",label:"Italy"},{value:"NL",label:"Netherlands"},{value:"BR",label:"Brazil"},{value:"MX",label:"Mexico"},{value:"IN",label:"India"},{value:"SG",label:"Singapore"},{value:"JP",label:"Japan"}],D3=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"nl",label:"Dutch"},{value:"ja",label:"Japanese"}];function NK(e,a){try{const s=new Intl.DisplayNames(["en"],{type:"region"}),r=new Intl.DisplayNames(["en"],{type:"language"}),u=e.length===2?s.of(e.toUpperCase()):void 0,f=a?r.of(a.toLowerCase()):void 0;return`${u??(e||"Country")} · ${f??(a||"Language")}`}catch{return`${e||"Country"} · ${a||"Language"}`}}function _K(e,a){const s=e.trim().toUpperCase(),r=a.trim().toLowerCase();return{countryValid:R3.some(u=>u.value===s),languageValid:D3.some(u=>u.value===r)}}function zK(e){const a=e.replace(/^\[|\]$/g,"");return/^(?:\d{1,3}\.){3}\d{1,3}$/.test(a)||a.includes(":")}function EK(e){const a=e.trim();if(!a)return null;const s=/^[a-z][a-z\d+.-]*:\/\//i.test(a)?a:`https://${a}`;let r;try{r=new URL(s)}catch{return null}if(r.protocol!=="http:"&&r.protocol!=="https:")return null;const u=r.hostname.toLowerCase().replace(/^www\./,"");if(!u||u==="localhost"||zK(u)||!u.includes("."))return null;const f=u.replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");return f?{canonicalDomain:u,projectName:f,displayName:u}:null}async function TK(e,a=SK){let s;const r=new Promise(f=>{s=setTimeout(()=>f({state:"timed-out"}),a)}),u=await Promise.race([e.then(f=>({state:"queued",run:f})),r]);return s&&clearTimeout(s),u}function RK(e,a){e.catch(()=>{rn({title:"Site Health scan did not start",detail:"The project is safe. Choose Run scan in Site Health to retry.",tone:"negative",dedupeKey:`site-health-dispatch:${a}`})})}function O3(e){const a=T.useRef(A3()).current,s=T.useRef(new Set),r=T.useCallback((u,f)=>{if(f){if(s.current.has(f))return;s.current.add(f)}PS({...u,surface:e,eventId:C3()})},[e]);return{onboardingSessionId:a,emit:r}}function Tx(e,a){return e instanceof fn&&e.statusCode===409?"A project with this name already exists. Change the project name, or open the existing project.":e instanceof Error&&e.message?e.message:a}function DK(){return c.jsxs("div",{className:"page-container max-w-3xl","aria-busy":"true","aria-live":"polite",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Preparing setup"}),c.jsx("p",{className:"page-subtitle",children:"Checking the projects already on this install."})]})}),c.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-default bg-surface p-4 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading projects…"]})]})}function OK({onRetry:e}){return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Can’t load projects"}),c.jsx("p",{className:"page-subtitle",children:"Canonry could not confirm whether this install already has a project."})]})}),c.jsxs("div",{className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:"Setup is paused to protect existing projects."}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:"Check the connection or sign in again, then retry."}),c.jsx(fe,{type:"button",className:"mt-4",variant:"secondary",onClick:e,children:"Retry project check"})]})]})}function qK({projectName:e,initialRunId:a}){return c.jsx(Ef,{title:"Site Health setup",children:c.jsx(BK,{projectName:e,initialRunId:a})})}function BK({projectName:e,initialRunId:a}){const s=Hs(),r=Et({...Zs({client:se}),enabled:!!e,retry:!1,refetchOnMount:"always"}),{onboardingSessionId:u,emit:f}=O3("site_health");T.useEffect(()=>{e&&f({flowVersion:st,onboardingSessionId:u,event:"onboarding.started",step:"run",resumed:!!a},"onboarding.started")},[f,a,u,e]),T.useEffect(()=>{!e||!a||z3(e)?.runId!==a&&_3(e,a)},[a,e]);const b=Et({...bf({client:se,path:{id:a??""}}),enabled:!!a,refetchInterval:({state:N})=>{const E=N.data?.status;return E==="completed"||E==="partial"||E==="failed"||E==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}).data?.status;if(T.useEffect(()=>{if(!e||!a||!b)return;if(b==="completed"||b==="partial"){f({flowVersion:st,onboardingSessionId:u,event:"onboarding.step_completed",step:"run",method:"automatic"},"onboarding.step_completed:run"),Zu(a);return}if(b!=="failed"&&b!=="cancelled")return;const N=b==="cancelled"?"run_cancelled":"run_failed";f({flowVersion:st,onboardingSessionId:u,event:"onboarding.blocked",step:"run",action:"retry_run",reasonCode:N},`onboarding.blocked:run:${N}`),Zu(a)},[f,a,u,e,b]),!e)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project not found"}),c.jsx("p",{className:"page-subtitle",children:"This setup link does not identify a project."})]})}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{s({to:"/projects"})},children:"View projects"})]});if(r.isPending)return c.jsxs("div",{className:"page-container max-w-3xl","aria-busy":"true","aria-live":"polite",children:[c.jsx(ir,{current:"site"}),c.jsxs("div",{className:"mt-8 flex items-center gap-3 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading Site Health setup…"]})]});if(r.isError)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Can’t resume setup"}),c.jsx("p",{className:"page-subtitle",children:"Canonry could not load the project for this Site Health scan."})]})}),c.jsxs("div",{className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",children:[c.jsx("p",{className:"text-sm text-secondary",children:"Check the connection or sign in again, then retry."}),c.jsx(fe,{type:"button",className:"mt-4",variant:"secondary",onClick:()=>{r.refetch()},children:"Retry project check"})]})]});const v=r.data.find(N=>N.name===e);if(!v)return c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx("div",{className:"page-header",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project not found"}),c.jsxs("p",{className:"page-subtitle",children:["Canonry could not find ",e,". It will not open a different project."]})]})}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{s({to:"/projects"})},children:"View projects"})]});const k=()=>{s({to:"/setup",search:{onboarding:"site-health",setupProject:v.name},replace:!0})},S=()=>{s({to:"/setup",search:{experience:"legacy",onboarding:"site-health",setupProject:v.name},replace:!0})},A=()=>{f({flowVersion:st,onboardingSessionId:u,event:"onboarding.step_completed",step:"run",method:"skipped"},"onboarding.step_completed:run"),s({to:"/projects/$projectName/technical-aeo",params:{projectName:v.name},replace:!0})};return c.jsxs("div",{className:"page-container max-w-7xl py-8 md:py-10",children:[c.jsx("h1",{className:"sr-only",children:"Set up Canonry"}),c.jsx(T.Suspense,{fallback:c.jsxs("div",{className:"space-y-5",children:[c.jsx(ir,{current:"site"}),c.jsxs("div",{className:"flex min-h-72 items-center justify-center gap-3 text-sm text-secondary",role:"status",children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"}),"Loading Site Health…"]})]}),children:c.jsx(wK,{projectName:v.name,projectId:v.id,initialRunId:a,onReleaseInitialRun:k,showOnboardingActions:!0,onContinueOnboarding:S,onSkipOnboarding:A})})]})}function PK(){const e=Dx({from:"/setup"}),a=e.onboarding==="site-health"&&!e.setupProject,s=e.onboarding==="site-health"&&e.experience!=="legacy",r=lI(),u=e.experience==="legacy"?"legacy":e.experience==="platform"?"platform":r,[f,g]=T.useState(!1),b=Et({...Zs({client:se}),enabled:u==="auto",retry:!1,refetchOnMount:"always"}),v=u==="auto"&&b.isSuccess&&b.isFetchedAfterMount&&b.data.length===0;T.useEffect(()=>{v&&g(!0)},[v]);const k=u!=="auto"?{state:"idle"}:b.isSuccess&&b.isFetchedAfterMount?{state:"success",projectCount:b.data.length}:b.isError?{state:"error"}:{state:"loading"},S=u==="legacy"?"legacy":f||v?"platform":CK(u,k);return a||s?c.jsx(qK,{projectName:e.setupProject,initialRunId:e.siteHealthRunId}):S==="legacy"?c.jsx(xK,{visibilityProjectName:e.setupProject,siteHealthOnboarding:e.onboarding==="site-health"}):S==="loading"?c.jsx(DK,{}):S==="retry"?c.jsx(OK,{onRetry:()=>{b.refetch()}}):c.jsx(MK,{onActivationStarted:()=>g(!0),skipSiteScan:e.siteScan==="skip"})}function MK({onActivationStarted:e,skipSiteScan:a}){return c.jsx(Ef,{title:"Site Health setup",children:c.jsx(IK,{onActivationStarted:e,skipSiteScan:a})})}function IK({onActivationStarted:e,skipSiteScan:a}){const s=Hs(),r=da(),u=pK(),f=Et({...FV({client:se}),retry:!1}),g=ns(ZV()),[b,v]=T.useState(""),[k,S]=T.useState(""),[A,N]=T.useState(""),[E,Z]=T.useState("US"),[_,G]=T.useState("en"),[K,te]=T.useState(!1),[Q,re]=T.useState("idle"),[W,oe]=T.useState(null),[H,$]=T.useState(null),[Te,Ke]=T.useState(!1),[Fe,Re]=T.useState(null),[ve,Ue]=T.useState(!1),be=f.isError?void 0:f.data,P=typeof be?.enabled=="boolean"?be.enabled:null,ae=g.isPending?g.variables.body.enabled:P,[he,je]=T.useState(null),X=T.useRef(null),{onboardingSessionId:Ie,emit:Ne}=O3("platform");T.useEffect(()=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.started",step:"project",resumed:!1},"onboarding.started")},[Ne,Ie]);const Ae=EK(b),ne=k||Ae?.projectName||"",V=A||Ae?.displayName||"",q=Q==="creating"||Q==="dispatching",le=H??Fe,De=NK(E,_),{countryValid:ye,languageValid:Je}=_K(E,_),Ge=ye&&Je;T.useEffect(()=>{le&&X.current?.focus()},[le]);const Be=(Ve,ut)=>s({to:"/setup",search:{...ut?{siteHealthRunId:ut}:{},onboarding:"site-health",setupProject:Ve.name},replace:!0}),de=async Ve=>{re("dispatching"),Re(null);try{const ut=u.mutateAsync({projectName:Ve.name,projectId:Ve.id,projectLabel:Ve.displayName||Ve.name,suppressErrorToast:!0,body:{checkDeadLinks:!0}}),Jt=await TK(ut);if(Jt.state==="queued"){Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"queued",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0"}),await Be(Ve,Jt.run.runId);return}ut.then(()=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"queued",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0"})},us=>{Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"rejected",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0",reasonCode:Al(us,"run_rejected")})}),RK(ut,Ve.id),await Be(Ve)}catch(ut){re("recovery"),Re(Tx(ut,"The project was created, but the Site Health scan could not be started."));const Jt=Al(ut,"run_rejected");Ne({flowVersion:st,onboardingSessionId:Ie,event:"run.requested",origin:"dashboard_setup",result:"rejected",kind:"site_health",providerCountBucket:"0",queryCountBucket:"0",reasonCode:Jt}),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.blocked",step:"run",action:"retry_run",reasonCode:Jt},`onboarding.blocked:run:${Jt}`)}},Me=async Ve=>{if(Ve.preventDefault(),!(!Ae||!a&&!K||!Ge||q)){re("creating"),$(null),Ke(!1),Re(null);try{const ut=await _I({name:ne,displayName:V,canonicalDomain:Ae.canonicalDomain,country:E,language:_});if(e(),oe(ut),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.step_completed",step:"project",method:"manual"},"onboarding.step_completed:project"),await r.invalidateQueries({queryKey:ts({client:se})}),a){await s({to:"/setup",search:{experience:"legacy",onboarding:"first-run",setupProject:ut.name},replace:!0});return}await de(ut)}catch(ut){re("idle");const Jt=ut instanceof fn&&ut.statusCode===409;Ke(Jt),$(Tx(ut,"Could not create the project. Try again.")),Ne({flowVersion:st,onboardingSessionId:Ie,event:"onboarding.blocked",step:"project",action:"save",reasonCode:Al(ut,"project_create_failed")},"onboarding.blocked:project"),Jt&&(e(),r.invalidateQueries({queryKey:ts({client:se})}))}}},$t=()=>{W&&!q&&de(W)},Sn=()=>{q||s({to:"/projects"})},ga=async()=>{try{await navigator.clipboard.writeText(AK),Ue(!0)}catch{rn({tone:"negative",title:"Could not copy setup request",detail:"Open the agent quickstart to continue with the CLI instead."})}},ln=async Ve=>{je(null);try{const ut=await g.mutateAsync({client:se,body:{enabled:Ve}});r.setQueryData(KS({client:se}),ut),ut.enabled!==Ve&&je(`The server kept telemetry ${ut.enabled?"on":"off"}. Check its telemetry settings.`)}catch{je("Could not update telemetry. Try again.")}};return W&&Q==="recovery"?c.jsxs("div",{className:"page-container max-w-3xl",children:[c.jsx(ir,{current:"site"}),c.jsx("div",{className:"page-header mt-8",children:c.jsxs("div",{className:"page-header-left",children:[c.jsx("h1",{className:"page-title",children:"Project created"}),c.jsxs("p",{className:"page-subtitle",children:[W.displayName||W.name," is ready. The Site Health scan needs another try."]})]})}),c.jsxs("div",{ref:X,className:"rounded-lg border border-negative bg-negative-soft p-4",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:Fe}),c.jsx("p",{className:"mt-1 text-sm text-secondary",children:"You can retry the scan or continue setup and retry from Site Health."}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-3",children:[c.jsx(fe,{type:"button",onClick:$t,children:"Retry Site Health scan"}),c.jsx(fe,{type:"button",variant:"secondary",onClick:()=>{Be(W)},children:"Continue setup"})]})]})]}):c.jsxs("div",{className:"page-container max-w-xl py-8 md:py-12",children:[a?null:c.jsx(ir,{current:"site"}),c.jsxs("header",{className:`mb-8 ${a?"":"mt-8"}`,children:[c.jsx("h1",{id:"site-map-setup-title",className:"text-2xl font-semibold tracking-[-0.025em] text-heading",children:a?"Create a project":"Map your site"}),c.jsx("p",{className:"mt-2 max-w-lg text-sm leading-6 text-secondary",children:a?"Add a public domain, then choose the queries you want to track. No site scan will run.":"Enter your public website to see its pages, structure, internal links, and technical SEO scores."})]}),c.jsxs("form",{"aria-labelledby":"site-map-setup-title",className:"space-y-6",onSubmit:Ft(Me),noValidate:!0,children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-heading",htmlFor:"launchpad-domain",children:"Website URL"}),c.jsx("input",{id:"launchpad-domain",className:"h-11 w-full rounded-md border border-strong bg-bg-elevated/50 px-3 text-base text-heading outline-none transition placeholder:text-muted focus:border-mono-500 focus:ring-1 focus:ring-mono-500",type:"text",inputMode:"url",autoComplete:"url",autoCapitalize:"none",spellCheck:!1,required:!0,"aria-invalid":!!(b&&!Ae),"aria-describedby":b&&!Ae?"launchpad-domain-hint launchpad-domain-error":"launchpad-domain-hint",placeholder:"https://example.com",value:b,onChange:Ve=>{v(Ve.target.value),$(null),Ke(!1)}}),c.jsx("p",{id:"launchpad-domain-hint",className:"text-sm text-secondary",children:a?c.jsxs(c.Fragment,{children:["A public domain is still required."," ",c.jsx(tt,{to:"/setup",search:{experience:"platform"},className:"font-medium text-link underline-offset-4 hover:underline",children:"Map with Site Health instead"})]}):c.jsxs(c.Fragment,{children:["Only public pages are scanned."," ",c.jsx(tt,{to:"/setup",search:{experience:"platform",onboarding:"first-run",siteScan:"skip"},className:"font-medium text-link underline-offset-4 hover:underline",children:"Set up without a site scan"})]})}),b&&!Ae?c.jsx("p",{id:"launchpad-domain-error",className:"text-sm text-negative",role:"alert",children:"Enter a public domain, such as example.com."}):null]}),c.jsxs("details",{className:"group border-y border-default",children:[c.jsxs("summary",{className:"flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 py-3 text-sm [&::-webkit-details-marker]:hidden",children:[c.jsx("span",{className:"font-medium text-heading",children:"Advanced settings"}),c.jsxs("span",{className:"flex items-center gap-2 text-secondary",children:[De,c.jsx(Xu,{className:"size-4 transition-transform group-open:rotate-180 motion-reduce:transition-none","aria-hidden":"true"})]})]}),c.jsxs("div",{className:"space-y-5 border-t border-default py-4",children:[Ae?c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-medium text-heading",children:"Project"}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-project-name",children:"Project name"}),c.jsx("input",{id:"launchpad-project-name",className:"setup-input h-10",type:"text",value:ne,onChange:Ve=>S(Ve.target.value)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-display-name",children:"Display name"}),c.jsx("input",{id:"launchpad-display-name",className:"setup-input h-10",type:"text",value:V,onChange:Ve=>N(Ve.target.value)})]})]})]}):null,c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-medium text-heading",children:"Locale"}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-country",children:"Country"}),c.jsx("select",{id:"launchpad-country",className:"setup-input h-10",value:E,onChange:Ve=>Z(Ve.target.value),children:R3.map(Ve=>c.jsx("option",{value:Ve.value,children:Ve.label},Ve.value))})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx("label",{className:"text-sm text-secondary",htmlFor:"launchpad-language",children:"Language"}),c.jsx("select",{id:"launchpad-language",className:"setup-input h-10",value:_,onChange:Ve=>G(Ve.target.value),children:D3.map(Ve=>c.jsx("option",{value:Ve.value,children:Ve.label},Ve.value))})]})]})]})]})]}),a?null:c.jsxs("label",{className:"flex min-h-11 cursor-pointer items-start gap-3 py-2",children:[c.jsx("input",{className:"mt-0.5 size-4 shrink-0 rounded border-strong bg-bg",type:"checkbox",checked:K,onChange:Ve=>te(Ve.target.checked),"aria-label":"Allow Canonry to scan this public site.","aria-describedby":"local-crawl-note"}),c.jsxs("span",{className:"grid gap-0.5",children:[c.jsx("span",{className:"text-sm leading-5 text-heading",children:"Allow Canonry to scan this public site."}),c.jsx("span",{id:"local-crawl-note",className:"text-sm leading-5 text-secondary",children:"The crawl runs on this Canonry instance, follows internal links, and stores its results locally."})]})]}),le?c.jsxs("div",{ref:X,className:"rounded-md border border-negative bg-negative-soft p-3",role:"alert",tabIndex:-1,children:[c.jsx("p",{className:"text-sm font-medium text-heading",children:le}),Te?c.jsx(fe,{type:"button",variant:"secondary",size:"sm",className:"mt-3",onClick:Sn,children:"View projects"}):null]}):null,c.jsxs("div",{className:"grid gap-2",children:[c.jsx(fe,{className:"h-11 w-full",type:"submit",disabled:!Ae||!a&&!K||!Ge||q,children:Q==="creating"||Q==="dispatching"?c.jsxs(c.Fragment,{children:[c.jsx(Zo,{className:"size-4 motion-safe:animate-spin","aria-hidden":"true"})," ",a?"Creating project…":"Mapping site…"]}):a?"Create project":"Map site"}),Q==="dispatching"?c.jsx("span",{className:"text-center text-sm text-secondary",role:"status",children:"Opening Site Health when the scan is ready."}):null]})]}),c.jsxs("section",{className:"mt-8 border-t border-default pt-6","aria-labelledby":"agent-setup-title",children:[c.jsx("p",{id:"agent-setup-title",className:"text-sm font-medium text-heading",children:"Use your agent instead"}),c.jsx("p",{className:"mt-1 text-sm leading-5 text-secondary",children:"Copy a complete CLI setup request into any coding agent."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-1",children:[c.jsxs(fe,{type:"button",variant:"ghost",size:"sm",className:"-ml-3",onClick:Ft(ga),children:[ve?c.jsx(Jh,{className:"size-3.5","aria-hidden":"true"}):c.jsx($x,{className:"size-3.5","aria-hidden":"true"}),c.jsx("span",{"aria-live":"polite",children:ve?"Copied setup request":"Copy setup request"})]}),c.jsx(fe,{asChild:!0,variant:"ghost",size:"sm",children:c.jsxs("a",{href:jK,target:"_blank",rel:"noopener noreferrer",children:["Agent quickstart",c.jsx(gA,{className:"size-3.5","aria-hidden":"true"}),c.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]})})]})]}),P!==null?c.jsxs("section",{className:"mt-6 border-t border-default pt-5","aria-labelledby":"telemetry-title",children:[c.jsxs("label",{className:`flex min-h-11 items-start gap-3 py-2 ${g.isPending?"cursor-wait":"cursor-pointer"}`,children:[c.jsx("input",{className:"mt-0.5 size-4 shrink-0 rounded border-strong bg-bg accent-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-mono-500 disabled:cursor-wait",type:"checkbox",checked:ae??!1,disabled:g.isPending,onChange:Ve=>{ln(Ve.target.checked)},"aria-describedby":"telemetry-detail"}),c.jsxs("span",{className:"grid gap-0.5",children:[c.jsx("span",{id:"telemetry-title",className:"text-sm leading-5 text-heading",children:"Share anonymous product telemetry"}),c.jsx("span",{id:"telemetry-detail",className:"max-w-[70ch] text-sm leading-5 text-secondary",children:"Helps prioritize improvements. Canonry does not send raw domains, URLs, queries, answer content, or credentials."})]})]}),g.isPending?c.jsx("p",{className:"mt-1 text-sm text-secondary",role:"status",children:"Saving preference…"}):null,he?c.jsx("p",{className:"mt-1 text-sm text-negative",role:"alert",children:he}):null]}):null]})}function VK(){return c.jsx("div",{className:"page-container",children:c.jsx("section",{className:"page-section",children:c.jsxs(ua,{className:"surface-card empty-card",children:[c.jsx("h1",{children:"Route not found"}),c.jsx("p",{children:"The current path does not map to a dashboard view."}),c.jsx(fe,{asChild:!0,children:c.jsx(tt,{to:"/",children:"Return to overview"})})]})})})}const Yn=as(()=>yi(()=>import("./ProjectPage-CrFybBls.js"),__vite__mapDeps([5,1,6,2,7,8,0,3,4,9,10,11,12]),import.meta.url),"ProjectPage"),LK=as(()=>yi(()=>import("./RunsPage-BVgBbE1M.js"),__vite__mapDeps([13,1,8,11,4,2,7,12]),import.meta.url),"RunsPage"),UK=as(()=>yi(()=>import("./HistoryPage-DDBCwooU.js"),__vite__mapDeps([14,1,10,11,4,2,7,12]),import.meta.url),"HistoryPage"),GK=as(()=>yi(()=>import("./SettingsPage-DYtN-1_-.js"),__vite__mapDeps([15,1,11,4,2,7,12]),import.meta.url),"SettingsPage"),$K=as(()=>yi(()=>import("./BacklinksPage-BiOj8ztV.js"),__vite__mapDeps([16,1,2,11,4,7,12]),import.meta.url),"BacklinksPage"),KK=as(()=>yi(()=>import("./TrafficPage-D6QT_2hU.js"),__vite__mapDeps([17,1,9,2,11,4,7,12]),import.meta.url),"TrafficPage"),HK=as(()=>yi(()=>import("./TrafficSourceDetailPage-BnLzF82w.js"),__vite__mapDeps([18,1,9,3,4,2,11,7,12]),import.meta.url),"TrafficSourceDetailPage"),QK=as(()=>yi(()=>import("./MeasurementPropertyPage-CMoU2yA_.js"),__vite__mapDeps([19,1,3,4,6,2,7,11,12]),import.meta.url),"MeasurementPropertyPage");function FK(){return c.jsx(K$,{children:c.jsx($$,{})})}const kn=K4()({component:FK,validateSearch:e=>({manageQueries:e.manageQueries===!0||e.manageQueries==="true"?!0:void 0,runId:typeof e.runId=="string"?e.runId:void 0,siteHealthRunId:typeof e.siteHealthRunId=="string"?e.siteHealthRunId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0,runStatus:typeof e.runStatus=="string"?e.runStatus:void 0,runKind:typeof e.runKind=="string"?e.runKind:void 0,runProject:typeof e.runProject=="string"?e.runProject:void 0,runWindow:typeof e.runWindow=="string"?e.runWindow:void 0,runQuery:typeof e.runQuery=="string"?e.runQuery:void 0,onboarding:e.onboarding==="site-health"||e.onboarding==="first-run"?e.onboarding:void 0,experience:e.experience==="legacy"||e.experience==="platform"?e.experience:void 0,siteScan:e.siteScan==="skip"?"skip":void 0,setupProject:typeof e.setupProject=="string"?e.setupProject:void 0,scope:typeof e.scope=="string"?e.scope:void 0,class:typeof e.class=="string"?e.class:void 0,...Object.fromEntries(["queryWorkspace","researchMode","trackingQueryId","measurementScope","measurementScopeKey","measurementMarketKey","queryClass","measurementProvider","measurementModel","measurementLocation","measurementFrom","measurementTo","measurementRevision","measurementRunId","measurementQueryKey","measurementAnswer"].map(a=>[a,typeof e[a]=="string"?e[a]:void 0]))})}),ZK=St({getParentRoute:()=>kn,path:"/",component:Y$,beforeLoad:async({context:e})=>{let a=e.queryClient.getQueryData(ts({client:se}));if(a===void 0)try{a=await e.queryClient.ensureQueryData(Zs({client:se}))}catch{return}if(a.length===0)throw qx({to:"/setup"})}}),YK=St({getParentRoute:()=>kn,path:"/projects",component:eK}),XK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,wn=St({getParentRoute:()=>kn,path:"/projects/$projectName",component:()=>c.jsx(hh,{}),beforeLoad:async({context:e,params:a,location:s})=>{const r=a.projectName;if(!XK.test(r))return;let u=e.queryClient.getQueryData(ts({client:se}));if(!u)try{u=await e.queryClient.ensureQueryData(Zs({client:se}))}catch{return}const f=u.find(g=>g.id===r);if(f)throw qx({to:s.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(f.name)}`),replace:!0})}}),JK=St({getParentRoute:()=>wn,path:"/",component:()=>c.jsx(Yn,{tab:"overview"})}),WK=St({getParentRoute:()=>wn,path:"/portfolio",component:()=>c.jsx(Yn,{tab:"portfolio"})}),eH=St({getParentRoute:()=>wn,path:"/search-console",component:()=>c.jsx(Yn,{tab:"search-console"})}),tH=St({getParentRoute:()=>wn,path:"/conversions",component:()=>c.jsx(Yn,{tab:"conversions"})}),nH=St({getParentRoute:()=>wn,path:"/local",component:()=>c.jsx(Yn,{tab:"local"})}),aH=St({getParentRoute:()=>wn,path:"/discovery",component:()=>c.jsx(Yn,{tab:"discovery"})}),iH=St({getParentRoute:()=>wn,path:"/queries",component:()=>c.jsx(Yn,{tab:"queries"})}),sH=St({getParentRoute:()=>wn,path:"/properties/$targetKey",component:()=>c.jsx(QK,{})}),oH=St({getParentRoute:()=>wn,path:"/report",component:()=>c.jsx(Yn,{tab:"report"})}),rH=St({getParentRoute:()=>wn,path:"/activity",component:()=>c.jsx(Yn,{tab:"activity"})}),lH=St({getParentRoute:()=>wn,path:"/backlinks",component:()=>c.jsx(Yn,{tab:"backlinks"})}),cH=St({getParentRoute:()=>wn,path:"/technical-aeo",component:()=>c.jsx(Yn,{tab:"technical-aeo"})}),uH=St({getParentRoute:()=>wn,path:"/history",component:()=>c.jsx(Yn,{tab:"history"})}),dH=St({getParentRoute:()=>wn,path:"/settings",component:()=>c.jsx(Yn,{tab:"settings"})}),mH=St({getParentRoute:()=>kn,path:"/runs",component:LK}),pH=St({getParentRoute:()=>kn,path:"/history",component:UK}),hH=St({getParentRoute:()=>kn,path:"/settings",component:GK,beforeLoad:({context:e})=>{}}),fH=St({getParentRoute:()=>kn,path:"/setup",component:PK}),gH=St({getParentRoute:()=>kn,path:"/backlinks",component:$K}),yH=St({getParentRoute:()=>kn,path:"/traffic",component:KK}),bH=St({getParentRoute:()=>kn,path:"/traffic/$projectName/$sourceId",component:HK}),vH=St({getParentRoute:()=>kn,path:"*",component:VK}),xH=kn.addChildren([ZK,YK,wn.addChildren([JK,WK,eH,tH,nH,aH,iH,sH,oH,rH,lH,cH,uH,dH]),mH,pH,hH,fH,gH,yH,bH,vH]);function kH(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Rx=kH(),wH=Rx==="/"?"":Rx.replace(/\/$/,"");function SH(e,a){return H4({routeTree:xH,basepath:wH||"/",context:{queryClient:e},...a?.initialEntries})}const jH=6e4;function AH(){const e=T.useRef(AI()).current,[a,s]=T.useState(e?"ready":"checking"),[r,u]=T.useState(null),[f,g]=T.useState(null),[b,v]=T.useState(e),[k,S]=T.useState(!1),[A,N]=T.useState(""),[E,Z]=T.useState(""),[_,G]=T.useState(""),[K,te]=T.useState(!1),[Q,re]=T.useState("password"),[W,oe]=T.useState(null),[H,$]=T.useState(!1),[Te,Ke]=T.useState(!1),Fe=T.useRef(null),Re=T.useRef(null),ve=T.useRef(null),Ue=()=>{const q=r?`${r.name}:${r.role}`:e?"api-key:explicit":f?`api-key:${f.id}`:"no-accounts";if(!Fe.current||ve.current!==q){Re.current?.clear();const le=sV();Re.current=le,Fe.current=SH(le),ve.current=q}return{queryClient:Re.current,router:Fe.current}},be=q=>q.authRequired?(S(!0),u(q.user),g(null),v(!1),s(q.user?"ready":"account-login"),!0):!1;T.useEffect(()=>{let q=!1;const le=async(De,ye=!1)=>{try{const Je=await lh();if(q)return;g(Je),v(!1),s("ready")}catch(Je){if(q)return;if(ye&&Je instanceof fn&&Je.statusCode===401)return PI().then(()=>{q||(oe(null),g(null),v(!1),Ke(!0),s("login"))}).catch(Ge=>{q||(oe(Ge instanceof Error?Ge.message:"Could not clear the invalid session"),s(De))});oe(Je instanceof Error?Je.message:"Could not verify API key access"),s(De)}};return e?(le("api-key-error"),()=>{q=!0}):(Promise.allSettled([Gv(),Uv()]).then(([De,ye])=>{if(q||De.status==="fulfilled"&&be(De.value))return;if(ye.status==="rejected"){const Ge=ye.reason;oe(Ge instanceof Error?Ge.message:"Failed to reach the Canonry API"),s("login");return}const Je=ye.value;Je.authenticated?(v(!0),le("api-key-error",!0)):(g(null),v(!1),s(Je.setupRequired?"setup":"login"))}),()=>{q=!0})},[]),T.useEffect(()=>{if(a!=="ready"||e)return;const q=setInterval(()=>{if(k){Gv().then(le=>{le.authRequired&&!le.user&&(Ke(!0),u(null),g(null),s("account-login"))}).catch(()=>{});return}Uv().then(le=>{le.authenticated||(Ke(!0),g(null),s(le.setupRequired?"setup":"login"))}).catch(()=>{})},jH);return Lv(()=>{Ke(!0),u(null),g(null),v(!1),s(k?"account-login":"login")}),()=>{clearInterval(q),Lv(null)}},[a,k,e]);const P=async q=>{if(q.preventDefault(),!E.trim()||E.trim().length<8){oe("Password must be at least 8 characters");return}if(E!==_){oe("Passwords do not match");return}$(!0),oe(null);try{if(!(await OI(E.trim())).authenticated){oe("Setup failed");return}Z(""),G(""),te(!1),Ke(!1),g(null),v(!0),s("checking");try{const De=await lh();g(De),v(!1),s("ready")}catch(De){oe(De instanceof Error?De.message:"Could not verify API key access"),s("api-key-error")}}catch(le){oe(le instanceof fn||le instanceof Error?le.message:"Setup failed")}finally{$(!1)}},ae=q=>{Z(q),oe(null)},he=q=>{G(q),oe(null)},je=async q=>{if(q.preventDefault(),!!E.trim()){$(!0),oe(null);try{if(!(Q==="api-key"?await BI(E.trim()):await qI(E.trim())).authenticated){oe(Q==="api-key"?"Invalid API key":"Incorrect password");return}const De=await lh();g(De),v(!1),Z(""),te(!1),Ke(!1),s("ready")}catch(le){oe(le instanceof fn||le instanceof Error?le.message:"Authentication failed")}finally{$(!1)}}},X=q=>{re(q),Z(""),te(!1),oe(null)},Ie=async q=>{if(q.preventDefault(),!(!A.trim()||!E)){$(!0),oe(null);try{const le=await MI(A.trim(),E);if(!le.user){oe("Incorrect name or password.");return}Z(""),Ke(!1),u(le.user),g(null),v(!1),s("ready")}catch(le){oe(le instanceof fn?le.message:"Incorrect name or password.")}finally{$(!1)}}};if(a==="ready"){const{queryClient:q,router:le}=Ue();return c.jsx(ZI,{account:r,apiKey:f,apiKeyPending:b,children:c.jsx(Q4,{client:q,children:c.jsx(F4,{router:le})})})}const Ne=E.trim(),Ae=E.length>0&&Ne.length<8,ne=_.length>0&&E!==_,V=Ne.length>=8&&E===_;return c.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:c.jsxs("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md flex-col items-center justify-center gap-5",children:[c.jsxs("div",{"data-testid":"auth-brand",className:"flex items-center gap-2.5",children:[c.jsx("img",{className:"size-7",src:"./favicon.svg",alt:"","aria-hidden":"true"}),c.jsx("span",{className:"text-lg font-semibold tracking-tight text-heading",children:"Canonry"})]}),c.jsx(ua,{className:"surface-card w-full",children:a==="checking"?c.jsx(Ms,{className:"py-8",children:c.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):a==="api-key-error"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Could not verify API key access"})]}),c.jsxs(Ms,{className:"space-y-4",children:[c.jsx("p",{className:"supporting-copy",children:W??"Canonry could not verify this session’s access, so the dashboard stayed locked."}),c.jsx(fe,{type:"button",className:"w-full",onClick:()=>{window.location.reload()},children:"Try again"})]})]}):a==="account-login"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Sign in to Canonry"})]}),c.jsxs(Ms,{children:[Te?c.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"You were signed out — please sign in again."}):null,c.jsxs("form",{className:"space-y-4",onSubmit:Ft(Ie),children:[c.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-name",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:"Name"}),c.jsx("input",{autoFocus:!0,id:"account-name",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"text",name:"username",autoComplete:"username",value:A,onChange:q=>{N(q.target.value),oe(null)},"aria-invalid":!!W,"aria-describedby":W?"account-login-error":void 0})]}),c.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-password",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),c.jsx("input",{id:"account-password",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",name:"password",autoComplete:"current-password",value:E,onChange:q=>ae(q.target.value),"aria-invalid":!!W,"aria-describedby":W?"account-login-error":void 0})]}),W?c.jsx("p",{id:"account-login-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!A.trim()||!E,children:H?"Signing in…":"Sign in"})]})]})]}):a==="setup"?c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Create a dashboard password"}),c.jsx(Qu,{children:"Stored on this Canonry install as a salted, one-way hash. Canonry cannot recover it."})]}),c.jsx(Ms,{children:c.jsxs("form",{className:"space-y-4",onSubmit:Ft(P),children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"block text-xs font-medium text-secondary",htmlFor:"dashboard-password-new",children:"Password"}),c.jsx("input",{autoFocus:!0,id:"dashboard-password-new",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:"new-password",autoComplete:"new-password",minLength:8,required:!0,value:E,onChange:q=>ae(q.target.value),"aria-invalid":Ae,"aria-describedby":"dashboard-password-new-help"}),c.jsx("span",{id:"dashboard-password-new-help","aria-live":"polite",className:Ae?"block text-sm text-negative-400":"block text-sm text-secondary",children:Ae?"Enter at least 8 characters.":"Use at least 8 characters."})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("label",{className:"block text-xs font-medium text-secondary",htmlFor:"dashboard-password-confirm",children:"Confirm password"}),c.jsx("input",{id:"dashboard-password-confirm",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:"confirm-password",autoComplete:"new-password",minLength:8,required:!0,value:_,onChange:q=>he(q.target.value),"aria-invalid":ne,"aria-describedby":"dashboard-password-confirm-help"}),c.jsx("span",{id:"dashboard-password-confirm-help","aria-live":"polite",className:ne?"block text-sm text-negative-400":"block text-sm text-secondary",children:ne?"Passwords do not match.":"Enter the same password again."})]}),c.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary",htmlFor:"dashboard-password-show",children:[c.jsx("input",{id:"dashboard-password-show",type:"checkbox",checked:K,onChange:q=>te(q.target.checked)}),"Show passwords"]}),W?c.jsx("p",{id:"dashboard-password-setup-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!V,children:H?"Creating password…":"Create password and continue"})]})})]}):c.jsxs(c.Fragment,{children:[c.jsxs(Ko,{children:[c.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),c.jsx("h1",{className:"font-medium tracking-tight text-primary",children:"Sign in to Canonry"}),c.jsx(Qu,{children:Q==="api-key"?"Enter an API key from this Canonry install. This opens the dashboard with that key’s access and does not change the password.":"Enter your dashboard password to continue."})]}),c.jsxs(Ms,{children:[Te?c.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,c.jsxs("form",{className:"space-y-4",onSubmit:Ft(je),children:[c.jsxs("label",{className:"block space-y-1.5",htmlFor:"dashboard-password-current",children:[c.jsx("span",{className:"text-xs font-medium text-secondary",children:Q==="api-key"?"Canonry API key":"Password"}),c.jsx("input",{autoFocus:!0,id:"dashboard-password-current",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:K?"text":"password",name:Q==="api-key"?"apiKey":"password",autoComplete:Q==="api-key"?"off":"current-password",spellCheck:!1,required:!0,value:E,onChange:q=>ae(q.target.value),"aria-invalid":!!W,"aria-describedby":W?"dashboard-password-login-error":void 0})]}),c.jsxs("label",{className:"flex min-h-10 cursor-pointer items-center gap-2 text-sm text-secondary",htmlFor:"dashboard-login-password-show",children:[c.jsx("input",{id:"dashboard-login-password-show",type:"checkbox",checked:K,onChange:q=>te(q.target.checked)}),Q==="api-key"?"Show API key":"Show password"]}),W?c.jsx("p",{id:"dashboard-password-login-error",role:"alert",className:"text-sm text-negative-400",children:W}):null,c.jsx(fe,{type:"submit",disabled:H||!E.trim(),children:H?"Signing in…":"Open dashboard"}),c.jsx(fe,{type:"button",variant:"ghost",onClick:()=>X(Q==="api-key"?"password":"api-key"),children:Q==="api-key"?"Use dashboard password instead":"Forgot password? Use API key"})]})]})]})})]})})}const q3=document.getElementById("root");if(!q3)throw new Error("Expected #root element for web app bootstrap.");SA.createRoot(q3).render(c.jsx(T.StrictMode,{children:c.jsx(AH,{})}));export{HZ as $,GF as A,fe as B,Uu as C,LF as D,$F as E,GQ as F,VF as G,LZ as H,yl as I,$Z as J,GZ as K,JQ as L,MY as M,XQ as N,lF as O,dG as P,rn as Q,QZ as R,lV as S,pn as T,FZ as U,aF as V,ZZ as W,iF as X,eF as Y,nF as Z,KZ as _,PY as a,sF as a$,UZ as a0,WQ as a1,YZ as a2,aY as a3,WZ as a4,tY as a5,eY as a6,nY as a7,CF as a8,vf as a9,RH as aA,nV as aB,nZ as aC,on as aD,kV as aE,$V as aF,lZ as aG,pZ as aH,cZ as aI,rQ as aJ,cQ as aK,EO as aL,uQ as aM,RV as aN,rZ as aO,RO as aP,qh as aQ,lQ as aR,fI as aS,uZ as aT,oZ as aU,OV as aV,dZ as aW,VY as aX,mZ as aY,kY as aZ,wY as a_,ze as aa,JZ as ab,ZS as ac,gi as ad,XZ as ae,HY as af,qT as ag,BT as ah,OH as ai,DH as aj,zF as ak,qF as al,BF as am,fn as an,PF as ao,OQ as ap,cV as aq,fU as ar,Ph as as,MF as at,Tu as au,gY as av,d_ as aw,Hh as ax,Ps as ay,tF as az,$9 as b,eQ as b$,gf as b0,fY as b1,MV as b2,bZ as b3,xZ as b4,_Z as b5,MZ as b6,PZ as b7,CZ as b8,qZ as b9,wQ as bA,fQ as bB,gQ as bC,kQ as bD,xQ as bE,vQ as bF,yQ as bG,bQ as bH,hQ as bI,pQ as bJ,mQ as bK,dQ as bL,uB as bM,ZH as bN,KH as bO,HH as bP,QH as bQ,YH as bR,FH as bS,WH as bT,hY as bU,XH as bV,JH as bW,gF as bX,GH as bY,KY as bZ,nQ as b_,VZ as ba,wZ as bb,EZ as bc,TZ as bd,RZ as be,kZ as bf,zZ as bg,SZ as bh,DZ as bi,jZ as bj,OZ as bk,NZ as bl,BZ as bm,IZ as bn,lK as bo,AZ as bp,ge as bq,TQ as br,EQ as bs,zQ as bt,_Q as bu,AQ as bv,jQ as bw,NQ as bx,CQ as by,SQ as bz,O2 as c,lY as c$,aQ as c0,iQ as c1,$H as c2,tQ as c3,LQ as c4,VQ as c5,IQ as c6,yF as c7,QV as c8,vZ as c9,$Y as cA,mK as cB,hZ as cC,XF as cD,tZ as cE,JF as cF,fZ as cG,IY as cH,WF as cI,xn as cJ,NI as cK,hV as cL,v$ as cM,qQ as cN,EI as cO,BQ as cP,PQ as cQ,MQ as cR,ts as cS,xV as cT,jV as cU,UQ as cV,iY as cW,UI as cX,pF as cY,oY as cZ,rY as c_,QF as ca,Fv as cb,KQ as cc,HQ as cd,KF as ce,HF as cf,QQ as cg,FQ as ch,YQ as ci,ZQ as cj,Kl as ck,Zs as cl,TS as cm,YF as cn,ZF as co,n$ as cp,mG as cq,p3 as cr,yG as cs,h3 as ct,f3 as cu,AV as cv,Is as cw,Yu as cx,XV as cy,fK as cz,IF as d,_Y as d$,sY as d0,UF as d1,cF as d2,uF as d3,dF as d4,hF as d5,mF as d6,nr as d7,yf as d8,LY as d9,vY as dA,J$ as dB,oQ as dC,of as dD,FF as dE,yY as dF,xY as dG,jF as dH,sQ as dI,wF as dJ,SF as dK,kF as dL,bY as dM,K8 as dN,aZ as dO,eZ as dP,sZ as dQ,iZ as dR,PH as dS,yi as dT,fa as dU,BH as dV,hI as dW,SY as dX,AY as dY,jY as dZ,pK as d_,zd as da,wf as db,gZ as dc,yZ as dd,xI as de,RQ as df,DQ as dg,$Q as dh,oF as di,rF as dj,Ef as dk,Ed as dl,Sf as dm,hK as dn,fF as dp,ar as dq,Yv as dr,NF as ds,EF as dt,RF as du,DF as dv,_F as dw,TF as dx,OF as dy,AF as dz,dY as e,f$ as e0,MH as e1,OY as e2,qY as e3,BY as e4,CY as e5,NY as e6,qH as e7,EY as e8,DY as e9,zY as ea,RY as eb,ir as ec,IH as ed,TY as ee,v9 as ef,LH as eg,VH as eh,ua as f,cY as g,rx as h,se as i,gI as j,Sl as k,mn as l,Ft as m,uY as n,pY as o,mY as p,bF as q,xF as r,UH as s,dV as t,jf as u,vF as v,ha as w,UY as x,GY as y,$h as z};
@@ -1,4 +1,4 @@
1
- import{g as Bt,t as S,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{e as Ht,G as Wt}from"./SiteHealthSection-D7sPztpW.js";import"./index-aZ69fB-u.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-D_WBzb76.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{g as Bt,t as S,r as C}from"./vendor-tanstack-ZXXkndVj.js";import{e as Ht,G as Wt}from"./SiteHealthSection-ElUwcAS4.js";import"./index-CoQVOsWw.js";import"./vendor-radix-twS1M3FF.js";import"./vendor-recharts-D-cUuLZo.js";import"./vendor-lucide-nVpYViBH.js";import"./vendor-markdown-B-Oq2NYq.js";import"./vendor-yaml-GWJz5H2G.js";import"./ChartPrimitives-Bxa_vFmq.js";function Vt(r,n){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var e=i.call(r,n);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function ae(r){var n=Vt(r,"string");return typeof n=="symbol"?n:n+""}function A(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function He(r,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,ae(e.key),e)}}function L(r,n,i){return n&&He(r.prototype,n),i&&He(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function Q(r){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Q(r)}function yt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yt=function(){return!!r})()}function jt(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Zt(r,n){if(n&&(typeof n=="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jt(r)}function I(r,n,i){return n=Q(n),Zt(r,yt()?Reflect.construct(n,i||[],Q(r).constructor):n.apply(r,i))}function xe(r,n){return xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,e){return i.__proto__=e,i},xe(r,n)}function G(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),n&&xe(r,n)}function qt(r){if(Array.isArray(r))return r}function Yt(r,n){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var e,t,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(r)).next,n===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(e=a.call(i)).done)&&(s.push(e.value),s.length!==n);l=!0);}catch(u){h=!0,t=u}finally{try{if(!l&&i.return!=null&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw t}}return s}}function Se(r,n){(n==null||n>r.length)&&(n=r.length);for(var i=0,e=Array(n);i<n;i++)e[i]=r[i];return e}function Tt(r,n){if(r){if(typeof r=="string")return Se(r,n);var i={}.toString.call(r).slice(8,-1);return i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set"?Array.from(r):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(r,n):void 0}}function Xt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(r,n){return qt(r)||Yt(r,n)||Tt(r,n)||Xt()}var pe={black:"#000000",silver:"#C0C0C0",gray:"#808080",grey:"#808080",white:"#FFFFFF",maroon:"#800000",red:"#FF0000",purple:"#800080",fuchsia:"#FF00FF",green:"#008000",lime:"#00FF00",olive:"#808000",yellow:"#FFFF00",navy:"#000080",blue:"#0000FF",teal:"#008080",aqua:"#00FFFF",darkblue:"#00008B",mediumblue:"#0000CD",darkgreen:"#006400",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",springgreen:"#00FF7F",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",rebeccapurple:"#663399",mediumaquamarine:"#66CDAA",dimgray:"#696969",dimgrey:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",slategrey:"#708090",lightslategray:"#778899",lightslategrey:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370DB",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",palevioletred:"#DB7093",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",lightyellow:"#FFFFE0",ivory:"#FFFFF0"},Ct=new Int8Array(4),be=new Int32Array(Ct.buffer,0,1),$t=new Float32Array(Ct.buffer,0,1),Kt=/^\s*rgba?\s*\(/,Jt=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function Qt(r){var n=0,i=0,e=0,t=1;if(r[0]==="#")r.length===4?(n=parseInt(r.charAt(1)+r.charAt(1),16),i=parseInt(r.charAt(2)+r.charAt(2),16),e=parseInt(r.charAt(3)+r.charAt(3),16)):(n=parseInt(r.charAt(1)+r.charAt(2),16),i=parseInt(r.charAt(3)+r.charAt(4),16),e=parseInt(r.charAt(5)+r.charAt(6),16)),r.length===9&&(t=parseInt(r.charAt(7)+r.charAt(8),16)/255);else if(Kt.test(r)){var a=r.match(Jt);a&&(n=+a[1],i=+a[2],e=+a[3],a[4]&&(t=+a[4]))}return{r:n,g:i,b:e,a:t}}var J={};for(var le in pe)J[le]=oe(pe[le]),J[pe[le]]=J[le];function Rt(r,n,i,e,t){return be[0]=e<<24|i<<16|n<<8|r,be[0]=be[0]&4278190079,$t[0]}function oe(r){if(r=r.toLowerCase(),typeof J[r]<"u")return J[r];var n=Qt(r),i=n.r,e=n.g,t=n.b,a=n.a;a=a*255|0;var o=Rt(i,e,t,a);return J[r]=o,o}var Ee={};function _t(r){if(typeof Ee[r]<"u")return Ee[r];var n=(r&16711680)>>>16,i=(r&65280)>>>8,e=r&255,t=255,a=Rt(n,i,e,t);return Ee[r]=a,a}function We(r,n,i,e){return i+(n<<8)+(r<<16)}function Ve(r,n,i,e,t,a){var o=Math.floor(i/a*t),s=Math.floor(r.drawingBufferHeight/a-e/a*t),l=new Uint8Array(4);r.bindFramebuffer(r.FRAMEBUFFER,n),r.readPixels(o,s,1,1,r.RGBA,r.UNSIGNED_BYTE,l);var h=ee(l,4),u=h[0],d=h[1],f=h[2],g=h[3];return[u,d,f,g]}function c(r,n,i){return(n=ae(n))in r?Object.defineProperty(r,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[n]=i,r}function je(r,n){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(r);n&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})),i.push.apply(i,e)}return i}function b(r){for(var n=1;n<arguments.length;n++){var i=arguments[n]!=null?arguments[n]:{};n%2?je(Object(i),!0).forEach(function(e){c(r,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):je(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function ei(r,n){for(;!{}.hasOwnProperty.call(r,n)&&(r=Q(r))!==null;);return r}function Ae(){return Ae=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(r,n,i){var e=ei(r,n);if(e){var t=Object.getOwnPropertyDescriptor(e,n);return t.get?t.get.call(arguments.length<3?r:i):t.value}},Ae.apply(null,arguments)}function wt(r,n,i,e){var t=Ae(Q(r.prototype),n,i);return typeof t=="function"?function(a){return t.apply(i,a)}:t}function ti(r){return r.normalized?1:r.size}function ye(r){var n=0;return r.forEach(function(i){return n+=ti(i)}),n}function xt(r,n,i){var e=r==="VERTEX"?n.VERTEX_SHADER:n.FRAGMENT_SHADER,t=n.createShader(e);if(t===null)throw new Error("loadShader: error while creating the shader");n.shaderSource(t,i),n.compileShader(t);var a=n.getShaderParameter(t,n.COMPILE_STATUS);if(!a){var o=n.getShaderInfoLog(t);throw n.deleteShader(t),new Error(`loadShader: error while compiling the shader:
3
3
  `.concat(o,`
4
4
  `).concat(i))}return t}function ii(r,n){return xt("VERTEX",r,n)}function ri(r,n){return xt("FRAGMENT",r,n)}function ni(r,n){var i=r.createProgram();if(i===null)throw new Error("loadProgram: error while creating the program.");var e,t;for(e=0,t=n.length;e<t;e++)r.attachShader(i,n[e]);r.linkProgram(i);var a=r.getProgramParameter(i,r.LINK_STATUS);if(!a){var o=r.getProgramInfoLog(i);throw r.deleteProgram(i),new Error("loadProgram: error while linking the program: ".concat(o))}return i}function Ze(r){var n=r.gl,i=r.buffer,e=r.program,t=r.vertexShader,a=r.fragmentShader;n.deleteShader(t),n.deleteShader(a),n.deleteProgram(e),n.deleteBuffer(i)}var qe=`#define PICKING_MODE
@@ -0,0 +1 @@
1
+ import{r as k,j as o}from"./vendor-tanstack-ZXXkndVj.js";import{C as oe,J as le,f as Z}from"./vendor-lucide-nVpYViBH.js";import{z as ue,B as ce}from"./index-CoQVOsWw.js";import{M as de}from"./vendor-markdown-B-Oq2NYq.js";const U={queryClass:"all"},me=["all","non-brand","branded"];function ne(e){return typeof e=="string"&&me.includes(e)}function pe(e){const r=ne(e.class)?e.class:U.queryClass,s=e.scope;if(typeof s!="string"||s==="all"||s.length===0)return{scope:"all",queryClass:r};const n=s.startsWith("group:")?s.slice(6):"";return n?{scope:"group",groupKey:n,queryClass:r}:{scope:"all",queryClass:r}}function Ie(e,r){return r===null||e===null?!1:e!==r}function $e(e){return{scope:e.scope==="group"&&e.groupKey?`group:${e.groupKey}`:void 0,class:e.queryClass===U.queryClass?void 0:e.queryClass}}function ge(e,r){if(!(typeof e!="string"||e.length>16384||!r))try{const s=JSON.parse(e);if(typeof s!="object"||s===null||Array.isArray(s))return;const n=s,m=d=>typeof d=="string"&&d.trim().length>0,i=d=>d===null||m(d);return n.queryKey!==r||!m(n.provider)||n.queryClass!=="branded"&&n.queryClass!=="non-brand"&&n.queryClass!=="unknown"||!i(n.model)||!i(n.location)||!i(n.runId)||n.revision!==null&&(typeof n.revision!="number"||!Number.isSafeInteger(n.revision)||n.revision<=0)?void 0:{queryKey:r,queryClass:n.queryClass,provider:n.provider,model:n.model,location:n.location,runId:n.runId,revision:n.revision}}catch{return}}function Ae(e){const r=y=>typeof e[y]=="string"&&e[y]!==""?e[y]:void 0,s=pe({scope:r("scope"),class:r("class")}),n=r("measurementScope")??(s.scope==="group"?"group":"project"),m=r("measurementScopeKey")??(r("measurementScope")?void 0:s.groupKey),i=r("queryClass")??r("class"),d={measurementScope:m&&(n==="group"||n==="market"||n==="property")?n:"project",queryClass:i==="unknown"||ne(i)?i:U.queryClass};d.measurementScope!=="project"&&(d.measurementScopeKey=m);for(const[y,K]of[["measurementMarketKey","marketKey"],["measurementProvider","provider"],["measurementModel","model"],["measurementLocation","location"],["measurementFrom","from"],["measurementTo","to"],["measurementRunId","measurementRunId"],["measurementQueryKey","queryKey"]]){const b=r(y);b!==void 0&&(d[K]=b)}const l=Number(e.measurementRevision);Number.isSafeInteger(l)&&l>0&&(d.revision=l);const f=ge(e.measurementAnswer,d.queryKey);return f&&(d.answer=f),d}function Ee(e,r){const s={...e,...r};return["measurementScope","measurementScopeKey","measurementMarketKey","queryClass","measurementProvider","measurementModel","measurementLocation","measurementFrom","measurementTo","measurementRevision","measurementRunId"].some(n=>n in r)?(s.measurementQueryKey=r.measurementQueryKey,s.measurementAnswer=r.measurementAnswer):"measurementQueryKey"in r&&!("measurementAnswer"in r)&&(s.measurementAnswer=void 0),"measurementScope"in r&&(s.scope=void 0,"measurementMarketKey"in r||(s.measurementMarketKey=void 0),s.measurementQueryKey=void 0,r.measurementScope==="project"&&(s.measurementScopeKey=void 0)),"queryClass"in r&&(s.class=void 0),s}function we(e){return{...e,onboarding:void 0,manageQueries:void 0,siteHealthRunId:void 0,siteScan:void 0,setupProject:void 0}}const X="min-h-11 w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",Q="flex min-h-11 w-full items-center justify-between gap-3 rounded px-2 text-left text-sm text-primary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",A=e=>e.kind==="project"?"Whole site":e.label,E={allMarkets:"All markets",browse:e=>`Browse ${e}`,select:e=>`Select ${e}`,browseAll:"Browse all properties"},fe=e=>e?.kind==="group"&&e.marketKeys?.length===1?e.marketKeys[0]:void 0,ee=e=>`${e} ${e===1?"property":"properties"}`;function Re({options:e,selected:r,onSelect:s,marketKey:n,label:m="Measurement scope",allowGroupSelect:i=!0}){const d=[...e].sort((t,c)=>t.label.localeCompare(c.label,void 0,{numeric:!0})||t.id.localeCompare(c.id)),[l,f]=k.useState(""),[y,K]=k.useState([]),[b,C]=k.useState(!1),x=k.useRef(null),v=k.useRef(null),q=k.useId(),a=d.filter(t=>t.kind==="group"),g=new Map(a.map(t=>[t.id,t])),u=g.get(y.at(-1)??""),S=g.get(y.at(-2)??""),h=l.trim().toLocaleLowerCase(),se=a.filter(t=>!t.parentGroupIds?.some(c=>g.has(c))),_=d.filter(t=>t.kind==="property"),L=t=>(t.parentGroupIds??[]).map(c=>g.get(c)?.label).filter(Boolean).join(" · "),w=t=>`${A(t)} ${L(t)}`.toLocaleLowerCase().includes(h),D=t=>{const c=[...t.parentGroupIds??[]],p=new Set;for(;c.length;){const j=c.pop();if(j===u?.id)return!0;p.has(j)||(p.add(j),c.push(...g.get(j)?.parentGroupIds??[]))}return!1},M=(b?[]:u?a.filter(t=>h?D(t):t.parentGroupIds?.includes(u.id)):h?a:se).filter(w),I=d.find(t=>t.kind==="market"&&t.id===(n??(r.kind==="market"?r.id:void 0))),F=u&&I&&(u.marketKeys?.includes(I.id)||I.parentGroupIds?.includes(u.id))?I.id:void 0,V=i?F??fe(u):void 0,O=(u?_.filter(t=>t.parentGroupIds?.includes(u.id)&&(!V||t.marketKeys?.includes(V))):h||b||a.length===0?_:[]).filter(w),W=d.filter(t=>t.kind!=="market"||b||!i&&!u&&!h&&a.length>0||i&&u?.marketKeys?.length===1&&!h?!1:(u?h?D(t):t.parentGroupIds?.includes(u.id):h||!t.parentGroupIds?.some(p=>g.has(p)))&&w(t)),H=u||b?[]:d.filter(t=>t.kind==="project"&&w(t));k.useEffect(()=>{const t=c=>{x.current?.open&&c.target instanceof Node&&!x.current.contains(c.target)&&(x.current.open=!1)};return document.addEventListener("pointerdown",t),()=>document.removeEventListener("pointerdown",t)},[]);const ae=t=>{x.current&&(x.current.open=!1,x.current.querySelector("summary")?.focus());const c=i?t.kind==="property"?V:t.kind==="group"&&t.id===u?.id?F:void 0:void 0;c?s(t,c):s(t)},R=t=>{const c=[];let p=g.get(t.parentGroupIds?.[0]??"");for(;p&&!c.includes(p.id)&&p.id!==t.id;)c.unshift(p.id),p=g.get(p.parentGroupIds?.[0]??"");return[...c,t.id]},ie=()=>{const t=r.kind==="group"?g.get(r.id):void 0,c=g.get(I?.parentGroupIds?.[0]??""),p=(r.parentGroupIds??[]).flatMap($=>{const P=g.get($);return P?[R(P)]:[]}),j=p.find($=>$.at(-1)===u?.id)??p.sort(($,P)=>P.length-$.length)[0]??[],J=c?R(c):r.marketKeys?.length?[]:j;K(t?R(t):J),C(r.kind==="property"&&J.length===0&&a.length>0),f("")},z=t=>{K(R(t)),C(!1),f(""),v.current?.focus()},T=(t,c=A(t))=>o.jsxs("div",{className:"flex items-stretch",children:[o.jsxs("button",{type:"button",className:Q,"aria-label":t.kind==="group"&&!i?E.browse(A(t)):E.select(A(t)),"aria-current":r.kind===t.kind&&r.id===t.id?"true":void 0,onClick:()=>t.kind==="group"&&!i?z(t):ae(t),children:[o.jsxs("span",{className:"min-w-0 break-words",children:[c,h&&L(t)?o.jsx("span",{className:"block text-[13px] text-secondary",children:L(t)}):null]}),o.jsx("span",{className:"shrink-0 text-right text-[13px] text-secondary",children:t.kind==="market"?i?"Query context":"Market":t.kind==="property"?"Property":ee(t.targetCount)})]}),i&&t.kind==="group"&&t.id!==u?.id&&d.some(p=>p.parentGroupIds?.includes(t.id))?o.jsx("button",{type:"button","aria-label":E.browse(t.label),title:`Browse ${t.label}`,className:"flex min-h-11 min-w-11 items-center justify-center rounded text-secondary hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",onClick:()=>z(t),children:o.jsx(Z,{size:18,"aria-hidden":"true"})}):null]},`${t.kind}:${t.id}`),G=(t,c)=>c.length>0?o.jsxs("section",{"aria-label":t,className:"mt-2",children:[o.jsx("h3",{className:"px-2 py-2 text-[13px] font-medium text-secondary",children:t}),c.map(p=>T(p))]}):null,Y=(t,c,p)=>c.length>0?o.jsxs("details",{open:p,className:"mt-2 border-y border-default",children:[o.jsxs("summary",{className:"min-h-11 cursor-pointer px-2 py-3 text-sm text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[t," (",c.length,")"]}),c.map(j=>T(j))]},`${u?.id??"root"}:${t}`):null;return o.jsxs("div",{className:"min-w-0",children:[o.jsx("span",{id:`${q}-label`,className:"mb-1 block text-sm font-medium text-heading",children:m}),o.jsxs("details",{ref:x,className:"relative",onToggle:t=>{t.target===t.currentTarget&&t.currentTarget.open&&v.current?.focus()},onKeyDown:t=>{t.key==="Escape"&&(t.preventDefault(),t.currentTarget.open=!1,t.currentTarget.querySelector("summary")?.focus())},children:[o.jsxs("summary",{id:`${q}-value`,"aria-labelledby":`${q}-label ${q}-value`,className:`${X} visibility-scope-trigger`,onClick:()=>{x.current?.open||ie()},children:[`${A(r)}${r.kind==="group"?` · ${ee(r.targetCount)}`:r.kind==="property"?` · ${d.find(t=>t.kind==="market"&&t.id===n)?.label??(r.marketKeys?.length?E.allMarkets:"Property")}`:r.kind==="market"?" · Market":""}`,o.jsx(oe,{size:16,"aria-hidden":"true",className:"shrink-0 text-secondary"})]}),o.jsxs("div",{className:"visibility-scope-menu",children:[u||b?o.jsxs("div",{className:"mb-2 border-b border-default pb-2",children:[o.jsx("button",{type:"button",className:Q,"aria-label":`Back to ${S?.label??"all groups"}`,onClick:()=>{K(y.slice(0,-1)),C(!1),f(""),v.current?.focus()},children:o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(le,{size:16,"aria-hidden":"true"}),S?.label??"All groups"]})}),o.jsx("p",{className:"px-2 py-1 text-sm font-medium text-heading","aria-live":"polite",children:u?.label??"All properties"})]}):null,o.jsx("input",{ref:v,type:"search","aria-label":"Search scopes",className:X,placeholder:u?"Search within this group":b?"Search properties":"Search groups or properties",value:l,onChange:t=>f(t.target.value)}),o.jsxs("div",{className:"mt-2 max-h-80 overflow-y-auto",children:[i&&u&&!h?T(u,"All properties in this group"):null,H.map(t=>T(t)),u&&!h?Y("Subgroups",M,!0):G(u?"Subgroups":"Groups",M),h?G("Properties",O):Y(u&&M.length>0?"All properties":"Properties",O,!u||M.length===0),G("Markets",W),!u&&!b&&!h&&a.length>0&&_.length>0?o.jsxs("button",{type:"button",className:`${Q} mt-2 border-t border-default`,"aria-label":E.browseAll,onClick:()=>{C(!0),v.current?.focus()},children:[o.jsx("span",{children:"All properties"}),o.jsx(Z,{size:18,"aria-hidden":"true"})]}):null,h&&M.length+O.length+W.length+H.length===0?o.jsx("p",{className:"py-3 text-sm text-secondary",children:"No matching scopes."}):null]})]})]})]})}const Te="Sources",B={copy:"Copy answer",copying:"Copying…",copied:"Copied",failed:"Could not copy. Select and copy the answer above."};function ye({headingLevel:e}){return r=>{const s=[],n=i=>{i.type==="heading"&&i.depth&&s.push(i),i.children?.forEach(n)};n(r);const m=s.reduce((i,d)=>Math.min(i,d.depth),6);for(const i of s){const d=i.depth-m;i.depth=Math.min(6,e+d),i.data={...i.data,hProperties:{...i.data?.hProperties,"data-answer-heading-level":d+1}}}}}function he({answer:e}){const[r,s]=k.useState("idle"),n=k.useRef(!1),m=async()=>{if(!n.current){n.current=!0,s("copying");try{await navigator.clipboard.writeText(e),s("copied")}catch{s("failed")}finally{n.current=!1}}};return o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3",children:[o.jsx(ce,{type:"button",variant:"ghost",className:"min-h-11 px-2","aria-disabled":r==="copying","aria-busy":r==="copying",onClick:()=>{m()},children:r==="copying"?B.copying:B.copy}),o.jsx("span",{role:"status",className:"text-sm text-secondary",children:r==="copied"?B.copied:r==="failed"?B.failed:""})]})}function Pe({children:e,headingLevel:r=4,copyable:s=!1}){return o.jsxs("div",{className:"answer-markdown",children:[o.jsx(de,{remarkPlugins:[[ye,{headingLevel:r}]],components:{p:({children:n})=>o.jsx("p",{className:"mb-3 whitespace-pre-wrap last:mb-0",children:n}),ul:({children:n})=>o.jsx("ul",{className:"mb-3 ml-5 list-disc space-y-1",children:n}),ol:({children:n,start:m})=>o.jsx("ol",{start:m,className:"mb-3 ml-5 list-decimal space-y-1",children:n}),pre:({children:n})=>o.jsx("pre",{className:"mb-3 overflow-x-auto whitespace-pre-wrap",children:n}),a:({children:n,href:m})=>{const i=ue(m);return i?o.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-link underline",children:n}):o.jsx("span",{children:n})},img:({alt:n})=>o.jsx("span",{children:n})},children:e}),s&&e.trim()?o.jsx(he,{answer:e},e):null]})}function Be(e){const r=e[0];return r?e.every(s=>s.mode===r.mode&&s.scope.kind===r.scope.kind&&s.scope.key===r.scope.key&&s.queryClass===r.queryClass&&s.measurement.displayedRunId===r.measurement.displayedRunId):!0}function N(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator}}function be(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function xe(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function ke(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function te(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function Ce(e,r,s){const n=new Map;if(!r)return n;const m=new Map(e.usageEdges.map(l=>[te(l),l.targetKey])),i=new Map(e.assignments.map(l=>[`${l.targetKey}:${l.queryId}`,l.queryClass])),d=new Map(e.usageEdges.map(l=>[te(l),i.get(`${l.targetKey}:${l.queryId}`)]));for(const l of r.evidence){if(s&&d.get(l.usageEdgeId)!==s)continue;const f=m.get(l.usageEdgeId);if(!f)continue;const y=n.get(f)??[];y.push({id:`${l.observationId}:${l.expectedSlotId}:${l.usageEdgeId}:${l.sourceUrl}`,kind:xe(l.classification),query:l.queryText,provider:l.provider,location:l.location,url:l.sourceUrl,tone:ke(l.classification),historical:l.historical||l.bridged}),n.set(f,y)}return n}function ve(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(s=>s.state==="unavailable").map(s=>s.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function Se(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function je(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function re(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function _e({overview:e,activePlan:r,report:s,reportState:n=s?"ready":"loading",sort:m}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=r.plan,d=new Map(i.targets.map(a=>[a.stableKey,a])),l=new Map(i.querySnapshots.map(a=>[a.queryId,a.queryText])),f=new Map;for(const a of i.assignments){if(e.queryClass!=="all"&&a.queryClass!==e.queryClass)continue;const g=l.get(a.queryId);if(!g)continue;const u=f.get(a.targetKey)??new Set;u.add(g),f.set(a.targetKey,u)}const y=s?.revision===r.revision&&s.run?.id===e.measurement.displayedRunId?s:null,K=e.measurement.displayedRunId===void 0||y?"ready":n==="error"||s!=null?"error":"loading",b=Ce(i,y,e.queryClass==="all"?void 0:e.queryClass),C=new Map;for(const a of i.groups)for(const g of a.targetKeys)C.has(g)||C.set(g,a.label);const x=e.properties.items.map(a=>{const g=d.get(a.targetKey),u=b.get(a.targetKey)??[];return{id:a.targetKey,name:a.label,mentionCoverage:N(a.mentionCoverage),citationCoverage:N(a.citationCoverage),status:ve(a),providers:a.providers?.map(S=>({provider:S.provider,mentionCoverage:N(S.mentionCoverage),citationCoverage:N(S.citationCoverage)})),market:C.get(a.targetKey),assignedQueries:[...f.get(a.targetKey)??[]],urls:g?.urlMatchers.map(be)??[],evidence:u,evidenceState:K,historical:u.some(S=>S.historical)}}),v=e.namedShareOfVoice?.entries.map(a=>({name:a.label,coverage:{numerator:a.credits,denominator:e.namedShareOfVoice.denominator}})),q=e.properties.items.flatMap(a=>a.flags>0?[{id:`property:${a.targetKey}`,property:a.label,summary:`${a.flags} ${a.flags===1?"result needs":"results need"} review.`,tone:"caution",count:a.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:Se(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:je(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:N(e.metrics.propertiesMentioned),mentionCoverage:N(e.metrics.mentionCoverage),citationCoverage:N(e.metrics.citationCoverage)},properties:x,...v?{shareOfVoice:v}:{}},propertyTotal:e.properties.totalEstimate??x.length,outcomes:e.outcomes,nextCursor:e.properties.nextCursor,...m?{sort:m}:{}},availableGroups:i.groups.map(a=>({id:a.stableKey,label:a.label})),...re(e)?{nextActionText:re(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:q}}export{Pe as A,E as M,Re as V,Te as a,Ee as b,pe as c,Be as d,_e as e,we as f,be as g,$e as m,Ae as p,Ie as s};