@ainyc/canonry 4.56.0 → 4.56.1

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-D1tnXJ2L.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-DEr_yQLw.js","./ChartPrimitives-gqioJ07n.js","./server-traffic-B5rtrB-q.js","./vendor-recharts-DWvKDyBF.js","./trash-2-CUczQ2Yl.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-DMrl5Fhn.js","./SettingsPage-Dp0TXf34.js","./BacklinksPage-yWx_BBLG.js","./TrafficPage-POy4iHHt.js","./extract-error-message-C0GGpK4T.js","./TrafficSourceDetailPage-BewjZ53n.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-Y6uCyjGb.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-BntNdrgM.js","./ChartPrimitives-D7C1Cp8w.js","./server-traffic-bn9LSZN9.js","./vendor-recharts-DWvKDyBF.js","./trash-2-B5clF2rU.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-Btp6qn10.js","./SettingsPage-DkyNiU2i.js","./BacklinksPage-CmeFZ8UJ.js","./TrafficPage-CBl4Mwdc.js","./extract-error-message-De8_qAzs.js","./TrafficSourceDetailPage-BZzuWCn-.js"])))=>i.map(i=>d[i]);
2
2
  import{c as aw,d as iw,Q as sw,M as rw,r as q,q as Ue,j as f,L as rt,a as ow,e as ks,u as cn,f as lw,h as dc,k as cw,l as uw,m as Xb,O as Jb,n as Ka,o as Ai,p as dw,s as Bt,t as Fb,v as Gs,x as fw,y as pw,z as mw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as hw,O as Df,P as Wb,C as Rf,a as ev,T as Mf,D as tv,R as nv}from"./vendor-radix-B57xfQbP.js";import{c as av}from"./vendor-recharts-DWvKDyBF.js";import{M as gw}from"./vendor-markdown-DK7fbRNb.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var Qd={exports:{}},Kr={},Yd={exports:{}},Xd={};var Ay;function yw(){return Ay||(Ay=1,(function(e){function n($,F){var de=$.length;$.push(F);e:for(;0<de;){var je=de-1>>>1,ie=$[je];if(0<l(ie,F))$[je]=F,$[de]=ie,de=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var F=$[0],de=$.pop();if(de!==F){$[0]=de;e:for(var je=0,ie=$.length,Qe=ie>>>1;je<Qe;){var J=2*(je+1)-1,le=$[J],te=J+1,ue=$[te];if(0>l(le,de))te<ie&&0>l(ue,le)?($[je]=ue,$[te]=de,je=te):($[je]=le,$[J]=de,je=J);else if(te<ie&&0>l(ue,de))$[je]=ue,$[te]=de,je=te;else break e}}return F}function l($,F){var de=$.sortIndex-F.sortIndex;return de!==0?de:$.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();e.unstable_now=function(){return d.now()-m}}var g=[],b=[],v=1,S=null,w=3,_=!1,C=!1,N=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function K($){for(var F=i(b);F!==null;){if(F.callback===null)r(b);else if(F.startTime<=$)r(b),F.sortIndex=F.expirationTime,n(g,F);else break;F=i(b)}}function Y($){if(N=!1,K($),!C)if(i(g)!==null)C=!0,X||(X=!0,ve());else{var F=i(b);F!==null&&pe(Y,F.startTime-$)}}var X=!1,D=-1,M=5,oe=-1;function ke(){return T?!0:!(e.unstable_now()-oe<M)}function _e(){if(T=!1,X){var $=e.unstable_now();oe=$;var F=!0;try{e:{C=!1,N&&(N=!1,G(D),D=-1),_=!0;var de=w;try{t:{for(K($),S=i(g);S!==null&&!(S.expirationTime>$&&ke());){var je=S.callback;if(typeof je=="function"){S.callback=null,w=S.priorityLevel;var ie=je(S.expirationTime<=$);if($=e.unstable_now(),typeof ie=="function"){S.callback=ie,K($),F=!0;break t}S===i(g)&&r(g),K($)}else r(g);S=i(g)}if(S!==null)F=!0;else{var Qe=i(b);Qe!==null&&pe(Y,Qe.startTime-$),F=!1}}break e}finally{S=null,w=de,_=!1}F=void 0}}finally{F?ve():X=!1}}}var ve;if(typeof H=="function")ve=function(){H(_e)};else if(typeof MessageChannel<"u"){var et=new MessageChannel,re=et.port2;et.port1.onmessage=_e,ve=function(){re.postMessage(null)}}else ve=function(){R(_e,0)};function pe($,F){D=R(function(){$(e.unstable_now())},F)}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($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function($){switch(w){case 1:case 2:case 3:var F=3;break;default:F=w}var de=w;w=F;try{return $()}finally{w=de}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function($,F){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var de=w;w=$;try{return F()}finally{w=de}},e.unstable_scheduleCallback=function($,F,de){var je=e.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?je+de:je):de=je,$){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=de+ie,$={id:v++,callback:F,priorityLevel:$,startTime:de,expirationTime:ie,sortIndex:-1},de>je?($.sortIndex=de,n(b,$),i(g)===null&&$===i(b)&&(N?(G(D),D=-1):N=!0,pe(Y,de-je))):($.sortIndex=ie,n(g,$),C||_||(C=!0,X||(X=!0,ve()))),$},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function($){var F=w;return function(){var de=w;w=F;try{return $.apply(this,arguments)}finally{w=de}}}})(Xd)),Xd}var _y;function bw(){return _y||(_y=1,Yd.exports=yw()),Yd.exports}var zy;function vw(){if(zy)return Kr;zy=1;var e=bw(),n=aw(),i=iw();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function m(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function b(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var p=u.alternate;if(p===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===p.child){for(p=u.child;p;){if(p===s)return g(u),t;if(p===o)return g(u),a;p=p.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=p;else{for(var y=!1,x=u.child;x;){if(x===s){y=!0,s=u,o=p;break}if(x===o){y=!0,o=u,s=p;break}x=x.sibling}if(!y){for(x=p.child;x;){if(x===s){y=!0,s=p,o=u;break}if(x===o){y=!0,o=p,s=u;break}x=x.sibling}if(!y)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function v(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=v(t),a!==null)return a;t=t.sibling}return null}var S=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),H=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),_e=Symbol.iterator;function ve(t){return t===null||typeof t!="object"?null:(t=_e&&t[_e]||t["@@iterator"],typeof t=="function"?t:null)}var et=Symbol.for("react.client.reference");function re(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===et?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case Y:return"Suspense";case X:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case H:return t.displayName||"Context";case G:return(t._context.displayName||"Context")+".Consumer";case K:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case D:return a=t.displayName||null,a!==null?a:re(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return re(t(a))}catch{}}return null}var pe=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},je=[],ie=-1;function Qe(t){return{current:t}}function J(t){0>ie||(t.current=je[ie],je[ie]=null,ie--)}function le(t,a){ie++,je[ie]=t.current,t.current=a}var te=Qe(null),ue=Qe(null),ne=Qe(null),Ne=Qe(null);function tt(t,a){switch(le(ne,a),le(ue,t),le(te,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Yg(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Yg(a),t=Xg(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(te),le(te,t)}function xe(){J(te),J(ue),J(ne)}function $e(t){t.memoizedState!==null&&le(Ne,t);var a=te.current,s=Xg(a,t.type);a!==s&&(le(ue,t),le(te,s))}function Ze(t){ue.current===t&&(J(te),J(ue)),Ne.current===t&&(J(Ne),Ir._currentValue=de)}var Ct,zn;function Tt(t){if(Ct===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Ct=a&&a[1]||"",zn=-1<s.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Ct+t+zn}var Fs=!1;function Ei(t,a){if(!t||Fs)return"";Fs=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(V){var U=V}Reflect.construct(t,[],Q)}else{try{Q.call()}catch(V){U=V}t.call(Q.prototype)}}else{try{throw Error()}catch(V){U=V}(Q=t())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(V){if(V&&U&&typeof V.stack=="string")return[V.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),y=p[0],x=p[1];if(y&&x){var A=y.split(`
@@ -53,8 +53,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
53
53
 
