@ainyc/canonry 4.76.2 → 4.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/{BacklinksPage-GkTp8zLM.js → BacklinksPage-CwXveumn.js} +1 -1
- package/assets/assets/{ChartPrimitives-0noLg9_T.js → ChartPrimitives-DntKGI5J.js} +1 -1
- package/assets/assets/{ProjectPage-Bg5sKYhO.js → ProjectPage-CVudiU8X.js} +4 -4
- package/assets/assets/{RunRow-BEhaQDol.js → RunRow-DMtYXaxG.js} +1 -1
- package/assets/assets/{RunsPage-CV2wKkaz.js → RunsPage-Cz-YlucO.js} +1 -1
- package/assets/assets/{SettingsPage-Ctij-T9F.js → SettingsPage-BCuG3C-0.js} +1 -1
- package/assets/assets/TrafficPage-DV8X47wa.js +1 -0
- package/assets/assets/TrafficSourceDetailPage-BmYhK9jm.js +1 -0
- package/assets/assets/arrow-left-CUmHyNnF.js +1 -0
- package/assets/assets/extract-error-message-DFjy9_zi.js +1 -0
- package/assets/assets/{index-DRhoqa2-.css → index-BgWgJE7S.css} +1 -1
- package/assets/assets/{index-B-_Dwwhd.js → index-D9smxU6R.js} +4 -4
- package/assets/assets/{trash-2-C65kNIO5.js → trash-2-B_UtEEm8.js} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-BIT3JPMW.js → chunk-3WXARKUE.js} +105 -15
- package/dist/{chunk-ETM5EPQH.js → chunk-KPN22EWK.js} +2 -2
- package/dist/{chunk-ZUQK4TLL.js → chunk-QKTIP6GC.js} +46 -17
- package/dist/{chunk-42TDEKKM.js → chunk-XI6YSTGE.js} +1 -1
- package/dist/cli.js +13 -4
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-QIGX7IVQ.js → intelligence-service-CDVUUG7O.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +10 -10
- package/assets/assets/TrafficPage-TnIPaMcL.js +0 -1
- package/assets/assets/TrafficSourceDetailPage-BBmIwaee.js +0 -1
- package/assets/assets/extract-error-message-BdLppivS.js +0 -1
- package/assets/assets/server-traffic-ScU00kCP.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-CVudiU8X.js","./vendor-tanstack-Dq7p98wZ.js","./RunRow-DMtYXaxG.js","./ChartPrimitives-DntKGI5J.js","./extract-error-message-DFjy9_zi.js","./vendor-recharts-ClRVR6aX.js","./trash-2-B_UtEEm8.js","./vendor-radix-B57xfQbP.js","./vendor-markdown-DK7fbRNb.js","./RunsPage-Cz-YlucO.js","./SettingsPage-BCuG3C-0.js","./BacklinksPage-CwXveumn.js","./TrafficPage-DV8X47wa.js","./arrow-left-CUmHyNnF.js","./TrafficSourceDetailPage-BmYhK9jm.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{c as hw,d as gw,Q as yw,M as bw,r as q,q as Oe,j as f,L as rt,a as vw,e as ks,u as dn,f as Sw,h as pc,k as xw,l as ww,m as iv,O as sv,n as Xa,o as _i,p as jw,s as zt,t as rv,v as Gs,x as Nw,y as kw,z as Aw}from"./vendor-tanstack-Dq7p98wZ.js";import{S as _w,O as Lf,P as ov,C as qf,a as lv,T as Uf,D as cv,R as uv}from"./vendor-radix-B57xfQbP.js";import{c as dv}from"./vendor-recharts-ClRVR6aX.js";import{M as zw}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 Yd={exports:{}},Yr={},Xd={exports:{}},Jd={};var Oy;function Cw(){return Oy||(Oy=1,(function(e){function n($,W){var fe=$.length;$.push(W);e:for(;0<fe;){var je=fe-1>>>1,se=$[je];if(0<l(se,W))$[je]=W,$[fe]=se,fe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],fe=$.pop();if(fe!==W){$[0]=fe;e:for(var je=0,se=$.length,Qe=se>>>1;je<Qe;){var F=2*(je+1)-1,ce=$[F],ee=F+1,ue=$[ee];if(0>l(ce,fe))ee<se&&0>l(ue,ce)?($[je]=ue,$[ee]=fe,je=ee):($[je]=ce,$[F]=fe,je=F);else if(ee<se&&0>l(ue,fe))$[je]=ue,$[ee]=fe,je=ee;else break e}}return W}function l($,W){var fe=$.sortIndex-W.sortIndex;return fe!==0?fe:$.id-W.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,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],b=[],v=1,x=null,j=3,A=!1,T=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function Z($){for(var W=i(b);W!==null;){if(W.callback===null)r(b);else if(W.startTime<=$)r(b),W.sortIndex=W.expirationTime,n(g,W);else break;W=i(b)}}function X($){if(k=!1,Z($),!T)if(i(g)!==null)T=!0,J||(J=!0,ve());else{var W=i(b);W!==null&&me(X,W.startTime-$)}}var J=!1,O=-1,B=5,oe=-1;function ke(){return E?!0:!(e.unstable_now()-oe<B)}function _e(){if(E=!1,J){var $=e.unstable_now();oe=$;var W=!0;try{e:{T=!1,k&&(k=!1,I(O),O=-1),A=!0;var fe=j;try{t:{for(Z($),x=i(g);x!==null&&!(x.expirationTime>$&&ke());){var je=x.callback;if(typeof je=="function"){x.callback=null,j=x.priorityLevel;var se=je(x.expirationTime<=$);if($=e.unstable_now(),typeof se=="function"){x.callback=se,Z($),W=!0;break t}x===i(g)&&r(g),Z($)}else r(g);x=i(g)}if(x!==null)W=!0;else{var Qe=i(b);Qe!==null&&me(X,Qe.startTime-$),W=!1}}break e}finally{x=null,j=fe,A=!1}W=void 0}}finally{W?ve():J=!1}}}var ve;if(typeof P=="function")ve=function(){P(_e)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,re=tt.port2;tt.port1.onmessage=_e,ve=function(){re.postMessage(null)}}else ve=function(){R(_e,0)};function me($,W){O=R(function(){$(e.unstable_now())},W)}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"):B=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function($){switch(j){case 1:case 2:case 3:var W=3;break;default:W=j}var fe=j;j=W;try{return $()}finally{j=fe}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=j;j=$;try{return W()}finally{j=fe}},e.unstable_scheduleCallback=function($,W,fe){var je=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?je+fe:je):fe=je,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=fe+se,$={id:v++,callback:W,priorityLevel:$,startTime:fe,expirationTime:se,sortIndex:-1},fe>je?($.sortIndex=fe,n(b,$),i(g)===null&&$===i(b)&&(k?(I(O),O=-1):k=!0,me(X,fe-je))):($.sortIndex=se,n(g,$),T||A||(T=!0,J||(J=!0,ve()))),$},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function($){var W=j;return function(){var fe=j;j=W;try{return $.apply(this,arguments)}finally{j=fe}}}})(Jd)),Jd}var Dy;function Tw(){return Dy||(Dy=1,Xd.exports=Cw()),Xd.exports}var Ry;function Ew(){if(Ry)return Yr;Ry=1;var e=Tw(),n=hw(),i=gw();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 h(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,w=u.child;w;){if(w===s){y=!0,s=u,o=p;break}if(w===o){y=!0,o=u,s=p;break}w=w.sibling}if(!y){for(w=p.child;w;){if(w===s){y=!0,s=p,o=u;break}if(w===o){y=!0,o=p,s=u;break}w=w.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 x=Object.assign,j=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),P=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),B=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 tt=Symbol.for("react.client.reference");function re(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===tt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case J:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case P:return t.displayName||"Context";case I:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:re(t.type)||"Memo";case B:a=t._payload,t=t._init;try{return re(t(a))}catch{}}return null}var me=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},je=[],se=-1;function Qe(t){return{current:t}}function F(t){0>se||(t.current=je[se],je[se]=null,se--)}function ce(t,a){se++,je[se]=t.current,t.current=a}var ee=Qe(null),ue=Qe(null),ne=Qe(null),Ne=Qe(null);function nt(t,a){switch(ce(ne,a),ce(ue,t),ce(ee,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?ty(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=ty(a),t=ny(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}F(ee),ce(ee,t)}function xe(){F(ee),F(ue),F(ne)}function $e(t){t.memoizedState!==null&&ce(Ne,t);var a=ee.current,s=ny(a,t.type);a!==s&&(ce(ue,t),ce(ee,s))}function He(t){ue.current===t&&(F(ee),F(ue)),Ne.current===t&&(F(Ne),Hr._currentValue=fe)}var Et,Cn;function Ot(t){if(Et===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Et=a&&a[1]||"",Cn=-1<s.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Et+t+Cn}var er=!1;function Ei(t,a){if(!t||er)return"";er=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(V){var U=V}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(V){U=V}t.call(Y.prototype)}}else{try{throw Error()}catch(V){U=V}(Y=t())&&typeof Y.catch=="function"&&Y.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],w=p[1];if(y&&w){var _=y.split(`
|
|
@@ -11,7 +11,7 @@ Error generating stack: `+o.message+`
|
|
|
11
11
|
|
|
12
12
|
`);B=ve.pop()??"";for(const tt of ve){const re=tt.split(`
|
|
13
13
|
`),me=[];let $;for(const je of re)if(je.startsWith("data:"))me.push(je.replace(/^data:\s*/,""));else if(je.startsWith("event:"))$=je.replace(/^event:\s*/,"");else if(je.startsWith("id:"))x=je.replace(/^id:\s*/,"");else if(je.startsWith("retry:")){const se=Number.parseInt(je.replace(/^retry:\s*/,""),10);Number.isNaN(se)||(k=se)}let W,fe=!1;if(me.length){const je=me.join(`
|
|
14
|
-
`);try{W=JSON.parse(je),fe=!0}catch{W=je}}fe&&(l&&await l(W),r&&(W=await r(W))),i?.({data:W,event:$,id:x,retry:k}),me.length&&(yield W)}}}finally{R.removeEventListener("abort",oe),O.releaseLock()}break}catch(P){if(n?.(P),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await j(Z)}}}()}},Mw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Lw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},qw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},fv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Lw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Mw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):mc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},mc=({allowReserved:e,name:n,value:i})=>{if(i==null)return"";if(typeof i=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?i:encodeURIComponent(i)}`},pv=({allowReserved:e,explode:n,name:i,style:r,value:l,valueOnly:c})=>{if(l instanceof Date)return c?l.toISOString():`${i}=${l.toISOString()}`;if(r!=="deepObject"&&!n){let g=[];Object.entries(l).forEach(([v,x])=>{g=[...g,v,e?x:encodeURIComponent(x)]});const b=g.join(",");switch(r){case"form":return`${i}=${b}`;case"label":return`.${b}`;case"matrix":return`;${i}=${b}`;default:return b}}const d=qw(r),h=Object.entries(l).map(([g,b])=>mc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},Uw=/\{[^{}]+\}/g,$w=({path:e,url:n})=>{let i=n;const r=n.match(Uw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,fv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,pv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${mc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,b)}return i},Vw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=$w({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Iw(e){const n=e.body!==void 0;if(n&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(n)return e.body}const Gw=async(e,n)=>{const i=typeof n=="function"?await n(e):n;if(i)return e.scheme==="bearer"?`Bearer ${i}`:e.scheme==="basic"?`Basic ${btoa(i)}`:i},mv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=fv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=pv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=mc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Pw=e=>{if(!e)return"stream";const n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(i=>n.startsWith(i)))return"blob";if(n.startsWith("text/"))return"text"}},Hw=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,Kw=async({security:e,...n})=>{for(const i of e){if(Hw(n,i.name))continue;const r=await Gw(i,n.auth);if(!r)continue;const l=i.name??"Authorization";switch(i.in){case"query":n.query||(n.query={}),n.query[l]=r;break;case"cookie":n.headers.append("Cookie",`${l}=${r}`);break;default:n.headers.set(l,r);break}}},My=e=>Vw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:mv(e.querySerializer),url:e.url}),Ly=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=hv(e.headers,n.headers),i},Zw=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},hv=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?Zw(i):Object.entries(i);for(const[l,c]of r)if(c===null)n.delete(l);else if(Array.isArray(c))for(const d of c)n.append(l,d);else c!==void 0&&n.set(l,typeof c=="object"?JSON.stringify(c):c)}return n};class Fd{fns=[];clear(){this.fns=[]}eject(n){const i=this.getInterceptorIndex(n);this.fns[i]&&(this.fns[i]=null)}exists(n){const i=this.getInterceptorIndex(n);return!!this.fns[i]}getInterceptorIndex(n){return typeof n=="number"?this.fns[n]?n:-1:this.fns.indexOf(n)}update(n,i){const r=this.getInterceptorIndex(n);return this.fns[r]?(this.fns[r]=i,n):!1}use(n){return this.fns.push(n),this.fns.length-1}}const Qw=()=>({error:new Fd,request:new Fd,response:new Fd}),Yw=mv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Xw={"Content-Type":"application/json"},gv=(e={})=>({...Rw,headers:Xw,parseAs:"auto",querySerializer:Yw,...e}),yv=(e={})=>{let n=Ly(gv(),e);const i=()=>({...n}),r=b=>(n=Ly(n,b),i()),l=Qw(),c=async b=>{const v={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:hv(n.headers,b.headers),serializedBody:void 0};v.security&&await Kw({...v,security:v.security}),v.requestValidator&&await v.requestValidator(v),v.body!==void 0&&v.bodySerializer&&(v.serializedBody=v.bodySerializer(v.body)),(v.body===void 0||v.serializedBody==="")&&v.headers.delete("Content-Type");const x=My(v);return{opts:v,url:x}},d=async b=>{const{opts:v,url:x}=await c(b),j={redirect:"follow",...v,body:Iw(v)};let A=new Request(x,j);for(const X of l.request.fns)X&&(A=await X(A,v));const T=v.fetch;let k=await T(A);for(const X of l.response.fns)X&&(k=await X(k,A,v));const E={request:A,response:k};if(k.ok){const X=(v.parseAs==="auto"?Pw(k.headers.get("Content-Type")):v.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return v.responseStyle==="data"?O:{data:O,...E}}let J;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":J=await k[X]();break;case"stream":return v.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(v.responseValidator&&await v.responseValidator(J),v.responseTransformer&&(J=await v.responseTransformer(J))),v.responseStyle==="data"?J:{data:J,...E}}const R=await k.text();let I;try{I=JSON.parse(R)}catch{}const P=I??R;let Z=P;for(const X of l.error.fns)X&&(Z=await X(P,k,A,v));if(Z=Z||{},v.throwOnError)throw Z;return v.responseStyle==="data"?void 0:{error:Z,...E}},h=b=>v=>d({...v,method:b}),g=b=>async v=>{const{opts:x,url:j}=await c(v);return Bw({...x,body:x.body,headers:x.headers,method:b,onRequest:async(A,T)=>{let k=new Request(A,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:j})};return{buildUrl:My,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("PUT"),request:d,setConfig:r,sse:{connect:g("CONNECT"),delete:g("DELETE"),get:g("GET"),head:g("HEAD"),options:g("OPTIONS"),patch:g("PATCH"),post:g("POST"),put:g("PUT"),trace:g("TRACE")},trace:h("TRACE")}},Q=yv(gv()),Jw=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),bv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),Fw=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ww=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),ej=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),tj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),nj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),aj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),ij=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),sj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),rj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),lj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),uj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),dj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),fj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),pj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),mj=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),hj=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),vv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),gj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),bj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),Sv=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),vj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),xj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),jj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Nj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),kj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Aj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),_j=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Cj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),Tj=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),Ej=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),Oj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Dj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Rj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Bj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Mj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Lj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),qj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Uj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),$j=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Vj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Ij=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),xv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Gj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Pj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Hj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),Kj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Zj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),Yj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Jj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),Fj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),Wj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),eN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),nN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),aN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),iN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),wv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),sN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),rN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),oN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),lN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),cN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),uN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),dN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),fN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),pN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),mN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),hN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),gN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),yN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),bN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),vN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),SN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),xN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),wN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),jN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),NN=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),kN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),AN=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),_N=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),zN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),CN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),TN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),EN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),ON=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),DN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),RN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),BN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),MN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),LN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),qN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),UN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),$N=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),VN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),IN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),GN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),PN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),HN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),KN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),ZN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),QN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),XN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),JN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),FN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),WN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function ek(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return yv(n)}class Pn extends Error{code;statusCode;constructor(n,i,r){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i}}function tk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const jv=tk();function nk(){const e=typeof window<"u"&&window.location?window.location.origin:"";return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?e+window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):e}function ak(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function ik(e){return`${ak()}${e}`}function sk(e,n){if(n===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function rk(){return""}function Wd(){return!!rk()}let Nv=null;function qy(e){Nv=e}function $f(){Nv?.()}const ae=ek({baseUrl:nk()});ae.interceptors.response.use((e,n)=>((e.status===401||e.status===403)&&!n.url.includes("/api/v1/session")&&$f(),e));async function le(e){const n=await e();if(n.error!==void 0&&n.error!==null){const i=n.response.status;let r=`API ${i}: ${n.response.statusText}`,l;if(typeof n.error=="object"&&n.error!==null){const c=n.error.error;if(typeof c=="string")r=c;else if(c&&typeof c=="object"){const d=c;d.message&&(r=d.message),d.code&&(l=d.code)}else{const d=n.error;d.message&&(r=d.message),d.code&&(l=d.code)}}else typeof n.error=="string"&&(r=n.error);throw new Pn(r,i,l)}if(n.response.status!==204)return n.data}async function Vf(e,n){const i=n?.body!=null,r=await fetch(`${jv}${e}`,{...n,credentials:n?.credentials??"same-origin",headers:{...i?{"Content-Type":"application/json"}:{},...n?.headers}});if(!r.ok){const l=await r.text();let c=`API ${r.status}: ${r.statusText}`,d;if(l)try{const h=JSON.parse(l);typeof h.error=="string"?c=h.error:h.error?.message?(c=h.error.message,d=h.error.code):h.message&&(c=h.message)}catch{c=l}throw(r.status===401||r.status===403)&&!e.startsWith("/session")&&$f(),new Pn(c,r.status,d)}if(r.status!==204)return r.json()}function If(e){return le(()=>bv({client:ae,path:{name:e}}))}function kB(e){return le(()=>fj({client:ae,path:{name:e}}))}function ec(e){return le(()=>vv({client:ae,path:{id:e}}))}function ok(e){return le(()=>sj({client:ae,path:{name:e}}))}function lk(e){return le(()=>uj({client:ae,path:{name:e}}))}function ck(e,n){return le(()=>yj({client:ae,path:{name:e},query:{location:n}}))}function kv(e,n){return le(()=>wN({client:ae,path:{name:e},query:{location:n?.location,since:n?.since}}))}function po(e,n){return le(()=>Fw({client:ae,path:{name:e},body:n}))}function uk(e,n){return le(()=>oj({client:ae,path:{name:e},body:{queries:n}}))}function dk(e,n){return le(()=>rj({client:ae,path:{name:e},body:{queries:n}}))}function AB(e,n){return le(()=>ij({client:ae,path:{name:e},body:{queries:n}}))}function fk(e,n){return le(()=>xN({client:ae,path:{name:e},body:n}))}function pk(e,n){return le(()=>dj({client:ae,path:{name:e},body:{competitors:n}}))}function _B(e,n){return le(()=>cj({client:ae,path:{name:e},body:{competitors:n}}))}async function zB(e,n){const i=await If(e);return po(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:n,aliases:i.aliases,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function CB(e,n){const i=await If(e);return po(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:i.ownedDomains,aliases:n,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function TB(e,n){const i=await If(e);return po(e,{displayName:n.displayName??i.displayName??i.name,canonicalDomain:n.canonicalDomain??i.canonicalDomain,ownedDomains:n.ownedDomains??i.ownedDomains,aliases:n.aliases??i.aliases,country:n.country??i.country,language:n.language??i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation})}function mk(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),le(()=>pj({client:ae,path:{name:e},body:i}))}function EB(e,n){return le(()=>ej({client:ae,path:{name:e},body:n}))}async function OB(e,n){await le(()=>tj({client:ae,path:{name:e,label:n}}))}function DB(e,n){return le(()=>nj({client:ae,path:{name:e},body:{label:n}}))}async function RB(e){await le(()=>Jw({client:ae,path:{name:e}}))}function BB(e){return le(()=>aj({client:ae,path:{name:e}}))}function MB(){return le(()=>Sv({client:ae}))}function Uy(){return Vf("/session")}function hk(e){return Vf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function gk(e){return Vf("/session",{method:"POST",body:JSON.stringify({password:e})})}function yk(e,n){return le(()=>vj({client:ae,path:{name:e},body:n}))}function LB(e){return le(()=>Sj({client:ae,body:e}))}async function qB(e){try{return await le(()=>Nj({client:ae,path:{name:e}}))}catch(n){if(n instanceof Pn&&n.statusCode===404)return null;throw n}}function UB(e,n){return le(()=>kj({client:ae,path:{name:e},body:n}))}async function $B(e){await le(()=>jj({client:ae,path:{name:e}}))}function VB(e){return le(()=>Aj({client:ae,path:{name:e}}))}function IB(e,n){return le(()=>_j({client:ae,path:{name:e},body:n}))}async function GB(e,n){await le(()=>zj({client:ae,path:{name:e,id:n}}))}function PB(e,n){return le(()=>Cj({client:ae,path:{name:e,id:n}}))}function bk(e,n,i){return le(()=>lj({client:ae,path:{name:e},body:{provider:n,count:i}}))}function vk(e){return le(()=>gj({client:ae,body:e}))}function Sk(e){return le(()=>hj({client:ae,body:e??{}}))}function HB(e,n){return le(()=>Oj({client:ae,path:{name:e},body:{type:n}}))}function KB(e,n){return le(()=>Dj({client:ae,path:{name:e,type:n}}))}function ZB(e,n,i){return le(()=>Bj({client:ae,path:{name:e,type:n},body:{propertyId:i}}))}function QB(e,n,i){return le(()=>Mj({client:ae,path:{name:e,type:n},body:{sitemapUrl:i}}))}function xk(e,n){return le(()=>Lj({client:ae,path:{name:e},body:n??{}}))}function YB(e,n){const i={};return n&&n!=="all"&&(i.window=n),le(()=>bj({client:ae,path:{name:e},query:i}))}function XB(e,n){return le(()=>$j({client:ae,path:{name:e},body:{url:n}}))}function wk(e){return le(()=>xv({client:ae,path:{name:e}}))}function jk(e,n){return le(()=>Kj({client:ae,path:{name:e},body:n??{}}))}function JB(e){return le(()=>Pj({client:ae,path:{name:e}}))}function Nk(e){return le(()=>Hj({client:ae,path:{name:e}}))}function FB(e,n){return le(()=>FN({client:ae,path:{name:e},body:{}}))}function WB(e,n){return le(()=>PN({client:ae,path:{name:e},body:n??{}}))}function eM(e,n,i){return le(()=>QN({client:ae,path:{name:e,id:n},body:i??{}}))}function tM(){return le(()=>Tj({client:ae}))}function nM(e,n){return le(()=>wj({client:ae,body:{host:e,port:n}}))}function aM(e,n){return le(()=>Zj({client:ae,path:{name:e},body:n}))}function iM(e,n){return le(()=>eN({client:ae,path:{name:e},body:{apiKey:n}}))}function sM(e){return le(()=>tN({client:ae,path:{name:e}}))}function rM(e,n){return le(()=>iN({client:ae,path:{name:e},body:{siteUrl:n}}))}function kk(e){return le(()=>wv({client:ae,path:{name:e}}))}function oM(e,n){return le(()=>rN({client:ae,path:{name:e},body:{url:n}}))}function lM(e,n){return le(()=>oN({client:ae,path:{name:e},body:{}}))}function cM(e,n){return le(()=>lN({client:ae,path:{name:e},body:n}))}function uM(e){return le(()=>xj({client:ae,body:{apiKey:e}}))}function Ak(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function dM(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${jv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Pn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Ak(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function fM(e,n){return le(()=>pN({client:ae,path:{name:e},body:{}}))}function pM(e,n){return le(()=>uN({client:ae,path:{name:e},body:n}))}function mM(e){return le(()=>dN({client:ae,path:{name:e}}))}function hM(e,n){return le(()=>BN({client:ae,path:{name:e},body:n}))}function gM(e,n){return le(()=>MN({client:ae,path:{name:e},body:n}))}function yM(e,n){return le(()=>LN({client:ae,path:{name:e},body:n}))}function bM(e,n,i){return le(()=>qN({client:ae,path:{name:e,id:n},body:i??{}}))}function vM(e,n,i){return le(()=>UN({client:ae,path:{name:e,id:n},body:{}}))}function _k(e,n){return le(()=>bN({client:ae,path:{name:e},query:{runId:n}}))}function zk(e){if(!e||typeof e!="object")return;const n=e;if(!(typeof n.current!="string"||typeof n.latest!="string"||typeof n.url!="string"||typeof n.upgradeCommand!="string"))return{current:n.current,latest:n.latest,url:n.url,upgradeCommand:n.upgradeCommand}}async function Ck(e,n){const i=ik(e);try{const r=await fetch(i,{credentials:"same-origin"});if(!r.ok)return{label:n,state:"error",detail:`${n} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:sk(e,r.status)};const l=await r.json(),c=typeof l.version=="string"?l.version:"unknown",d=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=zk(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:h,...g?{updateAvailable:g}:{}}}catch(r){return{label:n,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${i}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function SM(){return le(()=>jN({client:ae}))}function xM(){return le(()=>NN({client:ae}))}function wM(){return le(()=>_N({client:ae}))}function jM(){return le(()=>kN({client:ae}))}function NM(e){return le(()=>AN({client:ae,body:e?{release:e}:{}}))}function kM(){return le(()=>zN({client:ae}))}function AM(){return le(()=>CN({client:ae}))}function _M(e){return le(()=>TN({client:ae,path:{release:e}}))}function zM(e,n={}){return le(()=>ON({client:ae,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function CM(e,n={}){return le(()=>DN({client:ae,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function TM(e){return le(()=>RN({client:ae,path:{name:e}}))}function EM(e,n){return le(()=>EN({client:ae,path:{name:e},body:{release:void 0}}))}function wn(e){return(...n)=>{e(...n)}}const Tk=6e3,Ek=5,Ok=180;let $t=[],Dk=0;const mf=new Set,hf=new Map,gf=new Map;function tc(){const e=[...$t];for(const n of mf)n(e)}function Gf(e){const n=hf.get(e);n&&(clearTimeout(n),hf.delete(e));const i=gf.get(e);i&&(clearTimeout(i),gf.delete(e))}function Av(e){Gf(e);const n=$t.length;$t=$t.filter(i=>i.id!==e),$t.length!==n&&tc()}function $y(e){Gf(e.id),hf.set(e.id,setTimeout(()=>{yf(e.id)},e.durationMs))}function Rk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=Tk){const r=Rk(e,n,i),l={id:String(++Dk),title:r.title,detail:r.detail,tone:r.tone??n,durationMs:r.durationMs??i,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const c=$t.find(d=>d.dedupeKey===r.dedupeKey);if(c){if((r.dedupeMode??"drop")==="drop")return c.id;const d={...c,title:l.title,detail:l.detail,tone:l.tone,durationMs:l.durationMs,cta:l.cta,state:"open"};return $t=$t.map(h=>h.id===c.id?d:h),tc(),$y(d),c.id}}return $t.length>=Ek&&Av($t[0].id),$t=[...$t,l],tc(),$y(l),l.id}function yf(e){const n=$t.find(i=>i.id===e);!n||n.state==="closing"||(Gf(e),$t=$t.map(i=>i.id===e?{...i,state:"closing"}:i),tc(),gf.set(e,setTimeout(()=>{Av(e)},Ok)))}function Bk(e){return mf.add(e),()=>{mf.delete(e)}}function Vy(){return $t}const Mk=5*6e4,bf=30*6e4,OM=3e4,DM=6e4,ro=3e4,Lk=2e3,qk=5e3;function Uk(){return new yw({defaultOptions:{queries:{staleTime:Mk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new bw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const $k="modulepreload",Vk=function(e,n){return new URL(e,n).href},Iy={},Ps=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(v){return Promise.all(v.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(v=>{if(v=Vk(v,r),v in Iy)return;Iy[v]=!0;const x=v.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===v&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${j}`))return;const A=document.createElement("link");if(A.rel=x?"stylesheet":$k,x||(A.as="script"),A.crossOrigin="",A.href=v,g&&A.setAttribute("nonce",g),document.head.appendChild(A),x)return new Promise((T,k)=>{A.addEventListener("load",T),A.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const Ik=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Gy=e=>{const n=Gk(e);return n.charAt(0).toUpperCase()+n.slice(1)},_v=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),Pk=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var Hk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Kk=q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>q.createElement("svg",{ref:g,...Hk,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:_v("lucide",l),...!c&&!Pk(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,v])=>q.createElement(b,v)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=q.forwardRef(({className:r,...l},c)=>q.createElement(Kk,{ref:c,iconNode:n,className:_v(`lucide-${Ik(Gy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Gy(e),i};const Zk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Qk=et("arrow-right",Zk);const Yk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Xk=et("arrow-up",Yk);const Jk=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Fk=et("book-open",Jk);const Wk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zv=et("check",Wk);const eA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tA=et("chevron-down",eA);const nA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Pf=et("chevron-right",nA);const aA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],iA=et("copy",aA);const sA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rA=et("file-text",sA);const oA=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],lA=et("github",oA);const cA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],uA=et("globe",cA);const dA=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],fA=et("layout-dashboard",dA);const pA=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],mA=et("link-2",pA);const hA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gA=et("loader-circle",hA);const yA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],bA=et("maximize-2",yA);const vA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],SA=et("menu",vA);const xA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],wA=et("minimize-2",xA);const jA=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],NA=et("play",jA);const kA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Py=et("plus",kA);const AA=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],_A=et("radar",AA);const zA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Hy=et("radio",zA);const CA=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],TA=et("rocket",CA);const EA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Cv=et("rotate-ccw",EA);const OA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],DA=et("search",OA);const RA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],BA=et("settings",RA);const MA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tv=et("triangle-alert",MA);const LA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],qA=et("wrench",LA);const UA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hs=et("x",UA);function H(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const b=d.prototype,v=Object.keys(b);for(let x=0;x<v.length;x++){const j=v[x];j in h||(h[j]=b[j].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const b=i?.Parent?new c:this;r(b,h),(g=b._zod).deferred??(g.deferred=[]);for(const v of b._zod.deferred)v();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Rs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ev extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Ov={};function Qa(e){return Ov}function Dv(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,l])=>n.indexOf(+r)===-1).map(([r,l])=>l)}function vf(e,n){return typeof n=="bigint"?n.toString():n}function hc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Hf(e){return e==null}function Kf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function $A(e,n){const i=(e.toString().split(".")[1]||"").length,r=n.toString();let l=(r.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const c=i>l?i:l,d=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Ky=Symbol("evaluating");function Pe(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Ky)return r===void 0&&(r=Ky,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function zi(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Zy(e){return JSON.stringify(e)}function VA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function oo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const IA=hc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qs(e){if(oo(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(oo(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bv(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const GA=new Set(["string","number","symbol"]);function Us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fa(e,n,i){const r=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(r._zod.parent=e),r}function be(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function PA(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const HA={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function KA(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Ja(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return zi(this,"shape",d),d},checks:[]});return Fa(e,c)}function ZA(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Ja(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return zi(this,"shape",d),d},checks:[]});return Fa(e,c)}function QA(e,n){if(!qs(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ja(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return zi(this,"shape",c),c}});return Fa(e,l)}function YA(e,n){if(!qs(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return zi(this,"shape",r),r}});return Fa(e,i)}function XA(e,n){const i=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return zi(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Fa(e,i)}function JA(e,n,i){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Ja(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const b in i){if(!(b in h))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:h[b]}):h[b])}else for(const b in h)g[b]=e?new e({type:"optional",innerType:h[b]}):h[b];return zi(this,"shape",g),g},checks:[]});return Fa(n,d)}function FA(e,n,i){const r=Ja(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)c[d]=new e({type:"nonoptional",innerType:l[d]});return zi(this,"shape",c),c}});return Fa(n,r)}function Cs(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Ts(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function ql(e){return typeof e=="string"?e:e?.message}function Ya(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=ql(e.inst?._zod.def?.error?.(e))??ql(n?.error?.(e))??ql(i.customError?.(e))??ql(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Zf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Mv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,vf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Lv=H("$ZodError",Mv),qv=H("$ZodError",Mv,{Parent:Error});function WA(e,n=i=>i.message){const i={},r=[];for(const l of e.issues)l.path.length>0?(i[l.path[0]]=i[l.path[0]]||[],i[l.path[0]].push(n(l))):r.push(n(l));return{formErrors:r,fieldErrors:i}}function e2(e,n=i=>i.message){const i={_errors:[]},r=l=>{for(const c of l.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)i._errors.push(n(c));else{let d=i,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Qf=e=>(n,i,r,l)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new Rs;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Ya(g,c,Qa())));throw Rv(h,l?.callee),h}return d.value},Yf=e=>async(n,i,r,l)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Ya(g,c,Qa())));throw Rv(h,l?.callee),h}return d.value},gc=e=>(n,i,r)=>{const l=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Rs;return c.issues.length?{success:!1,error:new(e??Lv)(c.issues.map(d=>Ya(d,l,Qa())))}:{success:!0,data:c.value}},t2=gc(qv),yc=e=>async(n,i,r)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ya(d,l,Qa())))}:{success:!0,data:c.value}},n2=yc(qv),a2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qf(e)(n,i,l)},i2=e=>(n,i,r)=>Qf(e)(n,i,r),s2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yf(e)(n,i,l)},r2=e=>async(n,i,r)=>Yf(e)(n,i,r),o2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gc(e)(n,i,l)},l2=e=>(n,i,r)=>gc(e)(n,i,r),c2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yc(e)(n,i,l)},u2=e=>async(n,i,r)=>yc(e)(n,i,r),d2=/^[cC][^\s-]{8,}$/,f2=/^[0-9a-z]+$/,p2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,m2=/^[0-9a-vA-V]{20}$/,h2=/^[A-Za-z0-9]{27}$/,g2=/^[a-zA-Z0-9_-]{21}$/,y2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,b2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qy=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,v2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,S2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function x2(){return new RegExp(S2,"u")}const w2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,j2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,N2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,k2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Uv=/^[A-Za-z0-9_-]*$/,_2=/^\+[1-9]\d{6,14}$/,$v="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",z2=new RegExp(`^${$v}$`);function Vv(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C2(e){return new RegExp(`^${Vv(e)}$`)}function T2(e){const n=Vv({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${i.join("|")})`;return new RegExp(`^${$v}T(?:${r})$`)}const E2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},O2=/^-?\d+$/,Iv=/^-?\d+(?:\.\d+)?$/,D2=/^(?:true|false)$/i,R2=/^[^A-Z]*$/,B2=/^[^a-z]*$/,nn=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Gv={number:"number",bigint:"bigint",object:"date"},Pv=H("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Gv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<c&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Hv=H("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Gv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),M2=H("$ZodCheckMultipleOf",(e,n)=>{nn.init(e,n),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):$A(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),L2=H("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=HA[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=O2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),q2=H("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const l=r.value;if(l.length<=n.maximum)return;const d=Zf(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),U2=H("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const l=r.value;if(l.length>=n.minimum)return;const d=Zf(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),$2=H("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=r=>{const l=r.value,c=l.length;if(c===n.length)return;const d=Zf(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),bc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),V2=H("$ZodCheckRegex",(e,n)=>{bc.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),I2=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=R2),bc.init(e,n)}),G2=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=B2),bc.init(e,n)}),P2=H("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=Us(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=r,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),H2=H("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${Us(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),K2=H("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${Us(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),Z2=H("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class Q2{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
|
|
14
|
+
`);try{W=JSON.parse(je),fe=!0}catch{W=je}}fe&&(l&&await l(W),r&&(W=await r(W))),i?.({data:W,event:$,id:x,retry:k}),me.length&&(yield W)}}}finally{R.removeEventListener("abort",oe),O.releaseLock()}break}catch(P){if(n?.(P),d!==void 0&&E>=d)break;const Z=Math.min(k*2**(E-1),h??3e4);await j(Z)}}}()}},Mw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Lw=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},qw=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},fv=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(Lw(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=Mw(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):mc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},mc=({allowReserved:e,name:n,value:i})=>{if(i==null)return"";if(typeof i=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${e?i:encodeURIComponent(i)}`},pv=({allowReserved:e,explode:n,name:i,style:r,value:l,valueOnly:c})=>{if(l instanceof Date)return c?l.toISOString():`${i}=${l.toISOString()}`;if(r!=="deepObject"&&!n){let g=[];Object.entries(l).forEach(([v,x])=>{g=[...g,v,e?x:encodeURIComponent(x)]});const b=g.join(",");switch(r){case"form":return`${i}=${b}`;case"label":return`.${b}`;case"matrix":return`;${i}=${b}`;default:return b}}const d=qw(r),h=Object.entries(l).map(([g,b])=>mc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},Uw=/\{[^{}]+\}/g,$w=({path:e,url:n})=>{let i=n;const r=n.match(Uw);if(r)for(const l of r){let c=!1,d=l.substring(1,l.length-1),h="simple";d.endsWith("*")&&(c=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),h="label"):d.startsWith(";")&&(d=d.substring(1),h="matrix");const g=e[d];if(g==null)continue;if(Array.isArray(g)){i=i.replace(l,fv({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,pv({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${mc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,b)}return i},Vw=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=$w({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function Iw(e){const n=e.body!==void 0;if(n&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(n)return e.body}const Gw=async(e,n)=>{const i=typeof n=="function"?await n(e):n;if(i)return e.scheme==="bearer"?`Bearer ${i}`:e.scheme==="basic"?`Basic ${btoa(i)}`:i},mv=({allowReserved:e,array:n,object:i}={})=>l=>{const c=[];if(l&&typeof l=="object")for(const d in l){const h=l[d];if(h!=null)if(Array.isArray(h)){const g=fv({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=pv({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=mc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},Pw=e=>{if(!e)return"stream";const n=e.split(";")[0]?.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(i=>n.startsWith(i)))return"blob";if(n.startsWith("text/"))return"text"}},Hw=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,Kw=async({security:e,...n})=>{for(const i of e){if(Hw(n,i.name))continue;const r=await Gw(i,n.auth);if(!r)continue;const l=i.name??"Authorization";switch(i.in){case"query":n.query||(n.query={}),n.query[l]=r;break;case"cookie":n.headers.append("Cookie",`${l}=${r}`);break;default:n.headers.set(l,r);break}}},My=e=>Vw({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:mv(e.querySerializer),url:e.url}),Ly=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=hv(e.headers,n.headers),i},Zw=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},hv=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?Zw(i):Object.entries(i);for(const[l,c]of r)if(c===null)n.delete(l);else if(Array.isArray(c))for(const d of c)n.append(l,d);else c!==void 0&&n.set(l,typeof c=="object"?JSON.stringify(c):c)}return n};class Fd{fns=[];clear(){this.fns=[]}eject(n){const i=this.getInterceptorIndex(n);this.fns[i]&&(this.fns[i]=null)}exists(n){const i=this.getInterceptorIndex(n);return!!this.fns[i]}getInterceptorIndex(n){return typeof n=="number"?this.fns[n]?n:-1:this.fns.indexOf(n)}update(n,i){const r=this.getInterceptorIndex(n);return this.fns[r]?(this.fns[r]=i,n):!1}use(n){return this.fns.push(n),this.fns.length-1}}const Qw=()=>({error:new Fd,request:new Fd,response:new Fd}),Yw=mv({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),Xw={"Content-Type":"application/json"},gv=(e={})=>({...Rw,headers:Xw,parseAs:"auto",querySerializer:Yw,...e}),yv=(e={})=>{let n=Ly(gv(),e);const i=()=>({...n}),r=b=>(n=Ly(n,b),i()),l=Qw(),c=async b=>{const v={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:hv(n.headers,b.headers),serializedBody:void 0};v.security&&await Kw({...v,security:v.security}),v.requestValidator&&await v.requestValidator(v),v.body!==void 0&&v.bodySerializer&&(v.serializedBody=v.bodySerializer(v.body)),(v.body===void 0||v.serializedBody==="")&&v.headers.delete("Content-Type");const x=My(v);return{opts:v,url:x}},d=async b=>{const{opts:v,url:x}=await c(b),j={redirect:"follow",...v,body:Iw(v)};let A=new Request(x,j);for(const X of l.request.fns)X&&(A=await X(A,v));const T=v.fetch;let k=await T(A);for(const X of l.response.fns)X&&(k=await X(k,A,v));const E={request:A,response:k};if(k.ok){const X=(v.parseAs==="auto"?Pw(k.headers.get("Content-Type")):v.parseAs)??"json";if(k.status===204||k.headers.get("Content-Length")==="0"){let O;switch(X){case"arrayBuffer":case"blob":case"text":O=await k[X]();break;case"formData":O=new FormData;break;case"stream":O=k.body;break;default:O={};break}return v.responseStyle==="data"?O:{data:O,...E}}let J;switch(X){case"arrayBuffer":case"blob":case"formData":case"json":case"text":J=await k[X]();break;case"stream":return v.responseStyle==="data"?k.body:{data:k.body,...E}}return X==="json"&&(v.responseValidator&&await v.responseValidator(J),v.responseTransformer&&(J=await v.responseTransformer(J))),v.responseStyle==="data"?J:{data:J,...E}}const R=await k.text();let I;try{I=JSON.parse(R)}catch{}const P=I??R;let Z=P;for(const X of l.error.fns)X&&(Z=await X(P,k,A,v));if(Z=Z||{},v.throwOnError)throw Z;return v.responseStyle==="data"?void 0:{error:Z,...E}},h=b=>v=>d({...v,method:b}),g=b=>async v=>{const{opts:x,url:j}=await c(v);return Bw({...x,body:x.body,headers:x.headers,method:b,onRequest:async(A,T)=>{let k=new Request(A,T);for(const E of l.request.fns)E&&(k=await E(k,x));return k},url:j})};return{buildUrl:My,connect:h("CONNECT"),delete:h("DELETE"),get:h("GET"),getConfig:i,head:h("HEAD"),interceptors:l,options:h("OPTIONS"),patch:h("PATCH"),post:h("POST"),put:h("PUT"),request:d,setConfig:r,sse:{connect:g("CONNECT"),delete:g("DELETE"),get:g("GET"),head:g("HEAD"),options:g("OPTIONS"),patch:g("PATCH"),post:g("POST"),put:g("PUT"),trace:g("TRACE")},trace:h("TRACE")}},Q=yv(gv()),Jw=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),bv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),Fw=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Ww=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),ej=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),tj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),nj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/default",...e,headers:{"Content-Type":"application/json",...e.headers}}),aj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/export",...e}),ij=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),sj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),rj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),oj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),lj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries/generate",...e,headers:{"Content-Type":"application/json",...e.headers}}),cj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),uj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),dj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),fj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),pj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),mj=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),hj=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),vv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),gj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),yj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),bj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),Sv=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),vj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),Sj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),xj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),wj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),jj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),Nj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),kj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),Aj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),_j=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),zj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),Cj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),Tj=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),Ej=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),Oj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Dj=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),Rj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),Bj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/property",...e,headers:{"Content-Type":"application/json",...e.headers}}),Mj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}/sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Lj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),qj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),Uj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),$j=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect",...e,headers:{"Content-Type":"application/json",...e.headers}}),Vj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),Ij=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),xv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),Gj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),Pj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),Hj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),Kj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),Zj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/indexing/request",...e,headers:{"Content-Type":"application/json",...e.headers}}),Qj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),Yj=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations/{locationName}/selection",...e,headers:{"Content-Type":"application/json",...e.headers}}),Xj=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),Jj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),Fj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),Wj=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),eN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),tN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),nN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),aN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),iN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/set-site",...e,headers:{"Content-Type":"application/json",...e.headers}}),wv=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),sN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),rN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-url",...e,headers:{"Content-Type":"application/json",...e.headers}}),oN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspect-sitemap",...e,headers:{"Content-Type":"application/json",...e.headers}}),lN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/request-indexing",...e,headers:{"Content-Type":"application/json",...e.headers}}),cN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),uN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/connect",...e,headers:{"Content-Type":"application/json",...e.headers}}),dN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),fN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),pN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),mN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),hN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),gN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),yN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),bN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),vN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),SN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),xN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/content/dismissals",...e,headers:{"Content-Type":"application/json",...e.headers}}),wN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),jN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),NN=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),kN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),AN=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),_N=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),zN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),CN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),TN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),EN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/extract",...e,headers:{"Content-Type":"application/json",...e.headers}}),ON=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),DN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),RN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),BN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/cloud-run",...e,headers:{"Content-Type":"application/json",...e.headers}}),MN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/wordpress",...e,headers:{"Content-Type":"application/json",...e.headers}}),LN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/connect/vercel",...e,headers:{"Content-Type":"application/json",...e.headers}}),qN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/sync",...e,headers:{"Content-Type":"application/json",...e.headers}}),UN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}/backfill",...e,headers:{"Content-Type":"application/json",...e.headers}}),$N=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),VN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),IN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),GN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),PN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/run",...e,headers:{"Content-Type":"application/json",...e.headers}}),HN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),KN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),ZN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),QN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),XN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),JN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),FN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),WN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function ek(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return yv(n)}class Pn extends Error{code;statusCode;details;constructor(n,i,r,l){super(n),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=i,this.details=l}}function tk(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const jv=tk();function nk(){const e=typeof window<"u"&&window.location?window.location.origin:"";return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?e+window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):e}function ak(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function ik(e){return`${ak()}${e}`}function sk(e,n){if(n===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function rk(){return""}function Wd(){return!!rk()}let Nv=null;function qy(e){Nv=e}function $f(){Nv?.()}const ae=ek({baseUrl:nk()});ae.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&$f(),e));async function le(e){const n=await e();if(n.error!==void 0&&n.error!==null){const i=n.response.status;let r=`API ${i}: ${n.response.statusText}`,l,c;if(typeof n.error=="object"&&n.error!==null){const d=n.error.error;if(typeof d=="string")r=d;else if(d&&typeof d=="object"){const h=d;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}else{const h=n.error;h.message&&(r=h.message),h.code&&(l=h.code),h.details&&(c=h.details)}}else typeof n.error=="string"&&(r=n.error);throw new Pn(r,i,l,c)}if(n.response.status!==204)return n.data}async function Vf(e,n){const i=n?.body!=null,r=await fetch(`${jv}${e}`,{...n,credentials:n?.credentials??"same-origin",headers:{...i?{"Content-Type":"application/json"}:{},...n?.headers}});if(!r.ok){const l=await r.text();let c=`API ${r.status}: ${r.statusText}`,d,h;if(l)try{const g=JSON.parse(l);typeof g.error=="string"?c=g.error:g.error?.message?(c=g.error.message,d=g.error.code,h=g.error.details):g.message&&(c=g.message)}catch{c=l}throw r.status===401&&!e.startsWith("/session")&&$f(),new Pn(c,r.status,d,h)}if(r.status!==204)return r.json()}function If(e){return le(()=>bv({client:ae,path:{name:e}}))}function kB(e){return le(()=>fj({client:ae,path:{name:e}}))}function ec(e){return le(()=>vv({client:ae,path:{id:e}}))}function ok(e){return le(()=>sj({client:ae,path:{name:e}}))}function lk(e){return le(()=>uj({client:ae,path:{name:e}}))}function ck(e,n){return le(()=>yj({client:ae,path:{name:e},query:{location:n}}))}function kv(e,n){return le(()=>wN({client:ae,path:{name:e},query:{location:n?.location,since:n?.since}}))}function po(e,n){return le(()=>Fw({client:ae,path:{name:e},body:n}))}function uk(e,n){return le(()=>oj({client:ae,path:{name:e},body:{queries:n}}))}function dk(e,n){return le(()=>rj({client:ae,path:{name:e},body:{queries:n}}))}function AB(e,n){return le(()=>ij({client:ae,path:{name:e},body:{queries:n}}))}function fk(e,n){return le(()=>xN({client:ae,path:{name:e},body:n}))}function pk(e,n){return le(()=>dj({client:ae,path:{name:e},body:{competitors:n}}))}function _B(e,n){return le(()=>cj({client:ae,path:{name:e},body:{competitors:n}}))}async function zB(e,n){const i=await If(e);return po(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:n,aliases:i.aliases,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function CB(e,n){const i=await If(e);return po(e,{displayName:i.displayName??i.name,canonicalDomain:i.canonicalDomain,ownedDomains:i.ownedDomains,aliases:n,country:i.country,language:i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:i.locations,defaultLocation:i.defaultLocation})}async function TB(e,n){const i=await If(e);return po(e,{displayName:n.displayName??i.displayName??i.name,canonicalDomain:n.canonicalDomain??i.canonicalDomain,ownedDomains:n.ownedDomains??i.ownedDomains,aliases:n.aliases??i.aliases,country:n.country??i.country,language:n.language??i.language,tags:i.tags,labels:i.labels,providers:i.providers,locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation})}function mk(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),le(()=>pj({client:ae,path:{name:e},body:i}))}function EB(e,n){return le(()=>ej({client:ae,path:{name:e},body:n}))}async function OB(e,n){await le(()=>tj({client:ae,path:{name:e,label:n}}))}function DB(e,n){return le(()=>nj({client:ae,path:{name:e},body:{label:n}}))}async function RB(e){await le(()=>Jw({client:ae,path:{name:e}}))}function BB(e){return le(()=>aj({client:ae,path:{name:e}}))}function MB(){return le(()=>Sv({client:ae}))}function Uy(){return Vf("/session")}function hk(e){return Vf("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function gk(e){return Vf("/session",{method:"POST",body:JSON.stringify({password:e})})}function yk(e,n){return le(()=>vj({client:ae,path:{name:e},body:n}))}function LB(e){return le(()=>Sj({client:ae,body:e}))}async function qB(e){try{return await le(()=>Nj({client:ae,path:{name:e}}))}catch(n){if(n instanceof Pn&&n.statusCode===404)return null;throw n}}function UB(e,n){return le(()=>kj({client:ae,path:{name:e},body:n}))}async function $B(e){await le(()=>jj({client:ae,path:{name:e}}))}function VB(e){return le(()=>Aj({client:ae,path:{name:e}}))}function IB(e,n){return le(()=>_j({client:ae,path:{name:e},body:n}))}async function GB(e,n){await le(()=>zj({client:ae,path:{name:e,id:n}}))}function PB(e,n){return le(()=>Cj({client:ae,path:{name:e,id:n}}))}function bk(e,n,i){return le(()=>lj({client:ae,path:{name:e},body:{provider:n,count:i}}))}function vk(e){return le(()=>gj({client:ae,body:e}))}function Sk(e){return le(()=>hj({client:ae,body:e??{}}))}function HB(e,n){return le(()=>Oj({client:ae,path:{name:e},body:{type:n}}))}function KB(e,n){return le(()=>Dj({client:ae,path:{name:e,type:n}}))}function ZB(e,n,i){return le(()=>Bj({client:ae,path:{name:e,type:n},body:{propertyId:i}}))}function QB(e,n,i){return le(()=>Mj({client:ae,path:{name:e,type:n},body:{sitemapUrl:i}}))}function xk(e,n){return le(()=>Lj({client:ae,path:{name:e},body:n??{}}))}function YB(e,n){const i={};return n&&n!=="all"&&(i.window=n),le(()=>bj({client:ae,path:{name:e},query:i}))}function XB(e,n){return le(()=>$j({client:ae,path:{name:e},body:{url:n}}))}function wk(e){return le(()=>xv({client:ae,path:{name:e}}))}function jk(e,n){return le(()=>Kj({client:ae,path:{name:e},body:n??{}}))}function JB(e){return le(()=>Pj({client:ae,path:{name:e}}))}function Nk(e){return le(()=>Hj({client:ae,path:{name:e}}))}function FB(e,n){return le(()=>FN({client:ae,path:{name:e},body:{}}))}function WB(e,n){return le(()=>PN({client:ae,path:{name:e},body:n??{}}))}function eM(e,n,i){return le(()=>QN({client:ae,path:{name:e,id:n},body:i??{}}))}function tM(){return le(()=>Tj({client:ae}))}function nM(e,n){return le(()=>wj({client:ae,body:{host:e,port:n}}))}function aM(e,n){return le(()=>Zj({client:ae,path:{name:e},body:n}))}function iM(e,n){return le(()=>eN({client:ae,path:{name:e},body:{apiKey:n}}))}function sM(e){return le(()=>tN({client:ae,path:{name:e}}))}function rM(e,n){return le(()=>iN({client:ae,path:{name:e},body:{siteUrl:n}}))}function kk(e){return le(()=>wv({client:ae,path:{name:e}}))}function oM(e,n){return le(()=>rN({client:ae,path:{name:e},body:{url:n}}))}function lM(e,n){return le(()=>oN({client:ae,path:{name:e},body:{}}))}function cM(e,n){return le(()=>lN({client:ae,path:{name:e},body:n}))}function uM(e){return le(()=>xj({client:ae,body:{apiKey:e}}))}function Ak(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function dM(e,n="agency"){const i=new URLSearchParams({audience:n}),r=await fetch(`${jv}/projects/${encodeURIComponent(e)}/report.html?${i.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Pn(`Failed to download report: ${r.status}`,r.status);const l=await r.blob(),c=URL.createObjectURL(l),d=Ak(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,h=document.createElement("a");h.href=c,h.download=d,document.body.appendChild(h),h.click(),document.body.removeChild(h),URL.revokeObjectURL(c)}function fM(e,n){return le(()=>pN({client:ae,path:{name:e},body:{}}))}function pM(e,n){return le(()=>uN({client:ae,path:{name:e},body:n}))}function mM(e){return le(()=>dN({client:ae,path:{name:e}}))}function hM(e,n){return le(()=>BN({client:ae,path:{name:e},body:n}))}function gM(e,n){return le(()=>MN({client:ae,path:{name:e},body:n}))}function yM(e,n){return le(()=>LN({client:ae,path:{name:e},body:n}))}function bM(e,n,i){return le(()=>qN({client:ae,path:{name:e,id:n},body:i??{}}))}function vM(e,n,i){return le(()=>UN({client:ae,path:{name:e,id:n},body:{}}))}function _k(e,n){return le(()=>bN({client:ae,path:{name:e},query:{runId:n}}))}function zk(e){if(!e||typeof e!="object")return;const n=e;if(!(typeof n.current!="string"||typeof n.latest!="string"||typeof n.url!="string"||typeof n.upgradeCommand!="string"))return{current:n.current,latest:n.latest,url:n.url,upgradeCommand:n.upgradeCommand}}async function Ck(e,n){const i=ik(e);try{const r=await fetch(i,{credentials:"same-origin"});if(!r.ok)return{label:n,state:"error",detail:`${n} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:sk(e,r.status)};const l=await r.json(),c=typeof l.version=="string"?l.version:"unknown",d=typeof l.databaseUrlConfigured=="boolean"?l.databaseUrlConfigured:void 0,h=typeof l.lastHeartbeatAt=="string"?l.lastHeartbeatAt:void 0,g=zk(l.updateAvailable),b=[c,d===!1?"database not configured":"database configured",h?`heartbeat ${h}`:void 0].filter(Boolean).join(" · ");return{label:n,state:"ok",detail:b,version:c,databaseConfigured:d,lastHeartbeatAt:h,...g?{updateAvailable:g}:{}}}catch(r){return{label:n,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${i}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function SM(){return le(()=>jN({client:ae}))}function xM(){return le(()=>NN({client:ae}))}function wM(){return le(()=>_N({client:ae}))}function jM(){return le(()=>kN({client:ae}))}function NM(e){return le(()=>AN({client:ae,body:e?{release:e}:{}}))}function kM(){return le(()=>zN({client:ae}))}function AM(){return le(()=>CN({client:ae}))}function _M(e){return le(()=>TN({client:ae,path:{release:e}}))}function zM(e,n={}){return le(()=>ON({client:ae,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function CM(e,n={}){return le(()=>DN({client:ae,path:{name:e},query:{limit:n.limit!==void 0?String(n.limit):void 0,offset:n.offset!==void 0?String(n.offset):void 0,release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function TM(e){return le(()=>RN({client:ae,path:{name:e}}))}function EM(e,n){return le(()=>EN({client:ae,path:{name:e},body:{release:void 0}}))}function wn(e){return(...n)=>{e(...n)}}const Tk=6e3,Ek=5,Ok=180;let $t=[],Dk=0;const mf=new Set,hf=new Map,gf=new Map;function tc(){const e=[...$t];for(const n of mf)n(e)}function Gf(e){const n=hf.get(e);n&&(clearTimeout(n),hf.delete(e));const i=gf.get(e);i&&(clearTimeout(i),gf.delete(e))}function Av(e){Gf(e);const n=$t.length;$t=$t.filter(i=>i.id!==e),$t.length!==n&&tc()}function $y(e){Gf(e.id),hf.set(e.id,setTimeout(()=>{yf(e.id)},e.durationMs))}function Rk(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function en(e,n="negative",i=Tk){const r=Rk(e,n,i),l={id:String(++Dk),title:r.title,detail:r.detail,tone:r.tone??n,durationMs:r.durationMs??i,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const c=$t.find(d=>d.dedupeKey===r.dedupeKey);if(c){if((r.dedupeMode??"drop")==="drop")return c.id;const d={...c,title:l.title,detail:l.detail,tone:l.tone,durationMs:l.durationMs,cta:l.cta,state:"open"};return $t=$t.map(h=>h.id===c.id?d:h),tc(),$y(d),c.id}}return $t.length>=Ek&&Av($t[0].id),$t=[...$t,l],tc(),$y(l),l.id}function yf(e){const n=$t.find(i=>i.id===e);!n||n.state==="closing"||(Gf(e),$t=$t.map(i=>i.id===e?{...i,state:"closing"}:i),tc(),gf.set(e,setTimeout(()=>{Av(e)},Ok)))}function Bk(e){return mf.add(e),()=>{mf.delete(e)}}function Vy(){return $t}const Mk=5*6e4,bf=30*6e4,OM=3e4,DM=6e4,ro=3e4,Lk=2e3,qk=5e3;function Uk(){return new yw({defaultOptions:{queries:{staleTime:Mk,retry:1,refetchOnWindowFocus:!1}},mutationCache:new bw({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||en({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const $k="modulepreload",Vk=function(e,n){return new URL(e,n).href},Iy={},Ps=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(v){return Promise.all(v.map(x=>Promise.resolve(x).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(v=>{if(v=Vk(v,r),v in Iy)return;Iy[v]=!0;const x=v.endsWith(".css"),j=x?'[rel="stylesheet"]':"";if(r)for(let T=d.length-1;T>=0;T--){const k=d[T];if(k.href===v&&(!x||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${j}`))return;const A=document.createElement("link");if(A.rel=x?"stylesheet":$k,x||(A.as="script"),A.crossOrigin="",A.href=v,g&&A.setAttribute("nonce",g),document.head.appendChild(A),x)return new Promise((T,k)=>{A.addEventListener("load",T),A.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=d,window.dispatchEvent(h),!h.defaultPrevented)throw d}return l.then(d=>{for(const h of d||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};const Ik=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gk=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Gy=e=>{const n=Gk(e);return n.charAt(0).toUpperCase()+n.slice(1)},_v=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),Pk=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var Hk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Kk=q.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:r,className:l="",children:c,iconNode:d,...h},g)=>q.createElement("svg",{ref:g,...Hk,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:_v("lucide",l),...!c&&!Pk(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,v])=>q.createElement(b,v)),...Array.isArray(c)?c:[c]]));const et=(e,n)=>{const i=q.forwardRef(({className:r,...l},c)=>q.createElement(Kk,{ref:c,iconNode:n,className:_v(`lucide-${Ik(Gy(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Gy(e),i};const Zk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Qk=et("arrow-right",Zk);const Yk=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Xk=et("arrow-up",Yk);const Jk=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Fk=et("book-open",Jk);const Wk=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],zv=et("check",Wk);const eA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],tA=et("chevron-down",eA);const nA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Pf=et("chevron-right",nA);const aA=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],iA=et("copy",aA);const sA=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rA=et("file-text",sA);const oA=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],lA=et("github",oA);const cA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],uA=et("globe",cA);const dA=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],fA=et("layout-dashboard",dA);const pA=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],mA=et("link-2",pA);const hA=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],gA=et("loader-circle",hA);const yA=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],bA=et("maximize-2",yA);const vA=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],SA=et("menu",vA);const xA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],wA=et("minimize-2",xA);const jA=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],NA=et("play",jA);const kA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Py=et("plus",kA);const AA=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],_A=et("radar",AA);const zA=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Hy=et("radio",zA);const CA=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],TA=et("rocket",CA);const EA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Cv=et("rotate-ccw",EA);const OA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],DA=et("search",OA);const RA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],BA=et("settings",RA);const MA=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Tv=et("triangle-alert",MA);const LA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],qA=et("wrench",LA);const UA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hs=et("x",UA);function H(e,n,i){function r(h,g){if(h._zod||Object.defineProperty(h,"_zod",{value:{def:g,constr:d,traits:new Set},enumerable:!1}),h._zod.traits.has(e))return;h._zod.traits.add(e),n(h,g);const b=d.prototype,v=Object.keys(b);for(let x=0;x<v.length;x++){const j=v[x];j in h||(h[j]=b[j].bind(h))}}const l=i?.Parent??Object;class c extends l{}Object.defineProperty(c,"name",{value:e});function d(h){var g;const b=i?.Parent?new c:this;r(b,h),(g=b._zod).deferred??(g.deferred=[]);for(const v of b._zod.deferred)v();return b}return Object.defineProperty(d,"init",{value:r}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Rs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ev extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Ov={};function Qa(e){return Ov}function Dv(e){const n=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,l])=>n.indexOf(+r)===-1).map(([r,l])=>l)}function vf(e,n){return typeof n=="bigint"?n.toString():n}function hc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Hf(e){return e==null}function Kf(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function $A(e,n){const i=(e.toString().split(".")[1]||"").length,r=n.toString();let l=(r.split(".")[1]||"").length;if(l===0&&/\d?e-\d?/.test(r)){const g=r.match(/\d?e-(\d?)/);g?.[1]&&(l=Number.parseInt(g[1]))}const c=i>l?i:l,d=Number.parseInt(e.toFixed(c).replace(".","")),h=Number.parseInt(n.toFixed(c).replace(".",""));return d%h/10**c}const Ky=Symbol("evaluating");function Pe(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Ky)return r===void 0&&(r=Ky,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function zi(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ja(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Zy(e){return JSON.stringify(e)}function VA(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Rv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function oo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const IA=hc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function qs(e){if(oo(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(oo(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bv(e){return qs(e)?{...e}:Array.isArray(e)?[...e]:e}const GA=new Set(["string","number","symbol"]);function Us(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fa(e,n,i){const r=new e._zod.constr(n??e._zod.def);return(!n||i?.parent)&&(r._zod.parent=e),r}function be(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function PA(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const HA={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function KA(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Ja(e._zod.def,{get shape(){const d={};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&(d[h]=i.shape[h])}return zi(this,"shape",d),d},checks:[]});return Fa(e,c)}function ZA(e,n){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Ja(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const h in n){if(!(h in i.shape))throw new Error(`Unrecognized key: "${h}"`);n[h]&&delete d[h]}return zi(this,"shape",d),d},checks:[]});return Fa(e,c)}function QA(e,n){if(!qs(n))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const c=e._zod.def.shape;for(const d in n)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Ja(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return zi(this,"shape",c),c}});return Fa(e,l)}function YA(e,n){if(!qs(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return zi(this,"shape",r),r}});return Fa(e,i)}function XA(e,n){const i=Ja(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return zi(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return Fa(e,i)}function JA(e,n,i){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Ja(n._zod.def,{get shape(){const h=n._zod.def.shape,g={...h};if(i)for(const b in i){if(!(b in h))throw new Error(`Unrecognized key: "${b}"`);i[b]&&(g[b]=e?new e({type:"optional",innerType:h[b]}):h[b])}else for(const b in h)g[b]=e?new e({type:"optional",innerType:h[b]}):h[b];return zi(this,"shape",g),g},checks:[]});return Fa(n,d)}function FA(e,n,i){const r=Ja(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(i)for(const d in i){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);i[d]&&(c[d]=new e({type:"nonoptional",innerType:l[d]}))}else for(const d in l)c[d]=new e({type:"nonoptional",innerType:l[d]});return zi(this,"shape",c),c}});return Fa(n,r)}function Cs(e,n=0){if(e.aborted===!0)return!0;for(let i=n;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function Ts(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function ql(e){return typeof e=="string"?e:e?.message}function Ya(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=ql(e.inst?._zod.def?.error?.(e))??ql(n?.error?.(e))??ql(i.customError?.(e))??ql(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Zf(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function lo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const Mv=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,vf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Lv=H("$ZodError",Mv),qv=H("$ZodError",Mv,{Parent:Error});function WA(e,n=i=>i.message){const i={},r=[];for(const l of e.issues)l.path.length>0?(i[l.path[0]]=i[l.path[0]]||[],i[l.path[0]].push(n(l))):r.push(n(l));return{formErrors:r,fieldErrors:i}}function e2(e,n=i=>i.message){const i={_errors:[]},r=l=>{for(const c of l.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>r({issues:d}));else if(c.code==="invalid_key")r({issues:c.issues});else if(c.code==="invalid_element")r({issues:c.issues});else if(c.path.length===0)i._errors.push(n(c));else{let d=i,h=0;for(;h<c.path.length;){const g=c.path[h];h===c.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(n(c))):d[g]=d[g]||{_errors:[]},d=d[g],h++}}};return r(e),i}const Qf=e=>(n,i,r,l)=>{const c=r?Object.assign(r,{async:!1}):{async:!1},d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise)throw new Rs;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Ya(g,c,Qa())));throw Rv(h,l?.callee),h}return d.value},Yf=e=>async(n,i,r,l)=>{const c=r?Object.assign(r,{async:!0}):{async:!0};let d=n._zod.run({value:i,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>Ya(g,c,Qa())));throw Rv(h,l?.callee),h}return d.value},gc=e=>(n,i,r)=>{const l=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Rs;return c.issues.length?{success:!1,error:new(e??Lv)(c.issues.map(d=>Ya(d,l,Qa())))}:{success:!0,data:c.value}},t2=gc(qv),yc=e=>async(n,i,r)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=n._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ya(d,l,Qa())))}:{success:!0,data:c.value}},n2=yc(qv),a2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Qf(e)(n,i,l)},i2=e=>(n,i,r)=>Qf(e)(n,i,r),s2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Yf(e)(n,i,l)},r2=e=>async(n,i,r)=>Yf(e)(n,i,r),o2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gc(e)(n,i,l)},l2=e=>(n,i,r)=>gc(e)(n,i,r),c2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return yc(e)(n,i,l)},u2=e=>async(n,i,r)=>yc(e)(n,i,r),d2=/^[cC][^\s-]{8,}$/,f2=/^[0-9a-z]+$/,p2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,m2=/^[0-9a-vA-V]{20}$/,h2=/^[A-Za-z0-9]{27}$/,g2=/^[a-zA-Z0-9_-]{21}$/,y2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,b2=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Qy=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,v2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,S2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function x2(){return new RegExp(S2,"u")}const w2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,j2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,N2=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,k2=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Uv=/^[A-Za-z0-9_-]*$/,_2=/^\+[1-9]\d{6,14}$/,$v="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",z2=new RegExp(`^${$v}$`);function Vv(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function C2(e){return new RegExp(`^${Vv(e)}$`)}function T2(e){const n=Vv({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${n}(?:${i.join("|")})`;return new RegExp(`^${$v}T(?:${r})$`)}const E2=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},O2=/^-?\d+$/,Iv=/^-?\d+(?:\.\d+)?$/,D2=/^(?:true|false)$/i,R2=/^[^A-Z]*$/,B2=/^[^a-z]*$/,nn=H("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Gv={number:"number",bigint:"bigint",object:"date"},Pv=H("$ZodCheckLessThan",(e,n)=>{nn.init(e,n);const i=Gv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<c&&(n.inclusive?l.maximum=n.value:l.exclusiveMaximum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value<=n.value:r.value<n.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Hv=H("$ZodCheckGreaterThan",(e,n)=>{nn.init(e,n);const i=Gv[typeof n.value];e._zod.onattach.push(r=>{const l=r._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=r=>{(n.inclusive?r.value>=n.value:r.value>n.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:r.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),M2=H("$ZodCheckMultipleOf",(e,n)=>{nn.init(e,n),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=n.value)}),e._zod.check=i=>{if(typeof i.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%n.value===BigInt(0):$A(i.value,n.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:n.value,input:i.value,inst:e,continue:!n.abort})}}),L2=H("$ZodCheckNumberFormat",(e,n)=>{nn.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=HA[n.format];e._zod.onattach.push(d=>{const h=d._zod.bag;h.format=n.format,h.minimum=l,h.maximum=c,i&&(h.pattern=O2)}),e._zod.check=d=>{const h=d.value;if(i){if(!Number.isInteger(h)){d.issues.push({expected:r,format:n.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?d.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort}):d.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!n.abort});return}}h<l&&d.issues.push({origin:"number",input:h,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!n.abort}),h>c&&d.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),q2=H("$ZodCheckMaxLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<l&&(r._zod.bag.maximum=n.maximum)}),e._zod.check=r=>{const l=r.value;if(l.length<=n.maximum)return;const d=Zf(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),U2=H("$ZodCheckMinLength",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(r._zod.bag.minimum=n.minimum)}),e._zod.check=r=>{const l=r.value;if(l.length>=n.minimum)return;const d=Zf(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),$2=H("$ZodCheckLengthEquals",(e,n)=>{var i;nn.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Hf(l)&&l.length!==void 0}),e._zod.onattach.push(r=>{const l=r._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=r=>{const l=r.value,c=l.length;if(c===n.length)return;const d=Zf(l),h=c>n.length;r.issues.push({origin:d,...h?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!n.abort})}}),bc=H("$ZodCheckStringFormat",(e,n)=>{var i,r;nn.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(i=e._zod).check??(i.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(r=e._zod).check??(r.check=()=>{})}),V2=H("$ZodCheckRegex",(e,n)=>{bc.init(e,n),e._zod.check=i=>{n.pattern.lastIndex=0,!n.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),I2=H("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=R2),bc.init(e,n)}),G2=H("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=B2),bc.init(e,n)}),P2=H("$ZodCheckIncludes",(e,n)=>{nn.init(e,n);const i=Us(n.includes),r=new RegExp(typeof n.position=="number"?`^.{${n.position}}${i}`:i);n.pattern=r,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(r)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),H2=H("$ZodCheckStartsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`^${Us(n.prefix)}.*`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(n.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:r.value,inst:e,continue:!n.abort})}}),K2=H("$ZodCheckEndsWith",(e,n)=>{nn.init(e,n);const i=new RegExp(`.*${Us(n.suffix)}$`);n.pattern??(n.pattern=i),e._zod.onattach.push(r=>{const l=r._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(n.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:r.value,inst:e,continue:!n.abort})}}),Z2=H("$ZodCheckOverwrite",(e,n)=>{nn.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class Q2{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const r=n.split(`
|
|
15
15
|
`).filter(d=>d),l=Math.min(...r.map(d=>d.length-d.trimStart().length)),c=r.map(d=>d.slice(l)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const n=Function,i=this?.args,l=[...(this?.content??[""]).map(c=>` ${c}`)];return new n(...i,l.join(`
|
|
16
16
|
`))}}const Y2={major:4,minor:3,patch:6},ct=H("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=Y2;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const l of r)for(const c of l._zod.onattach)c(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(d,h,g)=>{let b=Cs(d),v;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(d))continue}else if(b)continue;const j=d.issues.length,A=x._zod.check(d);if(A instanceof Promise&&g?.async===!1)throw new Rs;if(v||A instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await A,d.issues.length!==j&&(b||(b=Cs(d,j)))});else{if(d.issues.length===j)continue;b||(b=Cs(d,j))}}return v?v.then(()=>d):d},c=(d,h,g)=>{if(Cs(d))return d.aborted=!0,d;const b=l(h,r,g);if(b instanceof Promise){if(g.async===!1)throw new Rs;return b.then(v=>e._zod.parse(v,g))}return e._zod.parse(b,g)};e._zod.run=(d,h)=>{if(h.skipChecks)return e._zod.parse(d,h);if(h.direction==="backward"){const b=e._zod.parse({value:d.value,issues:[]},{...h,skipChecks:!0});return b instanceof Promise?b.then(v=>c(v,d,h)):c(b,d,h)}const g=e._zod.parse(d,h);if(g instanceof Promise){if(h.async===!1)throw new Rs;return g.then(b=>l(b,r,h))}return l(g,r,h)}}Pe(e,"~standard",()=>({validate:l=>{try{const c=t2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return n2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Xf=H("$ZodString",(e,n)=>{ct.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??E2(e._zod.bag),e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),lt=H("$ZodStringFormat",(e,n)=>{bc.init(e,n),Xf.init(e,n)}),X2=H("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=b2),lt.init(e,n)}),J2=H("$ZodUUID",(e,n)=>{if(n.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(r===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=Qy(r))}else n.pattern??(n.pattern=Qy());lt.init(e,n)}),F2=H("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=v2),lt.init(e,n)}),W2=H("$ZodURL",(e,n)=>{lt.init(e,n),e._zod.check=i=>{try{const r=i.value.trim(),l=new URL(r);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:i.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:i.value,inst:e,continue:!n.abort})),n.normalize?i.value=l.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!n.abort})}}}),e_=H("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=x2()),lt.init(e,n)}),t_=H("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=g2),lt.init(e,n)}),n_=H("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=d2),lt.init(e,n)}),a_=H("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=f2),lt.init(e,n)}),i_=H("$ZodULID",(e,n)=>{n.pattern??(n.pattern=p2),lt.init(e,n)}),s_=H("$ZodXID",(e,n)=>{n.pattern??(n.pattern=m2),lt.init(e,n)}),r_=H("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=h2),lt.init(e,n)}),o_=H("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=T2(n)),lt.init(e,n)}),l_=H("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=z2),lt.init(e,n)}),c_=H("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=C2(n)),lt.init(e,n)}),u_=H("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=y2),lt.init(e,n)}),d_=H("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=w2),lt.init(e,n),e._zod.bag.format="ipv4"}),f_=H("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=j2),lt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!n.abort})}}}),p_=H("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=N2),lt.init(e,n)}),m_=H("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=k2),lt.init(e,n),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[l,c]=r;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${l}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!n.abort})}}});function Kv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const h_=H("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=A2),lt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{Kv(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function g_(e){if(!Uv.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return Kv(i)}const y_=H("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Uv),lt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{g_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),b_=H("$ZodE164",(e,n)=>{n.pattern??(n.pattern=_2),lt.init(e,n)});function v_(e,n=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const l=JSON.parse(atob(r));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const S_=H("$ZodJWT",(e,n)=>{lt.init(e,n),e._zod.check=i=>{v_(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),Zv=H("$ZodNumber",(e,n)=>{ct.init(e,n),e._zod.pattern=e._zod.bag.pattern??Iv,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=Number(i.value)}catch{}const l=i.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return i;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),i}}),x_=H("$ZodNumberFormat",(e,n)=>{L2.init(e,n),Zv.init(e,n)}),w_=H("$ZodBoolean",(e,n)=>{ct.init(e,n),e._zod.pattern=D2,e._zod.parse=(i,r)=>{if(n.coerce)try{i.value=!!i.value}catch{}const l=i.value;return typeof l=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),i}}),j_=H("$ZodUnknown",(e,n)=>{ct.init(e,n),e._zod.parse=i=>i}),N_=H("$ZodNever",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Yy(e,n,i){e.issues.length&&n.issues.push(...Ts(i,e.issues)),n.value[i]=e.value}const k_=H("$ZodArray",(e,n)=>{ct.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Array.isArray(l))return i.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),i;i.value=Array(l.length);const c=[];for(let d=0;d<l.length;d++){const h=l[d],g=n.element._zod.run({value:h,issues:[]},r);g instanceof Promise?c.push(g.then(b=>Yy(b,i,d))):Yy(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function nc(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Ts(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function Qv(e){const n=Object.keys(e.shape);for(const r of n)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const i=PA(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function Yv(e,n,i,r,l,c){const d=[],h=l.keySet,g=l.catchall._zod,b=g.def.type,v=g.optout==="optional";for(const x in n){if(h.has(x))continue;if(b==="never"){d.push(x);continue}const j=g.run({value:n[x],issues:[]},r);j instanceof Promise?e.push(j.then(A=>nc(A,i,x,n,v))):nc(j,i,x,n,v)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const A_=H("$ZodObject",(e,n)=>{if(ct.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const h=n.shape;Object.defineProperty(n,"shape",{get:()=>{const g={...h};return Object.defineProperty(n,"shape",{value:g}),g}})}const r=hc(()=>Qv(n));Pe(e._zod,"propValues",()=>{const h=n.shape,g={};for(const b in h){const v=h[b]._zod;if(v.values){g[b]??(g[b]=new Set);for(const x of v.values)g[b].add(x)}}return g});const l=oo,c=n.catchall;let d;e._zod.parse=(h,g)=>{d??(d=r.value);const b=h.value;if(!l(b))return h.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),h;h.value={};const v=[],x=d.shape;for(const j of d.keys){const A=x[j],T=A._zod.optout==="optional",k=A._zod.run({value:b[j],issues:[]},g);k instanceof Promise?v.push(k.then(E=>nc(E,h,j,b,T))):nc(k,h,j,b,T)}return c?Yv(v,b,h,g,r.value,e):v.length?Promise.all(v).then(()=>h):h}}),__=H("$ZodObjectJIT",(e,n)=>{A_.init(e,n);const i=e._zod.parse,r=hc(()=>Qv(n)),l=j=>{const A=new Q2(["shape","payload","ctx"]),T=r.value,k=P=>{const Z=Zy(P);return`shape[${Z}]._zod.run({ value: input[${Z}], issues: [] }, ctx)`};A.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const P of T.keys)E[P]=`key_${R++}`;A.write("const newResult = {};");for(const P of T.keys){const Z=E[P],X=Zy(P),O=j[P]?._zod?.optout==="optional";A.write(`const ${Z} = ${k(P)};`),O?A.write(`
|
|
17
17
|
if (${Z}.issues.length) {
|
|
@@ -55,7 +55,7 @@ ${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
|
|
|
55
55
|
|
|
56
56
|
`):"Run failed."}function s4(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function ZM(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function QM(e){return e===null?"Unknown":e?"Pass":"Fail"}function wb(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function YM(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function XM(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 JM(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 ${wb(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"},h=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${wb(h)} · ${r}`}return`${e} · ${r}`}function r4(e,n){return n&&n!==e?`${e} · ${n}`:e}function FM(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return r4(e,n)}const Ee=(e,n,i,r)=>{const l={_id:e,baseUrl:n?.baseUrl||(n?.client??Q).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]},o4=e=>Ee("getApiV1ProjectsByName",e),l4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:o4(e)}),Ys=e=>Ee("getApiV1Projects",e),pp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ww({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Ys(e)}),mp=e=>Ee("getApiV1Runs",e),hp=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mp(e)}),c4=e=>Ee("getApiV1RunsById",e),U0=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:c4(e)}),u4=e=>Ee("getApiV1Settings",e),d4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Sv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:u4(e)}),f4=e=>Ee("getApiV1ProjectsByNameGoogleConnections",e),WM=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ej({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:f4(e)}),p4=e=>Ee("getApiV1ProjectsByNameGoogleProperties",e),eL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Rj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:p4(e)}),m4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformance",e),tL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:m4(e)}),h4=e=>Ee("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),nL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:h4(e)}),g4=e=>Ee("getApiV1ProjectsByNameGoogleGscInspections",e),aL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:g4(e)}),y4=e=>Ee("getApiV1ProjectsByNameGoogleGscDeindexed",e),iL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ij({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:y4(e)}),b4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverage",e),sL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:b4(e)}),v4=e=>Ee("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),rL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Gj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:v4(e)}),oL=e=>Ee("getApiV1ProjectsByNameGoogleGscSitemaps",e),S4=e=>Ee("getApiV1ProjectsByNameGbpLocations",e),lL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Qj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:S4(e)}),cL=e=>({mutationFn:async i=>{const{data:r}=await Yj({...e,...i,throwOnError:!0});return r}}),uL=e=>({mutationFn:async i=>{const{data:r}=await Xj({...e,...i,throwOnError:!0});return r}}),x4=e=>Ee("getApiV1ProjectsByNameGbpKeywords",e),dL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Jj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:x4(e)}),w4=e=>Ee("getApiV1ProjectsByNameGbpPlaces",e),fL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Fj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:w4(e)}),j4=e=>Ee("getApiV1ProjectsByNameGbpSummary",e),pL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Wj({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:j4(e)}),N4=e=>Ee("getApiV1ProjectsByNameBingStatus",e),mL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await nN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:N4(e)}),k4=e=>Ee("getApiV1ProjectsByNameBingSites",e),hL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await aN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:k4(e)}),A4=e=>Ee("getApiV1ProjectsByNameBingCoverage",e),gL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wv({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:A4(e)}),_4=e=>Ee("getApiV1ProjectsByNameBingInspections",e),yL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:_4(e)}),z4=e=>Ee("getApiV1ProjectsByNameBingPerformance",e),bL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await cN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:z4(e)}),C4=e=>Ee("getApiV1ProjectsByNameGaStatus",e),vL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:C4(e)}),T4=e=>Ee("getApiV1ProjectsByNameGaTraffic",e),SL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:T4(e)}),E4=e=>Ee("getApiV1ProjectsByNameGaAiReferralHistory",e),xL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:E4(e)}),O4=e=>Ee("getApiV1ProjectsByNameGaSocialReferralHistory",e),wL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await gN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:O4(e)}),D4=e=>Ee("getApiV1ProjectsByNameGaSessionHistory",e),jL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:D4(e)}),R4=e=>Ee("getApiV1ProjectsByNameReport",e),NL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:R4(e)}),B4=e=>Ee("getApiV1ProjectsByNameCitationsVisibility",e),kL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await SN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:B4(e)}),M4=e=>Ee("getApiV1ProjectsByNameTrafficSources",e),AL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await $N({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:M4(e)}),L4=e=>Ee("getApiV1ProjectsByNameTrafficStatus",e),_L=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await VN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:L4(e)}),q4=e=>Ee("getApiV1ProjectsByNameTrafficSourcesById",e),zL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await IN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:q4(e)}),U4=e=>Ee("getApiV1ProjectsByNameTrafficEvents",e),CL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await GN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:U4(e)}),$4=e=>Ee("getApiV1ProjectsByNameDiscoverSessions",e),TL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await HN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$4(e)}),V4=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsById",e),EL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await KN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:V4(e)}),I4=e=>Ee("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),OL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ZN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:I4(e)}),G4=e=>Ee("getApiV1ProjectsByNameTechnicalAeo",e),DL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await YN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:G4(e)}),P4=e=>Ee("getApiV1ProjectsByNameTechnicalAeoPages",e),RL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await XN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:P4(e)}),H4=e=>Ee("getApiV1ProjectsByNameTechnicalAeoTrend",e),BL=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await JN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:H4(e)}),K4=e=>Ee("getApiV1ProjectsByNameAgentProviders",e),Z4=e=>Oe({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await WN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K4(e)});function jb(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function $0(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 ML(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 LL(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function qL(e){return e>=70?"positive":e>=40?"caution":"negative"}const UL={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-400"};function Q4(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function $s(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
|
|
57
57
|
`):void 0}function Y4(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:jb(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:jb(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,h=i.providerStatuses.filter(g=>g.state==="ready").map(g=>Q4(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function X4(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 J4(e,n,i){const r=X4(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(h=>h.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 V0="canonry.run-tracker",kf=new Set;let Nb=!1,F4=0,Sc={runs:{},batches:{}};function W4(){const e=ki();for(const n of kf)n(e)}function e3(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function t3(){typeof window>"u"||window.sessionStorage.setItem(V0,JSON.stringify(Sc))}function I0(){Nb||(Nb=!0,!(typeof window>"u")&&(Sc=e3(window.sessionStorage.getItem(V0))))}function xc(e){Sc=e,t3(),W4()}function ki(){return I0(),Sc}function n3(e){return I0(),kf.add(e),()=>{kf.delete(e)}}function G0(e){const n=ki();xc({...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",trackedAt:e.trackedAt??Date.now()}}})}function af(e){const n=ki();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;xc({...n,runs:r})}function a3(e){const n=ki(),i=`batch_${Date.now()}_${++F4}`;return xc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function i3(e){const n=ki();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;xc({...n,batches:r})}function s3(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const r3=10*6e4;function o3(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function l3(e,n){let i=0,r=0,l=0,c=0,d=0;for(const h of e){const g=n[h]?.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 kb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ab=dv,P0=(e,n)=>i=>{var r;if(n?.variants==null)return Ab(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const v=i?.[b],x=c?.[b];if(v===null)return null;const j=kb(v)||kb(x);return l[b][j]}),h=i&&Object.entries(i).reduce((b,v)=>{let[x,j]=v;return j===void 0||(b[x]=j),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,v)=>{let{class:x,className:j,...A}=v;return Object.entries(A).every(T=>{let[k,E]=T;return Array.isArray(E)?E.includes({...c,...h}[k]):{...c,...h}[k]===E})?[...b,x,j]:b},[]);return Ab(e,d,g,i?.class,i?.className)},c3=(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},u3=(e,n)=>({classGroupId:e,validator:n}),H0=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),uc="-",_b=[],d3="arbitrary..",f3=e=>{const n=m3(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return p3(d);const h=d.split(uc),g=h[0]===""&&h.length>1?1:0;return K0(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],b=i[d];return g?b?c3(b,g):g:b||_b}return i[d]||_b}}},K0=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=K0(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const h=n===0?e.join(uc):e.slice(n).join(uc),g=d.length;for(let b=0;b<g;b++){const v=d[b];if(v.validator(h))return v.classGroupId}},p3=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?d3+r:void 0})(),m3=e=>{const{theme:n,classGroups:i}=e;return h3(i,n)},h3=(e,n)=>{const i=H0();for(const r in e){const l=e[r];gp(l,i,r,n)}return i},gp=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];g3(d,n,i,r)}},g3=(e,n,i,r)=>{if(typeof e=="string"){y3(e,n,i);return}if(typeof e=="function"){b3(e,n,i,r);return}v3(e,n,i,r)},y3=(e,n,i)=>{const r=e===""?n:Z0(n,e);r.classGroupId=i},b3=(e,n,i,r)=>{if(S3(e)){gp(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push(u3(i,e))},v3=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];gp(g,Z0(n,h),i,r)}},Z0=(e,n)=>{let i=e;const r=n.split(uc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=H0(),i.nextPart.set(d,h)),i=h}return i},S3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,x3=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)}}},Af="!",zb=":",w3=[],Cb=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),j3=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,b;const v=l.length;for(let k=0;k<v;k++){const E=l[k];if(d===0&&h===0){if(E===zb){c.push(l.slice(g,k)),g=k+1;continue}if(E==="/"){b=k;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const x=c.length===0?l:l.slice(g);let j=x,A=!1;x.endsWith(Af)?(j=x.slice(0,-1),A=!0):x.startsWith(Af)&&(j=x.slice(1),A=!0);const T=b&&b>g?b-g:void 0;return Cb(c,A,j,T)};if(n){const l=n+zb,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Cb(w3,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},N3=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],h=d[0]==="[",g=n.has(d);h||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}},k3=e=>({cache:x3(e.cacheSize),parseClassName:j3(e),sortModifiers:N3(e),...f3(e)}),A3=/\s+/,_3=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(A3);let g="";for(let b=h.length-1;b>=0;b-=1){const v=h[b],{isExternal:x,modifiers:j,hasImportantModifier:A,baseClassName:T,maybePostfixModifierPosition:k}=i(v);if(x){g=v+(g.length>0?" "+g:g);continue}let E=!!k,R=r(E?T.substring(0,k):T);if(!R){if(!E){g=v+(g.length>0?" "+g:g);continue}if(R=r(T),!R){g=v+(g.length>0?" "+g:g);continue}E=!1}const I=j.length===0?"":j.length===1?j[0]:c(j).join(":"),P=A?I+Af:I,Z=P+R;if(d.indexOf(Z)>-1)continue;d.push(Z);const X=l(R,E);for(let J=0;J<X.length;++J){const O=X[J];d.push(P+O)}g=v+(g.length>0?" "+g:g)}return g},z3=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=Q0(i))&&(l&&(l+=" "),l+=r);return l},Q0=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=Q0(e[r]))&&(i&&(i+=" "),i+=n);return i},C3=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((v,x)=>x(v),e());return i=k3(b),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const b=r(g);if(b)return b;const v=_3(g,i);return l(g,v),v};return c=d,(...g)=>c(z3(...g))},T3=[],_t=e=>{const n=i=>i[e]||T3;return n.isThemeGetter=!0,n},Y0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,X0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,E3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,O3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,D3=/\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$/,R3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,M3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=e=>E3.test(e),De=e=>!!e&&!Number.isNaN(Number(e)),Ha=e=>!!e&&Number.isInteger(Number(e)),sf=e=>e.endsWith("%")&&De(e.slice(0,-1)),pa=e=>O3.test(e),J0=()=>!0,L3=e=>D3.test(e)&&!R3.test(e),yp=()=>!1,q3=e=>B3.test(e),U3=e=>M3.test(e),$3=e=>!he(e)&&!ge(e),V3=e=>Wa(e,e1,yp),he=e=>Y0.test(e),Si=e=>Wa(e,t1,L3),Tb=e=>Wa(e,Y3,De),I3=e=>Wa(e,a1,J0),G3=e=>Wa(e,n1,yp),Eb=e=>Wa(e,F0,yp),P3=e=>Wa(e,W0,U3),Vl=e=>Wa(e,i1,q3),ge=e=>X0.test(e),Fr=e=>Ci(e,t1),H3=e=>Ci(e,n1),Ob=e=>Ci(e,F0),K3=e=>Ci(e,e1),Z3=e=>Ci(e,W0),Il=e=>Ci(e,i1,!0),Q3=e=>Ci(e,a1,!0),Wa=(e,n,i)=>{const r=Y0.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Ci=(e,n,i=!1)=>{const r=X0.exec(e);return r?r[1]?n(r[1]):i:!1},F0=e=>e==="position"||e==="percentage",W0=e=>e==="image"||e==="url",e1=e=>e==="length"||e==="size"||e==="bg-size",t1=e=>e==="length",Y3=e=>e==="number",n1=e=>e==="family-name",a1=e=>e==="number"||e==="weight",i1=e=>e==="shadow",X3=()=>{const e=_t("color"),n=_t("font"),i=_t("text"),r=_t("font-weight"),l=_t("tracking"),c=_t("leading"),d=_t("breakpoint"),h=_t("container"),g=_t("spacing"),b=_t("radius"),v=_t("shadow"),x=_t("inset-shadow"),j=_t("text-shadow"),A=_t("drop-shadow"),T=_t("blur"),k=_t("perspective"),E=_t("aspect"),R=_t("ease"),I=_t("animate"),P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...Z(),ge,he],J=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],B=()=>[ge,he,g],oe=()=>[Pa,"full","auto",...B()],ke=()=>[Ha,"none","subgrid",ge,he],_e=()=>["auto",{span:["full",Ha,ge,he]},Ha,ge,he],ve=()=>[Ha,"auto",ge,he],tt=()=>["auto","min","max","fr",ge,he],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],me=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...B()],W=()=>[Pa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],fe=()=>[Pa,"screen","full","dvw","lvw","svw","min","max","fit",...B()],je=()=>[Pa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],se=()=>[e,ge,he],Qe=()=>[...Z(),Ob,Eb,{position:[ge,he]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",K3,V3,{size:[ge,he]}],ee=()=>[sf,Fr,Si],ue=()=>["","none","full",b,ge,he],ne=()=>["",De,Fr,Si],Ne=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[De,sf,Ob,Eb],$e=()=>["","none",T,ge,he],He=()=>["none",De,ge,he],Et=()=>["none",De,ge,he],Cn=()=>[De,ge,he],Ot=()=>[Pa,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pa],breakpoint:[pa],color:[J0],container:[pa],"drop-shadow":[pa],ease:["in","out","in-out"],font:[$3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pa],shadow:[pa],spacing:["px",De],text:[pa],"text-shadow":[pa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Pa,he,ge,E]}],container:["container"],columns:[{columns:[De,he,ge,h]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"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:X()}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],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:[Ha,"auto",ge,he]}],basis:[{basis:[Pa,"full","auto",h,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[De,Pa,"auto","initial","none",he]}],grow:[{grow:["",De,ge,he]}],shrink:[{shrink:["",De,ge,he]}],order:[{order:[Ha,"first","last","none",ge,he]}],"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":tt()}],"auto-rows":[{"auto-rows":tt()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...me(),"normal"]}],"justify-self":[{"justify-self":["auto",...me()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...me(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...me(),"baseline"]}],"place-self":[{"place-self":["auto",...me()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],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":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[h,"screen",...W()]}],"min-w":[{"min-w":[h,"screen","none",...W()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[d]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",i,Fr,Si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Q3,I3]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",sf,he]}],"font-family":[{font:[H3,G3,n]}],"font-features":[{"font-features":[he]}],"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,ge,he]}],"line-clamp":[{"line-clamp":[De,"none",ge,Tb]}],leading:[{leading:[c,...B()]}],"list-image":[{"list-image":["none",ge,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:se()}],"text-color":[{text:se()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[De,"from-font","auto",ge,Si]}],"text-decoration-color":[{decoration:se()}],"underline-offset":[{"underline-offset":[De,"auto",ge,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,he]}],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",ge,he]}],"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:F()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ha,ge,he],radial:["",ge,he],conic:[Ha,ge,he]},Z3,P3]}],"bg-color":[{bg:se()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:se()}],"gradient-via":[{via:se()}],"gradient-to":[{to:se()}],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:se()}],"border-color-x":[{"border-x":se()}],"border-color-y":[{"border-y":se()}],"border-color-s":[{"border-s":se()}],"border-color-e":[{"border-e":se()}],"border-color-bs":[{"border-bs":se()}],"border-color-be":[{"border-be":se()}],"border-color-t":[{"border-t":se()}],"border-color-r":[{"border-r":se()}],"border-color-b":[{"border-b":se()}],"border-color-l":[{"border-l":se()}],"divide-color":[{divide:se()}],"outline-style":[{outline:[...Ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[De,ge,he]}],"outline-w":[{outline:["",De,Fr,Si]}],"outline-color":[{outline:se()}],shadow:[{shadow:["","none",v,Il,Vl]}],"shadow-color":[{shadow:se()}],"inset-shadow":[{"inset-shadow":["none",x,Il,Vl]}],"inset-shadow-color":[{"inset-shadow":se()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:se()}],"ring-offset-w":[{"ring-offset":[De,Si]}],"ring-offset-color":[{"ring-offset":se()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":se()}],"text-shadow":[{"text-shadow":["none",j,Il,Vl]}],"text-shadow-color":[{"text-shadow":se()}],opacity:[{opacity:[De,ge,he]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"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":[De]}],"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":se()}],"mask-image-linear-to-color":[{"mask-linear-to":se()}],"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":se()}],"mask-image-t-to-color":[{"mask-t-to":se()}],"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":se()}],"mask-image-r-to-color":[{"mask-r-to":se()}],"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":se()}],"mask-image-b-to-color":[{"mask-b-to":se()}],"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":se()}],"mask-image-l-to-color":[{"mask-l-to":se()}],"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":se()}],"mask-image-x-to-color":[{"mask-x-to":se()}],"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":se()}],"mask-image-y-to-color":[{"mask-y-to":se()}],"mask-image-radial":[{"mask-radial":[ge,he]}],"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":se()}],"mask-image-radial-to-color":[{"mask-radial-to":se()}],"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":Z()}],"mask-image-conic-pos":[{"mask-conic":[De]}],"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":se()}],"mask-image-conic-to-color":[{"mask-conic-to":se()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Qe()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:$e()}],brightness:[{brightness:[De,ge,he]}],contrast:[{contrast:[De,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",A,Il,Vl]}],"drop-shadow-color":[{"drop-shadow":se()}],grayscale:[{grayscale:["",De,ge,he]}],"hue-rotate":[{"hue-rotate":[De,ge,he]}],invert:[{invert:["",De,ge,he]}],saturate:[{saturate:[De,ge,he]}],sepia:[{sepia:["",De,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":$e()}],"backdrop-brightness":[{"backdrop-brightness":[De,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[De,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",De,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[De,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",De,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[De,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[De,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",De,ge,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[De,"initial",ge,he]}],ease:[{ease:["linear","initial",R,ge,he]}],delay:[{delay:[De,ge,he]}],animate:[{animate:["none",I,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,ge,he]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:He()}],"rotate-x":[{"rotate-x":He()}],"rotate-y":[{"rotate-y":He()}],"rotate-z":[{"rotate-z":He()}],scale:[{scale:Et()}],"scale-x":[{"scale-x":Et()}],"scale-y":[{"scale-y":Et()}],"scale-z":[{"scale-z":Et()}],"scale-3d":["scale-3d"],skew:[{skew:Cn()}],"skew-x":[{"skew-x":Cn()}],"skew-y":[{"skew-y":Cn()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ot()}],"translate-x":[{"translate-x":Ot()}],"translate-y":[{"translate-y":Ot()}],"translate-z":[{"translate-z":Ot()}],"translate-none":["translate-none"],accent:[{accent:se()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:se()}],"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",ge,he]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",ge,he]}],fill:[{fill:["none",...se()]}],"stroke-w":[{stroke:[De,Fr,Si,Tb]}],stroke:[{stroke:["none",...se()]}],"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"]}},J3=C3(X3);function zn(...e){return J3(dv(e))}const F3=P0("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"}}),Ue=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?_w:"button";return f.jsx(d,{ref:c,className:zn(F3({variant:n,size:i,className:e})),...l})});Ue.displayName="Button";const W3=P0("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 s1({className:e,variant:n,...i}){return f.jsx("div",{className:zn(W3({variant:n}),e),...i})}const eD=220;function Db({compact:e=!1,version:n,updateAvailable:i,onDismissUpdate:r}){const l=!e&&n&&n!=="unknown",[c,d]=q.useState(!1),h=!e&&i&&r,g=()=>{d(!0),window.setTimeout(()=>{r?.(),d(!1)},eD)};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"}),h?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(Qk,{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 tD({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 Ln({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return f.jsx(s1,{variant:r,...i,children:n})}function bp({status:e}){return f.jsx(Ln,{tone:$0(e),children:s4(e)})}const nD=uv,aD=ov,r1=q.forwardRef(({className:e,...n},i)=>f.jsx(Lf,{ref:i,className:zn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...n}));r1.displayName=Lf.displayName;const iD=400,sD=1200,rD=720,o1=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(rD),d=q.useRef(!1),h=q.useRef(0),g=q.useRef(0),b=q.useCallback(j=>{d.current=!0,h.current=j.clientX,g.current=l,j.target.setPointerCapture(j.pointerId),j.preventDefault()},[l]),v=q.useCallback(j=>{if(!d.current)return;const A=h.current-j.clientX,T=Math.min(sD,Math.max(iD,g.current+A));c(T)},[]),x=q.useCallback(()=>{d.current=!1},[]);return f.jsxs(aD,{children:[f.jsx(r1,{}),f.jsxs(qf,{ref:r,className:zn("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:x}),n,f.jsxs(lv,{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"})]})]})]})});o1.displayName=qf.displayName;const oD=({className:e,...n})=>f.jsx("div",{className:zn("flex flex-col gap-1.5 pr-10",e),...n}),l1=q.forwardRef(({className:e,...n},i)=>f.jsx(Uf,{ref:i,className:zn("text-lg font-medium text-zinc-50",e),...n}));l1.displayName=Uf.displayName;const c1=q.forwardRef(({className:e,...n},i)=>f.jsx(cv,{ref:i,className:zn("text-sm text-zinc-500",e),...n}));c1.displayName=cv.displayName;function lD({title:e,subtitle:n,children:i,open:r,onClose:l}){return f.jsx(nD,{open:r,onOpenChange:c=>c?void 0:l(),children:f.jsxs(o1,{children:[f.jsxs(oD,{className:"drawer-head",children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),f.jsx(l1,{id:"drawer-title",children:e}),f.jsx(c1,{className:"sr-only",children:n})]}),f.jsx("div",{className:"drawer-body",children:i})]})})}function Wr({text:e}){const[n,i]=q.useState(null),r=q.useRef(null),l=q.useCallback(()=>{if(!r.current)return;const h=r.current.getBoundingClientRect();i({top:h.top,left:h.left+h.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:h=>{h.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&&vw.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 cD=/[\s\-_]+/;function uD(e){const n=e.split(cD).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Rb(e,n){const i=dD(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(uD).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 h=new RegExp(`(${d.join("|")})`,"gi"),g=new Map;for(const b of i)for(const v of b.terms){const x=cc(v);x&&!g.has(x)&&g.set(x,b.className)}return r.flatMap((b,v)=>b.value.split(h).map((j,A)=>{if(!j)return null;if(A%2===1){const k=g.get(cc(j))??"answer-highlight";return b.type==="bold"?ks.createElement("mark",{key:`hl-${v}-${A}`,className:k},ks.createElement("strong",{className:"text-zinc-200 font-semibold"},j)):ks.createElement("mark",{key:`hl-${v}-${A}`,className:k},j)}return b.type==="bold"?ks.createElement("strong",{key:`b-${v}-${A}`,className:"text-zinc-200 font-semibold"},j):j})).filter(Boolean)}function dD(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function _f(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function rf(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 fD({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[h,g]=q.useState(-1),[b,v]=q.useState(null),[x,j]=q.useState(!1),[A,T]=q.useState({}),k=_T(n.project),E=new Set(k.map(sc)),R=e.runHistory,I=R.length>1,[P,Z]=q.useState(null),X=q.useRef(!1);q.useEffect(()=>{if(X.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const ee=R.at(-1);ee&&(X.current=!0,ec(ee.runId).then(ue=>{const ne=ue.snapshots?.find(Ne=>Ne.query===e.query&&Ne.provider===e.provider);ne&&Z({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ee.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,searchQueries:ne.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const J=h>=0&&b!==null,O=J?b:P||{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,searchQueries:e.searchQueries??[],evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},B=O.visibilityState==="pending"||O.citationState==="pending",oe=B?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===rc.cited||O.citationState==="emerging",ke=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,_e=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,tt=[...k.map(sc),ve,ve.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(ee=>ee.trim().length>2),re=[...O.competitorDomains.flatMap(ee=>{const ue=AT(ee);return ue.length>=4?[ue]:[]}),...O.recommendedCompetitors].filter(ee=>ee.trim().length>2),me=[{terms:tt,className:"answer-highlight-brand"},...re.length>0?[{terms:re,className:"answer-highlight-competitor"}]:[]],$=B?"pending":O.visibilityTransition==="lost"?"lost":oe?"mentioned":"not-mentioned",W=q.useRef(0),fe=q.useCallback(async ee=>{const ue=++W.current;if(ee===-1||ee===R.length-1){g(-1),v(null),l(!1);return}g(ee),l(!1);const ne=R[ee],Ne=`${ne.runId}::${e.query}::${e.provider}`;if(A[Ne]){v(A[Ne]);return}j(!0);try{const nt=await ec(ne.runId);if(ue!==W.current)return;const xe=nt.snapshots?.find(He=>He.query===e.query&&He.provider===e.provider)??nt.snapshots?.find(He=>He.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,searchQueries:xe.searchQueries,evidenceUrls:[],changeLabel:rf(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:[],searchQueries:[],evidenceUrls:[],changeLabel:rf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Snapshot data not available for this run."};T(He=>({...He,[Ne]:$e})),v($e)}catch{if(ue!==W.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:[],searchQueries:[],evidenceUrls:[],changeLabel:rf(ne.mentionTransition??ne.visibilityTransition,ne.mentionState??ne.visibilityState),summary:"Failed to load historical run data."})}finally{ue===W.current&&j(!1)}},[R,e.query,e.provider,A]),se=(J||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Qe=!J&&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(" · "):"",F=oe?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:se}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:se}:B?{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:se},ce=()=>{if(!O.answerSnippet)return null;const ee=O.answerSnippet.split(`
|
|
58
|
-
`),ue=[];let ne=[],Ne=0;const nt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&ue.push(f.jsx("p",{className:ue.length>0?"mt-2.5":"",children:Rb(xe,me)},Ne++)),ne=[]};for(const xe of ee){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){nt(),ue.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ne++));continue}const He=$e.match(/^(#{1,3})\s+(\S.*)$/);if(He){nt();const Et=He[1].length,Cn=He[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||He[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===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:Ot,children:Rb(Cn,me)},Ne++));continue}if($e===""){nt();continue}ne.push($e)}return nt(),ue};return f.jsx(uv,{open:!0,onOpenChange:ee=>{ee||i()},children:f.jsxs(ov,{children:[f.jsx(Lf,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(qf,{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," ","·"," ",O.provider||"All providers"]}),f.jsx(Uf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(lv,{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"})]})]}),I&&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((ee,ue)=>{const ne=h===-1&&ue===R.length-1||h===ue,Ne=ee.visibilityState??(ee.answerMentioned?"visible":"not-visible"),nt=ee.visibilityTransition??Ne,xe=Ne==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",He=new Date(ee.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(ee.model&&ue>0&&R[ue-1]?.model&&R[ue-1].model!==ee.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{fe(ue===R.length-1?-1:ue)},"aria-label":[`Run ${He}: ${Ne}`,ee.model?`model ${ee.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"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:He})]},ue)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-1)},children:["←"," Back to latest"]})]}),!J&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(ee=>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:`${ee.fromModel??"unknown"} -> ${ee.toModel??"unknown"} on ${new Date(ee.createdAt).toLocaleDateString()}`},`${ee.runId}:${ee.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&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","…"]}),!x&&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:F.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:F.title}),f.jsx("p",{className:"evidence-position-meta",children:F.meta}),Qe&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Qe})]}),O.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:ce()}),O.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"})]}),!O.answerSnippet&&!x&&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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(Wr,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((ee,ue)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(DA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:ee})]},`${ue}-${ee}`))})]}),!J&&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((ee,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:ee})]},ue))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.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(Wr,{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:B?"…":oe?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:B?"Pending":oe?"Mentioned":"Not mentioned"})]}),O.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:O.matchedTerms.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:ee},ee))})]}),!B&&!oe&&O.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:tt.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:ee},ee))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.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(Wr,{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 ee=O.competitorDomains.map(Ne=>Ne.replace(/^www\./,"")),ue=new Set(ee.map(Ne=>cc(Ne.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(Ne=>!ue.has(cc(Ne))),...ee].map(Ne=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ne},Ne))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.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(Wr,{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:O.citedDomains.map((ee,ue)=>{const ne=ee.toLowerCase().replace(/^www\./,""),Ne=E.has(ne),nt=!Ne&&O.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ne),xe=Ne?"you":nt?"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:ee}),Ne&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ee)})})]}),O.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 (",O.groundingSources.length,")"]}),f.jsx(Wr,{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:O.groundingSources.map((ee,ue)=>{const ne=_f(ee.uri),Ne=ee.title||ee.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)})})]}),O.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:O.evidenceUrls.map(ee=>{const ue=_f(ee);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:ee}):f.jsx("span",{className:"text-zinc-400",children:ee})},ee)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",J?"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 ",J?"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 of=[{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 wc(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 pD=wc({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"}),mD=wc({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"}),hD=wc({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"}),gD=wc({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"}),yD=[{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"])}];of[0],of[1],Mn(["cited","cited","cited","cited","cited"]),of[2],2/7,3/7,Mn(["not-cited","not-cited","not-cited","cited"]);function bD(e,n){return e.runs.find(i=>i.id===n)}function vD(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 SD(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return vD(n,i)}const xD={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},wD={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},jD={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},ND={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function kD(e){return{id:e.id,tone:xD[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??ND[e.type],actionGroup:wD[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:jD[e.type]}]}}function AD(e){return e.filter(n=>!n.dismissed).map(kD)}function u1(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 Bb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function _D(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 d1(e){switch(e){case Te["answer-visibility"]:return"Answer visibility sweep";case Te["gsc-sync"]:return"GSC sync";case Te["inspect-sitemap"]:return"Sitemap inspection";case Te["ga-sync"]:return"GA sync";case Te["traffic-sync"]:return"Traffic sync";case Te["bing-inspect"]:return"Bing URL inspection";case Te["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Te["site-audit"]:return"Site audit";case Te["backlink-extract"]:return"Backlink extract";case Te["aeo-discover-seed"]:return"Discovery (seed phase)";case Te["aeo-discover-probe"]:return"Discovery (probe phase)";case Te["gbp-sync"]:return"Business Profile sync"}}function zD(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function vp(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:d1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Bb(e.startedAt):Bb(e.createdAt),duration:_D(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?f1(e.error):CD(e),summary:TD(e),triggerLabel:zD(e.trigger)}}function f1(e){const n=Wf(e);return n.length>200?n.slice(0,200)+"…":n}function CD(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?f1(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function TD(e){const n=d1(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 ED(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const b=new Set(h.map(T=>T.location??null));b.size===0&&b.add(null);const v=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),j=[...new Set([...v,...x])].sort(),A=j.length>0?j:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of A){const I=[...b].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),P=(T.providerRuns?.[R]?.length??0)>0,Z=I.length>0?I:P?[null]:[];for(const X of Z){const J=X??"",O=g.get(`${T.query}::${R}::${J}`),B=O?.model??null,oe=B?`${R}:${B}`:null,ke=T.providerRuns?.[R],_e=oe?T.modelRuns?.[oe]:void 0,ve=$e=>$e?.filter(He=>(He.location??null)===X),tt=I.length>0?ve(ke):ke,re=I.length>0?ve(_e):_e,me=(tt?.length?tt:null)??(re?.length?re:null),$=tt?.length?"provider":re?.length?"model":"query",W=me?me.at(-1).transition:E,fe=me?me.at(-1).visibilityTransition??(me.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),je=me?.at(-1)?.citationState,se=me?.at(-1)?.visibilityState,Qe=O?W==="lost"?"lost":W==="emerging"?"emerging":O.citationState===rc.cited?"cited":"not-cited":je===rc.cited?"cited":"not-cited",F=O?.visibilityState??(se==="visible"?"visible":se==="pending"?"pending":"not-visible"),ce=Mb(me||T.runs),ee=Lb(me||T.runs),ue=OD(T,R),ne=(me??T.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=DD(ne),nt=$==="provider"&&Ne.length<=1?"model":$,xe=RD(ne);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Qe,answerMentioned:O?.answerMentioned,visibilityState:F,visibilityChangeLabel:qb(fe,ee,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:qb(W,ce),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:BD(F,fe,T.query),runHistory:ne,historyScope:nt,modelsSeen:Ne,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.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:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function OD(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),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function DD(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function RD(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 Mb(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 Lb(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 qb(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?`${eo(r.positive)} in latest run`:`${eo(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return eo(r.first);case"not-cited":case"not-visible":return n<=1?`${eo(r.negative)} in latest run`:`${eo(r.negative)} across ${n} runs`;default:return e}}function eo(e){return e.charAt(0).toUpperCase()+e.slice(1)}function BD(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 p1(e){const n=u1(e.project),i=ED(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>vp(c,e.project.displayName||e.project.name));return e.overview?MD(n,e.overview,i,l):LD(n,i,l)}function MD(e,n,i,r){const l=AD(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 LD(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 qD(e){const n=u1(e.project),i=[...e.runs].sort((j,A)=>A.createdAt.localeCompare(j.createdAt)),r=i.find(j=>j.kind===Te["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?vp(r,l):UD(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,b=d.queryCounts.mentionedQueries,v=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:v>0?`${b} of ${v} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:v>0?`${b} of ${v} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function UD(e,n){return{id:"none",projectId:e,projectName:n,kind:Te["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function $D(e,n){const i=[],r=[],l=[];for(const d of e){r.push(p1(d)),l.push(qD(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(vp(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?VD(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 VD(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."}),n}const m1=q.createContext(null);m1.Provider;function mo(){return q.useContext(m1)}function jc(e){const i=mo()?.dashboard??null,r=dn({...pp({client:ae}),enabled:!i,refetchInterval:Lk}),l=dn({...hp({client:ae,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:ro,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:ro}),c=dn({...d4({client:ae}),enabled:!i}),d=r.data??[],h=l.data??[],g=Sw({queries:d.map(T=>{const k=h.filter(I=>I.projectId===T.id),E=k.filter(I=>(I.status==="completed"||I.status==="partial")&&I.kind==="answer-visibility"&&I.trigger!=="probe").sort((I,P)=>P.createdAt.localeCompare(I.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const I=await kv(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:I}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:bf}})}),b=g.every(T=>T.isSuccess),v=q.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return $D(T,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,h]),x=!i&&(r.isError||l.isError),j=!i&&!v&&!x,A=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:v,isLoading:j,isError:x,refetch:A}}function ID(e){const n=mo(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...l4({client:ae,path:{name:e??""}}),enabled:!!e&&!i,staleTime:bf,refetchOnWindowFocus:"always"}),l=dn({...hp({client:ae,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:ro,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:ro}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b}=q.useMemo(()=>{const T=d.filter(P=>(P.status==="completed"||P.status==="partial")&&P.kind==="answer-visibility"&&P.trigger!=="probe").sort((P,Z)=>Z.createdAt.localeCompare(P.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(P=>P.createdAt===k).map(P=>P.id):[],R=T.find(P=>P.createdAt!==k)?.createdAt??null,I=R?T.filter(P=>P.createdAt===R).map(P=>P.id):[];return{latestRunIds:E,previousRunIds:I,latestRunIdsKey:[...E].sort().join(",")}},[d]),v=dn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,I,P,Z,X,J]=await Promise.all([ok(e).catch(()=>[]),lk(e).catch(()=>[]),ck(e).catch(()=>[]),h.length?Promise.all(h.map(O=>ec(O).catch(()=>null))).then(O=>O.filter(B=>B!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>ec(O).catch(()=>null))).then(O=>O.filter(B=>B!=null)):Promise.resolve([]),wk(e).catch(()=>null),kk(e).catch(()=>null),_k(e).catch(()=>null),kv(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:I,gscCoverage:P,bingCoverage:Z,dbInsights:X,overview:J}},enabled:!!c&&!!e&&l.isSuccess,staleTime:bf,refetchOnWindowFocus:"always",refetchInterval:qk}),x=q.useMemo(()=>v.data?p1({...v.data,runs:d}):i||null,[v.data,d,i]),j=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),v.refetch()])},[r.refetch,l.refetch,v.refetch]),A=!x&&(r.isLoading||l.isLoading||v.isLoading);return{commandCenter:x,project:c,isLoading:A,isError:r.isError||l.isError||v.isError,refetch:j}}const GD=["health"];async function PD(){const e=await Ck("/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 Sp(e,n){return dn({queryKey:GD,queryFn:PD,enabled:e,refetchInterval:15e3,initialData:n})}function HD(e){return dn({...U0({client:ae,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function xp(){const e=pc(),n=xw({strict:!1}),i=ww({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const KD={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function ZD(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function QD(){const e=q.useSyncExternalStore(Bk,Vy,Vy),n=pc(),{openRun:i}=xp(),r=q.useCallback(c=>{yf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),yf(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 ${KD[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":ZD(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 YD(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 h(){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:h,isAtEnd:d}}async function wp(e){try{return await e.json()}catch{return{}}}function XD(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const jp=XD();function Np(e){(e===401||e===403)&&$f()}async function Ub(e){const n=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){Np(n.status);const i=await wp(n);throw new Pn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function JD(e){const n=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){Np(n.status);const i=await wp(n);throw new Pn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function FD({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){Np(g.status);const A=await wp(g);throw new Pn(A.error?.message??`prompt failed: ${g.status}`,g.status,A.error?.code)}const b=g.body.getReader(),v=new TextDecoder;let x="";const j=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",j,{once:!0});try{for(;;){const{value:A,done:T}=await b.read();if(T)break;x+=v.decode(A,{stream:!0});let k=x.indexOf(`
|
|
58
|
+
`),ue=[];let ne=[],Ne=0;const nt=()=>{if(ne.length===0)return;const xe=ne.join(" ").trim();xe&&ue.push(f.jsx("p",{className:ue.length>0?"mt-2.5":"",children:Rb(xe,me)},Ne++)),ne=[]};for(const xe of ee){const $e=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test($e)){nt(),ue.push(f.jsx("hr",{className:"border-zinc-800/60 my-3"},Ne++));continue}const He=$e.match(/^(#{1,3})\s+(\S.*)$/);if(He){nt();const Et=He[1].length,Cn=He[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||He[2],Ot=Et===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Et===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:Ot,children:Rb(Cn,me)},Ne++));continue}if($e===""){nt();continue}ne.push($e)}return nt(),ue};return f.jsx(uv,{open:!0,onOpenChange:ee=>{ee||i()},children:f.jsxs(ov,{children:[f.jsx(Lf,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),f.jsxs(qf,{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," ","·"," ",O.provider||"All providers"]}),f.jsx(Uf,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),f.jsxs(lv,{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"})]})]}),I&&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((ee,ue)=>{const ne=h===-1&&ue===R.length-1||h===ue,Ne=ee.visibilityState??(ee.answerMentioned?"visible":"not-visible"),nt=ee.visibilityTransition??Ne,xe=Ne==="visible"?"bg-emerald-400":nt==="emerging"?"bg-amber-400":nt==="lost"?"bg-rose-400":"bg-zinc-600",He=new Date(ee.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Et=!!(ee.model&&ue>0&&R[ue-1]?.model&&R[ue-1].model!==ee.model);return f.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>{fe(ue===R.length-1?-1:ue)},"aria-label":[`Run ${He}: ${Ne}`,ee.model?`model ${ee.model}`:null,Et?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[f.jsx("span",{className:`size-2 rounded-full ${xe} ${Et?"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:He})]},ue)})}),h>=0&&h<R.length&&f.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",f.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),f.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{fe(-1)},children:["←"," Back to latest"]})]}),!J&&(e.modelTransitions?.length??0)>0&&f.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(ee=>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:`${ee.fromModel??"unknown"} -> ${ee.toModel??"unknown"} on ${new Date(ee.createdAt).toLocaleDateString()}`},`${ee.runId}:${ee.toModel??"unknown"}`))})]}),f.jsxs("div",{className:"evidence-modal-body",children:[x&&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","…"]}),!x&&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:F.label}),f.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:F.title}),f.jsx("p",{className:"evidence-position-meta",children:F.meta}),Qe&&f.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:Qe})]}),O.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:ce()}),O.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"})]}),!O.answerSnippet&&!x&&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"}),O.searchQueries.length>0&&f.jsxs("div",{children:[f.jsxs("div",{className:"drawer-section-label flex items-center",children:[f.jsx("span",{children:"Web searches the model ran"}),f.jsx(Wr,{text:"The search queries this AI model issued while researching your prompt. They reveal how the model reformulated the question — the phrasings worth optimizing your content for. Distinct from grounding sources (what it found) and citations (what it linked)."})]}),f.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((ee,ue)=>f.jsxs("li",{className:"flex items-start gap-2 text-sm text-zinc-300",children:[f.jsx(DA,{className:"size-3.5 mt-0.5 shrink-0 text-zinc-600","aria-hidden":"true"}),f.jsx("span",{className:"break-words",children:ee})]},`${ue}-${ee}`))})]}),!J&&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((ee,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:ee})]},ue))})]}),O.summary&&f.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.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(Wr,{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:B?"…":oe?"✓":"—"}),f.jsx("span",{className:"mention-status-label",children:B?"Pending":oe?"Mentioned":"Not mentioned"})]}),O.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:O.matchedTerms.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--brand",children:ee},ee))})]}),!B&&!oe&&O.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:tt.map(ee=>f.jsx("span",{className:"mention-chip mention-chip--muted",children:ee},ee))}),f.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.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(Wr,{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 ee=O.competitorDomains.map(Ne=>Ne.replace(/^www\./,"")),ue=new Set(ee.map(Ne=>cc(Ne.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(Ne=>!ue.has(cc(Ne))),...ee].map(Ne=>f.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ne},Ne))})()})]})]}),c==="sources"&&f.jsxs(f.Fragment,{children:[O.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(Wr,{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:O.citedDomains.map((ee,ue)=>{const ne=ee.toLowerCase().replace(/^www\./,""),Ne=E.has(ne),nt=!Ne&&O.competitorDomains.some($e=>$e.toLowerCase().replace(/^www\./,"")===ne),xe=Ne?"you":nt?"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:ee}),Ne&&f.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),nt&&f.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ee)})})]}),O.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 (",O.groundingSources.length,")"]}),f.jsx(Wr,{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:O.groundingSources.map((ee,ue)=>{const ne=_f(ee.uri),Ne=ee.title||ee.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)})})]}),O.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:O.evidenceUrls.map(ee=>{const ue=_f(ee);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:ee}):f.jsx("span",{className:"text-zinc-400",children:ee})},ee)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&f.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",J?"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 ",J?"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 of=[{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 wc(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 pD=wc({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"}),mD=wc({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"}),hD=wc({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"}),gD=wc({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"}),yD=[{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"])}];of[0],of[1],Mn(["cited","cited","cited","cited","cited"]),of[2],2/7,3/7,Mn(["not-cited","not-cited","not-cited","cited"]);function bD(e,n){return e.runs.find(i=>i.id===n)}function vD(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 SD(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return vD(n,i)}const xD={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral","gbp-lodging-gap":"negative","gbp-listing-discrepancy":"negative","gbp-cta-gap":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},wD={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor","gbp-lodging-gap":"write","gbp-listing-discrepancy":"write","gbp-cta-gap":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},jD={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited","gbp-lodging-gap":"not-cited","gbp-listing-discrepancy":"not-cited","gbp-cta-gap":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},ND={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor","gbp-lodging-gap":"Lodging gap","gbp-listing-discrepancy":"Listing gap","gbp-cta-gap":"Booking CTA","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function kD(e){return{id:e.id,tone:xD[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??ND[e.type],actionGroup:wD[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:jD[e.type]}]}}function AD(e){return e.filter(n=>!n.dismissed).map(kD)}function u1(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 Bb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function _D(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 d1(e){switch(e){case Te["answer-visibility"]:return"Answer visibility sweep";case Te["gsc-sync"]:return"GSC sync";case Te["inspect-sitemap"]:return"Sitemap inspection";case Te["ga-sync"]:return"GA sync";case Te["traffic-sync"]:return"Traffic sync";case Te["bing-inspect"]:return"Bing URL inspection";case Te["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Te["site-audit"]:return"Site audit";case Te["backlink-extract"]:return"Backlink extract";case Te["aeo-discover-seed"]:return"Discovery (seed phase)";case Te["aeo-discover-probe"]:return"Discovery (probe phase)";case Te["gbp-sync"]:return"Business Profile sync"}}function zD(e){return e===Bs.manual?"Manual":e===Bs.scheduled?"Scheduled":e===Bs["config-apply"]?"Config apply":e}function vp(e,n){return{id:e.id,projectId:e.projectId,projectName:n,kind:e.kind,kindLabel:d1(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Bb(e.startedAt):Bb(e.createdAt),duration:_D(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?f1(e.error):CD(e),summary:TD(e),triggerLabel:zD(e.trigger)}}function f1(e){const n=Wf(e);return n.length>200?n.slice(0,200)+"…":n}function CD(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?f1(e.error):"Run failed.";case Ht.cancelled:return"Run was cancelled.";default:return""}}function TD(e){const n=d1(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 ED(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(T=>T.snapshots??[]),g=new Map;for(const T of h)if(T.query){const k=`${T.query}::${T.provider}::${T.location??""}`;g.set(k,T)}const b=new Set(h.map(T=>T.location??null));b.size===0&&b.add(null);const v=new Set(h.map(T=>T.provider)),x=new Set(n.flatMap(T=>Object.keys(T.providerRuns??{}))),j=[...new Set([...v,...x])].sort(),A=j.length>0?j:["gemini"];for(const T of n){if(T.runs.length===0)continue;d.add(T.query);const k=T.runs.at(-1),E=k?.transition??"not-cited";for(const R of A){const I=[...b].filter(X=>g.has(`${T.query}::${R}::${X??""}`)),P=(T.providerRuns?.[R]?.length??0)>0,Z=I.length>0?I:P?[null]:[];for(const X of Z){const J=X??"",O=g.get(`${T.query}::${R}::${J}`),B=O?.model??null,oe=B?`${R}:${B}`:null,ke=T.providerRuns?.[R],_e=oe?T.modelRuns?.[oe]:void 0,ve=$e=>$e?.filter(He=>(He.location??null)===X),tt=I.length>0?ve(ke):ke,re=I.length>0?ve(_e):_e,me=(tt?.length?tt:null)??(re?.length?re:null),$=tt?.length?"provider":re?.length?"model":"query",W=me?me.at(-1).transition:E,fe=me?me.at(-1).visibilityTransition??(me.at(-1).visibilityState==="visible"?"visible":"not-visible"):k?.visibilityTransition??(k?.visibilityState==="visible"?"visible":"not-visible"),je=me?.at(-1)?.citationState,se=me?.at(-1)?.visibilityState,Qe=O?W==="lost"?"lost":W==="emerging"?"emerging":O.citationState===rc.cited?"cited":"not-cited":je===rc.cited?"cited":"not-cited",F=O?.visibilityState??(se==="visible"?"visible":se==="pending"?"pending":"not-visible"),ce=Mb(me||T.runs),ee=Lb(me||T.runs),ue=OD(T,R),ne=(me??T.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=DD(ne),nt=$==="provider"&&Ne.length<=1?"model":$,xe=RD(ne);l.push({id:`evidence_${e}_${c++}`,query:T.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??X,citationState:Qe,answerMentioned:O?.answerMentioned,visibilityState:F,visibilityChangeLabel:qb(fe,ee,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:qb(W,ce),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:BD(F,fe,T.query),runHistory:ne,historyScope:nt,modelsSeen:Ne,modelTransitions:xe})}}}}for(const h of r)d.has(h.query)||l.push({id:`evidence_${e}_${c++}`,query:h.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:[],searchQueries:[],summary:`"${h.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return l}function OD(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),h=d==="unknown"?null:d;for(const g of c)i.set(g.runId,h)}return i}function DD(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function RD(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 Mb(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 Lb(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 qb(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?`${eo(r.positive)} in latest run`:`${eo(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return eo(r.first);case"not-cited":case"not-visible":return n<=1?`${eo(r.negative)} in latest run`:`${eo(r.negative)} across ${n} runs`;default:return e}}function eo(e){return e.charAt(0).toUpperCase()+e.slice(1)}function BD(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 p1(e){const n=u1(e.project),i=ED(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>vp(c,e.project.displayName||e.project.name));return e.overview?MD(n,e.overview,i,l):LD(n,i,l)}function MD(e,n,i,r){const l=AD(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 LD(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 qD(e){const n=u1(e.project),i=[...e.runs].sort((j,A)=>A.createdAt.localeCompare(j.createdAt)),r=i.find(j=>j.kind===Te["answer-visibility"])??i[0],l=e.project.displayName||e.project.name,c=r?vp(r,l):UD(e.project.id,l),d=e.overview;if(!d)return{project:n,mentionScore:0,mentionDelta:"No data",mentionTone:"neutral",lastRun:c,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const h=d.scores.mention,g=h.progress??0,b=d.queryCounts.mentionedQueries,v=d.queryCounts.totalQueries,x=d.providers.length;return{project:n,mentionScore:g,mentionDelta:v>0?`${b} of ${v} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:v>0?`${b} of ${v} queries mentioned across ${x} provider${x===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function UD(e,n){return{id:"none",projectId:e,projectName:n,kind:Te["answer-visibility"],kindLabel:"No runs yet",status:Ht.queued,trigger:Bs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function $D(e,n){const i=[],r=[],l=[];for(const d of e){r.push(p1(d)),l.push(qD(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(vp(g,d.project.displayName||d.project.name))}i.sort((d,h)=>h.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:l,attentionItems:c?VD(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 VD(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."}),n}const m1=q.createContext(null);m1.Provider;function mo(){return q.useContext(m1)}function jc(e){const i=mo()?.dashboard??null,r=dn({...pp({client:ae}),enabled:!i,refetchInterval:Lk}),l=dn({...hp({client:ae,query:{kind:"answer-visibility"}}),enabled:!i,staleTime:ro,refetchInterval:T=>T.state.data?.some(R=>R.status==="running"||R.status==="queued")?3e3:ro}),c=dn({...d4({client:ae}),enabled:!i}),d=r.data??[],h=l.data??[],g=Sw({queries:d.map(T=>{const k=h.filter(I=>I.projectId===T.id),E=k.filter(I=>(I.status==="completed"||I.status==="partial")&&I.kind==="answer-visibility"&&I.trigger!=="probe").sort((I,P)=>P.createdAt.localeCompare(I.createdAt)),R=E.length>0?E[0].id:"no-run";return{queryKey:["project-overview-slim",T.id,R],queryFn:async()=>{const I=await kv(T.name).catch(()=>null);return{project:T,runs:k,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:I}},enabled:!i&&r.isSuccess&&l.isSuccess,staleTime:bf}})}),b=g.every(T=>T.isSuccess),v=q.useMemo(()=>{if(i)return i;if(!r.data||!l.data||d.length>0&&!b)return null;const T=g.map(k=>k.data?{...k.data,runs:h.filter(E=>E.projectId===k.data.project.id)}:null).filter(k=>k!=null);return $D(T,c.data??null)},[i,r.data,l.data,c.data,b,g,d.length,h]),x=!i&&(r.isError||l.isError),j=!i&&!v&&!x,A=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),c.refetch()])},[r.refetch,l.refetch,c.refetch]);return{dashboard:v,isLoading:j,isError:x,refetch:A}}function ID(e){const n=mo(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(T=>T.project.name===e)??null,[n,e]),r=dn({...l4({client:ae,path:{name:e??""}}),enabled:!!e&&!i,staleTime:bf,refetchOnWindowFocus:"always"}),l=dn({...hp({client:ae,query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:ro,refetchOnWindowFocus:"always",refetchInterval:T=>T.state.data?.some(R=>R.projectId===r.data?.id&&(R.status==="running"||R.status==="queued"))?3e3:ro}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(T=>T.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b}=q.useMemo(()=>{const T=d.filter(P=>(P.status==="completed"||P.status==="partial")&&P.kind==="answer-visibility"&&P.trigger!=="probe").sort((P,Z)=>Z.createdAt.localeCompare(P.createdAt)),k=T[0]?.createdAt??null,E=k?T.filter(P=>P.createdAt===k).map(P=>P.id):[],R=T.find(P=>P.createdAt!==k)?.createdAt??null,I=R?T.filter(P=>P.createdAt===R).map(P=>P.id):[];return{latestRunIds:E,previousRunIds:I,latestRunIdsKey:[...E].sort().join(",")}},[d]),v=dn({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[T,k,E,R,I,P,Z,X,J]=await Promise.all([ok(e).catch(()=>[]),lk(e).catch(()=>[]),ck(e).catch(()=>[]),h.length?Promise.all(h.map(O=>ec(O).catch(()=>null))).then(O=>O.filter(B=>B!=null)):Promise.resolve([]),g.length?Promise.all(g.map(O=>ec(O).catch(()=>null))).then(O=>O.filter(B=>B!=null)):Promise.resolve([]),wk(e).catch(()=>null),kk(e).catch(()=>null),_k(e).catch(()=>null),kv(e).catch(()=>null)]);return{project:c,runs:d,queries:T,competitors:k,timeline:E,latestRunDetails:R,previousRunDetails:I,gscCoverage:P,bingCoverage:Z,dbInsights:X,overview:J}},enabled:!!c&&!!e&&l.isSuccess,staleTime:bf,refetchOnWindowFocus:"always",refetchInterval:qk}),x=q.useMemo(()=>v.data?p1({...v.data,runs:d}):i||null,[v.data,d,i]),j=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),v.refetch()])},[r.refetch,l.refetch,v.refetch]),A=!x&&(r.isLoading||l.isLoading||v.isLoading);return{commandCenter:x,project:c,isLoading:A,isError:r.isError||l.isError||v.isError,refetch:j}}const GD=["health"];async function PD(){const e=await Ck("/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 Sp(e,n){return dn({queryKey:GD,queryFn:PD,enabled:e,refetchInterval:15e3,initialData:n})}function HD(e){return dn({...U0({client:ae,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function xp(){const e=pc(),n=xw({strict:!1}),i=ww({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:tn.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:tn.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:tn.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const KD={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function ZD(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function QD(){const e=q.useSyncExternalStore(Bk,Vy,Vy),n=pc(),{openRun:i}=xp(),r=q.useCallback(c=>{yf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),yf(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 ${KD[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":ZD(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 YD(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 h(){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:h,isAtEnd:d}}async function wp(e){try{return await e.json()}catch{return{}}}function XD(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const jp=XD();function Np(e){e===401&&$f()}async function Ub(e){const n=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){Np(n.status);const i=await wp(n);throw new Pn(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function JD(e){const n=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){Np(n.status);const i=await wp(n);throw new Pn(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function FD({project:e,prompt:n,provider:i,modelId:r,scope:l,signal:c,onEvent:d}){const h={prompt:n};i&&(h.provider=i),r&&(h.modelId=r),l&&(h.scope=l);const g=await fetch(`${jp}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h),signal:c});if(!g.ok||!g.body){Np(g.status);const A=await wp(g);throw new Pn(A.error?.message??`prompt failed: ${g.status}`,g.status,A.error?.code)}const b=g.body.getReader(),v=new TextDecoder;let x="";const j=()=>{b.cancel().catch(()=>{})};c?.addEventListener("abort",j,{once:!0});try{for(;;){const{value:A,done:T}=await b.read();if(T)break;x+=v.decode(A,{stream:!0});let k=x.indexOf(`
|
|
59
59
|
|
|
60
60
|
`);for(;k!==-1;){const E=x.slice(0,k);x=x.slice(k+2);for(const R of E.split(`
|
|
61
61
|
`)){if(!R.startsWith("data:"))continue;const I=R.slice(5).trim();if(I)try{d(JSON.parse(I))}catch{}}k=x.indexOf(`
|
|
@@ -207,4 +207,4 @@ spec:
|
|
|
207
207
|
`);fe(Fe)}}catch(te){Cn(te instanceof Error?te.message:"Failed to generate queries")}finally{He(!1)}}},Zn=async()=>{if(!oe)return;const te=ei;if(te.length!==0){Ri(!0),Oi(null);try{await pk(oe,te),Mc(!0),await r(),j(4)}catch(Fe){Oi(Fe instanceof Error?Fe.message:"Failed to save competitors")}finally{Ri(!1)}}},$i=async()=>{const te=Mi.trim();if(te){va(!0),Tn(null);try{await yk("gemini",{apiKey:te}),en({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),wo(""),await r()}catch(Fe){Tn(Fe instanceof Error?Fe.message:"Failed to save Gemini key")}finally{va(!1)}}},ti=async()=>{if(oe){So(!0);try{const te=await Bi.mutateAsync({projectName:oe,projectLabel:k||A||oe,sourceAction:"setup-launch"});xo(te.id),Lc(!0),await r()}catch{}finally{So(!1)}}},Qn=()=>j(te=>Math.max(0,te-1)),jo=(()=>{switch(x){case 0:return f.jsxs(jn,{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(te=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:te.label}),f.jsx("p",{className:"supporting-copy",children:te.detail}),te.id==="provider"&&te.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:Mi,onChange:Fe=>wo(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:ar}),f.jsx(Ue,{type:"button",size:"sm",disabled:ar||!Mi.trim(),onClick:wn($i),children:ar?"Saving...":"Save"})]}),Ut&&f.jsx("p",{className:"text-xs text-rose-400",children:Ut}),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(Ln,{tone:te.state==="ready"?"positive":"caution",title:te.id==="api"?$s(g.apiStatus):te.id==="worker"?$s(g.workerStatus):te.detail,children:te.state==="ready"?"Ready":"Attention"})]},te.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",disabled:!Uc,onClick:()=>j(1),children:"Continue"})]})]});case 1:return f.jsxs(jn,{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(Ln,{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(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>j(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:A,onChange:te=>T(te.target.value)}),mt&&mt!==A?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:k,onChange:te=>E(te.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:te=>I(te.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:P,onChange:te=>Z(te.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:X,onChange:te=>J(te.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:O,onChange:te=>B(te.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"})]})]})]}),tt?f.jsx("p",{className:"text-rose-400 text-sm",children:tt}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:!mt||!R||me,onClick:wn(Li),children:me?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(jn,{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(Ln,{tone:"positive",children:[Un.length," saved"]}):f.jsxs(Ln,{tone:"neutral",children:[Un.length," quer",Un.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:Un.map(te=>f.jsx("li",{children:te},te))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>j(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:te=>Ne(te.target.value),children:ue.map(te=>f.jsxs("option",{value:te.name,children:[te.displayName??te.name,te.model?` (${te.model})`:""]},te.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:nt,onChange:te=>xe(Number(te.target.value)),children:[3,5,10,15,20].map(te=>f.jsx("option",{value:te,children:te},te))})]}),f.jsx(Ue,{type:"button",variant:"outline",disabled:$e||!ne,onClick:wn(Ui),children:$e?"Analyzing site...":"Generate"})]}),Et?f.jsx("p",{className:"text-rose-400 text-sm",children:Et}):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:W,onChange:te=>fe(te.target.value)})]}),Qe?f.jsx("p",{className:"text-rose-400 text-sm",children:Qe}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Un.length===0||ce,onClick:wn(qi),children:ce?"Saving...":`Save ${Un.length} quer${Un.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(jn,{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(Ln,{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:ei.map(te=>f.jsx("li",{children:te},te))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>j(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:Ot,onChange:te=>er(te.target.value)})]}),tr?f.jsx("p",{className:"text-rose-400 text-sm",children:tr}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>j(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:ei.length===0||Di,onClick:wn(Zn),children:Di?"Saving...":`Save ${ei.length} competitor${ei.length!==1?"s":""}`})]})]})]})]});case 4:{const te=qc.data,Fe=te?.status==="completed"||te?.status==="partial"||te?.status==="failed"||te?.status==="cancelled",ni=te?.snapshots??[],No=ni.filter(En=>En.citationState==="cited").length,ko=ni.filter(En=>En.answerMentioned===!0).length,ir=new Set(ni.map(En=>En.query).filter(En=>!!En)).size,sr=vo?Fe&&(te?.status==="completed"||te?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{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"})]}),sr]}),vo?Fe?te?.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(Ue,{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:[ko,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ir]})]}),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:[No,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ir]})]}),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:ni.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(Ue,{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:te?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{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(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:qt,onClick:wn(ti),children:qt?"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(I5,{current:x,labels:V5}),f.jsx("section",{className:"setup-wizard",children:jo})]})}function P5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{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(Ue,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Ps(()=>import("./ProjectPage-Bg5sKYhO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),H5=Gs(()=>Ps(()=>import("./RunsPage-CV2wKkaz.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),K5=Gs(()=>Ps(()=>import("./SettingsPage-Ctij-T9F.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),Z5=Gs(()=>Ps(()=>import("./BacklinksPage-GkTp8zLM.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),Q5=Gs(()=>Ps(()=>import("./TrafficPage-TnIPaMcL.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),Y5=Gs(()=>Ps(()=>import("./TrafficSourceDetailPage-BBmIwaee.js"),__vite__mapDeps([14,1,13,3,4,5,7,8]),import.meta.url),"TrafficSourceDetailPage");function X5(){return f.jsx(xR,{children:f.jsx(SR,{})})}const tn=jw()({component:X5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),J5=zt({getParentRoute:()=>tn,path:"/",component:NR,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ys({client:ae}));if(n&&n.length===0)throw rv({to:"/setup"})}}),F5=zt({getParentRoute:()=>tn,path:"/projects",component:M5}),Kn=zt({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(sv,{})}),W5=zt({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),eB=zt({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),tB=zt({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),nB=zt({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),aB=zt({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),iB=zt({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),sB=zt({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),rB=zt({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),oB=zt({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),lB=zt({getParentRoute:()=>tn,path:"/runs",component:H5}),cB=zt({getParentRoute:()=>tn,path:"/settings",component:K5,beforeLoad:({context:e})=>{}}),uB=zt({getParentRoute:()=>tn,path:"/setup",component:G5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ys({client:ae}));if(n&&n.length>0)throw rv({to:"/"})}}),dB=zt({getParentRoute:()=>tn,path:"/backlinks",component:Z5}),fB=zt({getParentRoute:()=>tn,path:"/traffic",component:Q5}),pB=zt({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:Y5}),mB=zt({getParentRoute:()=>tn,path:"*",component:P5}),hB=tn.addChildren([J5,F5,Kn.addChildren([W5,eB,tB,nB,aB,iB,sB,rB,oB]),lB,cB,uB,dB,fB,pB,mB]);function gB(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const av=gB(),yB=av==="/"?"":av.replace(/\/$/,"");function bB(e,n){return Nw({routeTree:hB,basepath:yB||"/",context:{queryClient:e},...n?.initialEntries})}const vB=6e4;function SB(){const[e,n]=q.useState(Wd()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,b]=q.useState(!1),[v,x]=q.useState(!1),j=q.useRef(null),A=q.useRef(null),T=()=>{if(!j.current){const R=Uk();A.current=R,j.current=bB(R)}return{queryClient:A.current,router:j.current}};q.useEffect(()=>{if(Wd())return;let R=!1;return Uy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||Wd())return;const R=setInterval(()=>{Uy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},vB);return qy(()=>{x(!0),n("login")}),()=>{clearInterval(R),qy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}b(!0),h(null);try{if(!(await hk(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Pn||I instanceof Error?I.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await gk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Pn||I instanceof Error?I.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=T();return f.jsx(kw,{client:R,children:f.jsx(Aw,{router:I})})}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(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Xl,{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(zf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Cf,{children:"Create a dashboard password"}),f.jsx(Tf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Xl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),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(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(zf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Cf,{children:"Sign in to Canonry"}),f.jsx(Tf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Xl,{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:wn(E),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(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const aS=document.getElementById("root");if(!aS)throw new Error("Expected #root element for web app bootstrap.");Dw.createRoot(aS).render(f.jsx(q.StrictMode,{children:f.jsx(SB,{})}));export{dL as $,MB as A,Ue as B,rc as C,WM as D,tL as E,nL as F,DM as G,KB as H,Wr as I,HB as J,QB as K,en as L,aM as M,sL as N,rL as O,tD as P,XB as Q,aL as R,a4 as S,Ln as T,iL as U,eL as V,ZB as W,JB as X,oL as Y,lL as Z,pL as _,ML as a,VB as a$,fL as a0,_k as a1,G0 as a2,Te as a3,uL as a4,n3 as a5,ki as a6,cL as a7,XT as a8,JT as a9,BL as aA,RL as aB,FB as aC,tA as aD,Tv as aE,G4 as aF,H4 as aG,P4 as aH,NL as aI,dM as aJ,HL as aK,UM as aL,LM as aM,$M as aN,VM as aO,MM as aP,qM as aQ,DB as aR,OB as aS,EB as aT,qB as aU,JM as aV,wb as aW,XM as aX,UB as aY,$B as aZ,YM as a_,BM as aa,RM as ab,wM as ac,zM as ad,CM as ae,Pn as af,TM as ag,kB as ah,gA as ai,KM as aj,mA as ak,NA as al,s3 as am,ec as an,EM as ao,bf as ap,kL as aq,YB as ar,TL as as,EL as at,OL as au,WB as av,Ys as aw,eM as ax,mp as ay,DL as az,Pf as b,IM as b$,IB as b0,PB as b1,GB as b2,mo as b3,pp as b4,ID as b5,$5 as b6,Ht as b7,ck as b8,UL as b9,jc as bA,$L as bB,bp as bC,yk as bD,LB as bE,tM as bF,nM as bG,Sp as bH,uM as bI,$s as bJ,jb as bK,SM as bL,jM as bM,kM as bN,AM as bO,xM as bP,NM as bQ,_M as bR,nD as bS,o1 as bT,oD as bU,l1 as bV,c1 as bW,uA as bX,vM as bY,Py as bZ,zL as b_,qL as ba,RB as bb,zB as bc,CB as bd,BB as be,lk as bf,pk as bg,_B as bh,AB as bi,dk as bj,TB as bk,PL as bl,d4 as bm,mL as bn,gL as bo,xk as bp,yL as bq,lM as br,oM as bs,bL as bt,hL as bu,HM as bv,iM as bw,sM as bx,rM as by,cM as bz,et as c,GM as c0,fp as c1,FM as c2,Hs as c3,AL as c4,CL as c5,bM as c6,gM as c7,yM as c8,hM as c9,_L as ca,AT as d,LL as e,ZM as f,jn as g,Rb as h,wn as i,OM as j,vL as k,ae as l,SL as m,xL as n,jL as o,wL as p,fM as q,mM as r,pM as s,s4 as t,xp as u,VL as v,IL as w,GL as x,PM as y,QM as z};
|
|
210
|
+
competitor2.com`,value:Ot,onChange:te=>er(te.target.value)})]}),tr?f.jsx("p",{className:"text-rose-400 text-sm",children:tr}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>j(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:ei.length===0||Di,onClick:wn(Zn),children:Di?"Saving...":`Save ${ei.length} competitor${ei.length!==1?"s":""}`})]})]})]})]});case 4:{const te=qc.data,Fe=te?.status==="completed"||te?.status==="partial"||te?.status==="failed"||te?.status==="cancelled",ni=te?.snapshots??[],No=ni.filter(En=>En.citationState==="cited").length,ko=ni.filter(En=>En.answerMentioned===!0).length,ir=new Set(ni.map(En=>En.query).filter(En=>!!En)).size,sr=vo?Fe&&(te?.status==="completed"||te?.status==="partial")?f.jsx(Ln,{tone:"positive",children:"Complete"}):Fe?f.jsx(Ln,{tone:"negative",children:"Failed"}):f.jsx(Ln,{tone:"caution",children:"Running"}):null;return f.jsxs(jn,{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"})]}),sr]}),vo?Fe?te?.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(Ue,{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:[ko,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ir]})]}),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:[No,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ir]})]}),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:ni.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(Ue,{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:te?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{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(Ue,{type:"button",variant:"outline",onClick:Qn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:qt,onClick:wn(ti),children:qt?"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(I5,{current:x,labels:V5}),f.jsx("section",{className:"setup-wizard",children:jo})]})}function P5(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(jn,{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(Ue,{asChild:!0,children:f.jsx(rt,{to:"/",children:"Return to overview"})})]})})})}const ba=Gs(()=>Ps(()=>import("./ProjectPage-CVudiU8X.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),H5=Gs(()=>Ps(()=>import("./RunsPage-Cz-YlucO.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),K5=Gs(()=>Ps(()=>import("./SettingsPage-BCuG3C-0.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),Z5=Gs(()=>Ps(()=>import("./BacklinksPage-CwXveumn.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),Q5=Gs(()=>Ps(()=>import("./TrafficPage-DV8X47wa.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),Y5=Gs(()=>Ps(()=>import("./TrafficSourceDetailPage-BmYhK9jm.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function X5(){return f.jsx(xR,{children:f.jsx(SR,{})})}const tn=jw()({component:X5,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),J5=zt({getParentRoute:()=>tn,path:"/",component:NR,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ys({client:ae}));if(n&&n.length===0)throw rv({to:"/setup"})}}),F5=zt({getParentRoute:()=>tn,path:"/projects",component:M5}),Kn=zt({getParentRoute:()=>tn,path:"/projects/$projectId",component:()=>f.jsx(sv,{})}),W5=zt({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),eB=zt({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),tB=zt({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),nB=zt({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),aB=zt({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),iB=zt({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),sB=zt({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),rB=zt({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),oB=zt({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),lB=zt({getParentRoute:()=>tn,path:"/runs",component:H5}),cB=zt({getParentRoute:()=>tn,path:"/settings",component:K5,beforeLoad:({context:e})=>{}}),uB=zt({getParentRoute:()=>tn,path:"/setup",component:G5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ys({client:ae}));if(n&&n.length>0)throw rv({to:"/"})}}),dB=zt({getParentRoute:()=>tn,path:"/backlinks",component:Z5}),fB=zt({getParentRoute:()=>tn,path:"/traffic",component:Q5}),pB=zt({getParentRoute:()=>tn,path:"/traffic/$projectName/$sourceId",component:Y5}),mB=zt({getParentRoute:()=>tn,path:"*",component:P5}),hB=tn.addChildren([J5,F5,Kn.addChildren([W5,eB,tB,nB,aB,iB,sB,rB,oB]),lB,cB,uB,dB,fB,pB,mB]);function gB(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const av=gB(),yB=av==="/"?"":av.replace(/\/$/,"");function bB(e,n){return Nw({routeTree:hB,basepath:yB||"/",context:{queryClient:e},...n?.initialEntries})}const vB=6e4;function SB(){const[e,n]=q.useState(Wd()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,b]=q.useState(!1),[v,x]=q.useState(!1),j=q.useRef(null),A=q.useRef(null),T=()=>{if(!j.current){const R=Uk();A.current=R,j.current=bB(R)}return{queryClient:A.current,router:j.current}};q.useEffect(()=>{if(Wd())return;let R=!1;return Uy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||Wd())return;const R=setInterval(()=>{Uy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},vB);return qy(()=>{x(!0),n("login")}),()=>{clearInterval(R),qy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}b(!0),h(null);try{if(!(await hk(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Pn||I instanceof Error?I.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await gk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Pn||I instanceof Error?I.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=T();return f.jsx(kw,{client:R,children:f.jsx(Aw,{router:I})})}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(jn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Xl,{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(zf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Cf,{children:"Create a dashboard password"}),f.jsx(Tf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Xl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:wn(k),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(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(zf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Cf,{children:"Sign in to Canonry"}),f.jsx(Tf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Xl,{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:wn(E),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(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const aS=document.getElementById("root");if(!aS)throw new Error("Expected #root element for web app bootstrap.");Dw.createRoot(aS).render(f.jsx(q.StrictMode,{children:f.jsx(SB,{})}));export{pL as $,QM as A,Ue as B,rc as C,MB as D,WM as E,tL as F,DM as G,nL as H,Wr as I,KB as J,HB as K,QB as L,en as M,aM as N,sL as O,tD as P,rL as Q,XB as R,a4 as S,Ln as T,aL as U,iL as V,eL as W,ZB as X,JB as Y,oL as Z,lL as _,ML as a,YM as a$,dL as a0,fL as a1,_k as a2,G0 as a3,Te as a4,uL as a5,n3 as a6,ki as a7,cL as a8,XT as a9,DL as aA,BL as aB,RL as aC,FB as aD,tA as aE,Tv as aF,G4 as aG,H4 as aH,P4 as aI,NL as aJ,dM as aK,HL as aL,UM as aM,LM as aN,$M as aO,VM as aP,MM as aQ,qM as aR,DB as aS,OB as aT,EB as aU,qB as aV,JM as aW,wb as aX,XM as aY,UB as aZ,$B as a_,JT as aa,BM as ab,RM as ac,wM as ad,zM as ae,CM as af,Pn as ag,TM as ah,kB as ai,gA as aj,KM as ak,mA as al,NA as am,s3 as an,ec as ao,EM as ap,bf as aq,kL as ar,YB as as,TL as at,EL as au,OL as av,WB as aw,Ys as ax,eM as ay,mp as az,Pf as b,zL as b$,VB as b0,IB as b1,PB as b2,GB as b3,mo as b4,pp as b5,ID as b6,$5 as b7,Ht as b8,ck as b9,cM as bA,jc as bB,$L as bC,bp as bD,yk as bE,LB as bF,tM as bG,nM as bH,Sp as bI,uM as bJ,$s as bK,jb as bL,SM as bM,jM as bN,kM as bO,AM as bP,xM as bQ,NM as bR,_M as bS,nD as bT,o1 as bU,oD as bV,l1 as bW,c1 as bX,uA as bY,vM as bZ,Py as b_,UL as ba,qL as bb,RB as bc,zB as bd,CB as be,BB as bf,lk as bg,pk as bh,_B as bi,AB as bj,dk as bk,TB as bl,PL as bm,d4 as bn,mL as bo,gL as bp,xk as bq,yL as br,lM as bs,oM as bt,bL as bu,hL as bv,HM as bw,iM as bx,sM as by,rM as bz,et as c,IM as c0,GM as c1,fp as c2,FM as c3,Hs as c4,AL as c5,CL as c6,bM as c7,gM as c8,yM as c9,hM as ca,_L as cb,AT as d,LL as e,ZM as f,jn as g,Rb as h,wn as i,OM as j,vL as k,ae as l,SL as m,xL as n,jL as o,wL as p,fM as q,mM as r,pM as s,s4 as t,xp as u,VL as v,IL as w,GL as x,_f as y,PM as z};
|