54
54
  ${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
55
55
 
56
- `):"Run failed."}function _0(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function qM(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function UM(e){return e===null?"Unknown":e?"Pass":"Fail"}function pb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function $M(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function VM(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const i=e.match(/^daily(?:@(\d+))?$/);if(i)return{freq:"daily",hour:i[1]?parseInt(i[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function GM(e,n,i){const r=i==="UTC"?"UTC":i.split("/").pop()?.replace(/_/g," ")??i;if(!e)return`Custom: ${n} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const l=e.match(/^daily(?:@(\d+))?$/);if(l){const d=l[1]?parseInt(l[1]):6;return`Every day at ${pb(d)} · ${r}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},m=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${pb(m)} · ${r}`}return`${e} · ${r}`}function dO(e,n){return n&&n!==e?`${e} · ${n}`:e}function IM(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return dO(e,n)}const qe=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??W).getConfig().baseUrl};return n?.body&&(l.body=n.body),n?.headers&&(l.headers=n.headers),n?.path&&(l.path=n.path),n?.query&&(l.query=n.query),[l]},fO=e=>qe("getApiV1ProjectsByName",e),pO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fO(e)}),Ks=e=>qe("getApiV1Projects",e),op=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vw({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Ks(e)}),lp=e=>qe("getApiV1Runs",e),cp=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lp(e)}),mO=e=>qe("getApiV1RunsById",e),z0=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mO(e)}),hO=e=>qe("getApiV1Settings",e),gO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hO(e)}),yO=e=>qe("getApiV1ProjectsByNameGoogleConnections",e),HM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yO(e)}),bO=e=>qe("getApiV1ProjectsByNameGoogleProperties",e),ZM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Sj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bO(e)}),vO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformance",e),PM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vO(e)}),SO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),KM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SO(e)}),xO=e=>qe("getApiV1ProjectsByNameGoogleGscInspections",e),QM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _j({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xO(e)}),wO=e=>qe("getApiV1ProjectsByNameGoogleGscDeindexed",e),YM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await zj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wO(e)}),jO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverage",e),XM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jO(e)}),NO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),JM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Cj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:NO(e)}),FM=e=>qe("getApiV1ProjectsByNameGoogleGscSitemaps",e),kO=e=>qe("getApiV1ProjectsByNameBingStatus",e),WM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Bj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kO(e)}),AO=e=>qe("getApiV1ProjectsByNameBingSites",e),e6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Lj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AO(e)}),_O=e=>qe("getApiV1ProjectsByNameBingCoverage",e),t6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_O(e)}),zO=e=>qe("getApiV1ProjectsByNameBingInspections",e),n6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:zO(e)}),CO=e=>qe("getApiV1ProjectsByNameBingPerformance",e),a6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ij({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:CO(e)}),TO=e=>qe("getApiV1ProjectsByNameGaStatus",e),i6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Pj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:TO(e)}),EO=e=>qe("getApiV1ProjectsByNameGaTraffic",e),s6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:EO(e)}),OO=e=>qe("getApiV1ProjectsByNameGaAiReferralHistory",e),r6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:OO(e)}),DO=e=>qe("getApiV1ProjectsByNameGaSocialReferralHistory",e),o6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:DO(e)}),RO=e=>qe("getApiV1ProjectsByNameGaSessionHistory",e),l6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:RO(e)}),MO=e=>qe("getApiV1ProjectsByNameReport",e),c6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:MO(e)}),BO=e=>qe("getApiV1ProjectsByNameCitationsVisibility",e),u6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await eN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:BO(e)}),LO=e=>qe("getApiV1ProjectsByNameTrafficSources",e),d6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:LO(e)}),qO=e=>qe("getApiV1ProjectsByNameTrafficStatus",e),f6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:qO(e)}),UO=e=>qe("getApiV1ProjectsByNameTrafficSourcesById",e),p6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:UO(e)}),$O=e=>qe("getApiV1ProjectsByNameTrafficEvents",e),m6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$O(e)}),VO=e=>qe("getApiV1ProjectsByNameDiscoverSessions",e),h6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:VO(e)}),GO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsById",e),g6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await AN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:GO(e)}),IO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),y6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:IO(e)}),HO=e=>qe("getApiV1ProjectsByNameAgentProviders",e),ZO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await CN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:HO(e)});function mb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function C0(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function b6(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function v6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function PO(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Us(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
57
- `):void 0}function KO(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:mb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:mb(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const l=i.providerStatuses.filter(g=>g.state==="ready").length,c=i.providerStatuses.length,d=l>0,m=i.providerStatuses.filter(g=>g.state==="ready").map(g=>PO(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:m||"None configured"}})}function QO(e,n){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!n.providerStatuses.some(i=>i.state==="ready"))return"Launch is blocked until at least one provider is configured."}function YO(e,n,i){const r=QO(n,i),l=structuredClone(e);return l.healthChecks=l.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=i.providerStatuses.some(m=>m.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),l.launchState.enabled=r===void 0,l.launchState.blockedReason=r,l.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",l}const T0="canonry.run-tracker",wf=new Set;let hb=!1,XO=0,bc={runs:{},batches:{}};function JO(){const e=Ni();for(const n of wf)n(e)}function FO(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function WO(){typeof window>"u"||window.sessionStorage.setItem(T0,JSON.stringify(bc))}function E0(){hb||(hb=!0,!(typeof window>"u")&&(bc=FO(window.sessionStorage.getItem(T0))))}function vc(e){bc=e,WO(),JO()}function Ni(){return E0(),bc}function e4(e){return E0(),wf.add(e),()=>{wf.delete(e)}}function O0(e){const n=Ni();vc({...n,runs:{...n.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function gb(e){const n=Ni();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;vc({...n,runs:r})}function t4(e){const n=Ni(),i=`batch_${Date.now()}_${++XO}`;return vc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function n4(e){const n=Ni();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;vc({...n,batches:r})}function a4(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function i4(e,n){let i=0,r=0,l=0,c=0,d=0;for(const m of e){const g=n[m]?.status;g==="completed"?i+=1:g==="partial"?r+=1:g==="failed"?l+=1:g==="cancelled"?c+=1:d+=1}return{completed:i,partial:r,failed:l,cancelled:c,pending:d,finished:d===0}}const yb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bb=av,D0=(e,n)=>i=>{var r;if(n?.variants==null)return bb(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const v=i?.[b],S=c?.[b];if(v===null)return null;const w=yb(v)||yb(S);return l[b][w]}),m=i&&Object.entries(i).reduce((b,v)=>{let[S,w]=v;return w===void 0||(b[S]=w),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,v)=>{let{class:S,className:w,..._}=v;return Object.entries(_).every(C=>{let[N,T]=C;return Array.isArray(T)?T.includes({...c,...m}[N]):{...c,...m}[N]===T})?[...b,S,w]:b},[]);return bb(e,d,g,i?.class,i?.className)},s4=(e,n)=>{const i=new Array(e.length+n.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<n.length;r++)i[e.length+r]=n[r];return i},r4=(e,n)=>({classGroupId:e,validator:n}),R0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),lc="-",vb=[],o4="arbitrary..",l4=e=>{const n=u4(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return c4(d);const m=d.split(lc),g=m[0]===""&&m.length>1?1:0;return M0(m,g,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const g=r[d],b=i[d];return g?b?s4(b,g):g:b||vb}return i[d]||vb}}},M0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=M0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const m=n===0?e.join(lc):e.slice(n).join(lc),g=d.length;for(let b=0;b<g;b++){const v=d[b];if(v.validator(m))return v.classGroupId}},c4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),r=n.slice(0,i);return r?o4+r:void 0})(),u4=e=>{const{theme:n,classGroups:i}=e;return d4(i,n)},d4=(e,n)=>{const i=R0();for(const r in e){const l=e[r];up(l,i,r,n)}return i},up=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];f4(d,n,i,r)}},f4=(e,n,i,r)=>{if(typeof e=="string"){p4(e,n,i);return}if(typeof e=="function"){m4(e,n,i,r);return}h4(e,n,i,r)},p4=(e,n,i)=>{const r=e===""?n:B0(n,e);r.classGroupId=i},m4=(e,n,i,r)=>{if(g4(e)){up(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(r4(i,e))},h4=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[m,g]=l[d];up(g,B0(n,m),i,r)}},B0=(e,n)=>{let i=e;const r=n.split(lc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let m=i.nextPart.get(d);m||(m=R0(),i.nextPart.set(d,m)),i=m}return i},g4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,y4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),r=Object.create(null);const l=(c,d)=>{i[c]=d,n++,n>e&&(n=0,r=i,i=Object.create(null))};return{get(c){let d=i[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in i?i[c]=d:l(c,d)}}},jf="!",Sb=":",b4=[],xb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),v4=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,m=0,g=0,b;const v=l.length;for(let N=0;N<v;N++){const T=l[N];if(d===0&&m===0){if(T===Sb){c.push(l.slice(g,N)),g=N+1;continue}if(T==="/"){b=N;continue}}T==="["?d++:T==="]"?d--:T==="("?m++:T===")"&&m--}const S=c.length===0?l:l.slice(g);let w=S,_=!1;S.endsWith(jf)?(w=S.slice(0,-1),_=!0):S.startsWith(jf)&&(w=S.slice(1),_=!0);const C=b&&b>g?b-g:void 0;return xb(c,_,w,C)};if(n){const l=n+Sb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):xb(b4,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},S4=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{n.set(i,1e6+r)}),i=>{const r=[];let l=[];for(let c=0;c<i.length;c++){const d=i[c],m=d[0]==="[",g=n.has(d);m||g?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},x4=e=>({cache:y4(e.cacheSize),parseClassName:v4(e),sortModifiers:S4(e),...l4(e)}),w4=/\s+/,j4=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],m=e.trim().split(w4);let g="";for(let b=m.length-1;b>=0;b-=1){const v=m[b],{isExternal:S,modifiers:w,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:N}=i(v);if(S){g=v+(g.length>0?" "+g:g);continue}let T=!!N,R=r(T?C.substring(0,N):C);if(!R){if(!T){g=v+(g.length>0?" "+g:g);continue}if(R=r(C),!R){g=v+(g.length>0?" "+g:g);continue}T=!1}const G=w.length===0?"":w.length===1?w[0]:c(w).join(":"),H=_?G+jf:G,K=H+R;if(d.indexOf(K)>-1)continue;d.push(K);const Y=l(R,T);for(let X=0;X<Y.length;++X){const D=Y[X];d.push(H+D)}g=v+(g.length>0?" "+g:g)}return g},N4=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=L0(i))&&(l&&(l+=" "),l+=r);return l},L0=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=L0(e[r]))&&(i&&(i+=" "),i+=n);return i},k4=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((v,S)=>S(v),e());return i=x4(b),r=i.cache.get,l=i.cache.set,c=m,m(g)},m=g=>{const b=r(g);if(b)return b;const v=j4(g,i);return l(g,v),v};return c=d,(...g)=>c(N4(...g))},A4=[],At=e=>{const n=i=>i[e]||A4;return n.isThemeGetter=!0,n},q0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,U0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,z4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,E4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>_4.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>!!e&&Number.isInteger(Number(e)),nf=e=>e.endsWith("%")&&Te(e.slice(0,-1)),fa=e=>z4.test(e),$0=()=>!0,D4=e=>C4.test(e)&&!T4.test(e),dp=()=>!1,R4=e=>E4.test(e),M4=e=>O4.test(e),B4=e=>!me(e)&&!he(e),L4=e=>Xa(e,I0,dp),me=e=>q0.test(e),bi=e=>Xa(e,H0,D4),wb=e=>Xa(e,Z4,Te),q4=e=>Xa(e,P0,$0),U4=e=>Xa(e,Z0,dp),jb=e=>Xa(e,V0,dp),$4=e=>Xa(e,G0,M4),ql=e=>Xa(e,K0,R4),he=e=>U0.test(e),Xr=e=>zi(e,H0),V4=e=>zi(e,Z0),Nb=e=>zi(e,V0),G4=e=>zi(e,I0),I4=e=>zi(e,G0),Ul=e=>zi(e,K0,!0),H4=e=>zi(e,P0,!0),Xa=(e,n,i)=>{const r=q0.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},zi=(e,n,i=!1)=>{const r=U0.exec(e);return r?r[1]?n(r[1]):i:!1},V0=e=>e==="position"||e==="percentage",G0=e=>e==="image"||e==="url",I0=e=>e==="length"||e==="size"||e==="bg-size",H0=e=>e==="length",Z4=e=>e==="number",Z0=e=>e==="family-name",P0=e=>e==="number"||e==="weight",K0=e=>e==="shadow",P4=()=>{const e=At("color"),n=At("font"),i=At("text"),r=At("font-weight"),l=At("tracking"),c=At("leading"),d=At("breakpoint"),m=At("container"),g=At("spacing"),b=At("radius"),v=At("shadow"),S=At("inset-shadow"),w=At("text-shadow"),_=At("drop-shadow"),C=At("blur"),N=At("perspective"),T=At("aspect"),R=At("ease"),G=At("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...K(),he,me],X=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[he,me,g],oe=()=>[Va,"full","auto",...M()],ke=()=>[Ga,"none","subgrid",he,me],_e=()=>["auto",{span:["full",Ga,he,me]},Ga,he,me],ve=()=>[Ga,"auto",he,me],et=()=>["auto","min","max","fr",he,me],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],pe=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],F=()=>[Va,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],de=()=>[Va,"screen","full","dvw","lvw","svw","min","max","fit",...M()],je=()=>[Va,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],ie=()=>[e,he,me],Qe=()=>[...K(),Nb,jb,{position:[he,me]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],le=()=>["auto","cover","contain",G4,L4,{size:[he,me]}],te=()=>[nf,Xr,bi],ue=()=>["","none","full",b,he,me],ne=()=>["",Te,Xr,bi],Ne=()=>["solid","dashed","dotted","double"],tt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Te,nf,Nb,jb],$e=()=>["","none",C,he,me],Ze=()=>["none",Te,he,me],Ct=()=>["none",Te,he,me],zn=()=>[Te,he,me],Tt=()=>[Va,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[$0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[B4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",Te],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Va,me,he,T]}],container:["container"],columns:[{columns:[Te,me,he,m]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ga,"auto",he,me]}],basis:[{basis:[Va,"full","auto",m,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Va,"auto","initial","none",me]}],grow:[{grow:["",Te,he,me]}],shrink:[{shrink:["",Te,he,me]}],order:[{order:[Ga,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":ke()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":ke()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":ve()}],"row-end":[{"row-end":ve()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":et()}],"auto-rows":[{"auto-rows":et()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...pe(),"normal"]}],"justify-self":[{"justify-self":["auto",...pe()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...pe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...pe(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...pe(),"baseline"]}],"place-self":[{"place-self":["auto",...pe()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[m,"screen",...F()]}],"min-w":[{"min-w":[m,"screen","none",...F()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,Xr,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,H4,q4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nf,me]}],"font-family":[{font:[V4,U4,n]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,he,me]}],"line-clamp":[{"line-clamp":[Te,"none",he,wb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ie()}],"text-color":[{text:ie()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",he,bi]}],"text-decoration-color":[{decoration:ie()}],"underline-offset":[{"underline-offset":[Te,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Qe()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:le()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ga,he,me],radial:["",he,me],conic:[Ga,he,me]},I4,$4]}],"bg-color":[{bg:ie()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:ie()}],"gradient-via":[{via:ie()}],"gradient-to":[{to:ie()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:ie()}],"border-color-x":[{"border-x":ie()}],"border-color-y":[{"border-y":ie()}],"border-color-s":[{"border-s":ie()}],"border-color-e":[{"border-e":ie()}],"border-color-bs":[{"border-bs":ie()}],"border-color-be":[{"border-be":ie()}],"border-color-t":[{"border-t":ie()}],"border-color-r":[{"border-r":ie()}],"border-color-b":[{"border-b":ie()}],"border-color-l":[{"border-l":ie()}],"divide-color":[{divide:ie()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,he,me]}],"outline-w":[{outline:["",Te,Xr,bi]}],"outline-color":[{outline:ie()}],shadow:[{shadow:["","none",v,Ul,ql]}],"shadow-color":[{shadow:ie()}],"inset-shadow":[{"inset-shadow":["none",S,Ul,ql]}],"inset-shadow-color":[{"inset-shadow":ie()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ie()}],"ring-offset-w":[{"ring-offset":[Te,bi]}],"ring-offset-color":[{"ring-offset":ie()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":ie()}],"text-shadow":[{"text-shadow":["none",w,Ul,ql]}],"text-shadow-color":[{"text-shadow":ie()}],opacity:[{opacity:[Te,he,me]}],"mix-blend":[{"mix-blend":[...tt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":tt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":ie()}],"mask-image-linear-to-color":[{"mask-linear-to":ie()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":ie()}],"mask-image-t-to-color":[{"mask-t-to":ie()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":ie()}],"mask-image-r-to-color":[{"mask-r-to":ie()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":ie()}],"mask-image-b-to-color":[{"mask-b-to":ie()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":ie()}],"mask-image-l-to-color":[{"mask-l-to":ie()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":ie()}],"mask-image-x-to-color":[{"mask-x-to":ie()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":ie()}],"mask-image-y-to-color":[{"mask-y-to":ie()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":ie()}],"mask-image-radial-to-color":[{"mask-radial-to":ie()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":K()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":ie()}],"mask-image-conic-to-color":[{"mask-conic-to":ie()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Qe()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:$e()}],brightness:[{brightness:[Te,he,me]}],contrast:[{contrast:[Te,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,Ul,ql]}],"drop-shadow-color":[{"drop-shadow":ie()}],grayscale:[{grayscale:["",Te,he,me]}],"hue-rotate":[{"hue-rotate":[Te,he,me]}],invert:[{invert:["",Te,he,me]}],saturate:[{saturate:[Te,he,me]}],sepia:[{sepia:["",Te,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[Te,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Te,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Te,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Te,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Te,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[Te,he,me]}],animate:[{animate:["none",G,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,he,me]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Tt()}],"translate-x":[{"translate-x":Tt()}],"translate-y":[{"translate-y":Tt()}],"translate-z":[{"translate-z":Tt()}],"translate-none":["translate-none"],accent:[{accent:ie()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ie()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...ie()]}],"stroke-w":[{stroke:[Te,Xr,bi,wb]}],stroke:[{stroke:["none",...ie()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},K4=k4(P4);function _n(...e){return K4(av(e))}const Q4=D0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),Le=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?hw:"button";return f.jsx(d,{ref:c,className:_n(Q4({variant:n,size:i,className:e})),...l})});Le.displayName="Button";const Y4=D0("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function Q0({className:e,variant:n,...i}){return f.jsx("div",{className:_n(Y4({variant:n}),e),...i})}const X4=220;function kb({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=q.useState(!1),m=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},X4)};return e?f.jsxs(rt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),f.jsx("span",{className:"brand-copy",children:f.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):f.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[f.jsx(rt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),f.jsxs("div",{className:"brand-copy",children:[f.jsx(rt,{to:"/",className:"brand-mark",children:"Canonry"}),m?f.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[f.jsxs("a",{className:"brand-update-bubble-link",href:i.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${i.upgradeCommand}`,"aria-label":`New version v${i.latest} available — open release page`,children:[f.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),f.jsx(Nk,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),f.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),f.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:f.jsx(Hs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function J4({provider:e}){const n={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return f.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Bn({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(Q0,{variant:r,...i,children:n})}function fp({status:e}){return f.jsx(Bn,{tone:C0(e),children:_0(e)})}const F4=nv,W4=Wb,Y0=q.forwardRef(({className:e,...n},i)=>f.jsx(Df,{ref:i,className:_n("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));Y0.displayName=Df.displayName;const e3=400,t3=1200,n3=720,X0=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(n3),d=q.useRef(!1),m=q.useRef(0),g=q.useRef(0),b=q.useCallback(w=>{d.current=!0,m.current=w.clientX,g.current=l,w.target.setPointerCapture(w.pointerId),w.preventDefault()},[l]),v=q.useCallback(w=>{if(!d.current)return;const _=m.current-w.clientX,C=Math.min(t3,Math.max(e3,g.current+_));c(C)},[]),S=q.useCallback(()=>{d.current=!1},[]);return f.jsxs(W4,{children:[f.jsx(Y0,{}),f.jsxs(Rf,{ref:r,className:_n("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${l}px, 100vw)`},...i,children:[f.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:b,onPointerMove:v,onPointerUp:S}),n,f.jsxs(ev,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[f.jsx(Hs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});X0.displayName=Rf.displayName;const a3=({className:e,...n})=>f.jsx("div",{className:_n("flex flex-col gap-1.5 pr-10",e),...n}),J0=q.forwardRef(({className:e,...n},i)=>f.jsx(Mf,{ref:i,className:_n("text-lg font-medium text-zinc-50",e),...n}));J0.displayName=Mf.displayName;const F0=q.forwardRef(({className:e,...n},i)=>f.jsx(tv,{ref:i,className:_n("text-sm text-zinc-500",e),...n}));F0.displayName=tv.displayName;function i3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(F4,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(X0,{children:[f.jsxs(a3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(J0,{id:"drawer-title",children:e}),f.jsx(F0,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function $l({text:e}){const[n,i]=q.useState(null),r=q.useRef(null),l=q.useCallback(()=>{if(!r.current)return;const d=r.current.getBoundingClientRect();i({top:d.top,left:d.left+d.width/2})},[]),c=q.useCallback(()=>i(null),[]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,onFocus:l,onBlur:c,children:[f.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),n!==null&&ow.createPortal(f.jsx("span",{role:"tooltip",style:{position:"fixed",top:n.top,left:n.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const s3=/[\s\-_]+/;function r3(e){const n=e.split(s3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Ab(e,n){const i=o3(n),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(b=>b.startsWith("**")&&b.endsWith("**")?{type:"bold",value:b.slice(2,-2)}:{type:"text",value:b}),l=i.flatMap(b=>b.terms).filter(b=>b.trim().length>1);if(l.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,v)=>v.length-b.length).map(r3).filter(b=>!!b);if(d.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const m=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const v of b.terms){const S=oc(v);S&&!g.has(S)&&g.set(S,b.className)}return r.flatMap((b,v)=>b.value.split(m).map((w,_)=>{if(!w)return null;if(_%2===1){const N=g.get(oc(w))??"answer-highlight";return b.type==="bold"?ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},ks.createElement("strong",{className:"text-zinc-200 font-semibold"},w)):ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},w)}return b.type==="bold"?ks.createElement("strong",{key:`b-${v}-${_}`,className:"text-zinc-200 font-semibold"},w):w})).filter(Boolean)}function o3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function _b(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function af(e,n){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return n==="mentioned"||n==="visible"?"Mentioned in latest run":n==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function l3({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[m,g]=q.useState(-1),[b,v]=q.useState(null),[S,w]=q.useState(!1),[_,C]=q.useState({}),N=tT(n.project),T=new Set(N.map(ac)),R=e.runHistory,G=R.length>1,[H,K]=q.useState(null),Y=q.useRef(!1);q.useEffect(()=>{if(Y.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const te=R.at(-1);te&&(Y.current=!0,Fl(te.runId).then(ue=>{const ne=ue.snapshots?.find(Ne=>Ne.query===e.query&&Ne.provider===e.provider);ne&&K({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:te.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const X=m>=0&&b!==null,D=X?b:H||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:R.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=D.visibilityState==="pending"||D.citationState==="pending",oe=M?!1:D.visibilityState!=null?D.visibilityState==="visible":D.answerMentioned!=null?D.answerMentioned:D.citationState===ic.cited||D.citationState==="emerging",ke=D.answerMentioned!=null||D.visibilityState!=null||D.recommendedCompetitors.length>0,_e=D.citedDomains.length>0||D.groundingSources.length>0||D.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,et=[...N.map(ac),ve,ve.split(" ").slice(0,2).join(" "),...D.matchedTerms].filter(te=>te.trim().length>2),re=[...D.competitorDomains.flatMap(te=>{const ue=eT(te);return ue.length>=4?[ue]:[]}),...D.recommendedCompetitors].filter(te=>te.trim().length>2),pe=[{terms:et,className:"answer-highlight-brand"},...re.length>0?[{terms:re,className:"answer-highlight-competitor"}]:[]],$=M?"pending":D.visibilityTransition==="lost"?"lost":oe?"mentioned":"not-mentioned",F=q.useRef(0),de=q.useCallback(async te=>{const ue=++F.current;if(te===-1||te===R.length-1){g(-1),v(null),l(!1);return}g(te),l(!1);const ne=R[te],Ne=`${ne.runId}::${e.query}::${e.provider}`;if(_[Ne]){v(_[Ne]);return}w(!0);try{const tt=await Fl(ne.runId);if(ue!==F.current)return;const xe=tt.snapshots?.find(Ze=>Ze.query===e.query&&Ze.provider===e.provider)??tt.snapshots?.find(Ze=>Ze.query===e.query),$e=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ne.visibilityTransition,provider:xe.provider,model:xe.model??null,answerSnippet:xe.answerText??"",citedDomains:xe.citedDomains,competitorDomains:xe.competitorOverlap,recommendedCompetitors:xe.recommendedCompetitors??[],matchedTerms:xe.matchedTerms??[],groundingSources:xe.groundingSources,evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};C(Ze=>({...Ze,[Ne]:$e})),v($e)}catch{if(ue!==F.current)return;v({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{ue===F.current&&w(!1)}},[R,e.query,e.provider,_]),ie=(X||e.historyScope!=="provider")&&D.model?`${D.provider} (${D.model}) · ${D.changeLabel.toLowerCase()}`:`${D.provider} · ${D.changeLabel.toLowerCase()}`,Qe=!X&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",J=oe?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:ie}:D.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:ie}:M?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:ie},le=()=>{if(!D.answerSnippet)return null;const te=D.answerSnippet.split(`
56
+ `):"Run failed."}function _0(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function qM(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function UM(e){return e===null?"Unknown":e?"Pass":"Fail"}function pb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function $M(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function VM(e,n){if(!e)return{freq:"custom",hour:6,customCron:n};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const i=e.match(/^daily(?:@(\d+))?$/);if(i)return{freq:"daily",hour:i[1]?parseInt(i[1]):6,customCron:""};const r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:n}}function GM(e,n,i){const r=i==="UTC"?"UTC":i.split("/").pop()?.replace(/_/g," ")??i;if(!e)return`Custom: ${n} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const l=e.match(/^daily(?:@(\d+))?$/);if(l){const d=l[1]?parseInt(l[1]):6;return`Every day at ${pb(d)} · ${r}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},m=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${pb(m)} · ${r}`}return`${e} · ${r}`}function dO(e,n){return n&&n!==e?`${e} · ${n}`:e}function IM(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return dO(e,n)}const qe=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??W).getConfig().baseUrl};return n?.body&&(l.body=n.body),n?.headers&&(l.headers=n.headers),n?.path&&(l.path=n.path),n?.query&&(l.query=n.query),[l]},fO=e=>qe("getApiV1ProjectsByName",e),pO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fO(e)}),Ks=e=>qe("getApiV1Projects",e),op=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vw({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Ks(e)}),lp=e=>qe("getApiV1Runs",e),cp=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lp(e)}),mO=e=>qe("getApiV1RunsById",e),z0=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await dv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mO(e)}),hO=e=>qe("getApiV1Settings",e),gO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hO(e)}),yO=e=>qe("getApiV1ProjectsByNameGoogleConnections",e),HM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yO(e)}),bO=e=>qe("getApiV1ProjectsByNameGoogleProperties",e),ZM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Sj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bO(e)}),vO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformance",e),PM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Nj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vO(e)}),SO=e=>qe("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),KM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SO(e)}),xO=e=>qe("getApiV1ProjectsByNameGoogleGscInspections",e),QM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _j({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xO(e)}),wO=e=>qe("getApiV1ProjectsByNameGoogleGscDeindexed",e),YM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await zj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wO(e)}),jO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverage",e),XM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jO(e)}),NO=e=>qe("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),JM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Cj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:NO(e)}),FM=e=>qe("getApiV1ProjectsByNameGoogleGscSitemaps",e),kO=e=>qe("getApiV1ProjectsByNameBingStatus",e),WM=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Bj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:kO(e)}),AO=e=>qe("getApiV1ProjectsByNameBingSites",e),e6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Lj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:AO(e)}),_O=e=>qe("getApiV1ProjectsByNameBingCoverage",e),t6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_O(e)}),zO=e=>qe("getApiV1ProjectsByNameBingInspections",e),n6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:zO(e)}),CO=e=>qe("getApiV1ProjectsByNameBingPerformance",e),a6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ij({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:CO(e)}),TO=e=>qe("getApiV1ProjectsByNameGaStatus",e),i6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Pj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:TO(e)}),EO=e=>qe("getApiV1ProjectsByNameGaTraffic",e),s6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:EO(e)}),OO=e=>qe("getApiV1ProjectsByNameGaAiReferralHistory",e),r6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Yj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:OO(e)}),DO=e=>qe("getApiV1ProjectsByNameGaSocialReferralHistory",e),o6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Xj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:DO(e)}),RO=e=>qe("getApiV1ProjectsByNameGaSessionHistory",e),l6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:RO(e)}),MO=e=>qe("getApiV1ProjectsByNameReport",e),c6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:MO(e)}),BO=e=>qe("getApiV1ProjectsByNameCitationsVisibility",e),u6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await eN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:BO(e)}),LO=e=>qe("getApiV1ProjectsByNameTrafficSources",e),d6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:LO(e)}),qO=e=>qe("getApiV1ProjectsByNameTrafficStatus",e),f6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:qO(e)}),UO=e=>qe("getApiV1ProjectsByNameTrafficSourcesById",e),p6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:UO(e)}),$O=e=>qe("getApiV1ProjectsByNameTrafficEvents",e),m6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$O(e)}),VO=e=>qe("getApiV1ProjectsByNameDiscoverSessions",e),h6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:VO(e)}),GO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsById",e),g6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await AN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:GO(e)}),IO=e=>qe("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),y6=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:IO(e)}),HO=e=>qe("getApiV1ProjectsByNameAgentProviders",e),ZO=e=>Ue({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await CN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:HO(e)});function mb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function C0(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function b6(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function v6(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function S6(e){return e>=70?"positive":e>=40?"caution":"negative"}const x6={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function PO(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Us(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
57
+ `):void 0}function KO(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:mb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:mb(n.workerStatus),detail:n.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:n.workerStatus.detail};const l=i.providerStatuses.filter(g=>g.state==="ready").length,c=i.providerStatuses.length,d=l>0,m=i.providerStatuses.filter(g=>g.state==="ready").map(g=>PO(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:m||"None configured"}})}function QO(e,n){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!n.providerStatuses.some(i=>i.state==="ready"))return"Launch is blocked until at least one provider is configured."}function YO(e,n,i){const r=QO(n,i),l=structuredClone(e);return l.healthChecks=l.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:n.apiStatus.detail,state:n.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:n.workerStatus.detail,state:n.workerStatus.state==="ok"?"ready":"attention"};const d=i.providerStatuses.some(m=>m.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),l.launchState.enabled=r===void 0,l.launchState.blockedReason=r,l.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",l}const T0="canonry.run-tracker",wf=new Set;let hb=!1,XO=0,bc={runs:{},batches:{}};function JO(){const e=Ni();for(const n of wf)n(e)}function FO(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function WO(){typeof window>"u"||window.sessionStorage.setItem(T0,JSON.stringify(bc))}function E0(){hb||(hb=!0,!(typeof window>"u")&&(bc=FO(window.sessionStorage.getItem(T0))))}function vc(e){bc=e,WO(),JO()}function Ni(){return E0(),bc}function e4(e){return E0(),wf.add(e),()=>{wf.delete(e)}}function O0(e){const n=Ni();vc({...n,runs:{...n.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function gb(e){const n=Ni();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;vc({...n,runs:r})}function t4(e){const n=Ni(),i=`batch_${Date.now()}_${++XO}`;return vc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function n4(e){const n=Ni();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;vc({...n,batches:r})}function a4(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function i4(e,n){let i=0,r=0,l=0,c=0,d=0;for(const m of e){const g=n[m]?.status;g==="completed"?i+=1:g==="partial"?r+=1:g==="failed"?l+=1:g==="cancelled"?c+=1:d+=1}return{completed:i,partial:r,failed:l,cancelled:c,pending:d,finished:d===0}}const yb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,bb=av,D0=(e,n)=>i=>{var r;if(n?.variants==null)return bb(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const v=i?.[b],S=c?.[b];if(v===null)return null;const w=yb(v)||yb(S);return l[b][w]}),m=i&&Object.entries(i).reduce((b,v)=>{let[S,w]=v;return w===void 0||(b[S]=w),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,v)=>{let{class:S,className:w,..._}=v;return Object.entries(_).every(C=>{let[N,T]=C;return Array.isArray(T)?T.includes({...c,...m}[N]):{...c,...m}[N]===T})?[...b,S,w]:b},[]);return bb(e,d,g,i?.class,i?.className)},s4=(e,n)=>{const i=new Array(e.length+n.length);for(let r=0;r<e.length;r++)i[r]=e[r];for(let r=0;r<n.length;r++)i[e.length+r]=n[r];return i},r4=(e,n)=>({classGroupId:e,validator:n}),R0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),lc="-",vb=[],o4="arbitrary..",l4=e=>{const n=u4(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return c4(d);const m=d.split(lc),g=m[0]===""&&m.length>1?1:0;return M0(m,g,n)},getConflictingClassGroupIds:(d,m)=>{if(m){const g=r[d],b=i[d];return g?b?s4(b,g):g:b||vb}return i[d]||vb}}},M0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=M0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const m=n===0?e.join(lc):e.slice(n).join(lc),g=d.length;for(let b=0;b<g;b++){const v=d[b];if(v.validator(m))return v.classGroupId}},c4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),r=n.slice(0,i);return r?o4+r:void 0})(),u4=e=>{const{theme:n,classGroups:i}=e;return d4(i,n)},d4=(e,n)=>{const i=R0();for(const r in e){const l=e[r];up(l,i,r,n)}return i},up=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];f4(d,n,i,r)}},f4=(e,n,i,r)=>{if(typeof e=="string"){p4(e,n,i);return}if(typeof e=="function"){m4(e,n,i,r);return}h4(e,n,i,r)},p4=(e,n,i)=>{const r=e===""?n:B0(n,e);r.classGroupId=i},m4=(e,n,i,r)=>{if(g4(e)){up(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(r4(i,e))},h4=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[m,g]=l[d];up(g,B0(n,m),i,r)}},B0=(e,n)=>{let i=e;const r=n.split(lc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let m=i.nextPart.get(d);m||(m=R0(),i.nextPart.set(d,m)),i=m}return i},g4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,y4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),r=Object.create(null);const l=(c,d)=>{i[c]=d,n++,n>e&&(n=0,r=i,i=Object.create(null))};return{get(c){let d=i[c];if(d!==void 0)return d;if((d=r[c])!==void 0)return l(c,d),d},set(c,d){c in i?i[c]=d:l(c,d)}}},jf="!",Sb=":",b4=[],xb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),v4=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,m=0,g=0,b;const v=l.length;for(let N=0;N<v;N++){const T=l[N];if(d===0&&m===0){if(T===Sb){c.push(l.slice(g,N)),g=N+1;continue}if(T==="/"){b=N;continue}}T==="["?d++:T==="]"?d--:T==="("?m++:T===")"&&m--}const S=c.length===0?l:l.slice(g);let w=S,_=!1;S.endsWith(jf)?(w=S.slice(0,-1),_=!0):S.startsWith(jf)&&(w=S.slice(1),_=!0);const C=b&&b>g?b-g:void 0;return xb(c,_,w,C)};if(n){const l=n+Sb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):xb(b4,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},S4=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,r)=>{n.set(i,1e6+r)}),i=>{const r=[];let l=[];for(let c=0;c<i.length;c++){const d=i[c],m=d[0]==="[",g=n.has(d);m||g?(l.length>0&&(l.sort(),r.push(...l),l=[]),r.push(d)):l.push(d)}return l.length>0&&(l.sort(),r.push(...l)),r}},x4=e=>({cache:y4(e.cacheSize),parseClassName:v4(e),sortModifiers:S4(e),...l4(e)}),w4=/\s+/,j4=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],m=e.trim().split(w4);let g="";for(let b=m.length-1;b>=0;b-=1){const v=m[b],{isExternal:S,modifiers:w,hasImportantModifier:_,baseClassName:C,maybePostfixModifierPosition:N}=i(v);if(S){g=v+(g.length>0?" "+g:g);continue}let T=!!N,R=r(T?C.substring(0,N):C);if(!R){if(!T){g=v+(g.length>0?" "+g:g);continue}if(R=r(C),!R){g=v+(g.length>0?" "+g:g);continue}T=!1}const G=w.length===0?"":w.length===1?w[0]:c(w).join(":"),H=_?G+jf:G,K=H+R;if(d.indexOf(K)>-1)continue;d.push(K);const Y=l(R,T);for(let X=0;X<Y.length;++X){const D=Y[X];d.push(H+D)}g=v+(g.length>0?" "+g:g)}return g},N4=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=L0(i))&&(l&&(l+=" "),l+=r);return l},L0=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=L0(e[r]))&&(i&&(i+=" "),i+=n);return i},k4=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((v,S)=>S(v),e());return i=x4(b),r=i.cache.get,l=i.cache.set,c=m,m(g)},m=g=>{const b=r(g);if(b)return b;const v=j4(g,i);return l(g,v),v};return c=d,(...g)=>c(N4(...g))},A4=[],At=e=>{const n=i=>i[e]||A4;return n.isThemeGetter=!0,n},q0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,U0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,z4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,T4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,E4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>_4.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),Ga=e=>!!e&&Number.isInteger(Number(e)),nf=e=>e.endsWith("%")&&Te(e.slice(0,-1)),fa=e=>z4.test(e),$0=()=>!0,D4=e=>C4.test(e)&&!T4.test(e),dp=()=>!1,R4=e=>E4.test(e),M4=e=>O4.test(e),B4=e=>!me(e)&&!he(e),L4=e=>Xa(e,I0,dp),me=e=>q0.test(e),bi=e=>Xa(e,H0,D4),wb=e=>Xa(e,Z4,Te),q4=e=>Xa(e,P0,$0),U4=e=>Xa(e,Z0,dp),jb=e=>Xa(e,V0,dp),$4=e=>Xa(e,G0,M4),ql=e=>Xa(e,K0,R4),he=e=>U0.test(e),Xr=e=>zi(e,H0),V4=e=>zi(e,Z0),Nb=e=>zi(e,V0),G4=e=>zi(e,I0),I4=e=>zi(e,G0),Ul=e=>zi(e,K0,!0),H4=e=>zi(e,P0,!0),Xa=(e,n,i)=>{const r=q0.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},zi=(e,n,i=!1)=>{const r=U0.exec(e);return r?r[1]?n(r[1]):i:!1},V0=e=>e==="position"||e==="percentage",G0=e=>e==="image"||e==="url",I0=e=>e==="length"||e==="size"||e==="bg-size",H0=e=>e==="length",Z4=e=>e==="number",Z0=e=>e==="family-name",P0=e=>e==="number"||e==="weight",K0=e=>e==="shadow",P4=()=>{const e=At("color"),n=At("font"),i=At("text"),r=At("font-weight"),l=At("tracking"),c=At("leading"),d=At("breakpoint"),m=At("container"),g=At("spacing"),b=At("radius"),v=At("shadow"),S=At("inset-shadow"),w=At("text-shadow"),_=At("drop-shadow"),C=At("blur"),N=At("perspective"),T=At("aspect"),R=At("ease"),G=At("animate"),H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...K(),he,me],X=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],M=()=>[he,me,g],oe=()=>[Va,"full","auto",...M()],ke=()=>[Ga,"none","subgrid",he,me],_e=()=>["auto",{span:["full",Ga,he,me]},Ga,he,me],ve=()=>[Ga,"auto",he,me],et=()=>["auto","min","max","fr",he,me],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],pe=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...M()],F=()=>[Va,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],de=()=>[Va,"screen","full","dvw","lvw","svw","min","max","fit",...M()],je=()=>[Va,"screen","full","lh","dvh","lvh","svh","min","max","fit",...M()],ie=()=>[e,he,me],Qe=()=>[...K(),Nb,jb,{position:[he,me]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],le=()=>["auto","cover","contain",G4,L4,{size:[he,me]}],te=()=>[nf,Xr,bi],ue=()=>["","none","full",b,he,me],ne=()=>["",Te,Xr,bi],Ne=()=>["solid","dashed","dotted","double"],tt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Te,nf,Nb,jb],$e=()=>["","none",C,he,me],Ze=()=>["none",Te,he,me],Ct=()=>["none",Te,he,me],zn=()=>[Te,he,me],Tt=()=>[Va,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fa],breakpoint:[fa],color:[$0],container:[fa],"drop-shadow":[fa],ease:["in","out","in-out"],font:[B4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fa],shadow:[fa],spacing:["px",Te],text:[fa],"text-shadow":[fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Va,me,he,T]}],container:["container"],columns:[{columns:[Te,me,he,m]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:oe()}],"inset-x":[{"inset-x":oe()}],"inset-y":[{"inset-y":oe()}],start:[{"inset-s":oe(),start:oe()}],end:[{"inset-e":oe(),end:oe()}],"inset-bs":[{"inset-bs":oe()}],"inset-be":[{"inset-be":oe()}],top:[{top:oe()}],right:[{right:oe()}],bottom:[{bottom:oe()}],left:[{left:oe()}],visibility:["visible","invisible","collapse"],z:[{z:[Ga,"auto",he,me]}],basis:[{basis:[Va,"full","auto",m,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,Va,"auto","initial","none",me]}],grow:[{grow:["",Te,he,me]}],shrink:[{shrink:["",Te,he,me]}],order:[{order:[Ga,"first","last","none",he,me]}],"grid-cols":[{"grid-cols":ke()}],"col-start-end":[{col:_e()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":ke()}],"row-start-end":[{row:_e()}],"row-start":[{"row-start":ve()}],"row-end":[{"row-end":ve()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":et()}],"auto-rows":[{"auto-rows":et()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...pe(),"normal"]}],"justify-self":[{"justify-self":["auto",...pe()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...pe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...pe(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...pe(),"baseline"]}],"place-self":[{"place-self":["auto",...pe()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pbs:[{pbs:M()}],pbe:[{pbe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...de()]}],"min-inline-size":[{"min-inline":["auto",...de()]}],"max-inline-size":[{"max-inline":["none",...de()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[m,"screen",...F()]}],"min-w":[{"min-w":[m,"screen","none",...F()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",i,Xr,bi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,H4,q4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nf,me]}],"font-family":[{font:[V4,U4,n]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,he,me]}],"line-clamp":[{"line-clamp":[Te,"none",he,wb]}],leading:[{leading:[c,...M()]}],"list-image":[{"list-image":["none",he,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:ie()}],"text-color":[{text:ie()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",he,bi]}],"text-decoration-color":[{decoration:ie()}],"underline-offset":[{"underline-offset":[Te,"auto",he,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Qe()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:le()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ga,he,me],radial:["",he,me],conic:[Ga,he,me]},I4,$4]}],"bg-color":[{bg:ie()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:ie()}],"gradient-via":[{via:ie()}],"gradient-to":[{to:ie()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ne(),"hidden","none"]}],"divide-style":[{divide:[...Ne(),"hidden","none"]}],"border-color":[{border:ie()}],"border-color-x":[{"border-x":ie()}],"border-color-y":[{"border-y":ie()}],"border-color-s":[{"border-s":ie()}],"border-color-e":[{"border-e":ie()}],"border-color-bs":[{"border-bs":ie()}],"border-color-be":[{"border-be":ie()}],"border-color-t":[{"border-t":ie()}],"border-color-r":[{"border-r":ie()}],"border-color-b":[{"border-b":ie()}],"border-color-l":[{"border-l":ie()}],"divide-color":[{divide:ie()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,he,me]}],"outline-w":[{outline:["",Te,Xr,bi]}],"outline-color":[{outline:ie()}],shadow:[{shadow:["","none",v,Ul,ql]}],"shadow-color":[{shadow:ie()}],"inset-shadow":[{"inset-shadow":["none",S,Ul,ql]}],"inset-shadow-color":[{"inset-shadow":ie()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ie()}],"ring-offset-w":[{"ring-offset":[Te,bi]}],"ring-offset-color":[{"ring-offset":ie()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":ie()}],"text-shadow":[{"text-shadow":["none",w,Ul,ql]}],"text-shadow-color":[{"text-shadow":ie()}],opacity:[{opacity:[Te,he,me]}],"mix-blend":[{"mix-blend":[...tt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":tt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":xe()}],"mask-image-linear-from-color":[{"mask-linear-from":ie()}],"mask-image-linear-to-color":[{"mask-linear-to":ie()}],"mask-image-t-from-pos":[{"mask-t-from":xe()}],"mask-image-t-to-pos":[{"mask-t-to":xe()}],"mask-image-t-from-color":[{"mask-t-from":ie()}],"mask-image-t-to-color":[{"mask-t-to":ie()}],"mask-image-r-from-pos":[{"mask-r-from":xe()}],"mask-image-r-to-pos":[{"mask-r-to":xe()}],"mask-image-r-from-color":[{"mask-r-from":ie()}],"mask-image-r-to-color":[{"mask-r-to":ie()}],"mask-image-b-from-pos":[{"mask-b-from":xe()}],"mask-image-b-to-pos":[{"mask-b-to":xe()}],"mask-image-b-from-color":[{"mask-b-from":ie()}],"mask-image-b-to-color":[{"mask-b-to":ie()}],"mask-image-l-from-pos":[{"mask-l-from":xe()}],"mask-image-l-to-pos":[{"mask-l-to":xe()}],"mask-image-l-from-color":[{"mask-l-from":ie()}],"mask-image-l-to-color":[{"mask-l-to":ie()}],"mask-image-x-from-pos":[{"mask-x-from":xe()}],"mask-image-x-to-pos":[{"mask-x-to":xe()}],"mask-image-x-from-color":[{"mask-x-from":ie()}],"mask-image-x-to-color":[{"mask-x-to":ie()}],"mask-image-y-from-pos":[{"mask-y-from":xe()}],"mask-image-y-to-pos":[{"mask-y-to":xe()}],"mask-image-y-from-color":[{"mask-y-from":ie()}],"mask-image-y-to-color":[{"mask-y-to":ie()}],"mask-image-radial":[{"mask-radial":[he,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":xe()}],"mask-image-radial-from-color":[{"mask-radial-from":ie()}],"mask-image-radial-to-color":[{"mask-radial-to":ie()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":K()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":xe()}],"mask-image-conic-from-color":[{"mask-conic-from":ie()}],"mask-image-conic-to-color":[{"mask-conic-to":ie()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Qe()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,me]}],filter:[{filter:["","none",he,me]}],blur:[{blur:$e()}],brightness:[{brightness:[Te,he,me]}],contrast:[{contrast:[Te,he,me]}],"drop-shadow":[{"drop-shadow":["","none",_,Ul,ql]}],"drop-shadow-color":[{"drop-shadow":ie()}],grayscale:[{grayscale:["",Te,he,me]}],"hue-rotate":[{"hue-rotate":[Te,he,me]}],invert:[{invert:["",Te,he,me]}],saturate:[{saturate:[Te,he,me]}],sepia:[{sepia:["",Te,he,me]}],"backdrop-filter":[{"backdrop-filter":["","none",he,me]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[Te,he,me]}],"backdrop-contrast":[{"backdrop-contrast":[Te,he,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,he,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,he,me]}],"backdrop-invert":[{"backdrop-invert":["",Te,he,me]}],"backdrop-opacity":[{"backdrop-opacity":[Te,he,me]}],"backdrop-saturate":[{"backdrop-saturate":[Te,he,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,he,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",he,me]}],ease:[{ease:["linear","initial",R,he,me]}],delay:[{delay:[Te,he,me]}],animate:[{animate:["none",G,he,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[N,he,me]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:Ct()}],"scale-x":[{"scale-x":Ct()}],"scale-y":[{"scale-y":Ct()}],"scale-z":[{"scale-z":Ct()}],"scale-3d":["scale-3d"],skew:[{skew:zn()}],"skew-x":[{"skew-x":zn()}],"skew-y":[{"skew-y":zn()}],transform:[{transform:[he,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Tt()}],"translate-x":[{"translate-x":Tt()}],"translate-y":[{"translate-y":Tt()}],"translate-z":[{"translate-z":Tt()}],"translate-none":["translate-none"],accent:[{accent:ie()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ie()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mbs":[{"scroll-mbs":M()}],"scroll-mbe":[{"scroll-mbe":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pbs":[{"scroll-pbs":M()}],"scroll-pbe":[{"scroll-pbe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he,me]}],fill:[{fill:["none",...ie()]}],"stroke-w":[{stroke:[Te,Xr,bi,wb]}],stroke:[{stroke:["none",...ie()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},K4=k4(P4);function _n(...e){return K4(av(e))}const Q4=D0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-10 px-4 md:h-9",sm:"h-9 px-3 text-xs md:h-8",icon:"size-10 md:size-9"}},defaultVariants:{variant:"default",size:"default"}}),Le=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?hw:"button";return f.jsx(d,{ref:c,className:_n(Q4({variant:n,size:i,className:e})),...l})});Le.displayName="Button";const Y4=D0("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function Q0({className:e,variant:n,...i}){return f.jsx("div",{className:_n(Y4({variant:n}),e),...i})}const X4=220;function kb({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=q.useState(!1),m=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},X4)};return e?f.jsxs(rt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),f.jsx("span",{className:"brand-copy",children:f.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):f.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[f.jsx(rt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:f.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),f.jsxs("div",{className:"brand-copy",children:[f.jsx(rt,{to:"/",className:"brand-mark",children:"Canonry"}),m?f.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[f.jsxs("a",{className:"brand-update-bubble-link",href:i.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${i.upgradeCommand}`,"aria-label":`New version v${i.latest} available — open release page`,children:[f.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),f.jsx(Nk,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),f.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),f.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:f.jsx(Hs,{className:"size-3","aria-hidden":"true"})})]}):l?f.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function J4({provider:e}){const n={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return f.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${n[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Bn({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(Q0,{variant:r,...i,children:n})}function fp({status:e}){return f.jsx(Bn,{tone:C0(e),children:_0(e)})}const F4=nv,W4=Wb,Y0=q.forwardRef(({className:e,...n},i)=>f.jsx(Df,{ref:i,className:_n("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));Y0.displayName=Df.displayName;const e3=400,t3=1200,n3=720,X0=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(n3),d=q.useRef(!1),m=q.useRef(0),g=q.useRef(0),b=q.useCallback(w=>{d.current=!0,m.current=w.clientX,g.current=l,w.target.setPointerCapture(w.pointerId),w.preventDefault()},[l]),v=q.useCallback(w=>{if(!d.current)return;const _=m.current-w.clientX,C=Math.min(t3,Math.max(e3,g.current+_));c(C)},[]),S=q.useCallback(()=>{d.current=!1},[]);return f.jsxs(W4,{children:[f.jsx(Y0,{}),f.jsxs(Rf,{ref:r,className:_n("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${l}px, 100vw)`},...i,children:[f.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:b,onPointerMove:v,onPointerUp:S}),n,f.jsxs(ev,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[f.jsx(Hs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});X0.displayName=Rf.displayName;const a3=({className:e,...n})=>f.jsx("div",{className:_n("flex flex-col gap-1.5 pr-10",e),...n}),J0=q.forwardRef(({className:e,...n},i)=>f.jsx(Mf,{ref:i,className:_n("text-lg font-medium text-zinc-50",e),...n}));J0.displayName=Mf.displayName;const F0=q.forwardRef(({className:e,...n},i)=>f.jsx(tv,{ref:i,className:_n("text-sm text-zinc-500",e),...n}));F0.displayName=tv.displayName;function i3({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(F4,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(X0,{children:[f.jsxs(a3,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(J0,{id:"drawer-title",children:e}),f.jsx(F0,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function $l({text:e}){const[n,i]=q.useState(null),r=q.useRef(null),l=q.useCallback(()=>{if(!r.current)return;const m=r.current.getBoundingClientRect();i({top:m.top,left:m.left+m.width/2})},[]),c=q.useCallback(()=>i(null),[]),d=q.useCallback(()=>{n===null?l():c()},[n,l,c]);return f.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[f.jsx("button",{ref:r,type:"button",className:"info-tooltip-trigger","aria-label":e,"aria-expanded":n!==null,onFocus:l,onBlur:c,onClick:d,onKeyDown:m=>{m.key==="Escape"&&c()},children:f.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),n!==null&&ow.createPortal(f.jsx("span",{"aria-hidden":"true",style:{position:"fixed",top:n.top,left:n.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const s3=/[\s\-_]+/;function r3(e){const n=e.split(s3).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Ab(e,n){const i=o3(n),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(b=>b.startsWith("**")&&b.endsWith("**")?{type:"bold",value:b.slice(2,-2)}:{type:"text",value:b}),l=i.flatMap(b=>b.terms).filter(b=>b.trim().length>1);if(l.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,v)=>v.length-b.length).map(r3).filter(b=>!!b);if(d.length===0)return r.map((b,v)=>b.type==="bold"?ks.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},b.value):b.value).filter(Boolean);const m=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const v of b.terms){const S=oc(v);S&&!g.has(S)&&g.set(S,b.className)}return r.flatMap((b,v)=>b.value.split(m).map((w,_)=>{if(!w)return null;if(_%2===1){const N=g.get(oc(w))??"answer-highlight";return b.type==="bold"?ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},ks.createElement("strong",{className:"text-zinc-200 font-semibold"},w)):ks.createElement("mark",{key:`hl-${v}-${_}`,className:N},w)}return b.type==="bold"?ks.createElement("strong",{key:`b-${v}-${_}`,className:"text-zinc-200 font-semibold"},w):w})).filter(Boolean)}function o3(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function _b(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function af(e,n){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return n==="mentioned"||n==="visible"?"Mentioned in latest run":n==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function l3({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[m,g]=q.useState(-1),[b,v]=q.useState(null),[S,w]=q.useState(!1),[_,C]=q.useState({}),N=tT(n.project),T=new Set(N.map(ac)),R=e.runHistory,G=R.length>1,[H,K]=q.useState(null),Y=q.useRef(!1);q.useEffect(()=>{if(Y.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const te=R.at(-1);te&&(Y.current=!0,Fl(te.runId).then(ue=>{const ne=ue.snapshots?.find(Ne=>Ne.query===e.query&&Ne.provider===e.provider);ne&&K({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:te.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const X=m>=0&&b!==null,D=X?b:H||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:R.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},M=D.visibilityState==="pending"||D.citationState==="pending",oe=M?!1:D.visibilityState!=null?D.visibilityState==="visible":D.answerMentioned!=null?D.answerMentioned:D.citationState===ic.cited||D.citationState==="emerging",ke=D.answerMentioned!=null||D.visibilityState!=null||D.recommendedCompetitors.length>0,_e=D.citedDomains.length>0||D.groundingSources.length>0||D.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,et=[...N.map(ac),ve,ve.split(" ").slice(0,2).join(" "),...D.matchedTerms].filter(te=>te.trim().length>2),re=[...D.competitorDomains.flatMap(te=>{const ue=eT(te);return ue.length>=4?[ue]:[]}),...D.recommendedCompetitors].filter(te=>te.trim().length>2),pe=[{terms:et,className:"answer-highlight-brand"},...re.length>0?[{terms:re,className:"answer-highlight-competitor"}]:[]],$=M?"pending":D.visibilityTransition==="lost"?"lost":oe?"mentioned":"not-mentioned",F=q.useRef(0),de=q.useCallback(async te=>{const ue=++F.current;if(te===-1||te===R.length-1){g(-1),v(null),l(!1);return}g(te),l(!1);const ne=R[te],Ne=`${ne.runId}::${e.query}::${e.provider}`;if(_[Ne]){v(_[Ne]);return}w(!0);try{const tt=await Fl(ne.runId);if(ue!==F.current)return;const xe=tt.snapshots?.find(Ze=>Ze.query===e.query&&Ze.provider===e.provider)??tt.snapshots?.find(Ze=>Ze.query===e.query),$e=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ne.visibilityTransition,provider:xe.provider,model:xe.model??null,answerSnippet:xe.answerText??"",citedDomains:xe.citedDomains,competitorDomains:xe.competitorOverlap,recommendedCompetitors:xe.recommendedCompetitors??[],matchedTerms:xe.matchedTerms??[],groundingSources:xe.groundingSources,evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};C(Ze=>({...Ze,[Ne]:$e})),v($e)}catch{if(ue!==F.current)return;v({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:af(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{ue===F.current&&w(!1)}},[R,e.query,e.provider,_]),ie=(X||e.historyScope!=="provider")&&D.model?`${D.provider} (${D.model}) · ${D.changeLabel.toLowerCase()}`:`${D.provider} · ${D.changeLabel.toLowerCase()}`,Qe=!X&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",J=oe?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:ie}:D.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:ie}:M?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:ie},le=()=>{if(!D.answerSnippet)return null;const te=D.answerSnippet.split(`
58
58
  `),ue=[];let ne=[],Ne=0;const tt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&ue.push(f.jsx("p",{className:ue.length>0?"mt-2.5":"",children:Ab(xe,pe)},Ne++)),ne=[]};for(const xe of te){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){tt(),ue.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ne++));continue}const Ze=$e.match(/^(#{1,3})\s+(\S.*)$/);if(Ze){tt();const Ct=Ze[1].length,zn=Ze[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||Ze[2],Tt=Ct===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Ct===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";ue.push(f.jsx("p",{className:Tt,children:Ab(zn,pe)},Ne++));continue}if($e===""){tt();continue}ne.push($e)}return tt(),ue};return f.jsx(nv,{open:!0,onOpenChange:te=>{te||i()},children:f.jsxs(Wb,{children:[f.jsx(Df,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(Rf,{className:"evidence-modal","aria-describedby":void 0,children:[f.jsxs("div",{className:"evidence-modal-header",children:[f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," ","·"," ",D.provider||"All providers"]}),f.jsx(Mf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(ev,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[f.jsx(Hs,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]}),G&&f.jsxs("div",{className:"evidence-modal-timeline",children:[f.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),f.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:R.map((te,ue)=>{const ne=m===-1&&ue===R.length-1||m===ue,Ne=te.visibilityState??(te.answerMentioned?"visible":"not-visible"),tt=te.visibilityTransition??Ne,xe=Ne==="visible"?"bg-emerald-400":tt==="emerging"?"bg-amber-400":tt==="lost"?"bg-rose-400":"bg-zinc-600",Ze=new Date(te.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Ct=!!(te.model&&ue>0&&R[ue-1]?.model&&R[ue-1].model!==te.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{de(ue===R.length-1?-1:ue)},"aria-label":[`Run ${Ze}: ${Ne}`,te.model?`model ${te.model}`:null,Ct?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Ct?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),f.jsx("span",{className:"text-[10px] text-zinc-500",children:Ze})]},ue)})}),m>=0&&m<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[m].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[m].visibilityState??(R[m].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{de(-1)},children:["←"," Back to latest"]})]}),!X&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(te=>f.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${te.fromModel??"unknown"} -> ${te.toModel??"unknown"} on ${new Date(te.createdAt).toLocaleDateString()}`},`${te.runId}:${te.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[S&&f.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!S&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"evidence-modal-main",children:[f.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${$}`,children:[f.jsx("p",{className:`evidence-position-label evidence-position-label--${$}`,children:J.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:J.title}),f.jsx("p",{className:"evidence-position-meta",children:J.meta}),Qe&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Qe})]}),D.answerSnippet&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),f.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:le()}),D.answerSnippet.length>280&&f.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>l(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!D.answerSnippet&&!S&&f.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!X&&e.relatedTechnicalSignals.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:oe?"Why you're visible":"What to fix"}),f.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((te,ue)=>f.jsxs("div",{className:"action-item",children:[f.jsx("svg",{className:`action-item-icon ${oe?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:oe?f.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),f.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),f.jsx("span",{className:"action-item-text",children:te})]},ue))})]}),D.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:D.summary})]}),f.jsxs("div",{className:"evidence-modal-sidebar",children:[(ke||_e)&&f.jsxs("div",{className:"sidebar-tabs",children:[f.jsx("button",{className:`sidebar-tab ${c==="mentions"?"sidebar-tab--active":""}`,onClick:()=>d("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),f.jsx("button",{className:`sidebar-tab ${c==="sources"?"sidebar-tab--active":""}`,onClick:()=>d("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),c==="mentions"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Mention in answer"}),f.jsx($l,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),f.jsxs("div",{className:`mention-status mention-status--${oe?"mentioned":"not-mentioned"}`,children:[f.jsx("span",{className:"mention-status-icon",children:M?"…":oe?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:M?"Pending":oe?"Mentioned":"Not mentioned"})]}),D.matchedTerms.length>0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.matchedTerms.map(te=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:te},te))})]}),!M&&!oe&&D.matchedTerms.length===0&&f.jsxs("div",{className:"mt-2",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:et.map(te=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:te},te))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(D.recommendedCompetitors.length>0||D.competitorDomains.length>0)&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Competitors in answer"}),f.jsx($l,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const te=D.competitorDomains.map(Ne=>Ne.replace(/^www\./,"")),ue=new Set(te.map(Ne=>oc(Ne.replace(/\.[^.]+$/,""))));return[...D.recommendedCompetitors.filter(Ne=>!ue.has(oc(Ne))),...te].map(Ne=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ne},Ne))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[D.citedDomains.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Domains from source links"}),f.jsx($l,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),f.jsx("div",{className:"citation-leaderboard",children:D.citedDomains.map((te,ue)=>{const ne=te.toLowerCase().replace(/^www\./,""),Ne=T.has(ne),tt=!Ne&&D.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ne),xe=Ne?"you":tt?"competitor":"other";return f.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[f.jsxs("span",{className:"citation-leaderboard-rank",children:["#",ue+1]}),f.jsx("span",{className:"citation-leaderboard-domain",children:te}),Ne&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),tt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},te)})})]}),D.groundingSources.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsxs("span",{children:["Grounding source links (",D.groundingSources.length,")"]}),f.jsx($l,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),f.jsx("ul",{className:"grid gap-0.5",children:D.groundingSources.map((te,ue)=>{const ne=_b(te.uri),Ne=te.title||te.uri;return f.jsx("li",{className:"truncate text-sm",children:ne?f.jsx("a",{href:ne,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Ne}):f.jsx("span",{className:"text-zinc-400",children:Ne})},ue)})})]}),D.evidenceUrls.length>0&&f.jsxs("div",{children:[f.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),f.jsx("ul",{className:"grid gap-1",children:D.evidenceUrls.map(te=>{const ue=_b(te);return f.jsx("li",{className:"truncate text-sm",children:ue?f.jsx("a",{href:ue,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:te}):f.jsx("span",{className:"text-zinc-400",children:te})},te)})})]}),D.citedDomains.length===0&&D.groundingSources.length===0&&D.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",X?"for this run":"yet"]})]}),!ke&&!_e&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",X?"for this run":"yet"]})]})]})]})]})]})})}function Mn(e){const n=new Date("2026-02-20");return e.map((i,r)=>({runId:`run_mock_${r+1}`,citationState:i,createdAt:new Date(n.getTime()+r*2*24*60*60*1e3).toISOString()}))}const sf=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["lead gen"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["multi-location"],labels:{},providers:[],locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Sc(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const c3=Sc({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),u3=Sc({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),d3=Sc({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),f3=Sc({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),p3=[{id:"evidence_citypoint_emergency_gemini",query:"emergency dentist brooklyn",provider:"gemini",model:"gemini-2.5-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:Mn(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:Mn(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",query:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-2.5-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:Mn(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",query:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-2.5-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",query:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:Mn(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];sf[0],sf[1],Mn(["cited","cited","cited","cited","cited"]),sf[2],2/7,3/7,Mn(["not-cited","not-cited","not-cited","cited"]);function m3(e,n){return e.runs.find(i=>i.id===n)}function h3(e,n){for(const i of e.projects){const r=i.visibilityEvidence.find(l=>l.id===n);if(r)return{project:i,evidence:r}}}function g3(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return h3(n,i)}const y3={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},b3={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor"},v3={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},S3={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function x3(e){return{id:e.id,tone:y3[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??S3[e.type],actionGroup:b3[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:v3[e.type]}]}}function w3(e){return e.filter(n=>!n.dismissed).map(x3)}function W0(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,providers:e.providers??[],locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function zb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function j3(e,n){if(!e)return"Waiting";if(!n)return"Running";const i=new Date(n).getTime()-new Date(e).getTime();if(i<1e3)return"<1s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const l=Math.floor(r/60),c=r%60;return`${l}m ${c}s`}function e1(e){switch(e){case Ee["answer-visibility"]:return"Answer visibility sweep";case Ee["gsc-sync"]:return"GSC sync";case Ee["inspect-sitemap"]:return"Sitemap inspection";case Ee["ga-sync"]:return"GA sync";case Ee["traffic-sync"]:return"Traffic sync";case Ee["bing-inspect"]:return"Bing URL inspection";case Ee["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ee["site-audit"]:return"Site audit";case Ee["backlink-extract"]:return"Backlink extract";case Ee["aeo-discover-seed"]:return"Discovery (seed phase)";case Ee["aeo-discover-probe"]:return"Discovery (probe phase)"}}function N3(e){return e===Rs.manual?"Manual":e===Rs.scheduled?"Scheduled":e===Rs["config-apply"]?"Config apply":e}function pp(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:e1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?zb(e.startedAt):zb(e.createdAt),duration:j3(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?t1(e.error):k3(e),summary:A3(e),triggerLabel:N3(e.trigger)}}function t1(e){const n=Yf(e);return n.length>200?n.slice(0,200)+"…":n}function k3(e){switch(e.status){case Ht.queued:return"Waiting for execution slot.";case Ht.running:return"Provider queries in progress.";case Ht.completed:return"All queries checked.";case Ht.partial:return"Run completed with some queries skipped.";case Ht.failed:return e.error?t1(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function A3(e){const n=e1(e.kind);switch(e.status){case Ht.queued:return`${n} queued`;case Ht.running:return`${n} in progress`;case Ht.completed:return`${n} completed`;case Ht.partial:return`${n} partially completed`;case Ht.failed:return`${n} failed`;case Ht.cancelled:return`${n} cancelled`;default:return e.status}}function _3(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const m=i.flatMap(C=>C.snapshots??[]),g=new Map;for(const C of m)if(C.query){const N=`${C.query}::${C.provider}::${C.location??""}`;g.set(N,C)}const b=new Set(m.map(C=>C.location??null));b.size===0&&b.add(null);const v=new Set(m.map(C=>C.provider)),S=new Set(n.flatMap(C=>Object.keys(C.providerRuns??{}))),w=[...new Set([...v,...S])].sort(),_=w.length>0?w:["gemini"];for(const C of n){if(C.runs.length===0)continue;d.add(C.query);const N=C.runs.at(-1),T=N?.transition??"not-cited";for(const R of _){const G=[...b].filter(Y=>g.has(`${C.query}::${R}::${Y??""}`)),H=(C.providerRuns?.[R]?.length??0)>0,K=G.length>0?G:H?[null]:[];for(const Y of K){const X=Y??"",D=g.get(`${C.query}::${R}::${X}`),M=D?.model??null,oe=M?`${R}:${M}`:null,ke=C.providerRuns?.[R],_e=oe?C.modelRuns?.[oe]:void 0,ve=$e=>$e?.filter(Ze=>(Ze.location??null)===Y),et=G.length>0?ve(ke):ke,re=G.length>0?ve(_e):_e,pe=(et?.length?et:null)??(re?.length?re:null),$=et?.length?"provider":re?.length?"model":"query",F=pe?pe.at(-1).transition:T,de=pe?pe.at(-1).visibilityTransition??(pe.at(-1).visibilityState==="visible"?"visible":"not-visible"):N?.visibilityTransition??(N?.visibilityState==="visible"?"visible":"not-visible"),je=pe?.at(-1)?.citationState,ie=pe?.at(-1)?.visibilityState,Qe=D?F==="lost"?"lost":F==="emerging"?"emerging":D.citationState===ic.cited?"cited":"not-cited":je===ic.cited?"cited":"not-cited",J=D?.visibilityState??(ie==="visible"?"visible":ie==="pending"?"pending":"not-visible"),le=Cb(pe||C.runs),te=Tb(pe||C.runs),ue=z3(C,R),ne=(pe??C.runs).map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt,model:ue.get($e.runId)??null,answerMentioned:$e.answerMentioned,visibilityState:$e.visibilityState,visibilityTransition:$e.visibilityTransition,mentionState:$e.mentionState,mentionTransition:$e.mentionTransition})),Ne=C3(ne),tt=$==="provider"&&Ne.length<=1?"model":$,xe=T3(ne);l.push({id:`evidence_${e}_${c++}`,query:C.query,provider:D?.provider??R,model:D?.model??null,location:D?.location??Y,citationState:Qe,answerMentioned:D?.answerMentioned,visibilityState:J,visibilityChangeLabel:Eb(de,te,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Eb(F,le),answerSnippet:D?.answerText??"",citedDomains:D?.citedDomains??[],evidenceUrls:[],competitorDomains:D?.competitorOverlap??[],recommendedCompetitors:D?.recommendedCompetitors??[],matchedTerms:D?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:D?.groundingSources??[],summary:E3(J,de,C.query),runHistory:ne,historyScope:tt,modelsSeen:Ne,modelTransitions:xe})}}}}for(const m of r)d.has(m.query)||l.push({id:`evidence_${e}_${c++}`,query:m.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${m.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function z3(e,n){const i=new Map,r=`${n}:`;for(const[l,c]of Object.entries(e.modelRuns??{})){if(!l.startsWith(r))continue;const d=l.slice(r.length),m=d==="unknown"?null:d;for(const g of c)i.set(g.runId,m)}return i}function C3(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function T3(e){const n=[];let i=null;for(const r of e){const l=r.model??null;l!==i&&i!==null&&n.push({runId:r.runId,createdAt:r.createdAt,fromModel:i,toModel:l}),i=l}return n}function Cb(e){if(e.length===0)return 0;const n=e[e.length-1].citationState;let i=0;for(let r=e.length-1;r>=0&&e[r].citationState===n;r--)i++;return i}function Tb(e){if(e.length===0)return 0;const n=e[e.length-1].visibilityState??"not-visible";let i=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===n;r--)i++;return i}function Eb(e,n,i){const r={positive:i?.positive??"cited",negative:i?.negative??"not cited",first:i?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return n<=1?`${Jr(r.positive)} in latest run`:`${Jr(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return Jr(r.first);case"not-cited":case"not-visible":return n<=1?`${Jr(r.negative)} in latest run`:`${Jr(r.negative)} across ${n} runs`;default:return e}}function Jr(e){return e.charAt(0).toUpperCase()+e.slice(1)}function E3(e,n,i){switch(n){case"lost":return`Mention was lost for "${i}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${i}".`}switch(e){case"visible":return`Your brand or domain is mentioned in AI answers for "${i}".`;case"pending":return`"${i}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${i}".`}}function n1(e){const n=W0(e.project),i=_3(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>pp(c,e.project.displayName||e.project.name));return e.overview?O3(n,e.overview,i,l):D3(n,i,l)}function O3(e,n,i,r){const l=w3(n.topInsights);for(const c of n.attentionItems)c.id.startsWith("insight_")||l.push({id:c.id,tone:c.tone,title:c.title,detail:c.detail,actionLabel:c.actionLabel,actionGroup:"investigate",affectedPhrases:[]});return{project:e,dateRangeLabel:n.dateRangeLabel,contextLabel:n.contextLabel,mentionSummary:n.scores.mention,visibilitySummary:n.scores.visibility,mentionShareSummary:n.scores.mentionShare,queryCounts:{cited:n.queryCounts.citedQueries,total:n.queryCounts.totalQueries},gapQueries:n.scores.gapQueries,mentionGaps:n.scores.mentionGaps,indexCoverage:n.scores.indexCoverage,providerScores:n.providerScores,competitorPressure:n.scores.competitorPressure,runStatus:n.scores.runStatus,movementSummary:n.movementSummary,insights:l,visibilityEvidence:i,competitors:n.competitors.map(c=>({id:c.id,domain:c.domain,citationCount:c.citationCount,totalQueries:c.totalQueries,pressureLabel:c.pressureLabel,citedQueries:c.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5),suggestedQueries:n.suggestedQueries}}function D3(e,n,i){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,mentionSummary:{...r,label:"Mention Coverage"},visibilitySummary:{...r,label:"Citation Coverage"},mentionShareSummary:{...r,label:"Mention Share",breakdown:{projectMentionSnapshots:0,competitorMentionSnapshots:0,perCompetitor:[],snapshotsWithAnswerText:0,snapshotsTotal:0}},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Citation Gaps"},mentionGaps:{...r,label:"Mention Gaps"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function R3(e){const n=W0(e.project),i=[...e.runs].sort((w,_)=>_.createdAt.localeCompare(w.createdAt)),r=i.find(w=>w.kind===Ee["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?pp(r,l):M3(e.project.id,l),d=e.overview;if(!d)return{project:n,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const m=d.scores.visibility,g=m.progress??0,b=d.queryCounts.citedQueries,v=d.queryCounts.totalQueries,S=d.providers.length;return{project:n,visibilityScore:g,visibilityDelta:v>0?`${b} of ${v} queries`:"No data",visibilityTone:m.tone,providerCoverage:m.providerCoverage,lastRun:c,insight:v>0?`${b} of ${v} queries mentioned across ${S} provider${S===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:d.scores.competitorPressure.value}}function M3(e,n){return{id:"none",projectId:e,projectName:n,kind:Ee["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Rs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function B3(e,n){const i=[],r=[],l=[];for(const d of e){r.push(n1(d)),l.push(R3(d));const m=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of m)i.push(pp(g,d.project.displayName||d.project.name))}i.sort((d,m)=>m.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?L3(r):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:i.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,runs:i,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(n?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,defaultModel:d.defaultModel,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.quota})),google:{state:n?.google?.configured?"ready":"needs-config",detail:n?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:n?.bing?.configured?"ready":"needs-config",detail:n?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function L3(e){const n=[];for(const i of e){const r=i.visibilityEvidence.filter(c=>c.citationState==="lost");r.length>0&&n.push({id:`attention_${i.project.id}_lost`,tone:"negative",title:`${i.project.displayName||i.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${i.project.id}`});const l=i.recentRuns.filter(c=>c.status===Ht.running||c.status===Ht.queued);l.length>0&&n.push({id:`attention_${i.project.id}_active`,tone:"neutral",title:`${i.project.displayName||i.project.name} has active runs`,detail:`${l.length} run${l.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return n.length===0&&n.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),n}const a1=q.createContext(null);a1.Provider;function uo(){return q.useContext(a1)}function xc(e){const i=uo()?.dashboard??null,r=cn({...op({client:ae}),enabled:!i,refetchInterval:pk}),l=cn({...cp({client:ae,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:io,refetchInterval:C=>C.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:io}),c=cn({...gO({client:ae}),enabled:!i}),d=r.data??[],m=l.data??[],g=lw({queries:d.map(C=>{const N=m.filter(G=>G.projectId===C.id),T=N.filter(G=>(G.status==="completed"||G.status==="partial")&&G.kind==="answer-visibility"&&G.trigger!=="probe").sort((G,H)=>H.createdAt.localeCompare(G.createdAt)),R=T.length>0?T[0].id:"no-run";return{queryKey:["project-overview-slim",C.id,R],queryFn:async()=>{const G=await yv(C.name).catch(()=>null);return{project:C,runs:N,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:G}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:gf}})}),b=g.every(C=>C.isSuccess),v=q.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const C=g.map(N=>N.data?{...N.data,runs:m.filter(T=>T.projectId===N.data.project.id)}:null).filter(N=>N!=null);return B3(C,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,m]),S=!i&&(r.isError||l.isError),w=!i&&!v&&!S,_=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:v,isLoading:w,isError:S,refetch:_}}function q3(e){const n=uo(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(C=>C.project.name===e)??null,[n,e]),r=cn({...pO({client:ae,path:{name:e??""}}),enabled:!!e&&!i,staleTime:gf,refetchOnWindowFocus:"always"}),l=cn({...cp({client:ae,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:io,refetchOnWindowFocus:"always",refetchInterval:C=>C.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:io}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(C=>C.projectId===c.id):[],[c,l.data]),{latestRunIds:m,previousRunIds:g,latestRunIdsKey:b}=q.useMemo(()=>{const C=d.filter(H=>(H.status==="completed"||H.status==="partial")&&H.kind==="answer-visibility"&&H.trigger!=="probe").sort((H,K)=>K.createdAt.localeCompare(H.createdAt)),N=C[0]?.createdAt??null,T=N?C.filter(H=>H.createdAt===N).map(H=>H.id):[],R=C.find(H=>H.createdAt!==N)?.createdAt??null,G=R?C.filter(H=>H.createdAt===R).map(H=>H.id):[];return{latestRunIds:T,previousRunIds:G,latestRunIdsKey:[...T].sort().join(",")}},[d]),v=cn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[C,N,T,R,G,H,K,Y,X]=await Promise.all([LN(e).catch(()=>[]),qN(e).catch(()=>[]),UN(e).catch(()=>[]),m.length?Promise.all(m.map(D=>Fl(D).catch(()=>null))).then(D=>D.filter(M=>M!=null)):Promise.resolve([]),g.length?Promise.all(g.map(D=>Fl(D).catch(()=>null))).then(D=>D.filter(M=>M!=null)):Promise.resolve([]),FN(e).catch(()=>null),tk(e).catch(()=>null),ak(e).catch(()=>null),yv(e).catch(()=>null)]);return{project:c,runs:d,queries:C,competitors:N,timeline:T,latestRunDetails:R,previousRunDetails:G,gscCoverage:H,bingCoverage:K,dbInsights:Y,overview:X}},enabled:!!c&&!!e&&l.isSuccess,staleTime:gf,refetchOnWindowFocus:"always",refetchInterval:mk}),S=q.useMemo(()=>v.data?n1({...v.data,runs:d}):i||null,[v.data,d,i]),w=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),v.refetch()])},[r.refetch,l.refetch,v.refetch]),_=!S&&(r.isLoading||l.isLoading||v.isLoading);return{commandCenter:S,project:c,isLoading:_,isError:r.isError||l.isError||v.isError,refetch:w}}const U3=["health"];async function $3(){const e=await sk("/health","API"),n=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:n}}function mp(e,n){return cn({queryKey:U3,queryFn:$3,enabled:e,refetchInterval:15e3,initialData:n})}function V3(e){return cn({...z0({client:ae,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function hp(){const e=dc(),n=cw({strict:!1}),i=uw({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:Wt.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:Wt.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:Wt.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const G3={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function I3(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function H3(){const e=q.useSyncExternalStore(dk,My,My),n=dc(),{openRun:i}=hp(),r=q.useCallback(c=>{hf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),hf(c.id))},[n,i]);return e.length===0?null:f.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>f.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${G3[c.tone]}`,children:[f.jsxs("div",{className:"toast-copy",children:[f.jsx("p",{className:"toast-title",children:c.title}),c.detail?f.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?f.jsx("button",{type:"button",className:"toast-action",onClick:()=>l(c),"aria-label":I3(c),children:c.cta.label}):null]}),f.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:f.jsx(Hs,{className:"size-3.5"})})]},c.id))})}function Z3(e,n={}){const{threshold:i=80}=n,r=q.useRef(null),l=q.useRef({scrollHeight:0,wasAtEnd:!0});function c(g){return g.scrollHeight-g.scrollTop-g.clientHeight}function d(){const g=r.current;return g?c(g)<=i:!0}function m(){const g=r.current;g&&(g.scrollTop=g.scrollHeight,l.current.wasAtEnd=!0,l.current.scrollHeight=g.scrollHeight)}return q.useEffect(()=>{const g=r.current;if(!g)return;const b=()=>{l.current.wasAtEnd=c(g)<=i};return g.addEventListener("scroll",b,{passive:!0}),()=>g.removeEventListener("scroll",b)},[i]),q.useLayoutEffect(()=>{const g=r.current;if(!g)return;const b=g.scrollHeight;b>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=b),l.current.scrollHeight=b},e),q.useEffect(()=>{const g=r.current;if(!g||typeof ResizeObserver>"u")return;const b=new ResizeObserver(()=>{const v=g.scrollHeight;v>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=v),l.current.scrollHeight=v});return b.observe(g),g.firstElementChild&&b.observe(g.firstElementChild),()=>b.disconnect()},[]),{ref:r,scrollToEnd:m,isAtEnd:d}}async function gp(e){try{return await e.json()}catch{return{}}}function P3(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const yp=P3();function bp(e){(e===401||e===403)&&Bf()}async function Ob(e){const n=await fetch(`${yp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){bp(n.status);const i=await gp(n);throw new In(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function K3(e){const n=await fetch(`${yp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){bp(n.status);const i=await gp(n);throw new In(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function Q3({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const m={prompt:n};i&&(m.provider=i),r&&(m.modelId=r),l&&(m.scope=l);const g=await fetch(`${yp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),signal:c});if(!g.ok||!g.body){bp(g.status);const _=await gp(g);throw new In(_.error?.message??`prompt failed: ${g.status}`,g.status,_.error?.code)}const b=g.body.getReader(),v=new TextDecoder;let S="";const w=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",w,{once:!0});try{for(;;){const{value:_,done:C}=await b.read();if(C)break;S+=v.decode(_,{stream:!0});let N=S.indexOf(`
59
59
 
60
60
  `);for(;N!==-1;){const T=S.slice(0,N);S=S.slice(N+2);for(const R of T.split(`
@@ -199,7 +199,7 @@ spec:
199
199
  canonicalDomain: example.com
200
200
  country: US
201
201
  language: en
202
- queries: []`,value:n,onChange:v=>i(v.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,S)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:v},S))}),m.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:m.map((v,S)=>f.jsx("li",{className:"text-rose-400 text-sm",children:v},S))}),f.jsx("div",{className:"mt-3",children:f.jsx(Le,{type:"button",disabled:!n.trim()||r,onClick:xn(b),children:r?"Applying...":"Apply"})})]})}function R5(){const{dashboard:e,isLoading:n,refetch:i}=xc();if(!e||n)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-28"}),f.jsx("div",{className:"skeleton-text-sm w-40"})]}),f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[f.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(D=>f.jsx("div",{className:"skeleton-text-sm w-16"},D))}),[1,2,3].map(D=>f.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[f.jsxs("div",{className:"flex-1 space-y-1",children:[f.jsx("div",{className:"skeleton-text w-28"}),f.jsx("div",{className:"skeleton-text-sm w-16"})]}),f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),f.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),f.jsx("div",{className:"skeleton-text-sm w-8"})]},D))]})]});const r=e.projects,l=dc(),[c,d]=q.useState(!1),[m,g]=q.useState(""),[b,v]=q.useState(""),[S,w]=q.useState(""),[_,C]=q.useState("US"),[N,T]=q.useState("en"),[R,G]=q.useState(!1),[H,K]=q.useState(null),Y=m.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),X=async()=>{if(!(!Y||!S)){G(!0),K(null);try{const D=await co(Y,{displayName:b||m,canonicalDomain:S,country:_,language:N});un({title:"Project created",detail:`${D.displayName||D.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${D.name}`,dedupeMode:"drop"}),i(),g(""),v(""),w(""),C("US"),T("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:D.id}})}catch(D){K(D instanceof Error?D.message:"Failed to create project")}finally{G(!1)}}};return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Projects"}),f.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),f.jsx("div",{className:"page-header-right",children:f.jsxs(Le,{type:"button",onClick:()=>d(D=>!D),children:[f.jsx(qy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(wn,{className:"surface-card mb-6",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),f.jsxs("div",{className:"compact-stack mt-4",children:[f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),f.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:m,onChange:D=>g(D.target.value)}),Y&&Y!==m?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",Y]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),f.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:b,onChange:D=>v(D.target.value)})]})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),f.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:S,onChange:D=>w(D.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),f.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:D=>C(D.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),f.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:N,onChange:D=>T(D.target.value.toLowerCase())})]})]})]}),H?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:H}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Le,{type:"button",disabled:!Y||!S||R,onClick:xn(X),children:R?"Creating...":"Create project"}),f.jsx(Le,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?f.jsx("div",{className:"data-table-wrapper",children:f.jsxs("table",{className:"data-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Name"}),f.jsx("th",{children:"Domain"}),f.jsx("th",{children:"Mentions"}),f.jsx("th",{children:"Last run"}),f.jsx("th",{className:"text-right",children:"Country"})]})}),f.jsx("tbody",{children:r.map(D=>{const M=D.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:D.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:D.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:oe=>oe.stopPropagation(),children:D.project.displayName||D.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:D.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:D.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Bn,{tone:D.mentionSummary.tone,children:D.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(fp,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:D.project.country})]},D.project.id)})})]})}):c?null:f.jsxs(wn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),f.jsxs(Le,{type:"button",onClick:()=>d(!0),children:[f.jsx(qy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(D5,{onApplied:()=>{i()}})]})}function I1(e){e.invalidateQueries({queryKey:lp({client:ae})}),e.invalidateQueries({queryKey:Ks({client:ae})})}function M5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function B5(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function Dc(e,n){O0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),un({title:M5(e.kind),detail:B5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function L5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){un({title:"No runs queued",detail:i.length>0?`${i.length} project${i.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const l of n)O0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=t4({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});un({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Rc(e,n){if(e instanceof In&&e.code==="RUN_IN_PROGRESS"){un({title:"Run already in progress",detail:n?.projectLabel?`${n.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}un({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function q5(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>HN(n,i),onSuccess:(n,i)=>{I1(e),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function S6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:n=>XN(n),onSuccess:n=>{I1(e),L5(n)},onError:n=>{un({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function x6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>JN(n,i),onSuccess:(n,i)=>{wc(e,Ee["gsc-sync"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function w6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>ek(n),onSuccess:(n,i)=>{wc(e,n.run.kind,i.projectName),Dc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function j6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>WN(n,i),onSuccess:(n,i)=>{wc(e,Ee["inspect-sitemap"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function H1(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function N6(){const e=Ka();return Ai({mutationFn:({projectName:n,queries:i})=>VN(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Ks({client:ae})}),e.invalidateQueries({predicate:H1})}})}function k6(){const e=Ka();return Ai({mutationFn:({projectName:n,body:i})=>GN(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:H1})}})}const U5=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function $5({current:e,labels:n}){return f.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return f.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[f.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),f.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function V5(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=xc(),l=n??e?.dashboard;if(!l||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-24"}),f.jsx("div",{className:"skeleton-text-sm w-80"})]}),f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-32"}),f.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ee=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"space-y-1 flex-1",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ee))})]})]});const c=l.settings,g=mp(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},b=YO(l.setup,g,c),v=dc(),[S,w]=q.useState(0),[_,C]=q.useState(""),[N,T]=q.useState(""),[R,G]=q.useState(""),[H,K]=q.useState("US"),[Y,X]=q.useState("en"),[D,M]=q.useState(!1),[oe,ke]=q.useState(null),[_e,ve]=q.useState(null),[et,re]=q.useState(null),[pe,$]=q.useState(!1),[F,de]=q.useState(""),[je,ie]=q.useState(!1),[Qe,J]=q.useState(null),[le,te]=q.useState(!1),ue=c.providerStatuses.filter(ee=>ee.state==="ready"),[ne,Ne]=q.useState(ue[0]?.name??""),[tt,xe]=q.useState(5),[$e,Ze]=q.useState(!1),[Ct,zn]=q.useState(null),[Tt,Fs]=q.useState(""),[Ei,Mc]=q.useState(!1),[Ws,Oi]=q.useState(null),[Di,Ri]=q.useState(!1),[go,Bc]=q.useState(!1),[Lt,yo]=q.useState(!1),[er,bo]=q.useState(null),Mi=q5(),Lc=cn({...z0({client:ae,path:{id:er??""}}),enabled:!!er,refetchInterval:({state:ee})=>{const Fe=ee.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[Bi,vo]=q.useState(""),[tr,ga]=q.useState(!1),[qt,Cn]=q.useState(null),mt=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),qn=F.split(`
202
+ queries: []`,value:n,onChange:v=>i(v.target.value)}),c.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,S)=>f.jsx("li",{className:"text-emerald-400 text-sm",children:v},S))}),m.length>0&&f.jsx("ul",{className:"mt-2 space-y-1",children:m.map((v,S)=>f.jsx("li",{className:"text-rose-400 text-sm",children:v},S))}),f.jsx("div",{className:"mt-3",children:f.jsx(Le,{type:"button",disabled:!n.trim()||r,onClick:xn(b),children:r?"Applying...":"Apply"})})]})}function R5(){const{dashboard:e,isLoading:n,refetch:i}=xc();if(!e||n)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-28"}),f.jsx("div",{className:"skeleton-text-sm w-40"})]}),f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[f.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(D=>f.jsx("div",{className:"skeleton-text-sm w-16"},D))}),[1,2,3].map(D=>f.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[f.jsxs("div",{className:"flex-1 space-y-1",children:[f.jsx("div",{className:"skeleton-text w-28"}),f.jsx("div",{className:"skeleton-text-sm w-16"})]}),f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),f.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),f.jsx("div",{className:"skeleton-text-sm w-8"})]},D))]})]});const r=e.projects,l=dc(),[c,d]=q.useState(!1),[m,g]=q.useState(""),[b,v]=q.useState(""),[S,w]=q.useState(""),[_,C]=q.useState("US"),[N,T]=q.useState("en"),[R,G]=q.useState(!1),[H,K]=q.useState(null),Y=m.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),X=async()=>{if(!(!Y||!S)){G(!0),K(null);try{const D=await co(Y,{displayName:b||m,canonicalDomain:S,country:_,language:N});un({title:"Project created",detail:`${D.displayName||D.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${D.name}`,dedupeMode:"drop"}),i(),g(""),v(""),w(""),C("US"),T("en"),d(!1),l({to:"/projects/$projectId",params:{projectId:D.id}})}catch(D){K(D instanceof Error?D.message:"Failed to create project")}finally{G(!1)}}};return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Projects"}),f.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),f.jsx("div",{className:"page-header-right",children:f.jsxs(Le,{type:"button",onClick:()=>d(D=>!D),children:[f.jsx(qy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?f.jsxs(wn,{className:"surface-card mb-6",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),f.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),f.jsxs("div",{className:"compact-stack mt-4",children:[f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),f.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:m,onChange:D=>g(D.target.value)}),Y&&Y!==m?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",Y]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),f.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:b,onChange:D=>v(D.target.value)})]})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),f.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:S,onChange:D=>w(D.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),f.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:_,onChange:D=>C(D.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),f.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:N,onChange:D=>T(D.target.value.toLowerCase())})]})]})]}),H?f.jsx("p",{className:"text-rose-400 text-sm mt-3",children:H}):null,f.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[f.jsx(Le,{type:"button",disabled:!Y||!S||R,onClick:xn(X),children:R?"Creating...":"Create project"}),f.jsx(Le,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?f.jsx("div",{className:"data-table-wrapper",children:f.jsxs("table",{className:"data-table",children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Name"}),f.jsx("th",{children:"Domain"}),f.jsx("th",{children:"Mentions"}),f.jsx("th",{children:"Last run"}),f.jsx("th",{className:"text-right",children:"Country"})]})}),f.jsx("tbody",{children:r.map(D=>{const M=D.recentRuns[0];return f.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectId",params:{projectId:D.project.id}})},children:[f.jsxs("td",{children:[f.jsx(rt,{to:"/projects/$projectId",params:{projectId:D.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:oe=>oe.stopPropagation(),children:D.project.displayName||D.project.name}),f.jsx("p",{className:"text-[11px] text-zinc-500",children:D.project.name})]}),f.jsx("td",{className:"text-zinc-400",children:D.project.canonicalDomain}),f.jsx("td",{children:f.jsx(Bn,{tone:D.mentionSummary.tone,children:D.mentionSummary.value})}),f.jsx("td",{className:"text-zinc-500 text-sm",children:M?f.jsx(fp,{status:M.status}):f.jsx("span",{className:"text-zinc-600",children:"No runs"})}),f.jsx("td",{className:"text-right text-zinc-500",children:D.project.country})]},D.project.id)})})]})}):c?null:f.jsxs(wn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),f.jsxs(Le,{type:"button",onClick:()=>d(!0),children:[f.jsx(qy,{className:"size-4 mr-1.5"}),"Add project"]})]}),f.jsx(D5,{onApplied:()=>{i()}})]})}function I1(e){e.invalidateQueries({queryKey:lp({client:ae})}),e.invalidateQueries({queryKey:Ks({client:ae})})}function M5(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function B5(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function Dc(e,n){O0({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),un({title:M5(e.kind),detail:B5(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function L5(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){un({title:"No runs queued",detail:i.length>0?`${i.length} project${i.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const l of n)O0({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=t4({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});un({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Rc(e,n){if(e instanceof In&&e.code==="RUN_IN_PROGRESS"){un({title:"Run already in progress",detail:n?.projectLabel?`${n.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}un({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function q5(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>HN(n,i),onSuccess:(n,i)=>{I1(e),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function w6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:n=>XN(n),onSuccess:n=>{I1(e),L5(n)},onError:n=>{un({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function j6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>JN(n,i),onSuccess:(n,i)=>{wc(e,Ee["gsc-sync"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function N6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>ek(n),onSuccess:(n,i)=>{wc(e,n.run.kind,i.projectName),Dc(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function k6(){const e=Ka();return Ai({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>WN(n,i),onSuccess:(n,i)=>{wc(e,Ee["inspect-sitemap"],i.projectName),Dc(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{Rc(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function H1(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function A6(){const e=Ka();return Ai({mutationFn:({projectName:n,queries:i})=>VN(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Ks({client:ae})}),e.invalidateQueries({predicate:H1})}})}function _6(){const e=Ka();return Ai({mutationFn:({projectName:n,body:i})=>GN(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:H1})}})}const U5=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function $5({current:e,labels:n}){return f.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return f.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[f.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),f.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function V5(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=xc(),l=n??e?.dashboard;if(!l||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-24"}),f.jsx("div",{className:"skeleton-text-sm w-80"})]}),f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-32"}),f.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ee=>f.jsxs("div",{className:"flex items-center justify-between",children:[f.jsxs("div",{className:"space-y-1 flex-1",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ee))})]})]});const c=l.settings,g=mp(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},b=YO(l.setup,g,c),v=dc(),[S,w]=q.useState(0),[_,C]=q.useState(""),[N,T]=q.useState(""),[R,G]=q.useState(""),[H,K]=q.useState("US"),[Y,X]=q.useState("en"),[D,M]=q.useState(!1),[oe,ke]=q.useState(null),[_e,ve]=q.useState(null),[et,re]=q.useState(null),[pe,$]=q.useState(!1),[F,de]=q.useState(""),[je,ie]=q.useState(!1),[Qe,J]=q.useState(null),[le,te]=q.useState(!1),ue=c.providerStatuses.filter(ee=>ee.state==="ready"),[ne,Ne]=q.useState(ue[0]?.name??""),[tt,xe]=q.useState(5),[$e,Ze]=q.useState(!1),[Ct,zn]=q.useState(null),[Tt,Fs]=q.useState(""),[Ei,Mc]=q.useState(!1),[Ws,Oi]=q.useState(null),[Di,Ri]=q.useState(!1),[go,Bc]=q.useState(!1),[Lt,yo]=q.useState(!1),[er,bo]=q.useState(null),Mi=q5(),Lc=cn({...z0({client:ae,path:{id:er??""}}),enabled:!!er,refetchInterval:({state:ee})=>{const Fe=ee.data?.status;return Fe==="completed"||Fe==="partial"||Fe==="failed"||Fe==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[Bi,vo]=q.useState(""),[tr,ga]=q.useState(!1),[qt,Cn]=q.useState(null),mt=_.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),qn=F.split(`
203
203
  `).map(ee=>ee.trim()).filter(Boolean),Fa=Tt.split(`
204
204
  `).map(ee=>ee.trim()).filter(Boolean),qc=b.healthChecks.some(ee=>ee.id==="api"&&ee.state==="ready"),Li=async()=>{if(!(!mt||!R)){$(!0),re(null);try{const ee=await co(mt,{displayName:N||_,canonicalDomain:R,country:H,language:Y,autoExtractBacklinks:D});ke(mt),ve(ee.id),un({title:"Project created",detail:`${ee.displayName||ee.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ee.name}`,dedupeMode:"drop"}),await r(),w(2)}catch(ee){re(ee instanceof Error?ee.message:"Failed to create project")}finally{$(!1)}}},qi=async()=>{if(!oe)return;const ee=qn;if(ee.length!==0){te(!0),J(null);try{await $N(oe,ee),ie(!0),await r(),w(3)}catch(Fe){J(Fe instanceof Error?Fe.message:"Failed to save queries")}finally{te(!1)}}},Ui=async()=>{if(!(!oe||!ne)){Ze(!0),zn(null);try{const ee=await QN(oe,ne,tt);if(ee.queries.length>0){const Fe=F?F.trimEnd()+`
205
205
  `+ee.queries.join(`
@@ -207,4 +207,4 @@ spec:
207
207
  `);de(Fe)}}catch(ee){zn(ee instanceof Error?ee.message:"Failed to generate queries")}finally{Ze(!1)}}},Pn=async()=>{if(!oe)return;const ee=Fa;if(ee.length!==0){Ri(!0),Oi(null);try{await IN(oe,ee),Mc(!0),await r(),w(4)}catch(Fe){Oi(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Ri(!1)}}},$i=async()=>{const ee=Bi.trim();if(ee){ga(!0),Cn(null);try{await KN("gemini",{apiKey:ee}),un({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),vo(""),await r()}catch(Fe){Cn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{ga(!1)}}},Wa=async()=>{if(oe){yo(!0);try{const ee=await Mi.mutateAsync({projectName:oe,projectLabel:N||_||oe,sourceAction:"setup-launch"});bo(ee.id),Bc(!0),await r()}catch{}finally{yo(!1)}}},Kn=()=>w(ee=>Math.max(0,ee-1)),So=(()=>{switch(S){case 0:return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:b.healthChecks.map(ee=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ee.label}),f.jsx("p",{className:"supporting-copy",children:ee.detail}),ee.id==="provider"&&ee.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:Bi,onChange:Fe=>vo(Fe.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:tr}),f.jsx(Le,{type:"button",size:"sm",disabled:tr||!Bi.trim(),onClick:xn($i),children:tr?"Saving...":"Save"})]}),qt&&f.jsx("p",{className:"text-xs text-rose-400",children:qt}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(rt,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Bn,{tone:ee.state==="ready"?"positive":"caution",title:ee.id==="api"?Us(g.apiStatus):ee.id==="worker"?Us(g.workerStatus):ee.detail,children:ee.state==="ready"?"Ready":"Attention"})]},ee.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",disabled:!qc,onClick:()=>w(1),children:"Continue"})]})]});case 1:return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),oe?f.jsx(Bn,{tone:"positive",children:"Created"}):null]}),oe?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ee=>C(ee.target.value)}),mt&&mt!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",mt]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:N,onChange:ee=>T(ee.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:ee=>G(ee.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:H,onChange:ee=>K(ee.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:Y,onChange:ee=>X(ee.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:D,onChange:ee=>M(ee.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(rt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),et?f.jsx("p",{className:"text-rose-400 text-sm",children:et}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:!mt||!R||pe,onClick:xn(Li),children:pe?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),je?f.jsxs(Bn,{tone:"positive",children:[qn.length," saved"]}):f.jsxs(Bn,{tone:"neutral",children:[qn.length," quer",qn.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),je?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:qn.map(ee=>f.jsx("li",{children:ee},ee))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[ue.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:ee=>Ne(ee.target.value),children:ue.map(ee=>f.jsxs("option",{value:ee.name,children:[ee.displayName??ee.name,ee.model?` (${ee.model})`:""]},ee.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:tt,onChange:ee=>xe(Number(ee.target.value)),children:[3,5,10,15,20].map(ee=>f.jsx("option",{value:ee,children:ee},ee))})]}),f.jsx(Le,{type:"button",variant:"outline",disabled:$e||!ne,onClick:xn(Ui),children:$e?"Analyzing site...":"Generate"})]}),Ct?f.jsx("p",{className:"text-rose-400 text-sm",children:Ct}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
208
208
  best invisalign downtown brooklyn
209
209
  pediatric dentist brooklyn heights`,value:F,onChange:ee=>de(ee.target.value)})]}),Qe?f.jsx("p",{className:"text-rose-400 text-sm",children:Qe}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:qn.length===0||le,onClick:xn(qi),children:le?"Saving...":`Save ${qn.length} quer${qn.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),f.jsx("h2",{children:"Add competitors"})]}),Ei?f.jsx(Bn,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ei?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:Fa.map(ee=>f.jsx("li",{children:ee},ee))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",onClick:()=>w(4),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),f.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
210
- competitor2.com`,value:Tt,onChange:ee=>Fs(ee.target.value)})]}),Ws?f.jsx("p",{className:"text-rose-400 text-sm",children:Ws}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:()=>w(4),children:"Skip"}),f.jsx(Le,{type:"button",disabled:Fa.length===0||Di,onClick:xn(Pn),children:Di?"Saving...":`Save ${Fa.length} competitor${Fa.length!==1?"s":""}`})]})]})]})]});case 4:{const ee=Lc.data,Fe=ee?.status==="completed"||ee?.status==="partial"||ee?.status==="failed"||ee?.status==="cancelled",ei=ee?.snapshots??[],xo=ei.filter(Tn=>Tn.citationState==="cited").length,wo=ei.filter(Tn=>Tn.answerMentioned===!0).length,nr=new Set(ei.map(Tn=>Tn.query).filter(Tn=>!!Tn)).size,ar=go?Fe&&(ee?.status==="completed"||ee?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):Fe?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),ar]}),go?Fe?ee?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[wo,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[xo,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:ei.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ee?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",variant:"outline",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:Lt,onClick:xn(Wa),children:Lt?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx($5,{current:S,labels:U5}),f.jsx("section",{className:"setup-wizard",children:So})]})}function G5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(wn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Le,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const Ti=Gs(()=>Is(()=>import("./ProjectPage-D1tnXJ2L.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),I5=Gs(()=>Is(()=>import("./RunsPage-DMrl5Fhn.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),H5=Gs(()=>Is(()=>import("./SettingsPage-Dp0TXf34.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),Z5=Gs(()=>Is(()=>import("./BacklinksPage-yWx_BBLG.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),P5=Gs(()=>Is(()=>import("./TrafficPage-POy4iHHt.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),K5=Gs(()=>Is(()=>import("./TrafficSourceDetailPage-BewjZ53n.js"),__vite__mapDeps([14,1,13,3,4,5,7,8]),import.meta.url),"TrafficSourceDetailPage");function Q5(){return f.jsx(vD,{children:f.jsx(bD,{})})}const Wt=dw()({component:Q5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),Y5=Bt({getParentRoute:()=>Wt,path:"/",component:wD,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length===0)throw Fb({to:"/setup"})}}),X5=Bt({getParentRoute:()=>Wt,path:"/projects",component:R5}),Ja=Bt({getParentRoute:()=>Wt,path:"/projects/$projectId",component:()=>f.jsx(Jb,{})}),J5=Bt({getParentRoute:()=>Ja,path:"/",component:()=>f.jsx(Ti,{tab:"overview"})}),F5=Bt({getParentRoute:()=>Ja,path:"/search-console",component:()=>f.jsx(Ti,{tab:"search-console"})}),W5=Bt({getParentRoute:()=>Ja,path:"/discovery",component:()=>f.jsx(Ti,{tab:"discovery"})}),eR=Bt({getParentRoute:()=>Ja,path:"/report",component:()=>f.jsx(Ti,{tab:"report"})}),tR=Bt({getParentRoute:()=>Ja,path:"/activity",component:()=>f.jsx(Ti,{tab:"activity"})}),nR=Bt({getParentRoute:()=>Ja,path:"/backlinks",component:()=>f.jsx(Ti,{tab:"backlinks"})}),aR=Bt({getParentRoute:()=>Ja,path:"/settings",component:()=>f.jsx(Ti,{tab:"settings"})}),iR=Bt({getParentRoute:()=>Wt,path:"/runs",component:I5}),sR=Bt({getParentRoute:()=>Wt,path:"/settings",component:H5,beforeLoad:({context:e})=>{}}),rR=Bt({getParentRoute:()=>Wt,path:"/setup",component:V5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length>0)throw Fb({to:"/"})}}),oR=Bt({getParentRoute:()=>Wt,path:"/backlinks",component:Z5}),lR=Bt({getParentRoute:()=>Wt,path:"/traffic",component:P5}),cR=Bt({getParentRoute:()=>Wt,path:"/traffic/$projectName/$sourceId",component:K5}),uR=Bt({getParentRoute:()=>Wt,path:"*",component:G5}),dR=Wt.addChildren([Y5,X5,Ja.addChildren([J5,F5,W5,eR,tR,nR,aR]),iR,sR,rR,oR,lR,cR,uR]);function fR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Yb=fR(),pR=Yb==="/"?"":Yb.replace(/\/$/,"");function mR(e,n){return fw({routeTree:dR,basepath:pR||"/",context:{queryClient:e},...n?.initialEntries})}const hR=6e4;function gR(){const[e,n]=q.useState(Fd()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,m]=q.useState(null),[g,b]=q.useState(!1),[v,S]=q.useState(!1),w=q.useRef(null),_=q.useRef(null),C=()=>{if(!w.current){const R=hk();_.current=R,w.current=mR(R)}return{queryClient:_.current,router:w.current}};q.useEffect(()=>{if(Fd())return;let R=!1;return Dy().then(G=>{R||(G.authenticated?n("ready"):n(G.setupRequired?"setup":"login"))}).catch(G=>{R||(m(G instanceof Error?G.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||Fd())return;const R=setInterval(()=>{Dy().then(G=>{G.authenticated||(S(!0),n(G.setupRequired?"setup":"login"))}).catch(()=>{})},hR);return Oy(()=>{S(!0),n("login")}),()=>{clearInterval(R),Oy(null)}},[e]);const N=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){m("Password must be at least 8 characters");return}if(i!==l){m("Passwords do not match");return}b(!0),m(null);try{if(!(await ZN(i.trim())).authenticated){m("Setup failed");return}r(""),c(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Setup failed")}finally{b(!1)}},T=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),m(null);try{if(!(await PN(i.trim())).authenticated){m("Incorrect password");return}r(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:G}=C();return f.jsx(pw,{client:R,children:f.jsx(mw,{router:G})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(wn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Ql,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(kf,{children:"Create a dashboard password"}),f.jsx(Af,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Ql,{children:f.jsxs("form",{className:"space-y-4",onSubmit:xn(N),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(kf,{children:"Sign in to Canonry"}),f.jsx(Af,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Ql,{children:[v?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:xn(T),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const Z1=document.getElementById("root");if(!Z1)throw new Error("Expected #root element for web app bootstrap.");xw.createRoot(Z1).render(f.jsx(q.StrictMode,{children:f.jsx(gR,{})}));export{wM as $,ER as A,Le as B,ic as C,HM as D,PM as E,KM as F,AM as G,VR as H,$l as I,$R as J,IR as K,un as L,XR as M,XM as N,JM as O,J4 as P,HR as Q,QM as R,cO as S,Bn as T,YM as U,ZM as V,GR as W,ZR as X,FM as Y,hM as Z,xM as _,b6 as a,n6 as a$,In as a0,jM as a1,xR as a2,Pk as a3,LM as a4,Hk as a5,eA as a6,Ee as a7,a4 as a8,Fl as a9,RR as aA,MR as aB,$M as aC,BR as aD,LR as aE,UR as aF,qR as aG,uo as aH,op as aI,q3 as aJ,q5 as aK,Ht as aL,UN as aM,CR as aN,jR as aO,NR as aP,TR as aQ,VN as aR,qN as aS,IN as aT,wR as aU,kR as aV,N6 as aW,gO as aX,WM as aY,t6 as aZ,JN as a_,NM as aa,gf as ab,u6 as ac,h6 as ad,g6 as ae,y6 as af,PR as ag,Ks as ah,KR as ai,lp as aj,c6 as ak,iM as al,k6 as am,TM as an,zM as ao,EM as ap,OM as aq,_M as ar,CM as as,zR as at,_R as au,AR as av,DR as aw,GM as ax,pb as ay,VM as az,$f as b,tM as b0,eM as b1,a6 as b2,e6 as b3,BM as b4,JR as b5,FR as b6,WR as b7,nM as b8,xc as b9,p6 as bA,DM as bB,RM as bC,ap as bD,IM as bE,Hs as bF,d6 as bG,m6 as bH,dM as bI,cM as bJ,uM as bK,lM as bL,f6 as bM,S6 as ba,fp as bb,KN as bc,OR as bd,QR as be,YR as bf,mp as bg,aM as bh,Us as bi,mb as bj,pM as bk,gM as bl,bM as bm,vM as bn,wv as bo,mM as bp,yM as bq,SM as br,F4 as bs,X0 as bt,a3 as bu,J0 as bv,F0 as bw,$k as bx,fM as by,qy as bz,at as c,eT as d,v6 as e,qM as f,wn as g,Ab as h,xn as i,kM as j,i6 as k,ae as l,s6 as m,r6 as n,l6 as o,o6 as p,sM as q,oM as r,rM as s,_0 as t,hp as u,x6 as v,w6 as w,j6 as x,MM as y,UM as z};
210
+ competitor2.com`,value:Tt,onChange:ee=>Fs(ee.target.value)})]}),Ws?f.jsx("p",{className:"text-rose-400 text-sm",children:Ws}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:()=>w(4),children:"Skip"}),f.jsx(Le,{type:"button",disabled:Fa.length===0||Di,onClick:xn(Pn),children:Di?"Saving...":`Save ${Fa.length} competitor${Fa.length!==1?"s":""}`})]})]})]})]});case 4:{const ee=Lc.data,Fe=ee?.status==="completed"||ee?.status==="partial"||ee?.status==="failed"||ee?.status==="cancelled",ei=ee?.snapshots??[],xo=ei.filter(Tn=>Tn.citationState==="cited").length,wo=ei.filter(Tn=>Tn.answerMentioned===!0).length,nr=new Set(ei.map(Tn=>Tn.query).filter(Tn=>!!Tn)).size,ar=go?Fe&&(ee?.status==="completed"||ee?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):Fe?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(wn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),ar]}),go?Fe?ee?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[wo,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[xo,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",nr]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:ei.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ee?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Le,{type:"button",variant:"outline",onClick:()=>{v({to:_e?`/projects/${_e}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Le,{type:"button",variant:"outline",onClick:Kn,children:"Back"}),f.jsx(Le,{type:"button",disabled:Lt,onClick:xn(Wa),children:Lt?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx($5,{current:S,labels:U5}),f.jsx("section",{className:"setup-wizard",children:So})]})}function G5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(wn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Le,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const Ti=Gs(()=>Is(()=>import("./ProjectPage-Y6uCyjGb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),I5=Gs(()=>Is(()=>import("./RunsPage-Btp6qn10.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),H5=Gs(()=>Is(()=>import("./SettingsPage-DkyNiU2i.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),Z5=Gs(()=>Is(()=>import("./BacklinksPage-CmeFZ8UJ.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),P5=Gs(()=>Is(()=>import("./TrafficPage-CBl4Mwdc.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),K5=Gs(()=>Is(()=>import("./TrafficSourceDetailPage-BZzuWCn-.js"),__vite__mapDeps([14,1,13,3,4,5,7,8]),import.meta.url),"TrafficSourceDetailPage");function Q5(){return f.jsx(vD,{children:f.jsx(bD,{})})}const Wt=dw()({component:Q5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),Y5=Bt({getParentRoute:()=>Wt,path:"/",component:wD,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length===0)throw Fb({to:"/setup"})}}),X5=Bt({getParentRoute:()=>Wt,path:"/projects",component:R5}),Ja=Bt({getParentRoute:()=>Wt,path:"/projects/$projectId",component:()=>f.jsx(Jb,{})}),J5=Bt({getParentRoute:()=>Ja,path:"/",component:()=>f.jsx(Ti,{tab:"overview"})}),F5=Bt({getParentRoute:()=>Ja,path:"/search-console",component:()=>f.jsx(Ti,{tab:"search-console"})}),W5=Bt({getParentRoute:()=>Ja,path:"/discovery",component:()=>f.jsx(Ti,{tab:"discovery"})}),eR=Bt({getParentRoute:()=>Ja,path:"/report",component:()=>f.jsx(Ti,{tab:"report"})}),tR=Bt({getParentRoute:()=>Ja,path:"/activity",component:()=>f.jsx(Ti,{tab:"activity"})}),nR=Bt({getParentRoute:()=>Ja,path:"/backlinks",component:()=>f.jsx(Ti,{tab:"backlinks"})}),aR=Bt({getParentRoute:()=>Ja,path:"/settings",component:()=>f.jsx(Ti,{tab:"settings"})}),iR=Bt({getParentRoute:()=>Wt,path:"/runs",component:I5}),sR=Bt({getParentRoute:()=>Wt,path:"/settings",component:H5,beforeLoad:({context:e})=>{}}),rR=Bt({getParentRoute:()=>Wt,path:"/setup",component:V5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ks({client:ae}));if(n&&n.length>0)throw Fb({to:"/"})}}),oR=Bt({getParentRoute:()=>Wt,path:"/backlinks",component:Z5}),lR=Bt({getParentRoute:()=>Wt,path:"/traffic",component:P5}),cR=Bt({getParentRoute:()=>Wt,path:"/traffic/$projectName/$sourceId",component:K5}),uR=Bt({getParentRoute:()=>Wt,path:"*",component:G5}),dR=Wt.addChildren([Y5,X5,Ja.addChildren([J5,F5,W5,eR,tR,nR,aR]),iR,sR,rR,oR,lR,cR,uR]);function fR(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Yb=fR(),pR=Yb==="/"?"":Yb.replace(/\/$/,"");function mR(e,n){return fw({routeTree:dR,basepath:pR||"/",context:{queryClient:e},...n?.initialEntries})}const hR=6e4;function gR(){const[e,n]=q.useState(Fd()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,m]=q.useState(null),[g,b]=q.useState(!1),[v,S]=q.useState(!1),w=q.useRef(null),_=q.useRef(null),C=()=>{if(!w.current){const R=hk();_.current=R,w.current=mR(R)}return{queryClient:_.current,router:w.current}};q.useEffect(()=>{if(Fd())return;let R=!1;return Dy().then(G=>{R||(G.authenticated?n("ready"):n(G.setupRequired?"setup":"login"))}).catch(G=>{R||(m(G instanceof Error?G.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||Fd())return;const R=setInterval(()=>{Dy().then(G=>{G.authenticated||(S(!0),n(G.setupRequired?"setup":"login"))}).catch(()=>{})},hR);return Oy(()=>{S(!0),n("login")}),()=>{clearInterval(R),Oy(null)}},[e]);const N=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){m("Password must be at least 8 characters");return}if(i!==l){m("Passwords do not match");return}b(!0),m(null);try{if(!(await ZN(i.trim())).authenticated){m("Setup failed");return}r(""),c(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Setup failed")}finally{b(!1)}},T=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),m(null);try{if(!(await PN(i.trim())).authenticated){m("Incorrect password");return}r(""),S(!1),n("ready")}catch(G){m(G instanceof In||G instanceof Error?G.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:G}=C();return f.jsx(pw,{client:R,children:f.jsx(mw,{router:G})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(wn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Ql,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(kf,{children:"Create a dashboard password"}),f.jsx(Af,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Ql,{children:f.jsxs("form",{className:"space-y-4",onSubmit:xn(N),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Nf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(kf,{children:"Sign in to Canonry"}),f.jsx(Af,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Ql,{children:[v?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:xn(T),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Le,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const Z1=document.getElementById("root");if(!Z1)throw new Error("Expected #root element for web app bootstrap.");xw.createRoot(Z1).render(f.jsx(q.StrictMode,{children:f.jsx(gR,{})}));export{wM as $,ER as A,Le as B,ic as C,HM as D,PM as E,KM as F,AM as G,VR as H,$l as I,$R as J,IR as K,un as L,XR as M,XM as N,JM as O,J4 as P,HR as Q,QM as R,cO as S,Bn as T,YM as U,ZM as V,GR as W,ZR as X,FM as Y,hM as Z,xM as _,b6 as a,t6 as a$,In as a0,jM as a1,xR as a2,Pk as a3,LM as a4,Hk as a5,eA as a6,Ee as a7,a4 as a8,Fl as a9,RR as aA,MR as aB,$M as aC,BR as aD,LR as aE,UR as aF,qR as aG,uo as aH,op as aI,q3 as aJ,q5 as aK,Ht as aL,UN as aM,x6 as aN,S6 as aO,CR as aP,jR as aQ,NR as aR,TR as aS,VN as aT,qN as aU,IN as aV,wR as aW,kR as aX,A6 as aY,gO as aZ,WM as a_,NM as aa,gf as ab,u6 as ac,h6 as ad,g6 as ae,y6 as af,PR as ag,Ks as ah,KR as ai,lp as aj,c6 as ak,iM as al,_6 as am,TM as an,zM as ao,EM as ap,OM as aq,_M as ar,CM as as,zR as at,_R as au,AR as av,DR as aw,GM as ax,pb as ay,VM as az,$f as b,JN as b0,n6 as b1,tM as b2,eM as b3,a6 as b4,e6 as b5,BM as b6,JR as b7,FR as b8,WR as b9,fM as bA,qy as bB,p6 as bC,DM as bD,RM as bE,ap as bF,IM as bG,Hs as bH,d6 as bI,m6 as bJ,dM as bK,cM as bL,uM as bM,lM as bN,f6 as bO,nM as ba,xc as bb,w6 as bc,fp as bd,KN as be,OR as bf,QR as bg,YR as bh,mp as bi,aM as bj,Us as bk,mb as bl,pM as bm,gM as bn,bM as bo,vM as bp,wv as bq,mM as br,yM as bs,SM as bt,F4 as bu,X0 as bv,a3 as bw,J0 as bx,F0 as by,$k as bz,at as c,eT as d,v6 as e,qM as f,wn as g,Ab as h,xn as i,kM as j,i6 as k,ae as l,s6 as m,r6 as n,l6 as o,o6 as p,sM as q,oM as r,rM as s,_0 as t,hp as u,j6 as v,N6 as w,k6 as x,MM as y,UM as z};