@canonry/canonry 4.129.1 → 4.130.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/README.md +1 -0
- package/assets/assets/{AuditHistoryPanel-wJqs99Ak.js → AuditHistoryPanel-Ydzb2Y_Y.js} +1 -1
- package/assets/assets/BacklinksPage-DYodEusK.js +1 -0
- package/assets/assets/{ChartPrimitives-DSr5ldMf.js → ChartPrimitives-D67hsnF7.js} +1 -1
- package/assets/assets/{HistoryPage-Ca-GGnTI.js → HistoryPage-_h9ITL1w.js} +1 -1
- package/assets/assets/ProjectPage-fCJKCcHE.js +8 -0
- package/assets/assets/{RunRow-O9TbOdQY.js → RunRow-DzUNyTE-.js} +1 -1
- package/assets/assets/{RunsPage-C1Sqd7AN.js → RunsPage-FTvAjptk.js} +1 -1
- package/assets/assets/{SettingsPage-DPFh62BV.js → SettingsPage-CvgpYEAt.js} +1 -1
- package/assets/assets/{TrafficPage-5vKoQyoP.js → TrafficPage-qaMW9k6o.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-D17oADs8.js → TrafficSourceDetailPage-CRCso7_A.js} +1 -1
- package/assets/assets/{arrow-left-De5P5AIE.js → arrow-left-C--lHdP2.js} +1 -1
- package/assets/assets/{extract-error-message-BqMd-fQ6.js → extract-error-message-DVqYbKpB.js} +1 -1
- package/assets/assets/index-CdXn0JEf.js +210 -0
- package/assets/assets/{index-jymsMBpZ.css → index-JhX-wfQO.css} +1 -1
- package/assets/assets/trash-2-CyKRU3tR.js +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-LPEE5AYY.js → chunk-5XU6WEMK.js} +649 -298
- package/dist/{chunk-K4FDDCYG.js → chunk-NVRJZU6V.js} +2742 -2626
- package/dist/{chunk-GYAKRVE2.js → chunk-QR5U2K3O.js} +508 -355
- package/dist/{chunk-WWZE7VDQ.js → chunk-WIALMCXM.js} +118 -1
- package/dist/cli.js +432 -182
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-2QBAGT5X.js → intelligence-service-53GUE6EI.js} +2 -2
- package/dist/mcp.js +5 -5
- package/package.json +8 -8
- package/assets/assets/BacklinksPage-BBDExYo_.js +0 -1
- package/assets/assets/ProjectPage-BuaSDSwf.js +0 -7
- package/assets/assets/index-C1ABEgkr.js +0 -210
- package/assets/assets/trash-2-6ZpABj9G.js +0 -1
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-BuaSDSwf.js","./vendor-tanstack-Be8JdV5M.js","./RunRow-O9TbOdQY.js","./ChartPrimitives-DSr5ldMf.js","./extract-error-message-BqMd-fQ6.js","./vendor-recharts-DSxTZhaH.js","./trash-2-6ZpABj9G.js","./AuditHistoryPanel-wJqs99Ak.js","./vendor-radix-CQ77EO2y.js","./vendor-markdown-6dwjPOKK.js","./RunsPage-C1Sqd7AN.js","./HistoryPage-Ca-GGnTI.js","./SettingsPage-DPFh62BV.js","./BacklinksPage-BBDExYo_.js","./TrafficPage-5vKoQyoP.js","./arrow-left-De5P5AIE.js","./TrafficSourceDetailPage-D17oADs8.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as Rj,d as Mj,Q as Bj,M as Lj,r as q,q as ke,j as p,L as tt,a as qj,e as Ls,u as on,f as Uj,h as Dc,k as $j,l as Ij,m as r0,O as Qf,n as ka,o as li,p as Pj,s as kt,t as Sp,v as qi,x as Vj,y as Gj,z as Hj}from"./vendor-tanstack-Be8JdV5M.js";import{S as Kj,O as xp,P as o0,C as wp,a as l0,T as jp,D as c0,R as u0}from"./vendor-radix-CQ77EO2y.js";import{c as d0}from"./vendor-recharts-DSxTZhaH.js";import{M as Qj}from"./vendor-markdown-6dwjPOKK.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 kf={exports:{}},lo={},Af={exports:{}},Cf={};var _b;function Zj(){return _b||(_b=1,(function(e){function n($,W){var pe=$.length;$.push(W);e:for(;0<pe;){var je=pe-1>>>1,le=$[je];if(0<l(le,W))$[je]=W,$[pe]=le,pe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],pe=$.pop();if(pe!==W){$[0]=pe;e:for(var je=0,le=$.length,Xe=le>>>1;je<Xe;){var J=2*(je+1)-1,ue=$[J],ee=J+1,de=$[ee];if(0>l(ue,pe))ee<le&&0>l(de,ue)?($[je]=de,$[ee]=pe,je=ee):($[je]=ue,$[J]=pe,je=J);else if(ee<le&&0>l(de,pe))$[je]=de,$[ee]=pe,je=ee;else break e}}return W}function l($,W){var pe=$.sortIndex-W.sortIndex;return pe!==0?pe:$.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=[],x=1,w=null,N=3,C=!1,D=!1,A=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function V($){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 P($){if(A=!1,V($),!D)if(i(g)!==null)D=!0,re||(re=!0,ve());else{var W=i(b);W!==null&&fe(P,W.startTime-$)}}var re=!1,O=-1,L=5,ae=-1;function _e(){return E?!0:!(e.unstable_now()-ae<L)}function Me(){if(E=!1,re){var $=e.unstable_now();ae=$;var W=!0;try{e:{D=!1,A&&(A=!1,G(O),O=-1),C=!0;var pe=N;try{t:{for(V($),w=i(g);w!==null&&!(w.expirationTime>$&&_e());){var je=w.callback;if(typeof je=="function"){w.callback=null,N=w.priorityLevel;var le=je(w.expirationTime<=$);if($=e.unstable_now(),typeof le=="function"){w.callback=le,V($),W=!0;break t}w===i(g)&&r(g),V($)}else r(g);w=i(g)}if(w!==null)W=!0;else{var Xe=i(b);Xe!==null&&fe(P,Xe.startTime-$),W=!1}}break e}finally{w=null,N=pe,C=!1}W=void 0}}finally{W?ve():re=!1}}}var ve;if(typeof X=="function")ve=function(){X(Me)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,oe=it.port2;it.port1.onmessage=Me,ve=function(){oe.postMessage(null)}}else ve=function(){R(Me,0)};function fe($,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"):L=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function($){switch(N){case 1:case 2:case 3:var W=3;break;default:W=N}var pe=N;N=W;try{return $()}finally{N=pe}},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 pe=N;N=$;try{return W()}finally{N=pe}},e.unstable_scheduleCallback=function($,W,pe){var je=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?je+pe:je):pe=je,$){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=pe+le,$={id:x++,callback:W,priorityLevel:$,startTime:pe,expirationTime:le,sortIndex:-1},pe>je?($.sortIndex=pe,n(b,$),i(g)===null&&$===i(b)&&(A?(G(O),O=-1):A=!0,fe(P,pe-je))):($.sortIndex=le,n(g,$),D||C||(D=!0,re||(re=!0,ve()))),$},e.unstable_shouldYield=_e,e.unstable_wrapCallback=function($){var W=N;return function(){var pe=N;N=W;try{return $.apply(this,arguments)}finally{N=pe}}}})(Cf)),Cf}var Tb;function Yj(){return Tb||(Tb=1,Af.exports=Zj()),Af.exports}var Eb;function Fj(){if(Eb)return lo;Eb=1;var e=Yj(),n=Rj(),i=Mj();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 f=s.return;if(f===null)break;var m=f.alternate;if(m===null){if(o=f.return,o!==null){s=o;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===s)return g(f),t;if(m===o)return g(f),a;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=f,o=m;else{for(var v=!1,j=f.child;j;){if(j===s){v=!0,s=f,o=m;break}if(j===o){v=!0,o=f,s=m;break}j=j.sibling}if(!v){for(j=m.child;j;){if(j===s){v=!0,s=m,o=f;break}if(j===o){v=!0,o=m,s=f;break}j=j.sibling}if(!v)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 x(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=x(t),a!==null)return a;t=t.sibling}return null}var w=Object.assign,N=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),X=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function ve(t){return t===null||typeof t!="object"?null:(t=Me&&t[Me]||t["@@iterator"],typeof t=="function"?t:null)}var it=Symbol.for("react.client.reference");function oe(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===it?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case A:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case re:return"SuspenseList";case ae:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case D:return"Portal";case X:return t.displayName||"Context";case G:return(t._context.displayName||"Context")+".Consumer";case V: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:oe(t.type)||"Memo";case L:a=t._payload,t=t._init;try{return oe(t(a))}catch{}}return null}var fe=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,pe={pending:!1,data:null,method:null,action:null},je=[],le=-1;function Xe(t){return{current:t}}function J(t){0>le||(t.current=je[le],je[le]=null,le--)}function ue(t,a){le++,je[le]=t.current,t.current=a}var ee=Xe(null),de=Xe(null),ie=Xe(null),Ae=Xe(null);function st(t,a){switch(ue(ie,a),ue(de,t),ue(ee,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?Xy(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=Xy(a),t=Jy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(ee),ue(ee,t)}function xe(){J(ee),J(de),J(ie)}function Pe(t){t.memoizedState!==null&&ue(Ae,t);var a=ee.current,s=Jy(a,t.type);a!==s&&(ue(de,t),ue(ee,s))}function Ze(t){de.current===t&&(J(ee),J(de)),Ae.current===t&&(J(Ae),io._currentValue=pe)}var Bt,Hn;function Lt(t){if(Bt===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Bt=a&&a[1]||"",Hn=-1<s.stack.indexOf(`
|
|
3
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
-
`+Bt+t+Hn}var hr=!1;function Ki(t,a){if(!t||hr)return"";hr=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(I){var U=I}Reflect.construct(t,[],F)}else{try{F.call()}catch(I){U=I}t.call(F.prototype)}}else{try{throw Error()}catch(I){U=I}(F=t())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(I){if(I&&U&&typeof I.stack=="string")return[I.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),v=m[0],j=m[1];if(v&&j){var _=v.split(`
|
|
5
|
-
`),B=j.split(`
|
|
6
|
-
`);for(f=o=0;o<_.length&&!_[o].includes("DetermineComponentFrameRoot");)o++;for(;f<B.length&&!B[f].includes("DetermineComponentFrameRoot");)f++;if(o===_.length||f===B.length)for(o=_.length-1,f=B.length-1;1<=o&&0<=f&&_[o]!==B[f];)f--;for(;1<=o&&0<=f;o--,f--)if(_[o]!==B[f]){if(o!==1||f!==1)do if(o--,f--,0>f||_[o]!==B[f]){var K=`
|
|
7
|
-
`+_[o].replace(" at new "," at ");return t.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",t.displayName)),K}while(1<=o&&0<=f);break}}}finally{hr=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Lt(s):""}function Bo(t,a){switch(t.tag){case 26:case 27:case 5:return Lt(t.type);case 16:return Lt("Lazy");case 13:return t.child!==a&&a!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return Ki(t.type,!1);case 11:return Ki(t.type.render,!1);case 1:return Ki(t.type,!0);case 31:return Lt("Activity");default:return""}}function gr(t){try{var a="",s=null;do a+=Bo(t,s),s=t,t=t.return;while(t);return a}catch(o){return`
|
|
8
|
-
Error generating stack: `+o.message+`
|
|
9
|
-
`+o.stack}}var Qi=Object.prototype.hasOwnProperty,Zi=e.unstable_scheduleCallback,yr=e.unstable_cancelCallback,Lo=e.unstable_shouldYield,qo=e.unstable_requestPaint,Gt=e.unstable_now,lu=e.unstable_getCurrentPriorityLevel,Uo=e.unstable_ImmediatePriority,$o=e.unstable_UserBlockingPriority,_a=e.unstable_NormalPriority,Io=e.unstable_LowPriority,Yi=e.unstable_IdlePriority,Po=e.log,Vo=e.unstable_setDisableYieldValue,Ta=null,vt=null;function qt(t){if(typeof Po=="function"&&Vo(t),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(Ta,t)}catch{}}var Ot=Math.clz32?Math.clz32:du,cu=Math.log,uu=Math.LN2;function du(t){return t>>>=0,t===0?32:31-(cu(t)/uu|0)|0}var Fi=256,Xi=262144,Ji=4194304;function Wn(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function gn(t,a,s){var o=t.pendingLanes;if(o===0)return 0;var f=0,m=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var j=o&134217727;return j!==0?(o=j&~m,o!==0?f=Wn(o):(v&=j,v!==0?f=Wn(v):s||(s=j&~t,s!==0&&(f=Wn(s))))):(j=o&~m,j!==0?f=Wn(j):v!==0?f=Wn(v):s||(s=o&~t,s!==0&&(f=Wn(s)))),f===0?0:a!==0&&a!==f&&(a&m)===0&&(m=f&-f,s=a&-a,m>=s||m===32&&(s&4194048)!==0)?a:f}function mi(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function se(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ut(){var t=Ji;return Ji<<=1,(Ji&62914560)===0&&(Ji=4194304),t}function ea(t){for(var a=[],s=0;31>s;s++)a.push(t);return a}function hi(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function fu(t,a,s,o,f,m){var v=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,_=t.expirationTimes,B=t.hiddenUpdates;for(s=v&~s;0<s;){var K=31-Ot(s),F=1<<K;j[K]=0,_[K]=-1;var U=B[K];if(U!==null)for(B[K]=null,K=0;K<U.length;K++){var I=U[K];I!==null&&(I.lane&=-536870913)}s&=~F}o!==0&&br(t,o,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(v&~a))}function br(t,a,s){t.pendingLanes|=a,t.suspendedLanes&=~a;var o=31-Ot(a);t.entangledLanes|=a,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function Go(t,a){var s=t.entangledLanes|=a;for(t=t.entanglements;s;){var o=31-Ot(s),f=1<<o;f&a|t[o]&a&&(t[o]|=a),s&=~f}}function Kn(t,a){var s=a&-a;return s=(s&42)!==0?1:pu(s),(s&(t.suspendedLanes|a))!==0?0:s}function pu(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function mu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Bm(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:xb(t.type))}function Lm(t,a){var s=W.p;try{return W.p=t,a()}finally{W.p=s}}var Ea=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Ea,Wt="__reactProps$"+Ea,Wi="__reactContainer$"+Ea,hu="__reactEvents$"+Ea,jx="__reactListeners$"+Ea,Nx="__reactHandles$"+Ea,qm="__reactResources$"+Ea,vr="__reactMarker$"+Ea;function gu(t){delete t[Ut],delete t[Wt],delete t[hu],delete t[jx],delete t[Nx]}function es(t){var a=t[Ut];if(a)return a;for(var s=t.parentNode;s;){if(a=s[Wi]||s[Ut]){if(s=a.alternate,a.child!==null||s!==null&&s.child!==null)for(t=sb(t);t!==null;){if(s=t[Ut])return s;t=sb(t)}return a}t=s,s=t.parentNode}return null}function ts(t){if(t=t[Ut]||t[Wi]){var a=t.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return t}return null}function Sr(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t.stateNode;throw Error(r(33))}function ns(t){var a=t[qm];return a||(a=t[qm]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Rt(t){t[vr]=!0}var Um=new Set,$m={};function gi(t,a){as(t,a),as(t+"Capture",a)}function as(t,a){for($m[t]=a,t=0;t<a.length;t++)Um.add(a[t])}var kx=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Im={},Pm={};function Ax(t){return Qi.call(Pm,t)?!0:Qi.call(Im,t)?!1:kx.test(t)?Pm[t]=!0:(Im[t]=!0,!1)}function Ho(t,a,s){if(Ax(a))if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(a);return;case"boolean":var o=a.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(a);return}}t.setAttribute(a,""+s)}}function Ko(t,a,s){if(s===null)t.removeAttribute(a);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttribute(a,""+s)}}function ta(t,a,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(a,s,""+o)}}function yn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Vm(t){var a=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Cx(t,a,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,a);if(!t.hasOwnProperty(a)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.set;return Object.defineProperty(t,a,{configurable:!0,get:function(){return f.call(this)},set:function(v){s=""+v,m.call(this,v)}}),Object.defineProperty(t,a,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(v){s=""+v},stopTracking:function(){t._valueTracker=null,delete t[a]}}}}function yu(t){if(!t._valueTracker){var a=Vm(t)?"checked":"value";t._valueTracker=Cx(t,a,""+t[a])}}function Gm(t){if(!t)return!1;var a=t._valueTracker;if(!a)return!0;var s=a.getValue(),o="";return t&&(o=Vm(t)?t.checked?"true":"false":t.value),t=o,t!==s?(a.setValue(t),!0):!1}function Qo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var _x=/[\n"\\]/g;function bn(t){return t.replace(_x,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function bu(t,a,s,o,f,m,v,j){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),a!=null?v==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+yn(a)):t.value!==""+yn(a)&&(t.value=""+yn(a)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),a!=null?vu(t,v,yn(a)):s!=null?vu(t,v,yn(s)):o!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+yn(j):t.removeAttribute("name")}function Hm(t,a,s,o,f,m,v,j){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),a!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||a!=null)){yu(t);return}s=s!=null?""+yn(s):"",a=a!=null?""+yn(a):s,j||a===t.value||(t.value=a),t.defaultValue=a}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=j?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),yu(t)}function vu(t,a,s){a==="number"&&Qo(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function is(t,a,s,o){if(t=t.options,a){a={};for(var f=0;f<s.length;f++)a["$"+s[f]]=!0;for(s=0;s<t.length;s++)f=a.hasOwnProperty("$"+t[s].value),t[s].selected!==f&&(t[s].selected=f),f&&o&&(t[s].defaultSelected=!0)}else{for(s=""+yn(s),a=null,f=0;f<t.length;f++){if(t[f].value===s){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}a!==null||t[f].disabled||(a=t[f])}a!==null&&(a.selected=!0)}}function Km(t,a,s){if(a!=null&&(a=""+yn(a),a!==t.value&&(t.value=a),s==null)){t.defaultValue!==a&&(t.defaultValue=a);return}t.defaultValue=s!=null?""+yn(s):""}function Qm(t,a,s,o){if(a==null){if(o!=null){if(s!=null)throw Error(r(92));if(fe(o)){if(1<o.length)throw Error(r(93));o=o[0]}s=o}s==null&&(s=""),a=s}s=yn(a),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),yu(t)}function ss(t,a){if(a){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=a;return}}t.textContent=a}var Tx=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Zm(t,a,s){var o=a.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(a,""):a==="float"?t.cssFloat="":t[a]="":o?t.setProperty(a,s):typeof s!="number"||s===0||Tx.has(a)?a==="float"?t.cssFloat=s:t[a]=(""+s).trim():t[a]=s+"px"}function Ym(t,a,s){if(a!=null&&typeof a!="object")throw Error(r(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||a!=null&&a.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in a)o=a[f],a.hasOwnProperty(f)&&s[f]!==o&&Zm(t,f,o)}else for(var m in a)a.hasOwnProperty(m)&&Zm(t,m,a[m])}function Su(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ex=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ox=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Zo(t){return Ox.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function na(){}var xu=null;function wu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var rs=null,os=null;function Fm(t){var a=ts(t);if(a&&(t=a.stateNode)){var s=t[Wt]||null;e:switch(t=a.stateNode,a.type){case"input":if(bu(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),a=s.name,s.type==="radio"&&a!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+bn(""+a)+'"][type="radio"]'),a=0;a<s.length;a++){var o=s[a];if(o!==t&&o.form===t.form){var f=o[Wt]||null;if(!f)throw Error(r(90));bu(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(a=0;a<s.length;a++)o=s[a],o.form===t.form&&Gm(o)}break e;case"textarea":Km(t,s.value,s.defaultValue);break e;case"select":a=s.value,a!=null&&is(t,!!s.multiple,a,!1)}}}var ju=!1;function Xm(t,a,s){if(ju)return t(a,s);ju=!0;try{var o=t(a);return o}finally{if(ju=!1,(rs!==null||os!==null)&&(Ml(),rs&&(a=rs,t=os,os=rs=null,Fm(a),t)))for(a=0;a<t.length;a++)Fm(t[a])}}function xr(t,a){var s=t.stateNode;if(s===null)return null;var o=s[Wt]||null;if(o===null)return null;s=o[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(r(231,a,typeof s));return s}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nu=!1;if(aa)try{var wr={};Object.defineProperty(wr,"passive",{get:function(){Nu=!0}}),window.addEventListener("test",wr,wr),window.removeEventListener("test",wr,wr)}catch{Nu=!1}var Oa=null,ku=null,Yo=null;function Jm(){if(Yo)return Yo;var t,a=ku,s=a.length,o,f="value"in Oa?Oa.value:Oa.textContent,m=f.length;for(t=0;t<s&&a[t]===f[t];t++);var v=s-t;for(o=1;o<=v&&a[s-o]===f[m-o];o++);return Yo=f.slice(t,1<o?1-o:void 0)}function Fo(t){var a=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&a===13&&(t=13)):t=a,t===10&&(t=13),32<=t||t===13?t:0}function Xo(){return!0}function Wm(){return!1}function en(t){function a(s,o,f,m,v){this._reactName=s,this._targetInst=f,this.type=o,this.nativeEvent=m,this.target=v,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(s=t[j],this[j]=s?s(m):m[j]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Xo:Wm,this.isPropagationStopped=Wm,this}return w(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),a}var yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jo=en(yi),jr=w({},yi,{view:0,detail:0}),Dx=en(jr),Au,Cu,Nr,Wo=w({},jr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Nr&&(Nr&&t.type==="mousemove"?(Au=t.screenX-Nr.screenX,Cu=t.screenY-Nr.screenY):Cu=Au=0,Nr=t),Au)},movementY:function(t){return"movementY"in t?t.movementY:Cu}}),eh=en(Wo),zx=w({},Wo,{dataTransfer:0}),Rx=en(zx),Mx=w({},jr,{relatedTarget:0}),_u=en(Mx),Bx=w({},yi,{animationName:0,elapsedTime:0,pseudoElement:0}),Lx=en(Bx),qx=w({},yi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ux=en(qx),$x=w({},yi,{data:0}),th=en($x),Ix={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Px={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Vx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gx(t){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(t):(t=Vx[t])?!!a[t]:!1}function Tu(){return Gx}var Hx=w({},jr,{key:function(t){if(t.key){var a=Ix[t.key]||t.key;if(a!=="Unidentified")return a}return t.type==="keypress"?(t=Fo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Px[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tu,charCode:function(t){return t.type==="keypress"?Fo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Fo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Kx=en(Hx),Qx=w({},Wo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nh=en(Qx),Zx=w({},jr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tu}),Yx=en(Zx),Fx=w({},yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xx=en(Fx),Jx=w({},Wo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Wx=en(Jx),ew=w({},yi,{newState:0,oldState:0}),tw=en(ew),nw=[9,13,27,32],Eu=aa&&"CompositionEvent"in window,kr=null;aa&&"documentMode"in document&&(kr=document.documentMode);var aw=aa&&"TextEvent"in window&&!kr,ah=aa&&(!Eu||kr&&8<kr&&11>=kr),ih=" ",sh=!1;function rh(t,a){switch(t){case"keyup":return nw.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function oh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ls=!1;function iw(t,a){switch(t){case"compositionend":return oh(a);case"keypress":return a.which!==32?null:(sh=!0,ih);case"textInput":return t=a.data,t===ih&&sh?null:t;default:return null}}function sw(t,a){if(ls)return t==="compositionend"||!Eu&&rh(t,a)?(t=Jm(),Yo=ku=Oa=null,ls=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return ah&&a.locale!=="ko"?null:a.data;default:return null}}var rw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lh(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a==="input"?!!rw[t.type]:a==="textarea"}function ch(t,a,s,o){rs?os?os.push(o):os=[o]:rs=o,a=Pl(a,"onChange"),0<a.length&&(s=new Jo("onChange","change",null,s,o),t.push({event:s,listeners:a}))}var Ar=null,Cr=null;function ow(t){Hy(t,0)}function el(t){var a=Sr(t);if(Gm(a))return t}function uh(t,a){if(t==="change")return a}var dh=!1;if(aa){var Ou;if(aa){var Du="oninput"in document;if(!Du){var fh=document.createElement("div");fh.setAttribute("oninput","return;"),Du=typeof fh.oninput=="function"}Ou=Du}else Ou=!1;dh=Ou&&(!document.documentMode||9<document.documentMode)}function ph(){Ar&&(Ar.detachEvent("onpropertychange",mh),Cr=Ar=null)}function mh(t){if(t.propertyName==="value"&&el(Cr)){var a=[];ch(a,Cr,t,wu(t)),Xm(ow,a)}}function lw(t,a,s){t==="focusin"?(ph(),Ar=a,Cr=s,Ar.attachEvent("onpropertychange",mh)):t==="focusout"&&ph()}function cw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return el(Cr)}function uw(t,a){if(t==="click")return el(a)}function dw(t,a){if(t==="input"||t==="change")return el(a)}function fw(t,a){return t===a&&(t!==0||1/t===1/a)||t!==t&&a!==a}var cn=typeof Object.is=="function"?Object.is:fw;function _r(t,a){if(cn(t,a))return!0;if(typeof t!="object"||t===null||typeof a!="object"||a===null)return!1;var s=Object.keys(t),o=Object.keys(a);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var f=s[o];if(!Qi.call(a,f)||!cn(t[f],a[f]))return!1}return!0}function hh(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function gh(t,a){var s=hh(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=a&&o>=a)return{node:s,offset:a-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=hh(s)}}function yh(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?yh(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function bh(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=Qo(t.document);a instanceof t.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)t=a.contentWindow;else break;a=Qo(t.document)}return a}function zu(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var pw=aa&&"documentMode"in document&&11>=document.documentMode,cs=null,Ru=null,Tr=null,Mu=!1;function vh(t,a,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Mu||cs==null||cs!==Qo(o)||(o=cs,"selectionStart"in o&&zu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Tr&&_r(Tr,o)||(Tr=o,o=Pl(Ru,"onSelect"),0<o.length&&(a=new Jo("onSelect","select",null,a,s),t.push({event:a,listeners:o}),a.target=cs)))}function bi(t,a){var s={};return s[t.toLowerCase()]=a.toLowerCase(),s["Webkit"+t]="webkit"+a,s["Moz"+t]="moz"+a,s}var us={animationend:bi("Animation","AnimationEnd"),animationiteration:bi("Animation","AnimationIteration"),animationstart:bi("Animation","AnimationStart"),transitionrun:bi("Transition","TransitionRun"),transitionstart:bi("Transition","TransitionStart"),transitioncancel:bi("Transition","TransitionCancel"),transitionend:bi("Transition","TransitionEnd")},Bu={},Sh={};aa&&(Sh=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function vi(t){if(Bu[t])return Bu[t];if(!us[t])return t;var a=us[t],s;for(s in a)if(a.hasOwnProperty(s)&&s in Sh)return Bu[t]=a[s];return t}var xh=vi("animationend"),wh=vi("animationiteration"),jh=vi("animationstart"),mw=vi("transitionrun"),hw=vi("transitionstart"),gw=vi("transitioncancel"),Nh=vi("transitionend"),kh=new Map,Lu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Lu.push("scrollEnd");function Bn(t,a){kh.set(t,a),gi(a,[t])}var tl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},vn=[],ds=0,qu=0;function nl(){for(var t=ds,a=qu=ds=0;a<t;){var s=vn[a];vn[a++]=null;var o=vn[a];vn[a++]=null;var f=vn[a];vn[a++]=null;var m=vn[a];if(vn[a++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}m!==0&&Ah(s,f,m)}}function al(t,a,s,o){vn[ds++]=t,vn[ds++]=a,vn[ds++]=s,vn[ds++]=o,qu|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Uu(t,a,s,o){return al(t,a,s,o),il(t)}function Si(t,a){return al(t,null,null,a),il(t)}function Ah(t,a,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var f=!1,m=t.return;m!==null;)m.childLanes|=s,o=m.alternate,o!==null&&(o.childLanes|=s),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&a!==null&&(f=31-Ot(s),t=m.hiddenUpdates,o=t[f],o===null?t[f]=[a]:o.push(a),a.lane=s|536870912),m):null}function il(t){if(50<Xr)throw Xr=0,Zd=null,Error(r(185));for(var a=t.return;a!==null;)t=a,a=t.return;return t.tag===3?t.stateNode:null}var fs={};function yw(t,a,s,o){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function un(t,a,s,o){return new yw(t,a,s,o)}function $u(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ia(t,a){var s=t.alternate;return s===null?(s=un(t.tag,a,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=a,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,a=t.dependencies,s.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function Ch(t,a){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=a,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,a=s.dependencies,t.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),t}function sl(t,a,s,o,f,m){var v=0;if(o=t,typeof t=="function")$u(t)&&(v=1);else if(typeof t=="string")v=wj(t,s,ee.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case ae:return t=un(31,s,a,f),t.elementType=ae,t.lanes=m,t;case A:return xi(s.children,f,m,a);case E:v=8,f|=24;break;case R:return t=un(12,s,a,f|2),t.elementType=R,t.lanes=m,t;case P:return t=un(13,s,a,f),t.elementType=P,t.lanes=m,t;case re:return t=un(19,s,a,f),t.elementType=re,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case X:v=10;break e;case G:v=9;break e;case V:v=11;break e;case O:v=14;break e;case L:v=16,o=null;break e}v=29,s=Error(r(130,t===null?"null":typeof t,"")),o=null}return a=un(v,s,a,f),a.elementType=t,a.type=o,a.lanes=m,a}function xi(t,a,s,o){return t=un(7,t,o,a),t.lanes=s,t}function Iu(t,a,s){return t=un(6,t,null,a),t.lanes=s,t}function _h(t){var a=un(18,null,null,0);return a.stateNode=t,a}function Pu(t,a,s){return a=un(4,t.children!==null?t.children:[],t.key,a),a.lanes=s,a.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},a}var Th=new WeakMap;function Sn(t,a){if(typeof t=="object"&&t!==null){var s=Th.get(t);return s!==void 0?s:(a={value:t,source:a,stack:gr(a)},Th.set(t,a),a)}return{value:t,source:a,stack:gr(a)}}var ps=[],ms=0,rl=null,Er=0,xn=[],wn=0,Da=null,Qn=1,Zn="";function sa(t,a){ps[ms++]=Er,ps[ms++]=rl,rl=t,Er=a}function Eh(t,a,s){xn[wn++]=Qn,xn[wn++]=Zn,xn[wn++]=Da,Da=t;var o=Qn;t=Zn;var f=32-Ot(o)-1;o&=~(1<<f),s+=1;var m=32-Ot(a)+f;if(30<m){var v=f-f%5;m=(o&(1<<v)-1).toString(32),o>>=v,f-=v,Qn=1<<32-Ot(a)+f|s<<f|o,Zn=m+t}else Qn=1<<m|s<<f|o,Zn=t}function Vu(t){t.return!==null&&(sa(t,1),Eh(t,1,0))}function Gu(t){for(;t===rl;)rl=ps[--ms],ps[ms]=null,Er=ps[--ms],ps[ms]=null;for(;t===Da;)Da=xn[--wn],xn[wn]=null,Zn=xn[--wn],xn[wn]=null,Qn=xn[--wn],xn[wn]=null}function Oh(t,a){xn[wn++]=Qn,xn[wn++]=Zn,xn[wn++]=Da,Qn=a.id,Zn=a.overflow,Da=t}var $t=null,lt=null,$e=!1,za=null,jn=!1,Hu=Error(r(519));function Ra(t){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Or(Sn(a,t)),Hu}function Dh(t){var a=t.stateNode,s=t.type,o=t.memoizedProps;switch(a[Ut]=t,a[Wt]=o,s){case"dialog":Le("cancel",a),Le("close",a);break;case"iframe":case"object":case"embed":Le("load",a);break;case"video":case"audio":for(s=0;s<Wr.length;s++)Le(Wr[s],a);break;case"source":Le("error",a);break;case"img":case"image":case"link":Le("error",a),Le("load",a);break;case"details":Le("toggle",a);break;case"input":Le("invalid",a),Hm(a,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Le("invalid",a);break;case"textarea":Le("invalid",a),Qm(a,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||a.textContent===""+s||o.suppressHydrationWarning===!0||Yy(a.textContent,s)?(o.popover!=null&&(Le("beforetoggle",a),Le("toggle",a)),o.onScroll!=null&&Le("scroll",a),o.onScrollEnd!=null&&Le("scrollend",a),o.onClick!=null&&(a.onclick=na),a=!0):a=!1,a||Ra(t,!0)}function zh(t){for($t=t.return;$t;)switch($t.tag){case 5:case 31:case 13:jn=!1;return;case 27:case 3:jn=!0;return;default:$t=$t.return}}function hs(t){if(t!==$t)return!1;if(!$e)return zh(t),$e=!0,!1;var a=t.tag,s;if((s=a!==3&&a!==27)&&((s=a===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||uf(t.type,t.memoizedProps)),s=!s),s&<&&Ra(t),zh(t),a===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));lt=ib(t)}else if(a===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));lt=ib(t)}else a===27?(a=lt,Za(t.type)?(t=hf,hf=null,lt=t):lt=a):lt=$t?kn(t.stateNode.nextSibling):null;return!0}function wi(){lt=$t=null,$e=!1}function Ku(){var t=za;return t!==null&&(sn===null?sn=t:sn.push.apply(sn,t),za=null),t}function Or(t){za===null?za=[t]:za.push(t)}var Qu=Xe(null),ji=null,ra=null;function Ma(t,a,s){ue(Qu,a._currentValue),a._currentValue=s}function oa(t){t._currentValue=Qu.current,J(Qu)}function Zu(t,a,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&a)!==a?(t.childLanes|=a,o!==null&&(o.childLanes|=a)):o!==null&&(o.childLanes&a)!==a&&(o.childLanes|=a),t===s)break;t=t.return}}function Yu(t,a,s,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var v=f.child;m=m.firstContext;e:for(;m!==null;){var j=m;m=f;for(var _=0;_<a.length;_++)if(j.context===a[_]){m.lanes|=s,j=m.alternate,j!==null&&(j.lanes|=s),Zu(m.return,s,t),o||(v=null);break e}m=j.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=s,m=v.alternate,m!==null&&(m.lanes|=s),Zu(v,s,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function gs(t,a,s,o){t=null;for(var f=a,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var j=f.type;cn(f.pendingProps.value,v.value)||(t!==null?t.push(j):t=[j])}}else if(f===Ae.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(io):t=[io])}f=f.return}t!==null&&Yu(a,t,s,o),a.flags|=262144}function ol(t){for(t=t.firstContext;t!==null;){if(!cn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ni(t){ji=t,ra=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function It(t){return Rh(ji,t)}function ll(t,a){return ji===null&&Ni(t),Rh(t,a)}function Rh(t,a){var s=a._currentValue;if(a={context:a,memoizedValue:s,next:null},ra===null){if(t===null)throw Error(r(308));ra=a,t.dependencies={lanes:0,firstContext:a},t.flags|=524288}else ra=ra.next=a;return s}var bw=typeof AbortController<"u"?AbortController:function(){var t=[],a=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){a.aborted=!0,t.forEach(function(s){return s()})}},vw=e.unstable_scheduleCallback,Sw=e.unstable_NormalPriority,At={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fu(){return{controller:new bw,data:new Map,refCount:0}}function Dr(t){t.refCount--,t.refCount===0&&vw(Sw,function(){t.controller.abort()})}var zr=null,Xu=0,ys=0,bs=null;function xw(t,a){if(zr===null){var s=zr=[];Xu=0,ys=ef(),bs={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Xu++,a.then(Mh,Mh),a}function Mh(){if(--Xu===0&&zr!==null){bs!==null&&(bs.status="fulfilled");var t=zr;zr=null,ys=0,bs=null;for(var a=0;a<t.length;a++)(0,t[a])()}}function ww(t,a){var s=[],o={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return t.then(function(){o.status="fulfilled",o.value=a;for(var f=0;f<s.length;f++)(0,s[f])(a)},function(f){for(o.status="rejected",o.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),o}var Bh=$.S;$.S=function(t,a){vy=Gt(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&xw(t,a),Bh!==null&&Bh(t,a)};var ki=Xe(null);function Ju(){var t=ki.current;return t!==null?t:at.pooledCache}function cl(t,a){a===null?ue(ki,ki.current):ue(ki,a.pool)}function Lh(){var t=Ju();return t===null?null:{parent:At._currentValue,pool:t}}var vs=Error(r(460)),Wu=Error(r(474)),ul=Error(r(542)),dl={then:function(){}};function qh(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Uh(t,a,s){switch(s=t[s],s===void 0?t.push(a):s!==a&&(a.then(na,na),a=s),a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Ih(t),t;default:if(typeof a.status=="string")a.then(na,na);else{if(t=at,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=a,t.status="pending",t.then(function(o){if(a.status==="pending"){var f=a;f.status="fulfilled",f.value=o}},function(o){if(a.status==="pending"){var f=a;f.status="rejected",f.reason=o}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw t=a.reason,Ih(t),t}throw Ci=a,vs}}function Ai(t){try{var a=t._init;return a(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ci=s,vs):s}}var Ci=null;function $h(){if(Ci===null)throw Error(r(459));var t=Ci;return Ci=null,t}function Ih(t){if(t===vs||t===ul)throw Error(r(483))}var Ss=null,Rr=0;function fl(t){var a=Rr;return Rr+=1,Ss===null&&(Ss=[]),Uh(Ss,t,a)}function Mr(t,a){a=a.props.ref,t.ref=a!==void 0?a:null}function pl(t,a){throw a.$$typeof===N?Error(r(525)):(t=Object.prototype.toString.call(a),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":t)))}function Ph(t){function a(z,T){if(t){var M=z.deletions;M===null?(z.deletions=[T],z.flags|=16):M.push(T)}}function s(z,T){if(!t)return null;for(;T!==null;)a(z,T),T=T.sibling;return null}function o(z){for(var T=new Map;z!==null;)z.key!==null?T.set(z.key,z):T.set(z.index,z),z=z.sibling;return T}function f(z,T){return z=ia(z,T),z.index=0,z.sibling=null,z}function m(z,T,M){return z.index=M,t?(M=z.alternate,M!==null?(M=M.index,M<T?(z.flags|=67108866,T):M):(z.flags|=67108866,T)):(z.flags|=1048576,T)}function v(z){return t&&z.alternate===null&&(z.flags|=67108866),z}function j(z,T,M,Y){return T===null||T.tag!==6?(T=Iu(M,z.mode,Y),T.return=z,T):(T=f(T,M),T.return=z,T)}function _(z,T,M,Y){var Se=M.type;return Se===A?K(z,T,M.props.children,Y,M.key):T!==null&&(T.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===L&&Ai(Se)===T.type)?(T=f(T,M.props),Mr(T,M),T.return=z,T):(T=sl(M.type,M.key,M.props,null,z.mode,Y),Mr(T,M),T.return=z,T)}function B(z,T,M,Y){return T===null||T.tag!==4||T.stateNode.containerInfo!==M.containerInfo||T.stateNode.implementation!==M.implementation?(T=Pu(M,z.mode,Y),T.return=z,T):(T=f(T,M.children||[]),T.return=z,T)}function K(z,T,M,Y,Se){return T===null||T.tag!==7?(T=xi(M,z.mode,Y,Se),T.return=z,T):(T=f(T,M),T.return=z,T)}function F(z,T,M){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=Iu(""+T,z.mode,M),T.return=z,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case C:return M=sl(T.type,T.key,T.props,null,z.mode,M),Mr(M,T),M.return=z,M;case D:return T=Pu(T,z.mode,M),T.return=z,T;case L:return T=Ai(T),F(z,T,M)}if(fe(T)||ve(T))return T=xi(T,z.mode,M,null),T.return=z,T;if(typeof T.then=="function")return F(z,fl(T),M);if(T.$$typeof===X)return F(z,ll(z,T),M);pl(z,T)}return null}function U(z,T,M,Y){var Se=T!==null?T.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return Se!==null?null:j(z,T,""+M,Y);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return M.key===Se?_(z,T,M,Y):null;case D:return M.key===Se?B(z,T,M,Y):null;case L:return M=Ai(M),U(z,T,M,Y)}if(fe(M)||ve(M))return Se!==null?null:K(z,T,M,Y,null);if(typeof M.then=="function")return U(z,T,fl(M),Y);if(M.$$typeof===X)return U(z,T,ll(z,M),Y);pl(z,M)}return null}function I(z,T,M,Y,Se){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return z=z.get(M)||null,j(T,z,""+Y,Se);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:return z=z.get(Y.key===null?M:Y.key)||null,_(T,z,Y,Se);case D:return z=z.get(Y.key===null?M:Y.key)||null,B(T,z,Y,Se);case L:return Y=Ai(Y),I(z,T,M,Y,Se)}if(fe(Y)||ve(Y))return z=z.get(M)||null,K(T,z,Y,Se,null);if(typeof Y.then=="function")return I(z,T,M,fl(Y),Se);if(Y.$$typeof===X)return I(z,T,M,ll(T,Y),Se);pl(T,Y)}return null}function me(z,T,M,Y){for(var Se=null,Ve=null,ye=T,Oe=T=0,Ue=null;ye!==null&&Oe<M.length;Oe++){ye.index>Oe?(Ue=ye,ye=null):Ue=ye.sibling;var Ge=U(z,ye,M[Oe],Y);if(Ge===null){ye===null&&(ye=Ue);break}t&&ye&&Ge.alternate===null&&a(z,ye),T=m(Ge,T,Oe),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge,ye=Ue}if(Oe===M.length)return s(z,ye),$e&&sa(z,Oe),Se;if(ye===null){for(;Oe<M.length;Oe++)ye=F(z,M[Oe],Y),ye!==null&&(T=m(ye,T,Oe),Ve===null?Se=ye:Ve.sibling=ye,Ve=ye);return $e&&sa(z,Oe),Se}for(ye=o(ye);Oe<M.length;Oe++)Ue=I(ye,z,Oe,M[Oe],Y),Ue!==null&&(t&&Ue.alternate!==null&&ye.delete(Ue.key===null?Oe:Ue.key),T=m(Ue,T,Oe),Ve===null?Se=Ue:Ve.sibling=Ue,Ve=Ue);return t&&ye.forEach(function(Wa){return a(z,Wa)}),$e&&sa(z,Oe),Se}function we(z,T,M,Y){if(M==null)throw Error(r(151));for(var Se=null,Ve=null,ye=T,Oe=T=0,Ue=null,Ge=M.next();ye!==null&&!Ge.done;Oe++,Ge=M.next()){ye.index>Oe?(Ue=ye,ye=null):Ue=ye.sibling;var Wa=U(z,ye,Ge.value,Y);if(Wa===null){ye===null&&(ye=Ue);break}t&&ye&&Wa.alternate===null&&a(z,ye),T=m(Wa,T,Oe),Ve===null?Se=Wa:Ve.sibling=Wa,Ve=Wa,ye=Ue}if(Ge.done)return s(z,ye),$e&&sa(z,Oe),Se;if(ye===null){for(;!Ge.done;Oe++,Ge=M.next())Ge=F(z,Ge.value,Y),Ge!==null&&(T=m(Ge,T,Oe),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge);return $e&&sa(z,Oe),Se}for(ye=o(ye);!Ge.done;Oe++,Ge=M.next())Ge=I(ye,z,Oe,Ge.value,Y),Ge!==null&&(t&&Ge.alternate!==null&&ye.delete(Ge.key===null?Oe:Ge.key),T=m(Ge,T,Oe),Ve===null?Se=Ge:Ve.sibling=Ge,Ve=Ge);return t&&ye.forEach(function(zj){return a(z,zj)}),$e&&sa(z,Oe),Se}function et(z,T,M,Y){if(typeof M=="object"&&M!==null&&M.type===A&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case C:e:{for(var Se=M.key;T!==null;){if(T.key===Se){if(Se=M.type,Se===A){if(T.tag===7){s(z,T.sibling),Y=f(T,M.props.children),Y.return=z,z=Y;break e}}else if(T.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===L&&Ai(Se)===T.type){s(z,T.sibling),Y=f(T,M.props),Mr(Y,M),Y.return=z,z=Y;break e}s(z,T);break}else a(z,T);T=T.sibling}M.type===A?(Y=xi(M.props.children,z.mode,Y,M.key),Y.return=z,z=Y):(Y=sl(M.type,M.key,M.props,null,z.mode,Y),Mr(Y,M),Y.return=z,z=Y)}return v(z);case D:e:{for(Se=M.key;T!==null;){if(T.key===Se)if(T.tag===4&&T.stateNode.containerInfo===M.containerInfo&&T.stateNode.implementation===M.implementation){s(z,T.sibling),Y=f(T,M.children||[]),Y.return=z,z=Y;break e}else{s(z,T);break}else a(z,T);T=T.sibling}Y=Pu(M,z.mode,Y),Y.return=z,z=Y}return v(z);case L:return M=Ai(M),et(z,T,M,Y)}if(fe(M))return me(z,T,M,Y);if(ve(M)){if(Se=ve(M),typeof Se!="function")throw Error(r(150));return M=Se.call(M),we(z,T,M,Y)}if(typeof M.then=="function")return et(z,T,fl(M),Y);if(M.$$typeof===X)return et(z,T,ll(z,M),Y);pl(z,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,T!==null&&T.tag===6?(s(z,T.sibling),Y=f(T,M),Y.return=z,z=Y):(s(z,T),Y=Iu(M,z.mode,Y),Y.return=z,z=Y),v(z)):s(z,T)}return function(z,T,M,Y){try{Rr=0;var Se=et(z,T,M,Y);return Ss=null,Se}catch(ye){if(ye===vs||ye===ul)throw ye;var Ve=un(29,ye,null,z.mode);return Ve.lanes=Y,Ve.return=z,Ve}}}var _i=Ph(!0),Vh=Ph(!1),Ba=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function La(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function qa(t,a,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(Ke&2)!==0){var f=o.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),o.pending=a,a=il(t),Ah(t,null,s),a}return al(t,o,a,s),il(t)}function Br(t,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,Go(t,s)}}function nd(t,a){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var f=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var v={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?f=m=v:m=m.next=v,s=s.next}while(s!==null);m===null?f=m=a:m=m.next=a}else f=m=a;s={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=a:t.next=a,s.lastBaseUpdate=a}var ad=!1;function Lr(){if(ad){var t=bs;if(t!==null)throw t}}function qr(t,a,s,o){ad=!1;var f=t.updateQueue;Ba=!1;var m=f.firstBaseUpdate,v=f.lastBaseUpdate,j=f.shared.pending;if(j!==null){f.shared.pending=null;var _=j,B=_.next;_.next=null,v===null?m=B:v.next=B,v=_;var K=t.alternate;K!==null&&(K=K.updateQueue,j=K.lastBaseUpdate,j!==v&&(j===null?K.firstBaseUpdate=B:j.next=B,K.lastBaseUpdate=_))}if(m!==null){var F=f.baseState;v=0,K=B=_=null,j=m;do{var U=j.lane&-536870913,I=U!==j.lane;if(I?(qe&U)===U:(o&U)===U){U!==0&&U===ys&&(ad=!0),K!==null&&(K=K.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var me=t,we=j;U=a;var et=s;switch(we.tag){case 1:if(me=we.payload,typeof me=="function"){F=me.call(et,F,U);break e}F=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=we.payload,U=typeof me=="function"?me.call(et,F,U):me,U==null)break e;F=w({},F,U);break e;case 2:Ba=!0}}U=j.callback,U!==null&&(t.flags|=64,I&&(t.flags|=8192),I=f.callbacks,I===null?f.callbacks=[U]:I.push(U))}else I={lane:U,tag:j.tag,payload:j.payload,callback:j.callback,next:null},K===null?(B=K=I,_=F):K=K.next=I,v|=U;if(j=j.next,j===null){if(j=f.shared.pending,j===null)break;I=j,j=I.next,I.next=null,f.lastBaseUpdate=I,f.shared.pending=null}}while(!0);K===null&&(_=F),f.baseState=_,f.firstBaseUpdate=B,f.lastBaseUpdate=K,m===null&&(f.shared.lanes=0),Va|=v,t.lanes=v,t.memoizedState=F}}function Gh(t,a){if(typeof t!="function")throw Error(r(191,t));t.call(a)}function Hh(t,a){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Gh(s[t],a)}var xs=Xe(null),ml=Xe(0);function Kh(t,a){t=ga,ue(ml,t),ue(xs,a),ga=t|a.baseLanes}function id(){ue(ml,ga),ue(xs,xs.current)}function sd(){ga=ml.current,J(xs),J(ml)}var dn=Xe(null),Nn=null;function Ua(t){var a=t.alternate;ue(St,St.current&1),ue(dn,t),Nn===null&&(a===null||xs.current!==null||a.memoizedState!==null)&&(Nn=t)}function rd(t){ue(St,St.current),ue(dn,t),Nn===null&&(Nn=t)}function Qh(t){t.tag===22?(ue(St,St.current),ue(dn,t),Nn===null&&(Nn=t)):$a()}function $a(){ue(St,St.current),ue(dn,dn.current)}function fn(t){J(dn),Nn===t&&(Nn=null),J(St)}var St=Xe(0);function hl(t){for(var a=t;a!==null;){if(a.tag===13){var s=a.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||pf(s)||mf(s)))return a}else if(a.tag===19&&(a.memoizedProps.revealOrder==="forwards"||a.memoizedProps.revealOrder==="backwards"||a.memoizedProps.revealOrder==="unstable_legacy-backwards"||a.memoizedProps.revealOrder==="together")){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var la=0,Ee=null,Je=null,Ct=null,gl=!1,ws=!1,Ti=!1,yl=0,Ur=0,js=null,jw=0;function yt(){throw Error(r(321))}function od(t,a){if(a===null)return!1;for(var s=0;s<a.length&&s<t.length;s++)if(!cn(t[s],a[s]))return!1;return!0}function ld(t,a,s,o,f,m){return la=m,Ee=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,$.H=t===null||t.memoizedState===null?Eg:jd,Ti=!1,m=s(o,f),Ti=!1,ws&&(m=Yh(a,s,o,f)),Zh(t),m}function Zh(t){$.H=Pr;var a=Je!==null&&Je.next!==null;if(la=0,Ct=Je=Ee=null,gl=!1,Ur=0,js=null,a)throw Error(r(300));t===null||_t||(t=t.dependencies,t!==null&&ol(t)&&(_t=!0))}function Yh(t,a,s,o){Ee=t;var f=0;do{if(ws&&(js=null),Ur=0,ws=!1,25<=f)throw Error(r(301));if(f+=1,Ct=Je=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}$.H=Og,m=a(s,o)}while(ws);return m}function Nw(){var t=$.H,a=t.useState()[0];return a=typeof a.then=="function"?$r(a):a,t=t.useState()[0],(Je!==null?Je.memoizedState:null)!==t&&(Ee.flags|=1024),a}function cd(){var t=yl!==0;return yl=0,t}function ud(t,a,s){a.updateQueue=t.updateQueue,a.flags&=-2053,t.lanes&=~s}function dd(t){if(gl){for(t=t.memoizedState;t!==null;){var a=t.queue;a!==null&&(a.pending=null),t=t.next}gl=!1}la=0,Ct=Je=Ee=null,ws=!1,Ur=yl=0,js=null}function Kt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Ee.memoizedState=Ct=t:Ct=Ct.next=t,Ct}function xt(){if(Je===null){var t=Ee.alternate;t=t!==null?t.memoizedState:null}else t=Je.next;var a=Ct===null?Ee.memoizedState:Ct.next;if(a!==null)Ct=a,Je=t;else{if(t===null)throw Ee.alternate===null?Error(r(467)):Error(r(310));Je=t,t={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},Ct===null?Ee.memoizedState=Ct=t:Ct=Ct.next=t}return Ct}function bl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $r(t){var a=Ur;return Ur+=1,js===null&&(js=[]),t=Uh(js,t,a),a=Ee,(Ct===null?a.memoizedState:Ct.next)===null&&(a=a.alternate,$.H=a===null||a.memoizedState===null?Eg:jd),t}function vl(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return $r(t);if(t.$$typeof===X)return It(t)}throw Error(r(438,String(t)))}function fd(t){var a=null,s=Ee.updateQueue;if(s!==null&&(a=s.memoCache),a==null){var o=Ee.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(a={data:o.data.map(function(f){return f.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),s===null&&(s=bl(),Ee.updateQueue=s),s.memoCache=a,s=a.data[a.index],s===void 0)for(s=a.data[a.index]=Array(t),o=0;o<t;o++)s[o]=_e;return a.index++,s}function ca(t,a){return typeof a=="function"?a(t):a}function Sl(t){var a=xt();return pd(a,Je,t)}function pd(t,a,s){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=s;var f=t.baseQueue,m=o.pending;if(m!==null){if(f!==null){var v=f.next;f.next=m.next,m.next=v}a.baseQueue=f=m,o.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{a=f.next;var j=v=null,_=null,B=a,K=!1;do{var F=B.lane&-536870913;if(F!==B.lane?(qe&F)===F:(la&F)===F){var U=B.revertLane;if(U===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),F===ys&&(K=!0);else if((la&U)===U){B=B.next,U===ys&&(K=!0);continue}else F={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},_===null?(j=_=F,v=m):_=_.next=F,Ee.lanes|=U,Va|=U;F=B.action,Ti&&s(m,F),m=B.hasEagerState?B.eagerState:s(m,F)}else U={lane:F,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},_===null?(j=_=U,v=m):_=_.next=U,Ee.lanes|=F,Va|=F;B=B.next}while(B!==null&&B!==a);if(_===null?v=m:_.next=j,!cn(m,t.memoizedState)&&(_t=!0,K&&(s=bs,s!==null)))throw s;t.memoizedState=m,t.baseState=v,t.baseQueue=_,o.lastRenderedState=m}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function md(t){var a=xt(),s=a.queue;if(s===null)throw Error(r(311));s.lastRenderedReducer=t;var o=s.dispatch,f=s.pending,m=a.memoizedState;if(f!==null){s.pending=null;var v=f=f.next;do m=t(m,v.action),v=v.next;while(v!==f);cn(m,a.memoizedState)||(_t=!0),a.memoizedState=m,a.baseQueue===null&&(a.baseState=m),s.lastRenderedState=m}return[m,o]}function Fh(t,a,s){var o=Ee,f=xt(),m=$e;if(m){if(s===void 0)throw Error(r(407));s=s()}else s=a();var v=!cn((Je||f).memoizedState,s);if(v&&(f.memoizedState=s,_t=!0),f=f.queue,yd(Wh.bind(null,o,f,t),[t]),f.getSnapshot!==a||v||Ct!==null&&Ct.memoizedState.tag&1){if(o.flags|=2048,Ns(9,{destroy:void 0},Jh.bind(null,o,f,s,a),null),at===null)throw Error(r(349));m||(la&127)!==0||Xh(o,a,s)}return s}function Xh(t,a,s){t.flags|=16384,t={getSnapshot:a,value:s},a=Ee.updateQueue,a===null?(a=bl(),Ee.updateQueue=a,a.stores=[t]):(s=a.stores,s===null?a.stores=[t]:s.push(t))}function Jh(t,a,s,o){a.value=s,a.getSnapshot=o,eg(a)&&tg(t)}function Wh(t,a,s){return s(function(){eg(a)&&tg(t)})}function eg(t){var a=t.getSnapshot;t=t.value;try{var s=a();return!cn(t,s)}catch{return!0}}function tg(t){var a=Si(t,2);a!==null&&rn(a,t,2)}function hd(t){var a=Kt();if(typeof t=="function"){var s=t;if(t=s(),Ti){qt(!0);try{s()}finally{qt(!1)}}}return a.memoizedState=a.baseState=t,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:t},a}function ng(t,a,s,o){return t.baseState=s,pd(t,Je,typeof o=="function"?o:ca)}function kw(t,a,s,o,f){if(jl(t))throw Error(r(485));if(t=a.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){m.listeners.push(v)}};$.T!==null?s(!0):m.isTransition=!1,o(m),s=a.pending,s===null?(m.next=a.pending=m,ag(a,m)):(m.next=s.next,a.pending=s.next=m)}}function ag(t,a){var s=a.action,o=a.payload,f=t.state;if(a.isTransition){var m=$.T,v={};$.T=v;try{var j=s(f,o),_=$.S;_!==null&&_(v,j),ig(t,a,j)}catch(B){gd(t,a,B)}finally{m!==null&&v.types!==null&&(m.types=v.types),$.T=m}}else try{m=s(f,o),ig(t,a,m)}catch(B){gd(t,a,B)}}function ig(t,a,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){sg(t,a,o)},function(o){return gd(t,a,o)}):sg(t,a,s)}function sg(t,a,s){a.status="fulfilled",a.value=s,rg(a),t.state=s,a=t.pending,a!==null&&(s=a.next,s===a?t.pending=null:(s=s.next,a.next=s,ag(t,s)))}function gd(t,a,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do a.status="rejected",a.reason=s,rg(a),a=a.next;while(a!==o)}t.action=null}function rg(t){t=t.listeners;for(var a=0;a<t.length;a++)(0,t[a])()}function og(t,a){return a}function lg(t,a){if($e){var s=at.formState;if(s!==null){e:{var o=Ee;if($e){if(lt){t:{for(var f=lt,m=jn;f.nodeType!==8;){if(!m){f=null;break t}if(f=kn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){lt=kn(f.nextSibling),o=f.data==="F!";break e}}Ra(o)}o=!1}o&&(a=s[0])}}return s=Kt(),s.memoizedState=s.baseState=a,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:og,lastRenderedState:a},s.queue=o,s=Cg.bind(null,Ee,o),o.dispatch=s,o=hd(!1),m=wd.bind(null,Ee,!1,o.queue),o=Kt(),f={state:a,dispatch:null,action:t,pending:null},o.queue=f,s=kw.bind(null,Ee,f,m,s),f.dispatch=s,o.memoizedState=t,[a,s,!1]}function cg(t){var a=xt();return ug(a,Je,t)}function ug(t,a,s){if(a=pd(t,a,og)[0],t=Sl(ca)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var o=$r(a)}catch(v){throw v===vs?ul:v}else o=a;a=xt();var f=a.queue,m=f.dispatch;return s!==a.memoizedState&&(Ee.flags|=2048,Ns(9,{destroy:void 0},Aw.bind(null,f,s),null)),[o,m,t]}function Aw(t,a){t.action=a}function dg(t){var a=xt(),s=Je;if(s!==null)return ug(a,s,t);xt(),a=a.memoizedState,s=xt();var o=s.queue.dispatch;return s.memoizedState=t,[a,o,!1]}function Ns(t,a,s,o){return t={tag:t,create:s,deps:o,inst:a,next:null},a=Ee.updateQueue,a===null&&(a=bl(),Ee.updateQueue=a),s=a.lastEffect,s===null?a.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,a.lastEffect=t),t}function fg(){return xt().memoizedState}function xl(t,a,s,o){var f=Kt();Ee.flags|=t,f.memoizedState=Ns(1|a,{destroy:void 0},s,o===void 0?null:o)}function wl(t,a,s,o){var f=xt();o=o===void 0?null:o;var m=f.memoizedState.inst;Je!==null&&o!==null&&od(o,Je.memoizedState.deps)?f.memoizedState=Ns(a,m,s,o):(Ee.flags|=t,f.memoizedState=Ns(1|a,m,s,o))}function pg(t,a){xl(8390656,8,t,a)}function yd(t,a){wl(2048,8,t,a)}function Cw(t){Ee.flags|=4;var a=Ee.updateQueue;if(a===null)a=bl(),Ee.updateQueue=a,a.events=[t];else{var s=a.events;s===null?a.events=[t]:s.push(t)}}function mg(t){var a=xt().memoizedState;return Cw({ref:a,nextImpl:t}),function(){if((Ke&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function hg(t,a){return wl(4,2,t,a)}function gg(t,a){return wl(4,4,t,a)}function yg(t,a){if(typeof a=="function"){t=t();var s=a(t);return function(){typeof s=="function"?s():a(null)}}if(a!=null)return t=t(),a.current=t,function(){a.current=null}}function bg(t,a,s){s=s!=null?s.concat([t]):null,wl(4,4,yg.bind(null,a,t),s)}function bd(){}function vg(t,a){var s=xt();a=a===void 0?null:a;var o=s.memoizedState;return a!==null&&od(a,o[1])?o[0]:(s.memoizedState=[t,a],t)}function Sg(t,a){var s=xt();a=a===void 0?null:a;var o=s.memoizedState;if(a!==null&&od(a,o[1]))return o[0];if(o=t(),Ti){qt(!0);try{t()}finally{qt(!1)}}return s.memoizedState=[o,a],o}function vd(t,a,s){return s===void 0||(la&1073741824)!==0&&(qe&261930)===0?t.memoizedState=a:(t.memoizedState=s,t=xy(),Ee.lanes|=t,Va|=t,s)}function xg(t,a,s,o){return cn(s,a)?s:xs.current!==null?(t=vd(t,s,o),cn(t,a)||(_t=!0),t):(la&42)===0||(la&1073741824)!==0&&(qe&261930)===0?(_t=!0,t.memoizedState=s):(t=xy(),Ee.lanes|=t,Va|=t,a)}function wg(t,a,s,o,f){var m=W.p;W.p=m!==0&&8>m?m:8;var v=$.T,j={};$.T=j,wd(t,!1,a,s);try{var _=f(),B=$.S;if(B!==null&&B(j,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var K=ww(_,o);Ir(t,a,K,hn(t))}else Ir(t,a,o,hn(t))}catch(F){Ir(t,a,{then:function(){},status:"rejected",reason:F},hn())}finally{W.p=m,v!==null&&j.types!==null&&(v.types=j.types),$.T=v}}function _w(){}function Sd(t,a,s,o){if(t.tag!==5)throw Error(r(476));var f=jg(t).queue;wg(t,f,a,pe,s===null?_w:function(){return Ng(t),s(o)})}function jg(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:pe},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:s},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Ng(t){var a=jg(t);a.next===null&&(a=t.alternate.memoizedState),Ir(t,a.next.queue,{},hn())}function xd(){return It(io)}function kg(){return xt().memoizedState}function Ag(){return xt().memoizedState}function Tw(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var s=hn();t=La(s);var o=qa(a,t,s);o!==null&&(rn(o,a,s),Br(o,a,s)),a={cache:Fu()},t.payload=a;return}a=a.return}}function Ew(t,a,s){var o=hn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},jl(t)?_g(a,s):(s=Uu(t,a,s,o),s!==null&&(rn(s,t,o),Tg(s,a,o)))}function Cg(t,a,s){var o=hn();Ir(t,a,s,o)}function Ir(t,a,s,o){var f={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(jl(t))_g(a,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=a.lastRenderedReducer,m!==null))try{var v=a.lastRenderedState,j=m(v,s);if(f.hasEagerState=!0,f.eagerState=j,cn(j,v))return al(t,a,f,0),at===null&&nl(),!1}catch{}if(s=Uu(t,a,f,o),s!==null)return rn(s,t,o),Tg(s,a,o),!0}return!1}function wd(t,a,s,o){if(o={lane:2,revertLane:ef(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},jl(t)){if(a)throw Error(r(479))}else a=Uu(t,s,o,2),a!==null&&rn(a,t,2)}function jl(t){var a=t.alternate;return t===Ee||a!==null&&a===Ee}function _g(t,a){ws=gl=!0;var s=t.pending;s===null?a.next=a:(a.next=s.next,s.next=a),t.pending=a}function Tg(t,a,s){if((s&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,s|=o,a.lanes=s,Go(t,s)}}var Pr={readContext:It,use:vl,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};Pr.useEffectEvent=yt;var Eg={readContext:It,use:vl,useCallback:function(t,a){return Kt().memoizedState=[t,a===void 0?null:a],t},useContext:It,useEffect:pg,useImperativeHandle:function(t,a,s){s=s!=null?s.concat([t]):null,xl(4194308,4,yg.bind(null,a,t),s)},useLayoutEffect:function(t,a){return xl(4194308,4,t,a)},useInsertionEffect:function(t,a){xl(4,2,t,a)},useMemo:function(t,a){var s=Kt();a=a===void 0?null:a;var o=t();if(Ti){qt(!0);try{t()}finally{qt(!1)}}return s.memoizedState=[o,a],o},useReducer:function(t,a,s){var o=Kt();if(s!==void 0){var f=s(a);if(Ti){qt(!0);try{s(a)}finally{qt(!1)}}}else f=a;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=Ew.bind(null,Ee,t),[o.memoizedState,t]},useRef:function(t){var a=Kt();return t={current:t},a.memoizedState=t},useState:function(t){t=hd(t);var a=t.queue,s=Cg.bind(null,Ee,a);return a.dispatch=s,[t.memoizedState,s]},useDebugValue:bd,useDeferredValue:function(t,a){var s=Kt();return vd(s,t,a)},useTransition:function(){var t=hd(!1);return t=wg.bind(null,Ee,t.queue,!0,!1),Kt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,s){var o=Ee,f=Kt();if($e){if(s===void 0)throw Error(r(407));s=s()}else{if(s=a(),at===null)throw Error(r(349));(qe&127)!==0||Xh(o,a,s)}f.memoizedState=s;var m={value:s,getSnapshot:a};return f.queue=m,pg(Wh.bind(null,o,m,t),[t]),o.flags|=2048,Ns(9,{destroy:void 0},Jh.bind(null,o,m,s,a),null),s},useId:function(){var t=Kt(),a=at.identifierPrefix;if($e){var s=Zn,o=Qn;s=(o&~(1<<32-Ot(o)-1)).toString(32)+s,a="_"+a+"R_"+s,s=yl++,0<s&&(a+="H"+s.toString(32)),a+="_"}else s=jw++,a="_"+a+"r_"+s.toString(32)+"_";return t.memoizedState=a},useHostTransitionStatus:xd,useFormState:lg,useActionState:lg,useOptimistic:function(t){var a=Kt();a.memoizedState=a.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=s,a=wd.bind(null,Ee,!0,s),s.dispatch=a,[t,a]},useMemoCache:fd,useCacheRefresh:function(){return Kt().memoizedState=Tw.bind(null,Ee)},useEffectEvent:function(t){var a=Kt(),s={impl:t};return a.memoizedState=s,function(){if((Ke&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}},jd={readContext:It,use:vl,useCallback:vg,useContext:It,useEffect:yd,useImperativeHandle:bg,useInsertionEffect:hg,useLayoutEffect:gg,useMemo:Sg,useReducer:Sl,useRef:fg,useState:function(){return Sl(ca)},useDebugValue:bd,useDeferredValue:function(t,a){var s=xt();return xg(s,Je.memoizedState,t,a)},useTransition:function(){var t=Sl(ca)[0],a=xt().memoizedState;return[typeof t=="boolean"?t:$r(t),a]},useSyncExternalStore:Fh,useId:kg,useHostTransitionStatus:xd,useFormState:cg,useActionState:cg,useOptimistic:function(t,a){var s=xt();return ng(s,Je,t,a)},useMemoCache:fd,useCacheRefresh:Ag};jd.useEffectEvent=mg;var Og={readContext:It,use:vl,useCallback:vg,useContext:It,useEffect:yd,useImperativeHandle:bg,useInsertionEffect:hg,useLayoutEffect:gg,useMemo:Sg,useReducer:md,useRef:fg,useState:function(){return md(ca)},useDebugValue:bd,useDeferredValue:function(t,a){var s=xt();return Je===null?vd(s,t,a):xg(s,Je.memoizedState,t,a)},useTransition:function(){var t=md(ca)[0],a=xt().memoizedState;return[typeof t=="boolean"?t:$r(t),a]},useSyncExternalStore:Fh,useId:kg,useHostTransitionStatus:xd,useFormState:dg,useActionState:dg,useOptimistic:function(t,a){var s=xt();return Je!==null?ng(s,Je,t,a):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:fd,useCacheRefresh:Ag};Og.useEffectEvent=mg;function Nd(t,a,s,o){a=t.memoizedState,s=s(o,a),s=s==null?a:w({},a,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var kd={enqueueSetState:function(t,a,s){t=t._reactInternals;var o=hn(),f=La(o);f.payload=a,s!=null&&(f.callback=s),a=qa(t,f,o),a!==null&&(rn(a,t,o),Br(a,t,o))},enqueueReplaceState:function(t,a,s){t=t._reactInternals;var o=hn(),f=La(o);f.tag=1,f.payload=a,s!=null&&(f.callback=s),a=qa(t,f,o),a!==null&&(rn(a,t,o),Br(a,t,o))},enqueueForceUpdate:function(t,a){t=t._reactInternals;var s=hn(),o=La(s);o.tag=2,a!=null&&(o.callback=a),a=qa(t,o,s),a!==null&&(rn(a,t,s),Br(a,t,s))}};function Dg(t,a,s,o,f,m,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,m,v):a.prototype&&a.prototype.isPureReactComponent?!_r(s,o)||!_r(f,m):!0}function zg(t,a,s,o){t=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(s,o),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(s,o),a.state!==t&&kd.enqueueReplaceState(a,a.state,null)}function Ei(t,a){var s=a;if("ref"in a){s={};for(var o in a)o!=="ref"&&(s[o]=a[o])}if(t=t.defaultProps){s===a&&(s=w({},s));for(var f in t)s[f]===void 0&&(s[f]=t[f])}return s}function Rg(t){tl(t)}function Mg(t){console.error(t)}function Bg(t){tl(t)}function Nl(t,a){try{var s=t.onUncaughtError;s(a.value,{componentStack:a.stack})}catch(o){setTimeout(function(){throw o})}}function Lg(t,a,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ad(t,a,s){return s=La(s),s.tag=3,s.payload={element:null},s.callback=function(){Nl(t,a)},s}function qg(t){return t=La(t),t.tag=3,t}function Ug(t,a,s,o){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var m=o.value;t.payload=function(){return f(m)},t.callback=function(){Lg(a,s,o)}}var v=s.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Lg(a,s,o),typeof f!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function Ow(t,a,s,o,f){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(a=s.alternate,a!==null&&gs(a,s,f,!0),s=dn.current,s!==null){switch(s.tag){case 31:case 13:return Nn===null?Bl():s.alternate===null&&bt===0&&(bt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,o===dl?s.flags|=16384:(a=s.updateQueue,a===null?s.updateQueue=new Set([o]):a.add(o),Xd(t,o,f)),!1;case 22:return s.flags|=65536,o===dl?s.flags|=16384:(a=s.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=a):(s=a.retryQueue,s===null?a.retryQueue=new Set([o]):s.add(o)),Xd(t,o,f)),!1}throw Error(r(435,s.tag))}return Xd(t,o,f),Bl(),!1}if($e)return a=dn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=f,o!==Hu&&(t=Error(r(422),{cause:o}),Or(Sn(t,s)))):(o!==Hu&&(a=Error(r(423),{cause:o}),Or(Sn(a,s))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Sn(o,s),f=Ad(t.stateNode,o,f),nd(t,f),bt!==4&&(bt=2)),!1;var m=Error(r(520),{cause:o});if(m=Sn(m,s),Fr===null?Fr=[m]:Fr.push(m),bt!==4&&(bt=2),a===null)return!0;o=Sn(o,s),s=a;do{switch(s.tag){case 3:return s.flags|=65536,t=f&-f,s.lanes|=t,t=Ad(s.stateNode,o,t),nd(s,t),!1;case 1:if(a=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ga===null||!Ga.has(m))))return s.flags|=65536,f&=-f,s.lanes|=f,f=qg(f),Ug(f,t,s,o),nd(s,f),!1}s=s.return}while(s!==null);return!1}var Cd=Error(r(461)),_t=!1;function Pt(t,a,s,o){a.child=t===null?Vh(a,null,s,o):_i(a,t.child,s,o)}function $g(t,a,s,o,f){s=s.render;var m=a.ref;if("ref"in o){var v={};for(var j in o)j!=="ref"&&(v[j]=o[j])}else v=o;return Ni(a),o=ld(t,a,s,v,m,f),j=cd(),t!==null&&!_t?(ud(t,a,f),ua(t,a,f)):($e&&j&&Vu(a),a.flags|=1,Pt(t,a,o,f),a.child)}function Ig(t,a,s,o,f){if(t===null){var m=s.type;return typeof m=="function"&&!$u(m)&&m.defaultProps===void 0&&s.compare===null?(a.tag=15,a.type=m,Pg(t,a,m,o,f)):(t=sl(s.type,null,o,a,a.mode,f),t.ref=a.ref,t.return=a,a.child=t)}if(m=t.child,!Md(t,f)){var v=m.memoizedProps;if(s=s.compare,s=s!==null?s:_r,s(v,o)&&t.ref===a.ref)return ua(t,a,f)}return a.flags|=1,t=ia(m,o),t.ref=a.ref,t.return=a,a.child=t}function Pg(t,a,s,o,f){if(t!==null){var m=t.memoizedProps;if(_r(m,o)&&t.ref===a.ref)if(_t=!1,a.pendingProps=o=m,Md(t,f))(t.flags&131072)!==0&&(_t=!0);else return a.lanes=t.lanes,ua(t,a,f)}return _d(t,a,s,o,f)}function Vg(t,a,s,o){var f=o.children,m=t!==null?t.memoizedState:null;if(t===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((a.flags&128)!==0){if(m=m!==null?m.baseLanes|s:s,t!==null){for(o=a.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~m}else o=0,a.child=null;return Gg(t,a,m,s,o)}if((s&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},t!==null&&cl(a,m!==null?m.cachePool:null),m!==null?Kh(a,m):id(),Qh(a);else return o=a.lanes=536870912,Gg(t,a,m!==null?m.baseLanes|s:s,s,o)}else m!==null?(cl(a,m.cachePool),Kh(a,m),$a(),a.memoizedState=null):(t!==null&&cl(a,null),id(),$a());return Pt(t,a,f,s),a.child}function Vr(t,a){return t!==null&&t.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function Gg(t,a,s,o,f){var m=Ju();return m=m===null?null:{parent:At._currentValue,pool:m},a.memoizedState={baseLanes:s,cachePool:m},t!==null&&cl(a,null),id(),Qh(a),t!==null&&gs(t,a,o,!0),a.childLanes=f,null}function kl(t,a){return a=Cl({mode:a.mode,children:a.children},t.mode),a.ref=t.ref,t.child=a,a.return=t,a}function Hg(t,a,s){return _i(a,t.child,null,s),t=kl(a,a.pendingProps),t.flags|=2,fn(a),a.memoizedState=null,t}function Dw(t,a,s){var o=a.pendingProps,f=(a.flags&128)!==0;if(a.flags&=-129,t===null){if($e){if(o.mode==="hidden")return t=kl(a,o),a.lanes=536870912,Vr(null,t);if(rd(a),(t=lt)?(t=ab(t,jn),t=t!==null&&t.data==="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Da!==null?{id:Qn,overflow:Zn}:null,retryLane:536870912,hydrationErrors:null},s=_h(t),s.return=a,a.child=s,$t=a,lt=null)):t=null,t===null)throw Ra(a);return a.lanes=536870912,null}return kl(a,o)}var m=t.memoizedState;if(m!==null){var v=m.dehydrated;if(rd(a),f)if(a.flags&256)a.flags&=-257,a=Hg(t,a,s);else if(a.memoizedState!==null)a.child=t.child,a.flags|=128,a=null;else throw Error(r(558));else if(_t||gs(t,a,s,!1),f=(s&t.childLanes)!==0,_t||f){if(o=at,o!==null&&(v=Kn(o,s),v!==0&&v!==m.retryLane))throw m.retryLane=v,Si(t,v),rn(o,t,v),Cd;Bl(),a=Hg(t,a,s)}else t=m.treeContext,lt=kn(v.nextSibling),$t=a,$e=!0,za=null,jn=!1,t!==null&&Oh(a,t),a=kl(a,o),a.flags|=4096;return a}return t=ia(t.child,{mode:o.mode,children:o.children}),t.ref=a.ref,a.child=t,t.return=a,t}function Al(t,a){var s=a.ref;if(s===null)t!==null&&t.ref!==null&&(a.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(r(284));(t===null||t.ref!==s)&&(a.flags|=4194816)}}function _d(t,a,s,o,f){return Ni(a),s=ld(t,a,s,o,void 0,f),o=cd(),t!==null&&!_t?(ud(t,a,f),ua(t,a,f)):($e&&o&&Vu(a),a.flags|=1,Pt(t,a,s,f),a.child)}function Kg(t,a,s,o,f,m){return Ni(a),a.updateQueue=null,s=Yh(a,o,s,f),Zh(t),o=cd(),t!==null&&!_t?(ud(t,a,m),ua(t,a,m)):($e&&o&&Vu(a),a.flags|=1,Pt(t,a,s,m),a.child)}function Qg(t,a,s,o,f){if(Ni(a),a.stateNode===null){var m=fs,v=s.contextType;typeof v=="object"&&v!==null&&(m=It(v)),m=new s(o,m),a.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=kd,a.stateNode=m,m._reactInternals=a,m=a.stateNode,m.props=o,m.state=a.memoizedState,m.refs={},ed(a),v=s.contextType,m.context=typeof v=="object"&&v!==null?It(v):fs,m.state=a.memoizedState,v=s.getDerivedStateFromProps,typeof v=="function"&&(Nd(a,s,v,o),m.state=a.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(v=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),v!==m.state&&kd.enqueueReplaceState(m,m.state,null),qr(a,o,m,f),Lr(),m.state=a.memoizedState),typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!0}else if(t===null){m=a.stateNode;var j=a.memoizedProps,_=Ei(s,j);m.props=_;var B=m.context,K=s.contextType;v=fs,typeof K=="object"&&K!==null&&(v=It(K));var F=s.getDerivedStateFromProps;K=typeof F=="function"||typeof m.getSnapshotBeforeUpdate=="function",j=a.pendingProps!==j,K||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(j||B!==v)&&zg(a,m,o,v),Ba=!1;var U=a.memoizedState;m.state=U,qr(a,o,m,f),Lr(),B=a.memoizedState,j||U!==B||Ba?(typeof F=="function"&&(Nd(a,s,F,o),B=a.memoizedState),(_=Ba||Dg(a,s,_,o,U,B,v))?(K||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(a.flags|=4194308)):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=o,a.memoizedState=B),m.props=o,m.state=B,m.context=v,o=_):(typeof m.componentDidMount=="function"&&(a.flags|=4194308),o=!1)}else{m=a.stateNode,td(t,a),v=a.memoizedProps,K=Ei(s,v),m.props=K,F=a.pendingProps,U=m.context,B=s.contextType,_=fs,typeof B=="object"&&B!==null&&(_=It(B)),j=s.getDerivedStateFromProps,(B=typeof j=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(v!==F||U!==_)&&zg(a,m,o,_),Ba=!1,U=a.memoizedState,m.state=U,qr(a,o,m,f),Lr();var I=a.memoizedState;v!==F||U!==I||Ba||t!==null&&t.dependencies!==null&&ol(t.dependencies)?(typeof j=="function"&&(Nd(a,s,j,o),I=a.memoizedState),(K=Ba||Dg(a,s,K,o,U,I,_)||t!==null&&t.dependencies!==null&&ol(t.dependencies))?(B||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,I,_),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,I,_)),typeof m.componentDidUpdate=="function"&&(a.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof m.componentDidUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),a.memoizedProps=o,a.memoizedState=I),m.props=o,m.state=I,m.context=_,o=K):(typeof m.componentDidUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(a.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&U===t.memoizedState||(a.flags|=1024),o=!1)}return m=o,Al(t,a),o=(a.flags&128)!==0,m||o?(m=a.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:m.render(),a.flags|=1,t!==null&&o?(a.child=_i(a,t.child,null,f),a.child=_i(a,null,s,f)):Pt(t,a,s,f),a.memoizedState=m.state,t=a.child):t=ua(t,a,f),t}function Zg(t,a,s,o){return wi(),a.flags|=256,Pt(t,a,s,o),a.child}var Td={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ed(t){return{baseLanes:t,cachePool:Lh()}}function Od(t,a,s){return t=t!==null?t.childLanes&~s:0,a&&(t|=mn),t}function Yg(t,a,s){var o=a.pendingProps,f=!1,m=(a.flags&128)!==0,v;if((v=m)||(v=t!==null&&t.memoizedState===null?!1:(St.current&2)!==0),v&&(f=!0,a.flags&=-129),v=(a.flags&32)!==0,a.flags&=-33,t===null){if($e){if(f?Ua(a):$a(),(t=lt)?(t=ab(t,jn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(a.memoizedState={dehydrated:t,treeContext:Da!==null?{id:Qn,overflow:Zn}:null,retryLane:536870912,hydrationErrors:null},s=_h(t),s.return=a,a.child=s,$t=a,lt=null)):t=null,t===null)throw Ra(a);return mf(t)?a.lanes=32:a.lanes=536870912,null}var j=o.children;return o=o.fallback,f?($a(),f=a.mode,j=Cl({mode:"hidden",children:j},f),o=xi(o,f,s,null),j.return=a,o.return=a,j.sibling=o,a.child=j,o=a.child,o.memoizedState=Ed(s),o.childLanes=Od(t,v,s),a.memoizedState=Td,Vr(null,o)):(Ua(a),Dd(a,j))}var _=t.memoizedState;if(_!==null&&(j=_.dehydrated,j!==null)){if(m)a.flags&256?(Ua(a),a.flags&=-257,a=zd(t,a,s)):a.memoizedState!==null?($a(),a.child=t.child,a.flags|=128,a=null):($a(),j=o.fallback,f=a.mode,o=Cl({mode:"visible",children:o.children},f),j=xi(j,f,s,null),j.flags|=2,o.return=a,j.return=a,o.sibling=j,a.child=o,_i(a,t.child,null,s),o=a.child,o.memoizedState=Ed(s),o.childLanes=Od(t,v,s),a.memoizedState=Td,a=Vr(null,o));else if(Ua(a),mf(j)){if(v=j.nextSibling&&j.nextSibling.dataset,v)var B=v.dgst;v=B,o=Error(r(419)),o.stack="",o.digest=v,Or({value:o,source:null,stack:null}),a=zd(t,a,s)}else if(_t||gs(t,a,s,!1),v=(s&t.childLanes)!==0,_t||v){if(v=at,v!==null&&(o=Kn(v,s),o!==0&&o!==_.retryLane))throw _.retryLane=o,Si(t,o),rn(v,t,o),Cd;pf(j)||Bl(),a=zd(t,a,s)}else pf(j)?(a.flags|=192,a.child=t.child,a=null):(t=_.treeContext,lt=kn(j.nextSibling),$t=a,$e=!0,za=null,jn=!1,t!==null&&Oh(a,t),a=Dd(a,o.children),a.flags|=4096);return a}return f?($a(),j=o.fallback,f=a.mode,_=t.child,B=_.sibling,o=ia(_,{mode:"hidden",children:o.children}),o.subtreeFlags=_.subtreeFlags&65011712,B!==null?j=ia(B,j):(j=xi(j,f,s,null),j.flags|=2),j.return=a,o.return=a,o.sibling=j,a.child=o,Vr(null,o),o=a.child,j=t.child.memoizedState,j===null?j=Ed(s):(f=j.cachePool,f!==null?(_=At._currentValue,f=f.parent!==_?{parent:_,pool:_}:f):f=Lh(),j={baseLanes:j.baseLanes|s,cachePool:f}),o.memoizedState=j,o.childLanes=Od(t,v,s),a.memoizedState=Td,Vr(t.child,o)):(Ua(a),s=t.child,t=s.sibling,s=ia(s,{mode:"visible",children:o.children}),s.return=a,s.sibling=null,t!==null&&(v=a.deletions,v===null?(a.deletions=[t],a.flags|=16):v.push(t)),a.child=s,a.memoizedState=null,s)}function Dd(t,a){return a=Cl({mode:"visible",children:a},t.mode),a.return=t,t.child=a}function Cl(t,a){return t=un(22,t,null,a),t.lanes=0,t}function zd(t,a,s){return _i(a,t.child,null,s),t=Dd(a,a.pendingProps.children),t.flags|=2,a.memoizedState=null,t}function Fg(t,a,s){t.lanes|=a;var o=t.alternate;o!==null&&(o.lanes|=a),Zu(t.return,a,s)}function Rd(t,a,s,o,f,m){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:f,treeForkCount:m}:(v.isBackwards=a,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=s,v.tailMode=f,v.treeForkCount=m)}function Xg(t,a,s){var o=a.pendingProps,f=o.revealOrder,m=o.tail;o=o.children;var v=St.current,j=(v&2)!==0;if(j?(v=v&1|2,a.flags|=128):v&=1,ue(St,v),Pt(t,a,o,s),o=$e?Er:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=a.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Fg(t,s,a);else if(t.tag===19)Fg(t,s,a);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===a)break e;for(;t.sibling===null;){if(t.return===null||t.return===a)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(s=a.child,f=null;s!==null;)t=s.alternate,t!==null&&hl(t)===null&&(f=s),s=s.sibling;s=f,s===null?(f=a.child,a.child=null):(f=s.sibling,s.sibling=null),Rd(a,!1,f,s,m,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=a.child,a.child=null;f!==null;){if(t=f.alternate,t!==null&&hl(t)===null){a.child=f;break}t=f.sibling,f.sibling=s,s=f,f=t}Rd(a,!0,s,null,m,o);break;case"together":Rd(a,!1,null,null,void 0,o);break;default:a.memoizedState=null}return a.child}function ua(t,a,s){if(t!==null&&(a.dependencies=t.dependencies),Va|=a.lanes,(s&a.childLanes)===0)if(t!==null){if(gs(t,a,s,!1),(s&a.childLanes)===0)return null}else return null;if(t!==null&&a.child!==t.child)throw Error(r(153));if(a.child!==null){for(t=a.child,s=ia(t,t.pendingProps),a.child=s,s.return=a;t.sibling!==null;)t=t.sibling,s=s.sibling=ia(t,t.pendingProps),s.return=a;s.sibling=null}return a.child}function Md(t,a){return(t.lanes&a)!==0?!0:(t=t.dependencies,!!(t!==null&&ol(t)))}function zw(t,a,s){switch(a.tag){case 3:st(a,a.stateNode.containerInfo),Ma(a,At,t.memoizedState.cache),wi();break;case 27:case 5:Pe(a);break;case 4:st(a,a.stateNode.containerInfo);break;case 10:Ma(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,rd(a),null;break;case 13:var o=a.memoizedState;if(o!==null)return o.dehydrated!==null?(Ua(a),a.flags|=128,null):(s&a.child.childLanes)!==0?Yg(t,a,s):(Ua(a),t=ua(t,a,s),t!==null?t.sibling:null);Ua(a);break;case 19:var f=(t.flags&128)!==0;if(o=(s&a.childLanes)!==0,o||(gs(t,a,s,!1),o=(s&a.childLanes)!==0),f){if(o)return Xg(t,a,s);a.flags|=128}if(f=a.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ue(St,St.current),o)break;return null;case 22:return a.lanes=0,Vg(t,a,s,a.pendingProps);case 24:Ma(a,At,t.memoizedState.cache)}return ua(t,a,s)}function Jg(t,a,s){if(t!==null)if(t.memoizedProps!==a.pendingProps)_t=!0;else{if(!Md(t,s)&&(a.flags&128)===0)return _t=!1,zw(t,a,s);_t=(t.flags&131072)!==0}else _t=!1,$e&&(a.flags&1048576)!==0&&Eh(a,Er,a.index);switch(a.lanes=0,a.tag){case 16:e:{var o=a.pendingProps;if(t=Ai(a.elementType),a.type=t,typeof t=="function")$u(t)?(o=Ei(t,o),a.tag=1,a=Qg(null,a,t,o,s)):(a.tag=0,a=_d(null,a,t,o,s));else{if(t!=null){var f=t.$$typeof;if(f===V){a.tag=11,a=$g(null,a,t,o,s);break e}else if(f===O){a.tag=14,a=Ig(null,a,t,o,s);break e}}throw a=oe(t)||t,Error(r(306,a,""))}}return a;case 0:return _d(t,a,a.type,a.pendingProps,s);case 1:return o=a.type,f=Ei(o,a.pendingProps),Qg(t,a,o,f,s);case 3:e:{if(st(a,a.stateNode.containerInfo),t===null)throw Error(r(387));o=a.pendingProps;var m=a.memoizedState;f=m.element,td(t,a),qr(a,o,null,s);var v=a.memoizedState;if(o=v.cache,Ma(a,At,o),o!==m.cache&&Yu(a,[At],s,!0),Lr(),o=v.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:v.cache},a.updateQueue.baseState=m,a.memoizedState=m,a.flags&256){a=Zg(t,a,o,s);break e}else if(o!==f){f=Sn(Error(r(424)),a),Or(f),a=Zg(t,a,o,s);break e}else for(t=a.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,lt=kn(t.firstChild),$t=a,$e=!0,za=null,jn=!0,s=Vh(a,null,o,s),a.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(wi(),o===f){a=ua(t,a,s);break e}Pt(t,a,o,s)}a=a.child}return a;case 26:return Al(t,a),t===null?(s=cb(a.type,null,a.pendingProps,null))?a.memoizedState=s:$e||(s=a.type,t=a.pendingProps,o=Vl(ie.current).createElement(s),o[Ut]=a,o[Wt]=t,Vt(o,s,t),Rt(o),a.stateNode=o):a.memoizedState=cb(a.type,t.memoizedProps,a.pendingProps,t.memoizedState),null;case 27:return Pe(a),t===null&&$e&&(o=a.stateNode=rb(a.type,a.pendingProps,ie.current),$t=a,jn=!0,f=lt,Za(a.type)?(hf=f,lt=kn(o.firstChild)):lt=f),Pt(t,a,a.pendingProps.children,s),Al(t,a),t===null&&(a.flags|=4194304),a.child;case 5:return t===null&&$e&&((f=o=lt)&&(o=cj(o,a.type,a.pendingProps,jn),o!==null?(a.stateNode=o,$t=a,lt=kn(o.firstChild),jn=!1,f=!0):f=!1),f||Ra(a)),Pe(a),f=a.type,m=a.pendingProps,v=t!==null?t.memoizedProps:null,o=m.children,uf(f,m)?o=null:v!==null&&uf(f,v)&&(a.flags|=32),a.memoizedState!==null&&(f=ld(t,a,Nw,null,null,s),io._currentValue=f),Al(t,a),Pt(t,a,o,s),a.child;case 6:return t===null&&$e&&((t=s=lt)&&(s=uj(s,a.pendingProps,jn),s!==null?(a.stateNode=s,$t=a,lt=null,t=!0):t=!1),t||Ra(a)),null;case 13:return Yg(t,a,s);case 4:return st(a,a.stateNode.containerInfo),o=a.pendingProps,t===null?a.child=_i(a,null,o,s):Pt(t,a,o,s),a.child;case 11:return $g(t,a,a.type,a.pendingProps,s);case 7:return Pt(t,a,a.pendingProps,s),a.child;case 8:return Pt(t,a,a.pendingProps.children,s),a.child;case 12:return Pt(t,a,a.pendingProps.children,s),a.child;case 10:return o=a.pendingProps,Ma(a,a.type,o.value),Pt(t,a,o.children,s),a.child;case 9:return f=a.type._context,o=a.pendingProps.children,Ni(a),f=It(f),o=o(f),a.flags|=1,Pt(t,a,o,s),a.child;case 14:return Ig(t,a,a.type,a.pendingProps,s);case 15:return Pg(t,a,a.type,a.pendingProps,s);case 19:return Xg(t,a,s);case 31:return Dw(t,a,s);case 22:return Vg(t,a,s,a.pendingProps);case 24:return Ni(a),o=It(At),t===null?(f=Ju(),f===null&&(f=at,m=Fu(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=s),f=m),a.memoizedState={parent:o,cache:f},ed(a),Ma(a,At,f)):((t.lanes&s)!==0&&(td(t,a),qr(a,null,null,s),Lr()),f=t.memoizedState,m=a.memoizedState,f.parent!==o?(f={parent:o,cache:o},a.memoizedState=f,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=f),Ma(a,At,o)):(o=m.cache,Ma(a,At,o),o!==f.cache&&Yu(a,[At],s,!0))),Pt(t,a,a.pendingProps.children,s),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function da(t){t.flags|=4}function Bd(t,a,s,o,f){if((a=(t.mode&32)!==0)&&(a=!1),a){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(ky())t.flags|=8192;else throw Ci=dl,Wu}else t.flags&=-16777217}function Wg(t,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!mb(a))if(ky())t.flags|=8192;else throw Ci=dl,Wu}function _l(t,a){a!==null&&(t.flags|=4),t.flags&16384&&(a=t.tag!==22?ut():536870912,t.lanes|=a,_s|=a)}function Gr(t,a){if(!$e)switch(t.tailMode){case"hidden":a=t.tail;for(var s=null;a!==null;)a.alternate!==null&&(s=a),a=a.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?a||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function ct(t){var a=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(a)for(var f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)s|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=s,a}function Rw(t,a,s){var o=a.pendingProps;switch(Gu(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(a),null;case 1:return ct(a),null;case 3:return s=a.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),a.memoizedState.cache!==o&&(a.flags|=2048),oa(At),xe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(hs(a)?da(a):t===null||t.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,Ku())),ct(a),null;case 26:var f=a.type,m=a.memoizedState;return t===null?(da(a),m!==null?(ct(a),Wg(a,m)):(ct(a),Bd(a,f,null,o,s))):m?m!==t.memoizedState?(da(a),ct(a),Wg(a,m)):(ct(a),a.flags&=-16777217):(t=t.memoizedProps,t!==o&&da(a),ct(a),Bd(a,f,t,o,s)),null;case 27:if(Ze(a),s=ie.current,f=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&da(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return ct(a),null}t=ee.current,hs(a)?Dh(a):(t=rb(f,o,s),a.stateNode=t,da(a))}return ct(a),null;case 5:if(Ze(a),f=a.type,t!==null&&a.stateNode!=null)t.memoizedProps!==o&&da(a);else{if(!o){if(a.stateNode===null)throw Error(r(166));return ct(a),null}if(m=ee.current,hs(a))Dh(a);else{var v=Vl(ie.current);switch(m){case 1:m=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=v.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}m[Ut]=a,m[Wt]=o;e:for(v=a.child;v!==null;){if(v.tag===5||v.tag===6)m.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===a)break e;for(;v.sibling===null;){if(v.return===null||v.return===a)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}a.stateNode=m;e:switch(Vt(m,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&da(a)}}return ct(a),Bd(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,s),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&da(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(r(166));if(t=ie.current,hs(a)){if(t=a.stateNode,s=a.memoizedProps,o=null,f=$t,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[Ut]=a,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Yy(t.nodeValue,s)),t||Ra(a,!0)}else t=Vl(t).createTextNode(o),t[Ut]=a,a.stateNode=t}return ct(a),null;case 31:if(s=a.memoizedState,t===null||t.memoizedState!==null){if(o=hs(a),s!==null){if(t===null){if(!o)throw Error(r(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[Ut]=a}else wi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ct(a),t=!1}else s=Ku(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return a.flags&256?(fn(a),a):(fn(a),null);if((a.flags&128)!==0)throw Error(r(558))}return ct(a),null;case 13:if(o=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=hs(a),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=a.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Ut]=a}else wi(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;ct(a),f=!1}else f=Ku(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return a.flags&256?(fn(a),a):(fn(a),null)}return fn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=a.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==f&&(o.flags|=2048)),s!==t&&s&&(a.child.flags|=8192),_l(a,a.updateQueue),ct(a),null);case 4:return xe(),t===null&&sf(a.stateNode.containerInfo),ct(a),null;case 10:return oa(a.type),ct(a),null;case 19:if(J(St),o=a.memoizedState,o===null)return ct(a),null;if(f=(a.flags&128)!==0,m=o.rendering,m===null)if(f)Gr(o,!1);else{if(bt!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(m=hl(t),m!==null){for(a.flags|=128,Gr(o,!1),t=m.updateQueue,a.updateQueue=t,_l(a,t),a.subtreeFlags=0,t=s,s=a.child;s!==null;)Ch(s,t),s=s.sibling;return ue(St,St.current&1|2),$e&&sa(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&Gt()>zl&&(a.flags|=128,f=!0,Gr(o,!1),a.lanes=4194304)}else{if(!f)if(t=hl(m),t!==null){if(a.flags|=128,f=!0,t=t.updateQueue,a.updateQueue=t,_l(a,t),Gr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!$e)return ct(a),null}else 2*Gt()-o.renderingStartTime>zl&&s!==536870912&&(a.flags|=128,f=!0,Gr(o,!1),a.lanes=4194304);o.isBackwards?(m.sibling=a.child,a.child=m):(t=o.last,t!==null?t.sibling=m:a.child=m,o.last=m)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Gt(),t.sibling=null,s=St.current,ue(St,f?s&1|2:s&1),$e&&sa(a,o.treeForkCount),t):(ct(a),null);case 22:case 23:return fn(a),sd(),o=a.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(a.flags|=8192):o&&(a.flags|=8192),o?(s&536870912)!==0&&(a.flags&128)===0&&(ct(a),a.subtreeFlags&6&&(a.flags|=8192)):ct(a),s=a.updateQueue,s!==null&&_l(a,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==s&&(a.flags|=2048),t!==null&&J(ki),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),oa(At),ct(a),null;case 25:return null;case 30:return null}throw Error(r(156,a.tag))}function Mw(t,a){switch(Gu(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return oa(At),xe(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return Ze(a),null;case 31:if(a.memoizedState!==null){if(fn(a),a.alternate===null)throw Error(r(340));wi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(fn(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(r(340));wi()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return J(St),null;case 4:return xe(),null;case 10:return oa(a.type),null;case 22:case 23:return fn(a),sd(),t!==null&&J(ki),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return oa(At),null;case 25:return null;default:return null}}function ey(t,a){switch(Gu(a),a.tag){case 3:oa(At),xe();break;case 26:case 27:case 5:Ze(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&fn(a);break;case 13:fn(a);break;case 19:J(St);break;case 10:oa(a.type);break;case 22:case 23:fn(a),sd(),t!==null&&J(ki);break;case 24:oa(At)}}function Hr(t,a){try{var s=a.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var f=o.next;s=f;do{if((s.tag&t)===t){o=void 0;var m=s.create,v=s.inst;o=m(),v.destroy=o}s=s.next}while(s!==f)}}catch(j){Fe(a,a.return,j)}}function Ia(t,a,s){try{var o=a.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var m=f.next;o=m;do{if((o.tag&t)===t){var v=o.inst,j=v.destroy;if(j!==void 0){v.destroy=void 0,f=a;var _=s,B=j;try{B()}catch(K){Fe(f,_,K)}}}o=o.next}while(o!==m)}}catch(K){Fe(a,a.return,K)}}function ty(t){var a=t.updateQueue;if(a!==null){var s=t.stateNode;try{Hh(a,s)}catch(o){Fe(t,t.return,o)}}}function ny(t,a,s){s.props=Ei(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){Fe(t,a,o)}}function Kr(t,a){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(f){Fe(t,a,f)}}function Yn(t,a){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(f){Fe(t,a,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){Fe(t,a,f)}else s.current=null}function ay(t){var a=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(f){Fe(t,t.return,f)}}function Ld(t,a,s){try{var o=t.stateNode;aj(o,t.type,s,a),o[Wt]=a}catch(f){Fe(t,t.return,f)}}function iy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Za(t.type)||t.tag===4}function qd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Za(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ud(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(t),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=na));else if(o!==4&&(o===27&&Za(t.type)&&(s=t.stateNode,a=null),t=t.child,t!==null))for(Ud(t,a,s),t=t.sibling;t!==null;)Ud(t,a,s),t=t.sibling}function Tl(t,a,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?s.insertBefore(t,a):s.appendChild(t);else if(o!==4&&(o===27&&Za(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Tl(t,a,s),t=t.sibling;t!==null;)Tl(t,a,s),t=t.sibling}function sy(t){var a=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);Vt(a,o,s),a[Ut]=t,a[Wt]=s}catch(m){Fe(t,t.return,m)}}var fa=!1,Tt=!1,$d=!1,ry=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Bw(t,a){if(t=t.containerInfo,lf=Fl,t=bh(t),zu(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var f=o.anchorOffset,m=o.focusNode;o=o.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var v=0,j=-1,_=-1,B=0,K=0,F=t,U=null;t:for(;;){for(var I;F!==s||f!==0&&F.nodeType!==3||(j=v+f),F!==m||o!==0&&F.nodeType!==3||(_=v+o),F.nodeType===3&&(v+=F.nodeValue.length),(I=F.firstChild)!==null;)U=F,F=I;for(;;){if(F===t)break t;if(U===s&&++B===f&&(j=v),U===m&&++K===o&&(_=v),(I=F.nextSibling)!==null)break;F=U,U=F.parentNode}F=I}s=j===-1||_===-1?null:{start:j,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(cf={focusedElem:t,selectionRange:s},Fl=!1,Mt=a;Mt!==null;)if(a=Mt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Mt=t;else for(;Mt!==null;){switch(a=Mt,m=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)f=t[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,s=a,f=m.memoizedProps,m=m.memoizedState,o=s.stateNode;try{var me=Ei(s.type,f);t=o.getSnapshotBeforeUpdate(me,m),o.__reactInternalSnapshotBeforeUpdate=t}catch(we){Fe(s,s.return,we)}}break;case 3:if((t&1024)!==0){if(t=a.stateNode.containerInfo,s=t.nodeType,s===9)ff(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ff(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=a.sibling,t!==null){t.return=a.return,Mt=t;break}Mt=a.return}}function oy(t,a,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ma(t,s),o&4&&Hr(5,s);break;case 1:if(ma(t,s),o&4)if(t=s.stateNode,a===null)try{t.componentDidMount()}catch(v){Fe(s,s.return,v)}else{var f=Ei(s.type,a.memoizedProps);a=a.memoizedState;try{t.componentDidUpdate(f,a,t.__reactInternalSnapshotBeforeUpdate)}catch(v){Fe(s,s.return,v)}}o&64&&ty(s),o&512&&Kr(s,s.return);break;case 3:if(ma(t,s),o&64&&(t=s.updateQueue,t!==null)){if(a=null,s.child!==null)switch(s.child.tag){case 27:case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}try{Hh(t,a)}catch(v){Fe(s,s.return,v)}}break;case 27:a===null&&o&4&&sy(s);case 26:case 5:ma(t,s),a===null&&o&4&&ay(s),o&512&&Kr(s,s.return);break;case 12:ma(t,s);break;case 31:ma(t,s),o&4&&uy(t,s);break;case 13:ma(t,s),o&4&&dy(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=Hw.bind(null,s),dj(t,s))));break;case 22:if(o=s.memoizedState!==null||fa,!o){a=a!==null&&a.memoizedState!==null||Tt,f=fa;var m=Tt;fa=o,(Tt=a)&&!m?ha(t,s,(s.subtreeFlags&8772)!==0):ma(t,s),fa=f,Tt=m}break;case 30:break;default:ma(t,s)}}function ly(t){var a=t.alternate;a!==null&&(t.alternate=null,ly(a)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(a=t.stateNode,a!==null&&gu(a)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var dt=null,tn=!1;function pa(t,a,s){for(s=s.child;s!==null;)cy(t,a,s),s=s.sibling}function cy(t,a,s){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ta,s)}catch{}switch(s.tag){case 26:Tt||Yn(s,a),pa(t,a,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Tt||Yn(s,a);var o=dt,f=tn;Za(s.type)&&(dt=s.stateNode,tn=!1),pa(t,a,s),to(s.stateNode),dt=o,tn=f;break;case 5:Tt||Yn(s,a);case 6:if(o=dt,f=tn,dt=null,pa(t,a,s),dt=o,tn=f,dt!==null)if(tn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(s.stateNode)}catch(m){Fe(s,a,m)}else try{dt.removeChild(s.stateNode)}catch(m){Fe(s,a,m)}break;case 18:dt!==null&&(tn?(t=dt,tb(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Bs(t)):tb(dt,s.stateNode));break;case 4:o=dt,f=tn,dt=s.stateNode.containerInfo,tn=!0,pa(t,a,s),dt=o,tn=f;break;case 0:case 11:case 14:case 15:Ia(2,s,a),Tt||Ia(4,s,a),pa(t,a,s);break;case 1:Tt||(Yn(s,a),o=s.stateNode,typeof o.componentWillUnmount=="function"&&ny(s,a,o)),pa(t,a,s);break;case 21:pa(t,a,s);break;case 22:Tt=(o=Tt)||s.memoizedState!==null,pa(t,a,s),Tt=o;break;default:pa(t,a,s)}}function uy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Bs(t)}catch(s){Fe(a,a.return,s)}}}function dy(t,a){if(a.memoizedState===null&&(t=a.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Bs(t)}catch(s){Fe(a,a.return,s)}}function Lw(t){switch(t.tag){case 31:case 13:case 19:var a=t.stateNode;return a===null&&(a=t.stateNode=new ry),a;case 22:return t=t.stateNode,a=t._retryCache,a===null&&(a=t._retryCache=new ry),a;default:throw Error(r(435,t.tag))}}function El(t,a){var s=Lw(t);a.forEach(function(o){if(!s.has(o)){s.add(o);var f=Kw.bind(null,t,o);o.then(f,f)}})}function nn(t,a){var s=a.deletions;if(s!==null)for(var o=0;o<s.length;o++){var f=s[o],m=t,v=a,j=v;e:for(;j!==null;){switch(j.tag){case 27:if(Za(j.type)){dt=j.stateNode,tn=!1;break e}break;case 5:dt=j.stateNode,tn=!1;break e;case 3:case 4:dt=j.stateNode.containerInfo,tn=!0;break e}j=j.return}if(dt===null)throw Error(r(160));cy(m,v,f),dt=null,tn=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)fy(a,t),a=a.sibling}var Ln=null;function fy(t,a){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:nn(a,t),an(t),o&4&&(Ia(3,t,t.return),Hr(3,t),Ia(5,t,t.return));break;case 1:nn(a,t),an(t),o&512&&(Tt||s===null||Yn(s,s.return)),o&64&&fa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var f=Ln;if(nn(a,t),an(t),o&512&&(Tt||s===null||Yn(s,s.return)),o&4){var m=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":m=f.getElementsByTagName("title")[0],(!m||m[vr]||m[Ut]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(o),f.head.insertBefore(m,f.querySelector("head > title"))),Vt(m,o,s),m[Ut]=t,Rt(m),o=m;break e;case"link":var v=fb("link","href",f).get(o+(s.href||""));if(v){for(var j=0;j<v.length;j++)if(m=v[j],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){v.splice(j,1);break t}}m=f.createElement(o),Vt(m,o,s),f.head.appendChild(m);break;case"meta":if(v=fb("meta","content",f).get(o+(s.content||""))){for(j=0;j<v.length;j++)if(m=v[j],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){v.splice(j,1);break t}}m=f.createElement(o),Vt(m,o,s),f.head.appendChild(m);break;default:throw Error(r(468,o))}m[Ut]=t,Rt(m),o=m}t.stateNode=o}else pb(f,t.type,t.stateNode);else t.stateNode=db(f,o,t.memoizedProps);else m!==o?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,o===null?pb(f,t.type,t.stateNode):db(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Ld(t,t.memoizedProps,s.memoizedProps)}break;case 27:nn(a,t),an(t),o&512&&(Tt||s===null||Yn(s,s.return)),s!==null&&o&4&&Ld(t,t.memoizedProps,s.memoizedProps);break;case 5:if(nn(a,t),an(t),o&512&&(Tt||s===null||Yn(s,s.return)),t.flags&32){f=t.stateNode;try{ss(f,"")}catch(me){Fe(t,t.return,me)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Ld(t,f,s!==null?s.memoizedProps:f)),o&1024&&($d=!0);break;case 6:if(nn(a,t),an(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(me){Fe(t,t.return,me)}}break;case 3:if(Kl=null,f=Ln,Ln=Gl(a.containerInfo),nn(a,t),Ln=f,an(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Bs(a.containerInfo)}catch(me){Fe(t,t.return,me)}$d&&($d=!1,py(t));break;case 4:o=Ln,Ln=Gl(t.stateNode.containerInfo),nn(a,t),an(t),Ln=o;break;case 12:nn(a,t),an(t);break;case 31:nn(a,t),an(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,El(t,o)));break;case 13:nn(a,t),an(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Dl=Gt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,El(t,o)));break;case 22:f=t.memoizedState!==null;var _=s!==null&&s.memoizedState!==null,B=fa,K=Tt;if(fa=B||f,Tt=K||_,nn(a,t),Tt=K,fa=B,an(t),o&8192)e:for(a=t.stateNode,a._visibility=f?a._visibility&-2:a._visibility|1,f&&(s===null||_||fa||Tt||Oi(t)),s=null,a=t;;){if(a.tag===5||a.tag===26){if(s===null){_=s=a;try{if(m=_.stateNode,f)v=m.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{j=_.stateNode;var F=_.memoizedProps.style,U=F!=null&&F.hasOwnProperty("display")?F.display:null;j.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(me){Fe(_,_.return,me)}}}else if(a.tag===6){if(s===null){_=a;try{_.stateNode.nodeValue=f?"":_.memoizedProps}catch(me){Fe(_,_.return,me)}}}else if(a.tag===18){if(s===null){_=a;try{var I=_.stateNode;f?nb(I,!0):nb(_.stateNode,!1)}catch(me){Fe(_,_.return,me)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===t)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;s===a&&(s=null),a=a.return}s===a&&(s=null),a.sibling.return=a.return,a=a.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,El(t,s))));break;case 19:nn(a,t),an(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,El(t,o)));break;case 30:break;case 21:break;default:nn(a,t),an(t)}}function an(t){var a=t.flags;if(a&2){try{for(var s,o=t.return;o!==null;){if(iy(o)){s=o;break}o=o.return}if(s==null)throw Error(r(160));switch(s.tag){case 27:var f=s.stateNode,m=qd(t);Tl(t,m,f);break;case 5:var v=s.stateNode;s.flags&32&&(ss(v,""),s.flags&=-33);var j=qd(t);Tl(t,j,v);break;case 3:case 4:var _=s.stateNode.containerInfo,B=qd(t);Ud(t,B,_);break;default:throw Error(r(161))}}catch(K){Fe(t,t.return,K)}t.flags&=-3}a&4096&&(t.flags&=-4097)}function py(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var a=t;py(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),t=t.sibling}}function ma(t,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)oy(t,a.alternate,a),a=a.sibling}function Oi(t){for(t=t.child;t!==null;){var a=t;switch(a.tag){case 0:case 11:case 14:case 15:Ia(4,a,a.return),Oi(a);break;case 1:Yn(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&ny(a,a.return,s),Oi(a);break;case 27:to(a.stateNode);case 26:case 5:Yn(a,a.return),Oi(a);break;case 22:a.memoizedState===null&&Oi(a);break;case 30:Oi(a);break;default:Oi(a)}t=t.sibling}}function ha(t,a,s){for(s=s&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var o=a.alternate,f=t,m=a,v=m.flags;switch(m.tag){case 0:case 11:case 15:ha(f,m,s),Hr(4,m);break;case 1:if(ha(f,m,s),o=m,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(B){Fe(o,o.return,B)}if(o=m,f=o.updateQueue,f!==null){var j=o.stateNode;try{var _=f.shared.hiddenCallbacks;if(_!==null)for(f.shared.hiddenCallbacks=null,f=0;f<_.length;f++)Gh(_[f],j)}catch(B){Fe(o,o.return,B)}}s&&v&64&&ty(m),Kr(m,m.return);break;case 27:sy(m);case 26:case 5:ha(f,m,s),s&&o===null&&v&4&&ay(m),Kr(m,m.return);break;case 12:ha(f,m,s);break;case 31:ha(f,m,s),s&&v&4&&uy(f,m);break;case 13:ha(f,m,s),s&&v&4&&dy(f,m);break;case 22:m.memoizedState===null&&ha(f,m,s),Kr(m,m.return);break;case 30:break;default:ha(f,m,s)}a=a.sibling}}function Id(t,a){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(t=a.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Dr(s))}function Pd(t,a){t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Dr(t))}function qn(t,a,s,o){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)my(t,a,s,o),a=a.sibling}function my(t,a,s,o){var f=a.flags;switch(a.tag){case 0:case 11:case 15:qn(t,a,s,o),f&2048&&Hr(9,a);break;case 1:qn(t,a,s,o);break;case 3:qn(t,a,s,o),f&2048&&(t=null,a.alternate!==null&&(t=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==t&&(a.refCount++,t!=null&&Dr(t)));break;case 12:if(f&2048){qn(t,a,s,o),t=a.stateNode;try{var m=a.memoizedProps,v=m.id,j=m.onPostCommit;typeof j=="function"&&j(v,a.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(_){Fe(a,a.return,_)}}else qn(t,a,s,o);break;case 31:qn(t,a,s,o);break;case 13:qn(t,a,s,o);break;case 23:break;case 22:m=a.stateNode,v=a.alternate,a.memoizedState!==null?m._visibility&2?qn(t,a,s,o):Qr(t,a):m._visibility&2?qn(t,a,s,o):(m._visibility|=2,ks(t,a,s,o,(a.subtreeFlags&10256)!==0||!1)),f&2048&&Id(v,a);break;case 24:qn(t,a,s,o),f&2048&&Pd(a.alternate,a);break;default:qn(t,a,s,o)}}function ks(t,a,s,o,f){for(f=f&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var m=t,v=a,j=s,_=o,B=v.flags;switch(v.tag){case 0:case 11:case 15:ks(m,v,j,_,f),Hr(8,v);break;case 23:break;case 22:var K=v.stateNode;v.memoizedState!==null?K._visibility&2?ks(m,v,j,_,f):Qr(m,v):(K._visibility|=2,ks(m,v,j,_,f)),f&&B&2048&&Id(v.alternate,v);break;case 24:ks(m,v,j,_,f),f&&B&2048&&Pd(v.alternate,v);break;default:ks(m,v,j,_,f)}a=a.sibling}}function Qr(t,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var s=t,o=a,f=o.flags;switch(o.tag){case 22:Qr(s,o),f&2048&&Id(o.alternate,o);break;case 24:Qr(s,o),f&2048&&Pd(o.alternate,o);break;default:Qr(s,o)}a=a.sibling}}var Zr=8192;function As(t,a,s){if(t.subtreeFlags&Zr)for(t=t.child;t!==null;)hy(t,a,s),t=t.sibling}function hy(t,a,s){switch(t.tag){case 26:As(t,a,s),t.flags&Zr&&t.memoizedState!==null&&jj(s,Ln,t.memoizedState,t.memoizedProps);break;case 5:As(t,a,s);break;case 3:case 4:var o=Ln;Ln=Gl(t.stateNode.containerInfo),As(t,a,s),Ln=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Zr,Zr=16777216,As(t,a,s),Zr=o):As(t,a,s));break;default:As(t,a,s)}}function gy(t){var a=t.alternate;if(a!==null&&(t=a.child,t!==null)){a.child=null;do a=t.sibling,t.sibling=null,t=a;while(t!==null)}}function Yr(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Mt=o,by(o,t)}gy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yy(t),t=t.sibling}function yy(t){switch(t.tag){case 0:case 11:case 15:Yr(t),t.flags&2048&&Ia(9,t,t.return);break;case 3:Yr(t);break;case 12:Yr(t);break;case 22:var a=t.stateNode;t.memoizedState!==null&&a._visibility&2&&(t.return===null||t.return.tag!==13)?(a._visibility&=-3,Ol(t)):Yr(t);break;default:Yr(t)}}function Ol(t){var a=t.deletions;if((t.flags&16)!==0){if(a!==null)for(var s=0;s<a.length;s++){var o=a[s];Mt=o,by(o,t)}gy(t)}for(t=t.child;t!==null;){switch(a=t,a.tag){case 0:case 11:case 15:Ia(8,a,a.return),Ol(a);break;case 22:s=a.stateNode,s._visibility&2&&(s._visibility&=-3,Ol(a));break;default:Ol(a)}t=t.sibling}}function by(t,a){for(;Mt!==null;){var s=Mt;switch(s.tag){case 0:case 11:case 15:Ia(8,s,a);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Dr(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Mt=o;else e:for(s=t;Mt!==null;){o=Mt;var f=o.sibling,m=o.return;if(ly(o),o===s){Mt=null;break e}if(f!==null){f.return=m,Mt=f;break e}Mt=m}}}var qw={getCacheForType:function(t){var a=It(At),s=a.data.get(t);return s===void 0&&(s=t(),a.data.set(t,s)),s},cacheSignal:function(){return It(At).controller.signal}},Uw=typeof WeakMap=="function"?WeakMap:Map,Ke=0,at=null,Be=null,qe=0,Ye=0,pn=null,Pa=!1,Cs=!1,Vd=!1,ga=0,bt=0,Va=0,Di=0,Gd=0,mn=0,_s=0,Fr=null,sn=null,Hd=!1,Dl=0,vy=0,zl=1/0,Rl=null,Ga=null,Dt=0,Ha=null,Ts=null,ya=0,Kd=0,Qd=null,Sy=null,Xr=0,Zd=null;function hn(){return(Ke&2)!==0&&qe!==0?qe&-qe:$.T!==null?ef():Bm()}function xy(){if(mn===0)if((qe&536870912)===0||$e){var t=Xi;Xi<<=1,(Xi&3932160)===0&&(Xi=262144),mn=t}else mn=536870912;return t=dn.current,t!==null&&(t.flags|=32),mn}function rn(t,a,s){(t===at&&(Ye===2||Ye===9)||t.cancelPendingCommit!==null)&&(Es(t,0),Ka(t,qe,mn,!1)),hi(t,s),((Ke&2)===0||t!==at)&&(t===at&&((Ke&2)===0&&(Di|=s),bt===4&&Ka(t,qe,mn,!1)),Fn(t))}function wy(t,a,s){if((Ke&6)!==0)throw Error(r(327));var o=!s&&(a&127)===0&&(a&t.expiredLanes)===0||mi(t,a),f=o?Pw(t,a):Fd(t,a,!0),m=o;do{if(f===0){Cs&&!o&&Ka(t,a,0,!1);break}else{if(s=t.current.alternate,m&&!$w(s)){f=Fd(t,a,!1),m=!1;continue}if(f===2){if(m=a,t.errorRecoveryDisabledLanes&m)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){a=v;e:{var j=t;f=Fr;var _=j.current.memoizedState.isDehydrated;if(_&&(Es(j,v).flags|=256),v=Fd(j,v,!1),v!==2){if(Vd&&!_){j.errorRecoveryDisabledLanes|=m,Di|=m,f=4;break e}m=sn,sn=f,m!==null&&(sn===null?sn=m:sn.push.apply(sn,m))}f=v}if(m=!1,f!==2)continue}}if(f===1){Es(t,0),Ka(t,a,0,!0);break}e:{switch(o=t,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a)break;case 6:Ka(o,a,mn,!Pa);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(f=Dl+300-Gt(),10<f)){if(Ka(o,a,mn,!Pa),gn(o,0,!0)!==0)break e;ya=a,o.timeoutHandle=Wy(jy.bind(null,o,s,sn,Rl,Hd,a,mn,Di,_s,Pa,m,"Throttled",-0,0),f);break e}jy(o,s,sn,Rl,Hd,a,mn,Di,_s,Pa,m,null,-0,0)}}break}while(!0);Fn(t)}function jy(t,a,s,o,f,m,v,j,_,B,K,F,U,I){if(t.timeoutHandle=-1,F=a.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},hy(a,m,F);var me=(m&62914560)===m?Dl-Gt():(m&4194048)===m?vy-Gt():0;if(me=Nj(F,me),me!==null){ya=m,t.cancelPendingCommit=me(Oy.bind(null,t,a,m,s,o,f,v,j,_,K,F,null,U,I)),Ka(t,m,v,!B);return}}Oy(t,a,m,s,o,f,v,j,_)}function $w(t){for(var a=t;;){var s=a.tag;if((s===0||s===11||s===15)&&a.flags&16384&&(s=a.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var f=s[o],m=f.getSnapshot;f=f.value;try{if(!cn(m(),f))return!1}catch{return!1}}if(s=a.child,a.subtreeFlags&16384&&s!==null)s.return=a,a=s;else{if(a===t)break;for(;a.sibling===null;){if(a.return===null||a.return===t)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Ka(t,a,s,o){a&=~Gd,a&=~Di,t.suspendedLanes|=a,t.pingedLanes&=~a,o&&(t.warmLanes|=a),o=t.expirationTimes;for(var f=a;0<f;){var m=31-Ot(f),v=1<<m;o[m]=-1,f&=~v}s!==0&&br(t,s,a)}function Ml(){return(Ke&6)===0?(Jr(0),!1):!0}function Yd(){if(Be!==null){if(Ye===0)var t=Be.return;else t=Be,ra=ji=null,dd(t),Ss=null,Rr=0,t=Be;for(;t!==null;)ey(t.alternate,t),t=t.return;Be=null}}function Es(t,a){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,rj(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),ya=0,Yd(),at=t,Be=s=ia(t.current,null),qe=a,Ye=0,pn=null,Pa=!1,Cs=mi(t,a),Vd=!1,_s=mn=Gd=Di=Va=bt=0,sn=Fr=null,Hd=!1,(a&8)!==0&&(a|=a&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=a;0<o;){var f=31-Ot(o),m=1<<f;a|=t[f],o&=~m}return ga=a,nl(),s}function Ny(t,a){Ee=null,$.H=Pr,a===vs||a===ul?(a=$h(),Ye=3):a===Wu?(a=$h(),Ye=4):Ye=a===Cd?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,pn=a,Be===null&&(bt=1,Nl(t,Sn(a,t.current)))}function ky(){var t=dn.current;return t===null?!0:(qe&4194048)===qe?Nn===null:(qe&62914560)===qe||(qe&536870912)!==0?t===Nn:!1}function Ay(){var t=$.H;return $.H=Pr,t===null?Pr:t}function Cy(){var t=$.A;return $.A=qw,t}function Bl(){bt=4,Pa||(qe&4194048)!==qe&&dn.current!==null||(Cs=!0),(Va&134217727)===0&&(Di&134217727)===0||at===null||Ka(at,qe,mn,!1)}function Fd(t,a,s){var o=Ke;Ke|=2;var f=Ay(),m=Cy();(at!==t||qe!==a)&&(Rl=null,Es(t,a)),a=!1;var v=bt;e:do try{if(Ye!==0&&Be!==null){var j=Be,_=pn;switch(Ye){case 8:Yd(),v=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(a=!0);var B=Ye;if(Ye=0,pn=null,Os(t,j,_,B),s&&Cs){v=0;break e}break;default:B=Ye,Ye=0,pn=null,Os(t,j,_,B)}}Iw(),v=bt;break}catch(K){Ny(t,K)}while(!0);return a&&t.shellSuspendCounter++,ra=ji=null,Ke=o,$.H=f,$.A=m,Be===null&&(at=null,qe=0,nl()),v}function Iw(){for(;Be!==null;)_y(Be)}function Pw(t,a){var s=Ke;Ke|=2;var o=Ay(),f=Cy();at!==t||qe!==a?(Rl=null,zl=Gt()+500,Es(t,a)):Cs=mi(t,a);e:do try{if(Ye!==0&&Be!==null){a=Be;var m=pn;t:switch(Ye){case 1:Ye=0,pn=null,Os(t,a,m,1);break;case 2:case 9:if(qh(m)){Ye=0,pn=null,Ty(a);break}a=function(){Ye!==2&&Ye!==9||at!==t||(Ye=7),Fn(t)},m.then(a,a);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:qh(m)?(Ye=0,pn=null,Ty(a)):(Ye=0,pn=null,Os(t,a,m,7));break;case 5:var v=null;switch(Be.tag){case 26:v=Be.memoizedState;case 5:case 27:var j=Be;if(v?mb(v):j.stateNode.complete){Ye=0,pn=null;var _=j.sibling;if(_!==null)Be=_;else{var B=j.return;B!==null?(Be=B,Ll(B)):Be=null}break t}}Ye=0,pn=null,Os(t,a,m,5);break;case 6:Ye=0,pn=null,Os(t,a,m,6);break;case 8:Yd(),bt=6;break e;default:throw Error(r(462))}}Vw();break}catch(K){Ny(t,K)}while(!0);return ra=ji=null,$.H=o,$.A=f,Ke=s,Be!==null?0:(at=null,qe=0,nl(),bt)}function Vw(){for(;Be!==null&&!Lo();)_y(Be)}function _y(t){var a=Jg(t.alternate,t,ga);t.memoizedProps=t.pendingProps,a===null?Ll(t):Be=a}function Ty(t){var a=t,s=a.alternate;switch(a.tag){case 15:case 0:a=Kg(s,a,a.pendingProps,a.type,void 0,qe);break;case 11:a=Kg(s,a,a.pendingProps,a.type.render,a.ref,qe);break;case 5:dd(a);default:ey(s,a),a=Be=Ch(a,ga),a=Jg(s,a,ga)}t.memoizedProps=t.pendingProps,a===null?Ll(t):Be=a}function Os(t,a,s,o){ra=ji=null,dd(a),Ss=null,Rr=0;var f=a.return;try{if(Ow(t,f,a,s,qe)){bt=1,Nl(t,Sn(s,t.current)),Be=null;return}}catch(m){if(f!==null)throw Be=f,m;bt=1,Nl(t,Sn(s,t.current)),Be=null;return}a.flags&32768?($e||o===1?t=!0:Cs||(qe&536870912)!==0?t=!1:(Pa=t=!0,(o===2||o===9||o===3||o===6)&&(o=dn.current,o!==null&&o.tag===13&&(o.flags|=16384))),Ey(a,t)):Ll(a)}function Ll(t){var a=t;do{if((a.flags&32768)!==0){Ey(a,Pa);return}t=a.return;var s=Rw(a.alternate,a,ga);if(s!==null){Be=s;return}if(a=a.sibling,a!==null){Be=a;return}Be=a=t}while(a!==null);bt===0&&(bt=5)}function Ey(t,a){do{var s=Mw(t.alternate,t);if(s!==null){s.flags&=32767,Be=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!a&&(t=t.sibling,t!==null)){Be=t;return}Be=t=s}while(t!==null);bt=6,Be=null}function Oy(t,a,s,o,f,m,v,j,_){t.cancelPendingCommit=null;do ql();while(Dt!==0);if((Ke&6)!==0)throw Error(r(327));if(a!==null){if(a===t.current)throw Error(r(177));if(m=a.lanes|a.childLanes,m|=qu,fu(t,s,m,v,j,_),t===at&&(Be=at=null,qe=0),Ts=a,Ha=t,ya=s,Kd=m,Qd=f,Sy=o,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Qw(_a,function(){return By(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||o){o=$.T,$.T=null,f=W.p,W.p=2,v=Ke,Ke|=4;try{Bw(t,a,s)}finally{Ke=v,W.p=f,$.T=o}}Dt=1,Dy(),zy(),Ry()}}function Dy(){if(Dt===1){Dt=0;var t=Ha,a=Ts,s=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var f=Ke;Ke|=4;try{fy(a,t);var m=cf,v=bh(t.containerInfo),j=m.focusedElem,_=m.selectionRange;if(v!==j&&j&&j.ownerDocument&&yh(j.ownerDocument.documentElement,j)){if(_!==null&&zu(j)){var B=_.start,K=_.end;if(K===void 0&&(K=B),"selectionStart"in j)j.selectionStart=B,j.selectionEnd=Math.min(K,j.value.length);else{var F=j.ownerDocument||document,U=F&&F.defaultView||window;if(U.getSelection){var I=U.getSelection(),me=j.textContent.length,we=Math.min(_.start,me),et=_.end===void 0?we:Math.min(_.end,me);!I.extend&&we>et&&(v=et,et=we,we=v);var z=gh(j,we),T=gh(j,et);if(z&&T&&(I.rangeCount!==1||I.anchorNode!==z.node||I.anchorOffset!==z.offset||I.focusNode!==T.node||I.focusOffset!==T.offset)){var M=F.createRange();M.setStart(z.node,z.offset),I.removeAllRanges(),we>et?(I.addRange(M),I.extend(T.node,T.offset)):(M.setEnd(T.node,T.offset),I.addRange(M))}}}}for(F=[],I=j;I=I.parentNode;)I.nodeType===1&&F.push({element:I,left:I.scrollLeft,top:I.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<F.length;j++){var Y=F[j];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Fl=!!lf,cf=lf=null}finally{Ke=f,W.p=o,$.T=s}}t.current=a,Dt=2}}function zy(){if(Dt===2){Dt=0;var t=Ha,a=Ts,s=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||s){s=$.T,$.T=null;var o=W.p;W.p=2;var f=Ke;Ke|=4;try{oy(t,a.alternate,a)}finally{Ke=f,W.p=o,$.T=s}}Dt=3}}function Ry(){if(Dt===4||Dt===3){Dt=0,qo();var t=Ha,a=Ts,s=ya,o=Sy;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?Dt=5:(Dt=0,Ts=Ha=null,My(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Ga=null),mu(s),a=a.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ta,a,void 0,(a.current.flags&128)===128)}catch{}if(o!==null){a=$.T,f=W.p,W.p=2,$.T=null;try{for(var m=t.onRecoverableError,v=0;v<o.length;v++){var j=o[v];m(j.value,{componentStack:j.stack})}}finally{$.T=a,W.p=f}}(ya&3)!==0&&ql(),Fn(t),f=t.pendingLanes,(s&261930)!==0&&(f&42)!==0?t===Zd?Xr++:(Xr=0,Zd=t):Xr=0,Jr(0)}}function My(t,a){(t.pooledCacheLanes&=a)===0&&(a=t.pooledCache,a!=null&&(t.pooledCache=null,Dr(a)))}function ql(){return Dy(),zy(),Ry(),By()}function By(){if(Dt!==5)return!1;var t=Ha,a=Kd;Kd=0;var s=mu(ya),o=$.T,f=W.p;try{W.p=32>s?32:s,$.T=null,s=Qd,Qd=null;var m=Ha,v=ya;if(Dt=0,Ts=Ha=null,ya=0,(Ke&6)!==0)throw Error(r(331));var j=Ke;if(Ke|=4,yy(m.current),my(m,m.current,v,s),Ke=j,Jr(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ta,m)}catch{}return!0}finally{W.p=f,$.T=o,My(t,a)}}function Ly(t,a,s){a=Sn(s,a),a=Ad(t.stateNode,a,2),t=qa(t,a,2),t!==null&&(hi(t,2),Fn(t))}function Fe(t,a,s){if(t.tag===3)Ly(t,t,s);else for(;a!==null;){if(a.tag===3){Ly(a,t,s);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ga===null||!Ga.has(o))){t=Sn(s,t),s=qg(2),o=qa(a,s,2),o!==null&&(Ug(s,o,a,t),hi(o,2),Fn(o));break}}a=a.return}}function Xd(t,a,s){var o=t.pingCache;if(o===null){o=t.pingCache=new Uw;var f=new Set;o.set(a,f)}else f=o.get(a),f===void 0&&(f=new Set,o.set(a,f));f.has(s)||(Vd=!0,f.add(s),t=Gw.bind(null,t,a,s),a.then(t,t))}function Gw(t,a,s){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,at===t&&(qe&s)===s&&(bt===4||bt===3&&(qe&62914560)===qe&&300>Gt()-Dl?(Ke&2)===0&&Es(t,0):Gd|=s,_s===qe&&(_s=0)),Fn(t)}function qy(t,a){a===0&&(a=ut()),t=Si(t,a),t!==null&&(hi(t,a),Fn(t))}function Hw(t){var a=t.memoizedState,s=0;a!==null&&(s=a.retryLane),qy(t,s)}function Kw(t,a){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(s=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(a),qy(t,s)}function Qw(t,a){return Zi(t,a)}var Ul=null,Ds=null,Jd=!1,$l=!1,Wd=!1,Qa=0;function Fn(t){t!==Ds&&t.next===null&&(Ds===null?Ul=Ds=t:Ds=Ds.next=t),$l=!0,Jd||(Jd=!0,Yw())}function Jr(t,a){if(!Wd&&$l){Wd=!0;do for(var s=!1,o=Ul;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var m=0;else{var v=o.suspendedLanes,j=o.pingedLanes;m=(1<<31-Ot(42|t)+1)-1,m&=f&~(v&~j),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Py(o,m))}else m=qe,m=gn(o,o===at?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||mi(o,m)||(s=!0,Py(o,m));o=o.next}while(s);Wd=!1}}function Zw(){Uy()}function Uy(){$l=Jd=!1;var t=0;Qa!==0&&sj()&&(t=Qa);for(var a=Gt(),s=null,o=Ul;o!==null;){var f=o.next,m=$y(o,a);m===0?(o.next=null,s===null?Ul=f:s.next=f,f===null&&(Ds=s)):(s=o,(t!==0||(m&3)!==0)&&($l=!0)),o=f}Dt!==0&&Dt!==5||Jr(t),Qa!==0&&(Qa=0)}function $y(t,a){for(var s=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var v=31-Ot(m),j=1<<v,_=f[v];_===-1?((j&s)===0||(j&o)!==0)&&(f[v]=se(j,a)):_<=a&&(t.expiredLanes|=j),m&=~j}if(a=at,s=qe,s=gn(t,t===a?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===a&&(Ye===2||Ye===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&yr(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||mi(t,s)){if(a=s&-s,a===t.callbackPriority)return a;switch(o!==null&&yr(o),mu(s)){case 2:case 8:s=$o;break;case 32:s=_a;break;case 268435456:s=Yi;break;default:s=_a}return o=Iy.bind(null,t),s=Zi(s,o),t.callbackPriority=a,t.callbackNode=s,a}return o!==null&&o!==null&&yr(o),t.callbackPriority=2,t.callbackNode=null,2}function Iy(t,a){if(Dt!==0&&Dt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(ql()&&t.callbackNode!==s)return null;var o=qe;return o=gn(t,t===at?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(wy(t,o,a),$y(t,Gt()),t.callbackNode!=null&&t.callbackNode===s?Iy.bind(null,t):null)}function Py(t,a){if(ql())return null;wy(t,a,!0)}function Yw(){oj(function(){(Ke&6)!==0?Zi(Uo,Zw):Uy()})}function ef(){if(Qa===0){var t=ys;t===0&&(t=Fi,Fi<<=1,(Fi&261888)===0&&(Fi=256)),Qa=t}return Qa}function Vy(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Zo(""+t)}function Gy(t,a){var s=a.ownerDocument.createElement("input");return s.name=a.name,s.value=a.value,t.id&&s.setAttribute("form",t.id),a.parentNode.insertBefore(s,a),t=new FormData(t),s.parentNode.removeChild(s),t}function Fw(t,a,s,o,f){if(a==="submit"&&s&&s.stateNode===f){var m=Vy((f[Wt]||null).action),v=o.submitter;v&&(a=(a=v[Wt]||null)?Vy(a.formAction):v.getAttribute("formAction"),a!==null&&(m=a,v=null));var j=new Jo("action","action",null,o,f);t.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Qa!==0){var _=v?Gy(f,v):new FormData(f);Sd(s,{pending:!0,data:_,method:f.method,action:m},null,_)}}else typeof m=="function"&&(j.preventDefault(),_=v?Gy(f,v):new FormData(f),Sd(s,{pending:!0,data:_,method:f.method,action:m},m,_))},currentTarget:f}]})}}for(var tf=0;tf<Lu.length;tf++){var nf=Lu[tf],Xw=nf.toLowerCase(),Jw=nf[0].toUpperCase()+nf.slice(1);Bn(Xw,"on"+Jw)}Bn(xh,"onAnimationEnd"),Bn(wh,"onAnimationIteration"),Bn(jh,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(mw,"onTransitionRun"),Bn(hw,"onTransitionStart"),Bn(gw,"onTransitionCancel"),Bn(Nh,"onTransitionEnd"),as("onMouseEnter",["mouseout","mouseover"]),as("onMouseLeave",["mouseout","mouseover"]),as("onPointerEnter",["pointerout","pointerover"]),as("onPointerLeave",["pointerout","pointerover"]),gi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gi("onBeforeInput",["compositionend","keypress","textInput","paste"]),gi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ww=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Wr));function Hy(t,a){a=(a&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],f=o.event;o=o.listeners;e:{var m=void 0;if(a)for(var v=o.length-1;0<=v;v--){var j=o[v],_=j.instance,B=j.currentTarget;if(j=j.listener,_!==m&&f.isPropagationStopped())break e;m=j,f.currentTarget=B;try{m(f)}catch(K){tl(K)}f.currentTarget=null,m=_}else for(v=0;v<o.length;v++){if(j=o[v],_=j.instance,B=j.currentTarget,j=j.listener,_!==m&&f.isPropagationStopped())break e;m=j,f.currentTarget=B;try{m(f)}catch(K){tl(K)}f.currentTarget=null,m=_}}}}function Le(t,a){var s=a[hu];s===void 0&&(s=a[hu]=new Set);var o=t+"__bubble";s.has(o)||(Ky(a,t,2,!1),s.add(o))}function af(t,a,s){var o=0;a&&(o|=4),Ky(s,t,o,a)}var Il="_reactListening"+Math.random().toString(36).slice(2);function sf(t){if(!t[Il]){t[Il]=!0,Um.forEach(function(s){s!=="selectionchange"&&(Ww.has(s)||af(s,!1,t),af(s,!0,t))});var a=t.nodeType===9?t:t.ownerDocument;a===null||a[Il]||(a[Il]=!0,af("selectionchange",!1,a))}}function Ky(t,a,s,o){switch(xb(a)){case 2:var f=Cj;break;case 8:f=_j;break;default:f=Sf}s=f.bind(null,a,s,t),f=void 0,!Nu||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(a,s,{capture:!0,passive:f}):t.addEventListener(a,s,!0):f!==void 0?t.addEventListener(a,s,{passive:f}):t.addEventListener(a,s,!1)}function rf(t,a,s,o,f){var m=o;if((a&1)===0&&(a&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var j=o.stateNode.containerInfo;if(j===f)break;if(v===4)for(v=o.return;v!==null;){var _=v.tag;if((_===3||_===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;j!==null;){if(v=es(j),v===null)return;if(_=v.tag,_===5||_===6||_===26||_===27){o=m=v;continue e}j=j.parentNode}}o=o.return}Xm(function(){var B=m,K=wu(s),F=[];e:{var U=kh.get(t);if(U!==void 0){var I=Jo,me=t;switch(t){case"keypress":if(Fo(s)===0)break e;case"keydown":case"keyup":I=Kx;break;case"focusin":me="focus",I=_u;break;case"focusout":me="blur",I=_u;break;case"beforeblur":case"afterblur":I=_u;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":I=eh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":I=Rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":I=Yx;break;case xh:case wh:case jh:I=Lx;break;case Nh:I=Xx;break;case"scroll":case"scrollend":I=Dx;break;case"wheel":I=Wx;break;case"copy":case"cut":case"paste":I=Ux;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":I=nh;break;case"toggle":case"beforetoggle":I=tw}var we=(a&4)!==0,et=!we&&(t==="scroll"||t==="scrollend"),z=we?U!==null?U+"Capture":null:U;we=[];for(var T=B,M;T!==null;){var Y=T;if(M=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||M===null||z===null||(Y=xr(T,z),Y!=null&&we.push(eo(T,Y,M))),et)break;T=T.return}0<we.length&&(U=new I(U,me,null,s,K),F.push({event:U,listeners:we}))}}if((a&7)===0){e:{if(U=t==="mouseover"||t==="pointerover",I=t==="mouseout"||t==="pointerout",U&&s!==xu&&(me=s.relatedTarget||s.fromElement)&&(es(me)||me[Wi]))break e;if((I||U)&&(U=K.window===K?K:(U=K.ownerDocument)?U.defaultView||U.parentWindow:window,I?(me=s.relatedTarget||s.toElement,I=B,me=me?es(me):null,me!==null&&(et=c(me),we=me.tag,me!==et||we!==5&&we!==27&&we!==6)&&(me=null)):(I=null,me=B),I!==me)){if(we=eh,Y="onMouseLeave",z="onMouseEnter",T="mouse",(t==="pointerout"||t==="pointerover")&&(we=nh,Y="onPointerLeave",z="onPointerEnter",T="pointer"),et=I==null?U:Sr(I),M=me==null?U:Sr(me),U=new we(Y,T+"leave",I,s,K),U.target=et,U.relatedTarget=M,Y=null,es(K)===B&&(we=new we(z,T+"enter",me,s,K),we.target=M,we.relatedTarget=et,Y=we),et=Y,I&&me)t:{for(we=ej,z=I,T=me,M=0,Y=z;Y;Y=we(Y))M++;Y=0;for(var Se=T;Se;Se=we(Se))Y++;for(;0<M-Y;)z=we(z),M--;for(;0<Y-M;)T=we(T),Y--;for(;M--;){if(z===T||T!==null&&z===T.alternate){we=z;break t}z=we(z),T=we(T)}we=null}else we=null;I!==null&&Qy(F,U,I,we,!1),me!==null&&et!==null&&Qy(F,et,me,we,!0)}}e:{if(U=B?Sr(B):window,I=U.nodeName&&U.nodeName.toLowerCase(),I==="select"||I==="input"&&U.type==="file")var Ve=uh;else if(lh(U))if(dh)Ve=dw;else{Ve=cw;var ye=lw}else I=U.nodeName,!I||I.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?B&&Su(B.elementType)&&(Ve=uh):Ve=uw;if(Ve&&(Ve=Ve(t,B))){ch(F,Ve,s,K);break e}ye&&ye(t,U,B),t==="focusout"&&B&&U.type==="number"&&B.memoizedProps.value!=null&&vu(U,"number",U.value)}switch(ye=B?Sr(B):window,t){case"focusin":(lh(ye)||ye.contentEditable==="true")&&(cs=ye,Ru=B,Tr=null);break;case"focusout":Tr=Ru=cs=null;break;case"mousedown":Mu=!0;break;case"contextmenu":case"mouseup":case"dragend":Mu=!1,vh(F,s,K);break;case"selectionchange":if(pw)break;case"keydown":case"keyup":vh(F,s,K)}var Oe;if(Eu)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ls?rh(t,s)&&(Ue="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(ah&&s.locale!=="ko"&&(ls||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ls&&(Oe=Jm()):(Oa=K,ku="value"in Oa?Oa.value:Oa.textContent,ls=!0)),ye=Pl(B,Ue),0<ye.length&&(Ue=new th(Ue,t,null,s,K),F.push({event:Ue,listeners:ye}),Oe?Ue.data=Oe:(Oe=oh(s),Oe!==null&&(Ue.data=Oe)))),(Oe=aw?iw(t,s):sw(t,s))&&(Ue=Pl(B,"onBeforeInput"),0<Ue.length&&(ye=new th("onBeforeInput","beforeinput",null,s,K),F.push({event:ye,listeners:Ue}),ye.data=Oe)),Fw(F,t,B,s,K)}Hy(F,a)})}function eo(t,a,s){return{instance:t,listener:a,currentTarget:s}}function Pl(t,a){for(var s=a+"Capture",o=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=xr(t,s),f!=null&&o.unshift(eo(t,f,m)),f=xr(t,a),f!=null&&o.push(eo(t,f,m))),t.tag===3)return o;t=t.return}return[]}function ej(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Qy(t,a,s,o,f){for(var m=a._reactName,v=[];s!==null&&s!==o;){var j=s,_=j.alternate,B=j.stateNode;if(j=j.tag,_!==null&&_===o)break;j!==5&&j!==26&&j!==27||B===null||(_=B,f?(B=xr(s,m),B!=null&&v.unshift(eo(s,B,_))):f||(B=xr(s,m),B!=null&&v.push(eo(s,B,_)))),s=s.return}v.length!==0&&t.push({event:a,listeners:v})}var tj=/\r\n?/g,nj=/\u0000|\uFFFD/g;function Zy(t){return(typeof t=="string"?t:""+t).replace(tj,`
|
|
10
|
-
`).replace(nj,"")}function Yy(t,a){return a=Zy(a),Zy(t)===a}function We(t,a,s,o,f,m){switch(s){case"children":typeof o=="string"?a==="body"||a==="textarea"&&o===""||ss(t,o):(typeof o=="number"||typeof o=="bigint")&&a!=="body"&&ss(t,""+o);break;case"className":Ko(t,"class",o);break;case"tabIndex":Ko(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Ko(t,s,o);break;case"style":Ym(t,o,m);break;case"data":if(a!=="object"){Ko(t,"data",o);break}case"src":case"href":if(o===""&&(a!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Zo(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(s==="formAction"?(a!=="input"&&We(t,a,"name",f.name,f,null),We(t,a,"formEncType",f.formEncType,f,null),We(t,a,"formMethod",f.formMethod,f,null),We(t,a,"formTarget",f.formTarget,f,null)):(We(t,a,"encType",f.encType,f,null),We(t,a,"method",f.method,f,null),We(t,a,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Zo(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=na);break;case"onScroll":o!=null&&Le("scroll",t);break;case"onScrollEnd":o!=null&&Le("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=Zo(""+o),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Le("beforetoggle",t),Le("toggle",t),Ho(t,"popover",o);break;case"xlinkActuate":ta(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ta(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ta(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ta(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ta(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ta(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ta(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ta(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ta(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ho(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ex.get(s)||s,Ho(t,s,o))}}function of(t,a,s,o,f,m){switch(s){case"style":Ym(t,o,m);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(s=o.__html,s!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=s}}break;case"children":typeof o=="string"?ss(t,o):(typeof o=="number"||typeof o=="bigint")&&ss(t,""+o);break;case"onScroll":o!=null&&Le("scroll",t);break;case"onScrollEnd":o!=null&&Le("scrollend",t);break;case"onClick":o!=null&&(t.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$m.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),a=s.slice(2,f?s.length-7:void 0),m=t[Wt]||null,m=m!=null?m[s]:null,typeof m=="function"&&t.removeEventListener(a,m,f),typeof o=="function")){typeof m!="function"&&m!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(a,o,f);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Ho(t,s,o)}}}function Vt(t,a,s){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",t),Le("load",t);var o=!1,f=!1,m;for(m in s)if(s.hasOwnProperty(m)){var v=s[m];if(v!=null)switch(m){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:We(t,a,m,v,s,null)}}f&&We(t,a,"srcSet",s.srcSet,s,null),o&&We(t,a,"src",s.src,s,null);return;case"input":Le("invalid",t);var j=m=v=f=null,_=null,B=null;for(o in s)if(s.hasOwnProperty(o)){var K=s[o];if(K!=null)switch(o){case"name":f=K;break;case"type":v=K;break;case"checked":_=K;break;case"defaultChecked":B=K;break;case"value":m=K;break;case"defaultValue":j=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(r(137,a));break;default:We(t,a,o,K,s,null)}}Hm(t,m,j,_,B,v,f,!1);return;case"select":Le("invalid",t),o=v=m=null;for(f in s)if(s.hasOwnProperty(f)&&(j=s[f],j!=null))switch(f){case"value":m=j;break;case"defaultValue":v=j;break;case"multiple":o=j;default:We(t,a,f,j,s,null)}a=m,s=v,t.multiple=!!o,a!=null?is(t,!!o,a,!1):s!=null&&is(t,!!o,s,!0);return;case"textarea":Le("invalid",t),m=f=o=null;for(v in s)if(s.hasOwnProperty(v)&&(j=s[v],j!=null))switch(v){case"value":o=j;break;case"defaultValue":f=j;break;case"children":m=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(91));break;default:We(t,a,v,j,s,null)}Qm(t,o,f,m);return;case"option":for(_ in s)s.hasOwnProperty(_)&&(o=s[_],o!=null)&&(_==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":We(t,a,_,o,s,null));return;case"dialog":Le("beforetoggle",t),Le("toggle",t),Le("cancel",t),Le("close",t);break;case"iframe":case"object":Le("load",t);break;case"video":case"audio":for(o=0;o<Wr.length;o++)Le(Wr[o],t);break;case"image":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"embed":case"source":case"link":Le("error",t),Le("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(B in s)if(s.hasOwnProperty(B)&&(o=s[B],o!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:We(t,a,B,o,s,null)}return;default:if(Su(a)){for(K in s)s.hasOwnProperty(K)&&(o=s[K],o!==void 0&&of(t,a,K,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&We(t,a,j,o,s,null))}function aj(t,a,s,o){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,v=null,j=null,_=null,B=null,K=null;for(I in s){var F=s[I];if(s.hasOwnProperty(I)&&F!=null)switch(I){case"checked":break;case"value":break;case"defaultValue":_=F;default:o.hasOwnProperty(I)||We(t,a,I,null,o,F)}}for(var U in o){var I=o[U];if(F=s[U],o.hasOwnProperty(U)&&(I!=null||F!=null))switch(U){case"type":m=I;break;case"name":f=I;break;case"checked":B=I;break;case"defaultChecked":K=I;break;case"value":v=I;break;case"defaultValue":j=I;break;case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(137,a));break;default:I!==F&&We(t,a,U,I,o,F)}}bu(t,v,j,_,B,K,m,f);return;case"select":I=v=j=U=null;for(m in s)if(_=s[m],s.hasOwnProperty(m)&&_!=null)switch(m){case"value":break;case"multiple":I=_;default:o.hasOwnProperty(m)||We(t,a,m,null,o,_)}for(f in o)if(m=o[f],_=s[f],o.hasOwnProperty(f)&&(m!=null||_!=null))switch(f){case"value":U=m;break;case"defaultValue":j=m;break;case"multiple":v=m;default:m!==_&&We(t,a,f,m,o,_)}a=j,s=v,o=I,U!=null?is(t,!!s,U,!1):!!o!=!!s&&(a!=null?is(t,!!s,a,!0):is(t,!!s,s?[]:"",!1));return;case"textarea":I=U=null;for(j in s)if(f=s[j],s.hasOwnProperty(j)&&f!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:We(t,a,j,null,o,f)}for(v in o)if(f=o[v],m=s[v],o.hasOwnProperty(v)&&(f!=null||m!=null))switch(v){case"value":U=f;break;case"defaultValue":I=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&We(t,a,v,f,o,m)}Km(t,U,I);return;case"option":for(var me in s)U=s[me],s.hasOwnProperty(me)&&U!=null&&!o.hasOwnProperty(me)&&(me==="selected"?t.selected=!1:We(t,a,me,null,o,U));for(_ in o)U=o[_],I=s[_],o.hasOwnProperty(_)&&U!==I&&(U!=null||I!=null)&&(_==="selected"?t.selected=U&&typeof U!="function"&&typeof U!="symbol":We(t,a,_,U,o,I));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in s)U=s[we],s.hasOwnProperty(we)&&U!=null&&!o.hasOwnProperty(we)&&We(t,a,we,null,o,U);for(B in o)if(U=o[B],I=s[B],o.hasOwnProperty(B)&&U!==I&&(U!=null||I!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,a));break;default:We(t,a,B,U,o,I)}return;default:if(Su(a)){for(var et in s)U=s[et],s.hasOwnProperty(et)&&U!==void 0&&!o.hasOwnProperty(et)&&of(t,a,et,void 0,o,U);for(K in o)U=o[K],I=s[K],!o.hasOwnProperty(K)||U===I||U===void 0&&I===void 0||of(t,a,K,U,o,I);return}}for(var z in s)U=s[z],s.hasOwnProperty(z)&&U!=null&&!o.hasOwnProperty(z)&&We(t,a,z,null,o,U);for(F in o)U=o[F],I=s[F],!o.hasOwnProperty(F)||U===I||U==null&&I==null||We(t,a,F,U,o,I)}function Fy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ij(){if(typeof performance.getEntriesByType=="function"){for(var t=0,a=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var f=s[o],m=f.transferSize,v=f.initiatorType,j=f.duration;if(m&&j&&Fy(v)){for(v=0,j=f.responseEnd,o+=1;o<s.length;o++){var _=s[o],B=_.startTime;if(B>j)break;var K=_.transferSize,F=_.initiatorType;K&&Fy(F)&&(_=_.responseEnd,v+=K*(_<j?1:(j-B)/(_-B)))}if(--o,a+=8*(m+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return a/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var lf=null,cf=null;function Vl(t){return t.nodeType===9?t:t.ownerDocument}function Xy(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Jy(t,a){if(t===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&a==="foreignObject"?0:t}function uf(t,a){return t==="textarea"||t==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var df=null;function sj(){var t=window.event;return t&&t.type==="popstate"?t===df?!1:(df=t,!0):(df=null,!1)}var Wy=typeof setTimeout=="function"?setTimeout:void 0,rj=typeof clearTimeout=="function"?clearTimeout:void 0,eb=typeof Promise=="function"?Promise:void 0,oj=typeof queueMicrotask=="function"?queueMicrotask:typeof eb<"u"?function(t){return eb.resolve(null).then(t).catch(lj)}:Wy;function lj(t){setTimeout(function(){throw t})}function Za(t){return t==="head"}function tb(t,a){var s=a,o=0;do{var f=s.nextSibling;if(t.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(f),Bs(a);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")to(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,to(s);for(var m=s.firstChild;m;){var v=m.nextSibling,j=m.nodeName;m[vr]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=v}}else s==="body"&&to(t.ownerDocument.body);s=f}while(s);Bs(a)}function nb(t,a){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?a?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(a?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function ff(t){var a=t.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var s=a;switch(a=a.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":ff(s),gu(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function cj(t,a,s,o){for(;t.nodeType===1;){var f=s;if(t.nodeName.toLowerCase()!==a.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[vr])switch(a){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(a==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=kn(t.nextSibling),t===null)break}return null}function uj(t,a,s){if(a==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=kn(t.nextSibling),t===null))return null;return t}function ab(t,a){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=kn(t.nextSibling),t===null))return null;return t}function pf(t){return t.data==="$?"||t.data==="$~"}function mf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function dj(t,a){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=a;else if(t.data!=="$?"||s.readyState!=="loading")a();else{var o=function(){a(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function kn(t){for(;t!=null;t=t.nextSibling){var a=t.nodeType;if(a===1||a===3)break;if(a===8){if(a=t.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return t}var hf=null;function ib(t){t=t.nextSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(a===0)return kn(t.nextSibling);a--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||a++}t=t.nextSibling}return null}function sb(t){t=t.previousSibling;for(var a=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(a===0)return t;a--}else s!=="/$"&&s!=="/&"||a++}t=t.previousSibling}return null}function rb(t,a,s){switch(a=Vl(s),t){case"html":if(t=a.documentElement,!t)throw Error(r(452));return t;case"head":if(t=a.head,!t)throw Error(r(453));return t;case"body":if(t=a.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function to(t){for(var a=t.attributes;a.length;)t.removeAttributeNode(a[0]);gu(t)}var An=new Map,ob=new Set;function Gl(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ba=W.d;W.d={f:fj,r:pj,D:mj,C:hj,L:gj,m:yj,X:vj,S:bj,M:Sj};function fj(){var t=ba.f(),a=Ml();return t||a}function pj(t){var a=ts(t);a!==null&&a.tag===5&&a.type==="form"?Ng(a):ba.r(t)}var zs=typeof document>"u"?null:document;function lb(t,a,s){var o=zs;if(o&&typeof a=="string"&&a){var f=bn(a);f='link[rel="'+t+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),ob.has(f)||(ob.add(f),t={rel:t,crossOrigin:s,href:a},o.querySelector(f)===null&&(a=o.createElement("link"),Vt(a,"link",t),Rt(a),o.head.appendChild(a)))}}function mj(t){ba.D(t),lb("dns-prefetch",t,null)}function hj(t,a){ba.C(t,a),lb("preconnect",t,a)}function gj(t,a,s){ba.L(t,a,s);var o=zs;if(o&&t&&a){var f='link[rel="preload"][as="'+bn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+bn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+bn(s.imageSizes)+'"]')):f+='[href="'+bn(t)+'"]';var m=f;switch(a){case"style":m=Rs(t);break;case"script":m=Ms(t)}An.has(m)||(t=w({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:t,as:a},s),An.set(m,t),o.querySelector(f)!==null||a==="style"&&o.querySelector(no(m))||a==="script"&&o.querySelector(ao(m))||(a=o.createElement("link"),Vt(a,"link",t),Rt(a),o.head.appendChild(a)))}}function yj(t,a){ba.m(t,a);var s=zs;if(s&&t){var o=a&&typeof a.as=="string"?a.as:"script",f='link[rel="modulepreload"][as="'+bn(o)+'"][href="'+bn(t)+'"]',m=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Ms(t)}if(!An.has(m)&&(t=w({rel:"modulepreload",href:t},a),An.set(m,t),s.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ao(m)))return}o=s.createElement("link"),Vt(o,"link",t),Rt(o),s.head.appendChild(o)}}}function bj(t,a,s){ba.S(t,a,s);var o=zs;if(o&&t){var f=ns(o).hoistableStyles,m=Rs(t);a=a||"default";var v=f.get(m);if(!v){var j={loading:0,preload:null};if(v=o.querySelector(no(m)))j.loading=5;else{t=w({rel:"stylesheet",href:t,"data-precedence":a},s),(s=An.get(m))&&gf(t,s);var _=v=o.createElement("link");Rt(_),Vt(_,"link",t),_._p=new Promise(function(B,K){_.onload=B,_.onerror=K}),_.addEventListener("load",function(){j.loading|=1}),_.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Hl(v,a,o)}v={type:"stylesheet",instance:v,count:1,state:j},f.set(m,v)}}}function vj(t,a){ba.X(t,a);var s=zs;if(s&&t){var o=ns(s).hoistableScripts,f=Ms(t),m=o.get(f);m||(m=s.querySelector(ao(f)),m||(t=w({src:t,async:!0},a),(a=An.get(f))&&yf(t,a),m=s.createElement("script"),Rt(m),Vt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function Sj(t,a){ba.M(t,a);var s=zs;if(s&&t){var o=ns(s).hoistableScripts,f=Ms(t),m=o.get(f);m||(m=s.querySelector(ao(f)),m||(t=w({src:t,async:!0,type:"module"},a),(a=An.get(f))&&yf(t,a),m=s.createElement("script"),Rt(m),Vt(m,"link",t),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(f,m))}}function cb(t,a,s,o){var f=(f=ie.current)?Gl(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=Rs(s.href),s=ns(f).hoistableStyles,o=s.get(a),o||(o={type:"style",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Rs(s.href);var m=ns(f).hoistableStyles,v=m.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,v),(m=f.querySelector(no(t)))&&!m._p&&(v.instance=m,v.state.loading=5),An.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},An.set(t,s),m||xj(f,t,s,v.state))),a&&o===null)throw Error(r(528,""));return v}if(a&&o!==null)throw Error(r(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Ms(s),s=ns(f).hoistableScripts,o=s.get(a),o||(o={type:"script",instance:null,count:0,state:null},s.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Rs(t){return'href="'+bn(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function ub(t){return w({},t,{"data-precedence":t.precedence,precedence:null})}function xj(t,a,s,o){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?o.loading=1:(a=t.createElement("link"),o.preload=a,a.addEventListener("load",function(){return o.loading|=1}),a.addEventListener("error",function(){return o.loading|=2}),Vt(a,"link",s),Rt(a),t.head.appendChild(a))}function Ms(t){return'[src="'+bn(t)+'"]'}function ao(t){return"script[async]"+t}function db(t,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+bn(s.href)+'"]');if(o)return a.instance=o,Rt(o),o;var f=w({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Rt(o),Vt(o,"style",f),Hl(o,s.precedence,t),a.instance=o;case"stylesheet":f=Rs(s.href);var m=t.querySelector(no(f));if(m)return a.state.loading|=4,a.instance=m,Rt(m),m;o=ub(s),(f=An.get(f))&&gf(o,f),m=(t.ownerDocument||t).createElement("link"),Rt(m);var v=m;return v._p=new Promise(function(j,_){v.onload=j,v.onerror=_}),Vt(m,"link",o),a.state.loading|=4,Hl(m,s.precedence,t),a.instance=m;case"script":return m=Ms(s.src),(f=t.querySelector(ao(m)))?(a.instance=f,Rt(f),f):(o=s,(f=An.get(m))&&(o=w({},s),yf(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),Rt(f),Vt(f,"link",o),t.head.appendChild(f),a.instance=f);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(o=a.instance,a.state.loading|=4,Hl(o,s.precedence,t));return a.instance}function Hl(t,a,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,m=f,v=0;v<o.length;v++){var j=o[v];if(j.dataset.precedence===a)m=j;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(a=s.nodeType===9?s.head:s,a.insertBefore(t,a.firstChild))}function gf(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.title==null&&(t.title=a.title)}function yf(t,a){t.crossOrigin==null&&(t.crossOrigin=a.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=a.referrerPolicy),t.integrity==null&&(t.integrity=a.integrity)}var Kl=null;function fb(t,a,s){if(Kl===null){var o=new Map,f=Kl=new Map;f.set(s,o)}else f=Kl,o=f.get(s),o||(o=new Map,f.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),f=0;f<s.length;f++){var m=s[f];if(!(m[vr]||m[Ut]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var v=m.getAttribute(a)||"";v=t+v;var j=o.get(v);j?j.push(m):o.set(v,[m])}}return o}function pb(t,a,s){t=t.ownerDocument||t,t.head.insertBefore(s,a==="title"?t.querySelector("head > title"):null)}function wj(t,a,s){if(s===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function mb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function jj(t,a,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Rs(o.href),m=a.querySelector(no(f));if(m){a=m._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=Ql.bind(t),a.then(t,t)),s.state.loading|=4,s.instance=m,Rt(m);return}m=a.ownerDocument||a,o=ub(o),(f=An.get(f))&&gf(o,f),m=m.createElement("link"),Rt(m);var v=m;v._p=new Promise(function(j,_){v.onload=j,v.onerror=_}),Vt(m,"link",o),s.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Ql.bind(t),a.addEventListener("load",s),a.addEventListener("error",s))}}var bf=0;function Nj(t,a){return t.stylesheets&&t.count===0&&Yl(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Yl(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+a);0<t.imgBytes&&bf===0&&(bf=62500*ij());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Yl(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>bf?50:800)+a);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Ql(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yl(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Zl=null;function Yl(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Zl=new Map,a.forEach(kj,t),Zl=null,Ql.call(t))}function kj(t,a){if(!(a.state.loading&4)){var s=Zl.get(t);if(s)var o=s.get(null);else{s=new Map,Zl.set(t,s);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var v=f[m];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(s.set(v.dataset.precedence,v),o=v)}o&&s.set(null,o)}f=a.instance,v=f.getAttribute("data-precedence"),m=s.get(v)||o,m===o&&s.set(null,f),s.set(v,f),this.count++,o=Ql.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),a.state.loading|=4}}var io={$$typeof:X,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function Aj(t,a,s,o,f,m,v,j,_){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ea(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ea(0),this.hiddenUpdates=ea(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function hb(t,a,s,o,f,m,v,j,_,B,K,F){return t=new Aj(t,a,s,v,_,B,K,F,j),a=1,m===!0&&(a|=24),m=un(3,null,null,a),t.current=m,m.stateNode=t,a=Fu(),a.refCount++,t.pooledCache=a,a.refCount++,m.memoizedState={element:o,isDehydrated:s,cache:a},ed(m),t}function gb(t){return t?(t=fs,t):fs}function yb(t,a,s,o,f,m){f=gb(f),o.context===null?o.context=f:o.pendingContext=f,o=La(a),o.payload={element:s},m=m===void 0?null:m,m!==null&&(o.callback=m),s=qa(t,o,a),s!==null&&(rn(s,t,a),Br(s,t,a))}function bb(t,a){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<a?s:a}}function vf(t,a){bb(t,a),(t=t.alternate)&&bb(t,a)}function vb(t){if(t.tag===13||t.tag===31){var a=Si(t,67108864);a!==null&&rn(a,t,67108864),vf(t,67108864)}}function Sb(t){if(t.tag===13||t.tag===31){var a=hn();a=pu(a);var s=Si(t,a);s!==null&&rn(s,t,a),vf(t,a)}}var Fl=!0;function Cj(t,a,s,o){var f=$.T;$.T=null;var m=W.p;try{W.p=2,Sf(t,a,s,o)}finally{W.p=m,$.T=f}}function _j(t,a,s,o){var f=$.T;$.T=null;var m=W.p;try{W.p=8,Sf(t,a,s,o)}finally{W.p=m,$.T=f}}function Sf(t,a,s,o){if(Fl){var f=xf(o);if(f===null)rf(t,a,o,Xl,s),wb(t,o);else if(Ej(f,t,a,s,o))o.stopPropagation();else if(wb(t,o),a&4&&-1<Tj.indexOf(t)){for(;f!==null;){var m=ts(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=Wn(m.pendingLanes);if(v!==0){var j=m;for(j.pendingLanes|=2,j.entangledLanes|=2;v;){var _=1<<31-Ot(v);j.entanglements[1]|=_,v&=~_}Fn(m),(Ke&6)===0&&(zl=Gt()+500,Jr(0))}}break;case 31:case 13:j=Si(m,2),j!==null&&rn(j,m,2),Ml(),vf(m,2)}if(m=xf(o),m===null&&rf(t,a,o,Xl,s),m===f)break;f=m}f!==null&&o.stopPropagation()}else rf(t,a,o,null,s)}}function xf(t){return t=wu(t),wf(t)}var Xl=null;function wf(t){if(Xl=null,t=es(t),t!==null){var a=c(t);if(a===null)t=null;else{var s=a.tag;if(s===13){if(t=d(a),t!==null)return t;t=null}else if(s===31){if(t=h(a),t!==null)return t;t=null}else if(s===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;t=null}else a!==t&&(t=null)}}return Xl=t,null}function xb(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(lu()){case Uo:return 2;case $o:return 8;case _a:case Io:return 32;case Yi:return 268435456;default:return 32}default:return 32}}var jf=!1,Ya=null,Fa=null,Xa=null,so=new Map,ro=new Map,Ja=[],Tj="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function wb(t,a){switch(t){case"focusin":case"focusout":Ya=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":so.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(a.pointerId)}}function oo(t,a,s,o,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:a,domEventName:s,eventSystemFlags:o,nativeEvent:m,targetContainers:[f]},a!==null&&(a=ts(a),a!==null&&vb(a)),t):(t.eventSystemFlags|=o,a=t.targetContainers,f!==null&&a.indexOf(f)===-1&&a.push(f),t)}function Ej(t,a,s,o,f){switch(a){case"focusin":return Ya=oo(Ya,t,a,s,o,f),!0;case"dragenter":return Fa=oo(Fa,t,a,s,o,f),!0;case"mouseover":return Xa=oo(Xa,t,a,s,o,f),!0;case"pointerover":var m=f.pointerId;return so.set(m,oo(so.get(m)||null,t,a,s,o,f)),!0;case"gotpointercapture":return m=f.pointerId,ro.set(m,oo(ro.get(m)||null,t,a,s,o,f)),!0}return!1}function jb(t){var a=es(t.target);if(a!==null){var s=c(a);if(s!==null){if(a=s.tag,a===13){if(a=d(s),a!==null){t.blockedOn=a,Lm(t.priority,function(){Sb(s)});return}}else if(a===31){if(a=h(s),a!==null){t.blockedOn=a,Lm(t.priority,function(){Sb(s)});return}}else if(a===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Jl(t){if(t.blockedOn!==null)return!1;for(var a=t.targetContainers;0<a.length;){var s=xf(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);xu=o,s.target.dispatchEvent(o),xu=null}else return a=ts(s),a!==null&&vb(a),t.blockedOn=s,!1;a.shift()}return!0}function Nb(t,a,s){Jl(t)&&s.delete(a)}function Oj(){jf=!1,Ya!==null&&Jl(Ya)&&(Ya=null),Fa!==null&&Jl(Fa)&&(Fa=null),Xa!==null&&Jl(Xa)&&(Xa=null),so.forEach(Nb),ro.forEach(Nb)}function Wl(t,a){t.blockedOn===a&&(t.blockedOn=null,jf||(jf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Oj)))}var ec=null;function kb(t){ec!==t&&(ec=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ec===t&&(ec=null);for(var a=0;a<t.length;a+=3){var s=t[a],o=t[a+1],f=t[a+2];if(typeof o!="function"){if(wf(o||s)===null)continue;break}var m=ts(s);m!==null&&(t.splice(a,3),a-=3,Sd(m,{pending:!0,data:f,method:s.method,action:o},o,f))}}))}function Bs(t){function a(_){return Wl(_,t)}Ya!==null&&Wl(Ya,t),Fa!==null&&Wl(Fa,t),Xa!==null&&Wl(Xa,t),so.forEach(a),ro.forEach(a);for(var s=0;s<Ja.length;s++){var o=Ja[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<Ja.length&&(s=Ja[0],s.blockedOn===null);)jb(s),s.blockedOn===null&&Ja.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var f=s[o],m=s[o+1],v=f[Wt]||null;if(typeof m=="function")v||kb(s);else if(v){var j=null;if(m&&m.hasAttribute("formAction")){if(f=m,v=m[Wt]||null)j=v.formAction;else if(wf(f)!==null)continue}else j=v.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),kb(s)}}}function Ab(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function a(){f!==null&&(f(),f=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),f!==null&&(f(),f=null)}}}function Nf(t){this._internalRoot=t}tc.prototype.render=Nf.prototype.render=function(t){var a=this._internalRoot;if(a===null)throw Error(r(409));var s=a.current,o=hn();yb(s,o,t,a,null,null)},tc.prototype.unmount=Nf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var a=t.containerInfo;yb(t.current,2,null,t,null,null),Ml(),a[Wi]=null}};function tc(t){this._internalRoot=t}tc.prototype.unstable_scheduleHydration=function(t){if(t){var a=Bm();t={blockedOn:null,target:t,priority:a};for(var s=0;s<Ja.length&&a!==0&&a<Ja[s].priority;s++);Ja.splice(s,0,t),s===0&&jb(t)}};var Cb=n.version;if(Cb!=="19.2.4")throw Error(r(527,Cb,"19.2.4"));W.findDOMNode=function(t){var a=t._reactInternals;if(a===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=b(a),t=t!==null?x(t):null,t=t===null?null:t.stateNode,t};var Dj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{Ta=nc.inject(Dj),vt=nc}catch{}}return lo.createRoot=function(t,a){if(!l(t))throw Error(r(299));var s=!1,o="",f=Rg,m=Mg,v=Bg;return a!=null&&(a.unstable_strictMode===!0&&(s=!0),a.identifierPrefix!==void 0&&(o=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(m=a.onCaughtError),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=hb(t,1,!1,null,null,s,o,null,f,m,v,Ab),t[Wi]=a.current,sf(t),new Nf(a)},lo.hydrateRoot=function(t,a,s){if(!l(t))throw Error(r(299));var o=!1,f="",m=Rg,v=Mg,j=Bg,_=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(v=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(_=s.formState)),a=hb(t,1,!0,a,s??null,o,f,_,m,v,j,Ab),a.context=gb(null),s=a.current,o=hn(),o=pu(o),f=La(o),f.callback=null,qa(s,f,o),s=o,a.current.lanes=s,hi(a,s),Fn(a),t[Wi]=a.current,sf(t),new tc(a)},lo.version="19.2.4",lo}var Ob;function Xj(){if(Ob)return kf.exports;Ob=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),kf.exports=Fj(),kf.exports}var Jj=Xj();const Wj={bodySerializer:e=>JSON.stringify(e,(n,i)=>typeof i=="bigint"?i.toString():i)},eN=({onRequest:e,onSseError:n,onSseEvent:i,responseTransformer:r,responseValidator:l,sseDefaultRetryDelay:c,sseMaxRetryAttempts:d,sseMaxRetryDelay:h,sseSleepFn:g,url:b,...x})=>{let w;const N=g??(A=>new Promise(E=>setTimeout(E,A)));return{stream:async function*(){let A=c??3e3,E=0;const R=x.signal??new AbortController().signal;for(;!R.aborted;){E++;const G=x.headers instanceof Headers?x.headers:new Headers(x.headers);w!==void 0&&G.set("Last-Event-ID",w);try{const X={redirect:"follow",...x,body:x.serializedBody,headers:G,signal:R};let V=new Request(b,X);e&&(V=await e(b,X));const re=await(x.fetch??globalThis.fetch)(V);if(!re.ok)throw new Error(`SSE failed: ${re.status} ${re.statusText}`);if(!re.body)throw new Error("No body in SSE response");const O=re.body.pipeThrough(new TextDecoderStream).getReader();let L="";const ae=()=>{try{O.cancel()}catch{}};R.addEventListener("abort",ae);try{for(;;){const{done:_e,value:Me}=await O.read();if(_e)break;L+=Me;const ve=L.split(`
|
|
11
|
-
|
|
12
|
-
`);L=ve.pop()??"";for(const it of ve){const oe=it.split(`
|
|
13
|
-
`),fe=[];let $;for(const je of oe)if(je.startsWith("data:"))fe.push(je.replace(/^data:\s*/,""));else if(je.startsWith("event:"))$=je.replace(/^event:\s*/,"");else if(je.startsWith("id:"))w=je.replace(/^id:\s*/,"");else if(je.startsWith("retry:")){const le=Number.parseInt(je.replace(/^retry:\s*/,""),10);Number.isNaN(le)||(A=le)}let W,pe=!1;if(fe.length){const je=fe.join(`
|
|
14
|
-
`);try{W=JSON.parse(je),pe=!0}catch{W=je}}pe&&(l&&await l(W),r&&(W=await r(W))),i?.({data:W,event:$,id:w,retry:A}),fe.length&&(yield W)}}}finally{R.removeEventListener("abort",ae),O.releaseLock()}break}catch(X){if(n?.(X),d!==void 0&&E>=d)break;const V=Math.min(A*2**(E-1),h??3e4);await N(V)}}}()}},tN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},nN=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},aN=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},f0=({allowReserved:e,explode:n,name:i,style:r,value:l})=>{if(!n){const h=(e?l:l.map(g=>encodeURIComponent(g))).join(nN(r));switch(r){case"label":return`.${h}`;case"matrix":return`;${i}=${h}`;case"simple":return h;default:return`${i}=${h}`}}const c=tN(r),d=l.map(h=>r==="label"||r==="simple"?e?h:encodeURIComponent(h):zc({allowReserved:e,name:i,value:h})).join(c);return r==="label"||r==="matrix"?c+d:d},zc=({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)}`},p0=({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(([x,w])=>{g=[...g,x,e?w:encodeURIComponent(w)]});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=aN(r),h=Object.entries(l).map(([g,b])=>zc({allowReserved:e,name:r==="deepObject"?`${i}[${g}]`:g,value:b})).join(d);return r==="label"||r==="matrix"?d+h:h},iN=/\{[^{}]+\}/g,sN=({path:e,url:n})=>{let i=n;const r=n.match(iN);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,f0({explode:c,name:d,style:h,value:g}));continue}if(typeof g=="object"){i=i.replace(l,p0({explode:c,name:d,style:h,value:g,valueOnly:!0}));continue}if(h==="matrix"){i=i.replace(l,`;${zc({name:d,value:g})}`);continue}const b=encodeURIComponent(h==="label"?`.${g}`:g);i=i.replace(l,b)}return i},rN=({baseUrl:e,path:n,query:i,querySerializer:r,url:l})=>{const c=l.startsWith("/")?l:`/${l}`;let d=(e??"")+c;n&&(d=sN({path:n,url:d}));let h=i?r(i):"";return h.startsWith("?")&&(h=h.substring(1)),h&&(d+=`?${h}`),d};function oN(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 lN=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},m0=({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=f0({allowReserved:e,explode:!0,name:d,style:"form",value:h,...n});g&&c.push(g)}else if(typeof h=="object"){const g=p0({allowReserved:e,explode:!0,name:d,style:"deepObject",value:h,...i});g&&c.push(g)}else{const g=zc({allowReserved:e,name:d,value:h});g&&c.push(g)}}return c.join("&")},cN=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"}},uN=(e,n)=>n?!!(e.headers.has(n)||e.query?.[n]||e.headers.get("Cookie")?.includes(`${n}=`)):!1,dN=async({security:e,...n})=>{for(const i of e){if(uN(n,i.name))continue;const r=await lN(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}}},Db=e=>rN({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:m0(e.querySerializer),url:e.url}),zb=(e,n)=>{const i={...e,...n};return i.baseUrl?.endsWith("/")&&(i.baseUrl=i.baseUrl.substring(0,i.baseUrl.length-1)),i.headers=h0(e.headers,n.headers),i},fN=e=>{const n=[];return e.forEach((i,r)=>{n.push([r,i])}),n},h0=(...e)=>{const n=new Headers;for(const i of e){if(!i)continue;const r=i instanceof Headers?fN(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 _f{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 pN=()=>({error:new _f,request:new _f,response:new _f}),mN=m0({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),hN={"Content-Type":"application/json"},g0=(e={})=>({...Wj,headers:hN,parseAs:"auto",querySerializer:mN,...e}),y0=(e={})=>{let n=zb(g0(),e);const i=()=>({...n}),r=b=>(n=zb(n,b),i()),l=pN(),c=async b=>{const x={...n,...b,fetch:b.fetch??n.fetch??globalThis.fetch,headers:h0(n.headers,b.headers),serializedBody:void 0};x.security&&await dN({...x,security:x.security}),x.requestValidator&&await x.requestValidator(x),x.body!==void 0&&x.bodySerializer&&(x.serializedBody=x.bodySerializer(x.body)),(x.body===void 0||x.serializedBody==="")&&x.headers.delete("Content-Type");const w=Db(x);return{opts:x,url:w}},d=async b=>{const{opts:x,url:w}=await c(b),N={redirect:"follow",...x,body:oN(x)};let C=new Request(w,N);for(const P of l.request.fns)P&&(C=await P(C,x));const D=x.fetch;let A=await D(C);for(const P of l.response.fns)P&&(A=await P(A,C,x));const E={request:C,response:A};if(A.ok){const P=(x.parseAs==="auto"?cN(A.headers.get("Content-Type")):x.parseAs)??"json";if(A.status===204||A.headers.get("Content-Length")==="0"){let O;switch(P){case"arrayBuffer":case"blob":case"text":O=await A[P]();break;case"formData":O=new FormData;break;case"stream":O=A.body;break;default:O={};break}return x.responseStyle==="data"?O:{data:O,...E}}let re;switch(P){case"arrayBuffer":case"blob":case"formData":case"json":case"text":re=await A[P]();break;case"stream":return x.responseStyle==="data"?A.body:{data:A.body,...E}}return P==="json"&&(x.responseValidator&&await x.responseValidator(re),x.responseTransformer&&(re=await x.responseTransformer(re))),x.responseStyle==="data"?re:{data:re,...E}}const R=await A.text();let G;try{G=JSON.parse(R)}catch{}const X=G??R;let V=X;for(const P of l.error.fns)P&&(V=await P(X,A,C,x));if(V=V||{},x.throwOnError)throw V;return x.responseStyle==="data"?void 0:{error:V,...E}},h=b=>x=>d({...x,method:b}),g=b=>async x=>{const{opts:w,url:N}=await c(x);return eN({...w,body:w.body,headers:w.headers,method:b,onRequest:async(C,D)=>{let A=new Request(C,D);for(const E of l.request.fns)E&&(A=await E(A,w));return A},url:N})};return{buildUrl:Db,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=y0(g0()),gN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),b0=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e}),yN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),bN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects",...e}),vN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations",...e,headers:{"Content-Type":"application/json",...e.headers}}),SN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/locations/{label}",...e}),xN=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}}),wN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),jN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e}),NN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),kN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/queries",...e,headers:{"Content-Type":"application/json",...e.headers}}),AN=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}}),CN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e}),_N=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),TN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors",...e,headers:{"Content-Type":"application/json",...e.headers}}),EN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/competitors/{id}",...e}),v0=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e}),ON=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/runs",...e,headers:{"Content-Type":"application/json",...e.headers}}),DN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e}),zN=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),S0=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/runs/{id}",...e}),RN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/apply",...e,headers:{"Content-Type":"application/json",...e.headers}}),MN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/history",...e}),BN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/history",...e}),LN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/timeline",...e}),qN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/analytics/metrics",...e}),UN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/snapshots/diff",...e}),x0=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings",...e}),$N=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/providers/{name}",...e,headers:{"Content-Type":"application/json",...e.headers}}),IN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/google",...e,headers:{"Content-Type":"application/json",...e.headers}}),PN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/bing",...e,headers:{"Content-Type":"application/json",...e.headers}}),VN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/settings/cdp",...e,headers:{"Content-Type":"application/json",...e.headers}}),GN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),HN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e}),KN=e=>(e.client??Q).put({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/schedule",...e,headers:{"Content-Type":"application/json",...e.headers}}),QN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e}),ZN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications",...e,headers:{"Content-Type":"application/json",...e.headers}}),YN=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}",...e}),FN=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/notifications/{id}/test",...e}),XN=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/cdp/status",...e}),JN=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections",...e}),WN=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}}),ek=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/connections/{type}",...e}),tk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/properties",...e}),nk=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}}),ak=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}}),ik=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}}),sk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance",...e}),rk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/performance/daily",...e}),ok=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}}),lk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/inspections",...e}),ck=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/deindexed",...e}),w0=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage",...e}),uk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/coverage/history",...e}),dk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/sitemaps",...e}),fk=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/google/gsc/discover-sitemaps",...e}),pk=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}}),mk=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}}),hk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/locations",...e}),gk=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}}),yk=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}}),bk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/keywords",...e}),vk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/place-actions",...e}),Sk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/lodging",...e}),xk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/places",...e}),wk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/gbp/summary",...e}),jk=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}}),Nk=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/disconnect",...e}),kk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/status",...e}),Ak=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/sites",...e}),Ck=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}}),j0=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/coverage",...e}),_k=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/inspections",...e}),Tk=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}}),Ek=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}}),Ok=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}}),Dk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/bing/performance",...e}),zk=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}}),Rk=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/disconnect",...e}),Mk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/status",...e}),Bk=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}}),Lk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/traffic",...e}),qk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/ai-referral-history",...e}),Uk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/social-referral-history",...e}),$k=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/ga/session-history",...e}),Ik=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/insights",...e}),Pk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/report",...e}),Vk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/health/history",...e}),Gk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/citations/visibility",...e}),Hk=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}}),Kk=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/overview",...e}),Qk=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/status",...e}),Zk=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/install",...e}),Yk=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e}),Fk=e=>(e?.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs",...e,headers:{"Content-Type":"application/json",...e?.headers}}),Xk=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/syncs/latest",...e}),Jk=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/releases",...e}),Wk=e=>(e?.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/latest-release",...e}),eA=e=>(e.client??Q).delete({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/backlinks/cache/{release}",...e}),tA=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}}),nA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/summary",...e}),aA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/domains",...e}),iA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/history",...e}),sA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/sources",...e}),rA=e=>(e.client??Q).post({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/backlinks/bing-sync",...e}),oA=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}}),lA=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}}),cA=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}}),uA=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}}),dA=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}}),fA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources",...e}),pA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/status",...e}),mA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/sources/{id}",...e}),hA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/traffic/events",...e}),gA=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}}),yA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions",...e}),bA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}",...e}),vA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/discover/sessions/{id}/promote",...e}),SA=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}}),xA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo",...e}),wA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/pages",...e}),jA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/technical-aeo/trend",...e}),NA=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}}),kA=e=>(e.client??Q).get({security:[{scheme:"bearer",type:"http"}],url:"/api/v1/projects/{name}/agent/providers",...e});function AA(e){const n={baseUrl:e.baseUrl,fetch:e.fetch,headers:{...e.headers??{}}};return y0(n)}class In 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 CA(){if(typeof window>"u")return;const e=window.__CANONRY_CONFIG__?.embed?.renderToken;return typeof e=="string"&&e.length>0?e:void 0}function Np(e){const n=CA();if(!n)return e;let i;const r=typeof window<"u"&&window.location?window.location.href:"http://localhost/";try{i=new URL(e,r)}catch{return e}const l=new URL(r).origin;if(i.origin!==l)return e;const d=`${Ap().replace(/\/$/,"")}/api/v1`;return i.pathname!==d&&!i.pathname.startsWith(`${d}/`)?e:(i.searchParams.set("token",n),/^[a-z][a-z\d+.-]*:/i.test(e)?i.toString():`${i.pathname}${i.search}${i.hash}`)}function _A(e,n){const i={method:e.method,headers:e.headers,cache:e.cache,credentials:e.credentials,integrity:e.integrity,keepalive:e.keepalive,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,signal:e.signal};return e.body&&(i.body=e.body,i.duplex="half"),new Request(n,i)}function N0(){if(typeof window>"u")return null;const e=window.__CANONRY_CONFIG__?.embed;return e?.enabled?e:null}function TA(){return N0()!==null}function EA(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const kp=EA();function OA(){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 Ap(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function DA(e){const n=e.trim().toLowerCase().replace(/^\[|\]$/g,"");return n==="localhost"||n==="::1"?!0:/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n)}function zA(e,n){if(e.protocol!=="http:"&&e.protocol!=="https:"||!DA(e.hostname))return;const i=e.port?`:${e.port}`:"",r=n?n.replace(/\/$/,""):"";return`${e.protocol}//localhost${i}${r}`}function cq(e){return`${e.replace(/\/$/,"")}/api/v1/google/callback`}function RA(){if(!(typeof window>"u"))return zA(window.location,Ap())}function MA(e){return`${Ap()}${e}`}function BA(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 LA(){return""}function Tf(){return!!LA()}let k0=null;function Rb(e){k0=e}function Cp(){k0?.()}const ne=AA({baseUrl:OA()});ne.interceptors.response.use((e,n)=>(e.status===401&&!n.url.includes("/api/v1/session")&&Cp(),e));ne.interceptors.request.use(e=>{const n=Np(e.url);return n===e.url?e:_A(e,n)});async function ce(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 In(r,i,l,c)}if(n.response.status!==204)return n.data}async function _p(e,n){const i=n?.body!=null,r=await fetch(Np(`${kp}${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")&&Cp(),new In(c,r.status,d,h)}if(r.status!==204)return r.json()}function Tp(e){return ce(()=>b0({client:ne,path:{name:e}}))}function uq(e){return ce(()=>v0({client:ne,path:{name:e}}))}function vc(e){return ce(()=>S0({client:ne,path:{id:e}}))}function qA(e){return ce(()=>jN({client:ne,path:{name:e}}))}function UA(e){return ce(()=>CN({client:ne,path:{name:e}}))}function $A(e,n,i){return ce(()=>LN({client:ne,path:{name:e},query:{location:n,limit:i}}))}function A0(e,n){return ce(()=>Kk({client:ne,path:{name:e},query:{location:n?.location,since:n?.since}}))}function Co(e,n){return ce(()=>yN({client:ne,path:{name:e},body:n}))}function IA(e,n){return ce(()=>kN({client:ne,path:{name:e},body:{queries:n}}))}function PA(e,n){return ce(()=>NN({client:ne,path:{name:e},body:{queries:n}}))}function dq(e,n){return ce(()=>wN({client:ne,path:{name:e},body:{queries:n}}))}function VA(e,n){return ce(()=>Hk({client:ne,path:{name:e},body:n}))}function GA(e,n){return ce(()=>TN({client:ne,path:{name:e},body:{competitors:n}}))}function fq(e,n){return ce(()=>_N({client:ne,path:{name:e},body:{competitors:n}}))}function pq(e,n){return ce(()=>EN({client:ne,path:{name:e,id:n}}))}async function mq(e,n){const i=await Tp(e);return Co(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,providerModels:i.providerModels??{},locations:i.locations,defaultLocation:i.defaultLocation,autoExtractBacklinks:i.autoExtractBacklinks})}async function hq(e,n){const i=await Tp(e);return Co(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,providerModels:i.providerModels??{},locations:i.locations,defaultLocation:i.defaultLocation,autoExtractBacklinks:i.autoExtractBacklinks})}async function gq(e,n){const i=await Tp(e);return Co(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:n.providers??i.providers,providerModels:n.providerModels??i.providerModels??{},locations:n.locations??i.locations,defaultLocation:n.defaultLocation!==void 0?n.defaultLocation:i.defaultLocation,autoExtractBacklinks:i.autoExtractBacklinks})}function HA(e,n){const i={};return n?.location&&(i.location=n.location),n?.allLocations&&(i.allLocations=!0),n?.noLocation&&(i.noLocation=!0),ce(()=>ON({client:ne,path:{name:e},body:i}))}function yq(e,n){return ce(()=>vN({client:ne,path:{name:e},body:n}))}async function bq(e,n){await ce(()=>SN({client:ne,path:{name:e,label:n}}))}function vq(e,n){return ce(()=>xN({client:ne,path:{name:e},body:{label:n}}))}async function Sq(e){await ce(()=>gN({client:ne,path:{name:e}}))}function xq(){return ce(()=>x0({client:ne}))}function Mb(){return _p("/session")}function KA(e){return _p("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function QA(e){return _p("/session",{method:"POST",body:JSON.stringify({password:e})})}function ZA(e,n){return ce(()=>$N({client:ne,path:{name:e},body:n}))}function wq(e){return ce(()=>IN({client:ne,body:e}))}async function jq(e){try{return await ce(()=>HN({client:ne,path:{name:e}}))}catch(n){if(n instanceof In&&n.statusCode===404)return null;throw n}}function Nq(e,n){return ce(()=>KN({client:ne,path:{name:e},body:n}))}async function kq(e){await ce(()=>GN({client:ne,path:{name:e}}))}function Aq(e){return ce(()=>QN({client:ne,path:{name:e}}))}function Cq(e,n){return ce(()=>ZN({client:ne,path:{name:e},body:n}))}async function _q(e,n){await ce(()=>YN({client:ne,path:{name:e,id:n}}))}function Tq(e,n){return ce(()=>FN({client:ne,path:{name:e,id:n}}))}function YA(e,n,i){return ce(()=>AN({client:ne,path:{name:e},body:{provider:n,count:i}}))}function FA(e){return ce(()=>RN({client:ne,body:e}))}function XA(e){return ce(()=>zN({client:ne,body:e??{}}))}function Eq(e,n){const i=RA();return ce(()=>WN({client:ne,path:{name:e},body:{type:n,...i?{publicUrl:i}:{}}}))}function Oq(e,n){return ce(()=>ek({client:ne,path:{name:e,type:n}}))}function Dq(e,n,i){return ce(()=>nk({client:ne,path:{name:e,type:n},body:{propertyId:i}}))}function zq(e,n,i){return ce(()=>ak({client:ne,path:{name:e,type:n},body:{sitemapUrl:i}}))}function JA(e,n){return ce(()=>ik({client:ne,path:{name:e},body:n??{}}))}function Rq(e,n){const i={};return n&&n!=="all"&&(i.window=n),ce(()=>qN({client:ne,path:{name:e},query:i}))}function Mq(e,n){return ce(()=>ok({client:ne,path:{name:e},body:{url:n}}))}function WA(e){return ce(()=>w0({client:ne,path:{name:e}}))}function eC(e,n){return ce(()=>pk({client:ne,path:{name:e},body:n??{}}))}function Bq(e){return ce(()=>dk({client:ne,path:{name:e}}))}function tC(e){return ce(()=>fk({client:ne,path:{name:e}}))}function nC(e,n){return ce(()=>NA({client:ne,path:{name:e},body:n??{}}))}function Lq(e,n){return ce(()=>gA({client:ne,path:{name:e},body:n??{}}))}function qq(e,n,i){return ce(()=>SA({client:ne,path:{name:e,id:n},body:i??{}}))}function Uq(){return ce(()=>XN({client:ne}))}function $q(e,n){return ce(()=>VN({client:ne,body:{host:e,port:n}}))}function Iq(e,n){return ce(()=>mk({client:ne,path:{name:e},body:n}))}function Pq(e,n){return ce(()=>jk({client:ne,path:{name:e},body:{apiKey:n}}))}function Vq(e){return ce(()=>Nk({client:ne,path:{name:e}}))}function Gq(e,n){return ce(()=>Ck({client:ne,path:{name:e},body:{siteUrl:n}}))}function aC(e){return ce(()=>j0({client:ne,path:{name:e}}))}function Hq(e,n){return ce(()=>Tk({client:ne,path:{name:e},body:{url:n}}))}function Kq(e,n){return ce(()=>Ek({client:ne,path:{name:e},body:{}}))}function Qq(e,n){return ce(()=>Ok({client:ne,path:{name:e},body:n}))}function Zq(e){return ce(()=>PN({client:ne,body:{apiKey:e}}))}function C0(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function Yq(e,n="agency",i){const r=new URLSearchParams({audience:n});i!==void 0&&r.set("period",String(i));const l=await fetch(Np(`${kp}/projects/${encodeURIComponent(e)}/report.html?${r.toString()}`),{credentials:"same-origin",headers:{}});if(!l.ok)throw new In(`Failed to download report: ${l.status}`,l.status);const c=await l.blob(),d=URL.createObjectURL(c),h=C0(l.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,g=document.createElement("a");g.href=d,g.download=h,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(d)}async function Fq(e,n){const i=await fetch(`${kp}/projects/${encodeURIComponent(e)}/results/export?format=${n}`,{credentials:"same-origin",headers:{}});if(!i.ok)throw new In(`Failed to download results: ${i.status}`,i.status);const r=await i.blob(),l=URL.createObjectURL(r),c=C0(i.headers.get("Content-Disposition"))??`canonry-results-${e}.${n}`,d=document.createElement("a");d.href=l,d.download=c,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(l)}function Xq(e,n){return ce(()=>Bk({client:ne,path:{name:e},body:{}}))}function Jq(e,n){return ce(()=>zk({client:ne,path:{name:e},body:n}))}function Wq(e){return ce(()=>Rk({client:ne,path:{name:e}}))}function eU(e,n){return ce(()=>oA({client:ne,path:{name:e},body:n}))}function tU(e,n){return ce(()=>lA({client:ne,path:{name:e},body:n}))}function nU(e,n){return ce(()=>cA({client:ne,path:{name:e},body:n}))}function aU(e,n,i){return ce(()=>uA({client:ne,path:{name:e,id:n},body:i??{}}))}function iU(e,n,i){return ce(()=>dA({client:ne,path:{name:e,id:n},body:{}}))}function iC(e,n){return ce(()=>Ik({client:ne,path:{name:e},query:{runId:n}}))}function sC(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 rC(e,n){const i=MA(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:BA(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=sC(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 sU(){return ce(()=>Qk({client:ne}))}function rU(){return ce(()=>Zk({client:ne}))}function oU(){return ce(()=>Xk({client:ne}))}function lU(){return ce(()=>Yk({client:ne}))}function cU(e){return ce(()=>Fk({client:ne,body:e?{release:e}:{}}))}function uU(){return ce(()=>Jk({client:ne}))}function dU(){return ce(()=>Wk({client:ne}))}function fU(e){return ce(()=>eA({client:ne,path:{release:e}}))}function pU(e,n={}){return ce(()=>nA({client:ne,path:{name:e},query:{release:n.release,excludeCrawlers:n.excludeCrawlers?"1":void 0,source:n.source}}))}function mU(e,n={}){return ce(()=>aA({client:ne,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,source:n.source}}))}function hU(e,n={}){return ce(()=>iA({client:ne,path:{name:e},query:{source:n.source}}))}function gU(e,n={}){return ce(()=>sA({client:ne,path:{name:e},query:{excludeCrawlers:n.excludeCrawlers?"1":void 0}}))}function yU(e,n){return ce(()=>tA({client:ne,path:{name:e},body:{release:void 0}}))}function bU(e){return ce(()=>rA({client:ne,path:{name:e}}))}function _n(e){return(...n)=>{e(...n)}}const oC=6e3,lC=5,cC=180;let Ht=[],uC=0;const Zf=new Set,Yf=new Map,Ff=new Map;function Sc(){const e=[...Ht];for(const n of Zf)n(e)}function Ep(e){const n=Yf.get(e);n&&(clearTimeout(n),Yf.delete(e));const i=Ff.get(e);i&&(clearTimeout(i),Ff.delete(e))}function _0(e){Ep(e);const n=Ht.length;Ht=Ht.filter(i=>i.id!==e),Ht.length!==n&&Sc()}function Bb(e){Ep(e.id),Yf.set(e.id,setTimeout(()=>{Xf(e.id)},e.durationMs))}function dC(e,n,i){return typeof e=="string"?{title:e,tone:n,durationMs:i}:e}function Ft(e,n="negative",i=oC){const r=dC(e,n,i),l={id:String(++uC),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=Ht.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 Ht=Ht.map(h=>h.id===c.id?d:h),Sc(),Bb(d),c.id}}return Ht.length>=lC&&_0(Ht[0].id),Ht=[...Ht,l],Sc(),Bb(l),l.id}function Xf(e){const n=Ht.find(i=>i.id===e);!n||n.state==="closing"||(Ep(e),Ht=Ht.map(i=>i.id===e?{...i,state:"closing"}:i),Sc(),Ff.set(e,setTimeout(()=>{_0(e)},cC)))}function fC(e){return Zf.add(e),()=>{Zf.delete(e)}}function Lb(){return Ht}const pC=5*6e4,Jf=30*6e4,vU=3e4,SU=6e4,Xs=3e4,mC=2e3;function hC(){return new Bj({defaultOptions:{queries:{staleTime:pC,retry:1,refetchOnWindowFocus:!1}},mutationCache:new Lj({onError:(e,n,i,r)=>{r.meta?.skipGlobalErrorToast||Ft({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const gC="modulepreload",yC=function(e,n){return new URL(e,n).href},qb={},Ui=function(n,i,r){let l=Promise.resolve();if(i&&i.length>0){let b=function(x){return Promise.all(x.map(w=>Promise.resolve(w).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),g=h?.nonce||h?.getAttribute("nonce");l=b(i.map(x=>{if(x=yC(x,r),x in qb)return;qb[x]=!0;const w=x.endsWith(".css"),N=w?'[rel="stylesheet"]':"";if(r)for(let D=d.length-1;D>=0;D--){const A=d[D];if(A.href===x&&(!w||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${N}`))return;const C=document.createElement("link");if(C.rel=w?"stylesheet":gC,w||(C.as="script"),C.crossOrigin="",C.href=x,g&&C.setAttribute("nonce",g),document.head.appendChild(C),w)return new Promise((D,A)=>{C.addEventListener("load",D),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${x}`)))})}))}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 bC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,r)=>r?r.toUpperCase():i.toLowerCase()),Ub=e=>{const n=vC(e);return n.charAt(0).toUpperCase()+n.slice(1)},T0=(...e)=>e.filter((n,i,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===i).join(" ").trim(),SC=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var xC={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 wC=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,...xC,width:n,height:n,stroke:e,strokeWidth:r?Number(i)*24/Number(n):i,className:T0("lucide",l),...!c&&!SC(h)&&{"aria-hidden":"true"},...h},[...d.map(([b,x])=>q.createElement(b,x)),...Array.isArray(c)?c:[c]]));const nt=(e,n)=>{const i=q.forwardRef(({className:r,...l},c)=>q.createElement(wC,{ref:c,iconNode:n,className:T0(`lucide-${bC(Ub(e))}`,`lucide-${e}`,r),...l}));return i.displayName=Ub(e),i};const jC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],NC=nt("arrow-right",jC);const kC=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],AC=nt("arrow-up",kC);const CC=[["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"}]],_C=nt("book-open",CC);const TC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],E0=nt("check",TC);const EC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],O0=nt("chevron-down",EC);const OC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Op=nt("chevron-right",OC);const DC=[["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"}]],zC=nt("copy",DC);const RC=[["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"}]],MC=nt("file-text",RC);const BC=[["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"}]],LC=nt("github",BC);const qC=[["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"}]],UC=nt("globe",qC);const $C=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],IC=nt("history",$C);const PC=[["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"}]],VC=nt("layout-dashboard",PC);const GC=[["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"}]],HC=nt("link-2",GC);const KC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],D0=nt("loader-circle",KC);const QC=[["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"}]],ZC=nt("maximize-2",QC);const YC=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],FC=nt("menu",YC);const XC=[["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"}]],JC=nt("minimize-2",XC);const WC=[["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"}]],e2=nt("play",WC);const t2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$b=nt("plus",t2);const n2=[["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"}]],a2=nt("radar",n2);const i2=[["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"}]],Ib=nt("radio",i2);const s2=[["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"}]],r2=nt("rocket",s2);const o2=[["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"}]],z0=nt("rotate-ccw",o2);const l2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],c2=nt("search",l2);const u2=[["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"}]],d2=nt("settings",u2);const f2=[["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"}]],R0=nt("triangle-alert",f2);const p2=[["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"}]],m2=nt("wrench",p2);const h2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],rr=nt("x",h2);function Z(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,x=Object.keys(b);for(let w=0;w<x.length;w++){const N=x[w];N in h||(h[N]=b[N].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 x of b._zod.deferred)x();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 Ks extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class M0 extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const B0={};function si(e){return B0}function L0(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 Wf(e,n){return typeof n=="bigint"?n.toString():n}function Rc(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function Dp(e){return e==null}function zp(e){const n=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(n,i)}function g2(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 Pb=Symbol("evaluating");function Qe(e,n,i){let r;Object.defineProperty(e,n,{get(){if(r!==Pb)return r===void 0&&(r=Pb,r=i()),r},set(l){Object.defineProperty(e,n,{value:l})},configurable:!0})}function $i(e,n,i){Object.defineProperty(e,n,{value:i,writable:!0,enumerable:!0,configurable:!0})}function ci(...e){const n={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(n,r)}return Object.defineProperties({},n)}function Vb(e){return JSON.stringify(e)}function y2(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const q0="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const b2=Rc(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Js(e){if(xo(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const i=n.prototype;return!(xo(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function U0(e){return Js(e)?{...e}:Array.isArray(e)?[...e]:e}const v2=new Set(["string","number","symbol"]);function Ws(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ui(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 S2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const x2={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 w2(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=ci(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 $i(this,"shape",d),d},checks:[]});return ui(e,c)}function j2(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=ci(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 $i(this,"shape",d),d},checks:[]});return ui(e,c)}function N2(e,n){if(!Js(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=ci(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return $i(this,"shape",c),c}});return ui(e,l)}function k2(e,n){if(!Js(n))throw new Error("Invalid input to safeExtend: expected a plain object");const i=ci(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n};return $i(this,"shape",r),r}});return ui(e,i)}function A2(e,n){const i=ci(e._zod.def,{get shape(){const r={...e._zod.def.shape,...n._zod.def.shape};return $i(this,"shape",r),r},get catchall(){return n._zod.def.catchall},checks:[]});return ui(e,i)}function C2(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=ci(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 $i(this,"shape",g),g},checks:[]});return ui(n,d)}function _2(e,n,i){const r=ci(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 $i(this,"shape",c),c}});return ui(n,r)}function Is(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 Ps(e,n){return n.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function ac(e){return typeof e=="string"?e:e?.message}function ri(e,n,i){const r={...e,path:e.path??[]};if(!e.message){const l=ac(e.inst?._zod.def?.error?.(e))??ac(n?.error?.(e))??ac(i.customError?.(e))??ac(i.localeError?.(e))??"Invalid input";r.message=l}return delete r.inst,delete r.continue,n?.reportInput||delete r.input,r}function Rp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wo(...e){const[n,i,r]=e;return typeof n=="string"?{message:n,code:"custom",input:i,inst:r}:{...n}}const $0=(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,Wf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},I0=Z("$ZodError",$0),P0=Z("$ZodError",$0,{Parent:Error});function T2(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 Mp=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 Ks;if(d.issues.length){const h=new(l?.Err??e)(d.issues.map(g=>ri(g,c,si())));throw q0(h,l?.callee),h}return d.value},Bp=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=>ri(g,c,si())));throw q0(h,l?.callee),h}return d.value},Mc=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 Ks;return c.issues.length?{success:!1,error:new(e??I0)(c.issues.map(d=>ri(d,l,si())))}:{success:!0,data:c.value}},O2=Mc(P0),Bc=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=>ri(d,l,si())))}:{success:!0,data:c.value}},D2=Bc(P0),z2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mp(e)(n,i,l)},R2=e=>(n,i,r)=>Mp(e)(n,i,r),M2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bp(e)(n,i,l)},B2=e=>async(n,i,r)=>Bp(e)(n,i,r),L2=e=>(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mc(e)(n,i,l)},q2=e=>(n,i,r)=>Mc(e)(n,i,r),U2=e=>async(n,i,r)=>{const l=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bc(e)(n,i,l)},$2=e=>async(n,i,r)=>Bc(e)(n,i,r),I2=/^[cC][^\s-]{8,}$/,P2=/^[0-9a-z]+$/,V2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,G2=/^[0-9a-vA-V]{20}$/,H2=/^[A-Za-z0-9]{27}$/,K2=/^[a-zA-Z0-9_-]{21}$/,Q2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Z2=/^([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})$/,Gb=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)$/,Y2=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,F2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function X2(){return new RegExp(F2,"u")}const J2=/^(?:(?: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])$/,W2=/^(([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}|:))$/,e_=/^((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])$/,t_=/^(([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])$/,n_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V0=/^[A-Za-z0-9_-]*$/,a_=/^\+[1-9]\d{6,14}$/,G0="(?:(?:\\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])))",i_=new RegExp(`^${G0}$`);function H0(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 s_(e){return new RegExp(`^${H0(e)}$`)}function r_(e){const n=H0({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(`^${G0}T(?:${r})$`)}const o_=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},l_=/^-?\d+$/,K0=/^-?\d+(?:\.\d+)?$/,c_=/^(?:true|false)$/i,u_=/^null$/i,d_=/^[^A-Z]*$/,f_=/^[^a-z]*$/,ln=Z("$ZodCheck",(e,n)=>{var i;e._zod??(e._zod={}),e._zod.def=n,(i=e._zod).onattach??(i.onattach=[])}),Q0={number:"number",bigint:"bigint",object:"date"},Z0=Z("$ZodCheckLessThan",(e,n)=>{ln.init(e,n);const i=Q0[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})}}),Y0=Z("$ZodCheckGreaterThan",(e,n)=>{ln.init(e,n);const i=Q0[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})}}),p_=Z("$ZodCheckMultipleOf",(e,n)=>{ln.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):g2(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})}}),m_=Z("$ZodCheckNumberFormat",(e,n)=>{ln.init(e,n),n.format=n.format||"float64";const i=n.format?.includes("int"),r=i?"int":"number",[l,c]=x2[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=l_)}),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})}}),h_=Z("$ZodCheckMaxLength",(e,n)=>{var i;ln.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Dp(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=Rp(l);r.issues.push({origin:d,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),g_=Z("$ZodCheckMinLength",(e,n)=>{var i;ln.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Dp(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=Rp(l);r.issues.push({origin:d,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),y_=Z("$ZodCheckLengthEquals",(e,n)=>{var i;ln.init(e,n),(i=e._zod.def).when??(i.when=r=>{const l=r.value;return!Dp(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=Rp(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})}}),Lc=Z("$ZodCheckStringFormat",(e,n)=>{var i,r;ln.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=()=>{})}),b_=Z("$ZodCheckRegex",(e,n)=>{Lc.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})}}),v_=Z("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=d_),Lc.init(e,n)}),S_=Z("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=f_),Lc.init(e,n)}),x_=Z("$ZodCheckIncludes",(e,n)=>{ln.init(e,n);const i=Ws(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})}}),w_=Z("$ZodCheckStartsWith",(e,n)=>{ln.init(e,n);const i=new RegExp(`^${Ws(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})}}),j_=Z("$ZodCheckEndsWith",(e,n)=>{ln.init(e,n);const i=new RegExp(`.*${Ws(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})}}),N_=Z("$ZodCheckOverwrite",(e,n)=>{ln.init(e,n),e._zod.check=i=>{i.value=n.tx(i.value)}});class k_{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
|
-
`).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
|
-
`))}}const A_={major:4,minor:3,patch:6},pt=Z("$ZodType",(e,n)=>{var i;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=A_;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=Is(d),x;for(const w of h){if(w._zod.def.when){if(!w._zod.def.when(d))continue}else if(b)continue;const N=d.issues.length,C=w._zod.check(d);if(C instanceof Promise&&g?.async===!1)throw new Ks;if(x||C instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await C,d.issues.length!==N&&(b||(b=Is(d,N)))});else{if(d.issues.length===N)continue;b||(b=Is(d,N))}}return x?x.then(()=>d):d},c=(d,h,g)=>{if(Is(d))return d.aborted=!0,d;const b=l(h,r,g);if(b instanceof Promise){if(g.async===!1)throw new Ks;return b.then(x=>e._zod.parse(x,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(x=>c(x,d,h)):c(b,d,h)}const g=e._zod.parse(d,h);if(g instanceof Promise){if(h.async===!1)throw new Ks;return g.then(b=>l(b,r,h))}return l(g,r,h)}}Qe(e,"~standard",()=>({validate:l=>{try{const c=O2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return D2(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),Lp=Z("$ZodString",(e,n)=>{pt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??o_(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}}),mt=Z("$ZodStringFormat",(e,n)=>{Lc.init(e,n),Lp.init(e,n)}),C_=Z("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=Z2),mt.init(e,n)}),__=Z("$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=Gb(r))}else n.pattern??(n.pattern=Gb());mt.init(e,n)}),T_=Z("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=Y2),mt.init(e,n)}),E_=Z("$ZodURL",(e,n)=>{mt.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})}}}),O_=Z("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=X2()),mt.init(e,n)}),D_=Z("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=K2),mt.init(e,n)}),z_=Z("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=I2),mt.init(e,n)}),R_=Z("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=P2),mt.init(e,n)}),M_=Z("$ZodULID",(e,n)=>{n.pattern??(n.pattern=V2),mt.init(e,n)}),B_=Z("$ZodXID",(e,n)=>{n.pattern??(n.pattern=G2),mt.init(e,n)}),L_=Z("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=H2),mt.init(e,n)}),q_=Z("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=r_(n)),mt.init(e,n)}),U_=Z("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=i_),mt.init(e,n)}),$_=Z("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=s_(n)),mt.init(e,n)}),I_=Z("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=Q2),mt.init(e,n)}),P_=Z("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=J2),mt.init(e,n),e._zod.bag.format="ipv4"}),V_=Z("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=W2),mt.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})}}}),G_=Z("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=e_),mt.init(e,n)}),H_=Z("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=t_),mt.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 F0(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const K_=Z("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=n_),mt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{F0(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!n.abort})}});function Q_(e){if(!V0.test(e))return!1;const n=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=n.padEnd(Math.ceil(n.length/4)*4,"=");return F0(i)}const Z_=Z("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=V0),mt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{Q_(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!n.abort})}}),Y_=Z("$ZodE164",(e,n)=>{n.pattern??(n.pattern=a_),mt.init(e,n)});function F_(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 X_=Z("$ZodJWT",(e,n)=>{mt.init(e,n),e._zod.check=i=>{F_(i.value,n.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!n.abort})}}),X0=Z("$ZodNumber",(e,n)=>{pt.init(e,n),e._zod.pattern=e._zod.bag.pattern??K0,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}}),J_=Z("$ZodNumberFormat",(e,n)=>{m_.init(e,n),X0.init(e,n)}),W_=Z("$ZodBoolean",(e,n)=>{pt.init(e,n),e._zod.pattern=c_,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}}),eT=Z("$ZodNull",(e,n)=>{pt.init(e,n),e._zod.pattern=u_,e._zod.values=new Set([null]),e._zod.parse=(i,r)=>{const l=i.value;return l===null||i.issues.push({expected:"null",code:"invalid_type",input:l,inst:e}),i}}),tT=Z("$ZodUnknown",(e,n)=>{pt.init(e,n),e._zod.parse=i=>i}),nT=Z("$ZodNever",(e,n)=>{pt.init(e,n),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function Hb(e,n,i){e.issues.length&&n.issues.push(...Ps(i,e.issues)),n.value[i]=e.value}const aT=Z("$ZodArray",(e,n)=>{pt.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=>Hb(b,i,d))):Hb(g,i,d)}return c.length?Promise.all(c).then(()=>i):i}});function xc(e,n,i,r,l){if(e.issues.length){if(l&&!(i in r))return;n.issues.push(...Ps(i,e.issues))}e.value===void 0?i in r&&(n.value[i]=void 0):n.value[i]=e.value}function J0(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=S2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(i)}}function W0(e,n,i,r,l,c){const d=[],h=l.keySet,g=l.catchall._zod,b=g.def.type,x=g.optout==="optional";for(const w in n){if(h.has(w))continue;if(b==="never"){d.push(w);continue}const N=g.run({value:n[w],issues:[]},r);N instanceof Promise?e.push(N.then(C=>xc(C,i,w,n,x))):xc(N,i,w,n,x)}return d.length&&i.issues.push({code:"unrecognized_keys",keys:d,input:n,inst:c}),e.length?Promise.all(e).then(()=>i):i}const iT=Z("$ZodObject",(e,n)=>{if(pt.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=Rc(()=>J0(n));Qe(e._zod,"propValues",()=>{const h=n.shape,g={};for(const b in h){const x=h[b]._zod;if(x.values){g[b]??(g[b]=new Set);for(const w of x.values)g[b].add(w)}}return g});const l=xo,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 x=[],w=d.shape;for(const N of d.keys){const C=w[N],D=C._zod.optout==="optional",A=C._zod.run({value:b[N],issues:[]},g);A instanceof Promise?x.push(A.then(E=>xc(E,h,N,b,D))):xc(A,h,N,b,D)}return c?W0(x,b,h,g,r.value,e):x.length?Promise.all(x).then(()=>h):h}}),sT=Z("$ZodObjectJIT",(e,n)=>{iT.init(e,n);const i=e._zod.parse,r=Rc(()=>J0(n)),l=N=>{const C=new k_(["shape","payload","ctx"]),D=r.value,A=X=>{const V=Vb(X);return`shape[${V}]._zod.run({ value: input[${V}], issues: [] }, ctx)`};C.write("const input = payload.value;");const E=Object.create(null);let R=0;for(const X of D.keys)E[X]=`key_${R++}`;C.write("const newResult = {};");for(const X of D.keys){const V=E[X],P=Vb(X),O=N[X]?._zod?.optout==="optional";C.write(`const ${V} = ${A(X)};`),O?C.write(`
|
|
17
|
-
if (${V}.issues.length) {
|
|
18
|
-
if (${P} in input) {
|
|
19
|
-
payload.issues = payload.issues.concat(${V}.issues.map(iss => ({
|
|
20
|
-
...iss,
|
|
21
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
22
|
-
})));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (${V}.value === undefined) {
|
|
27
|
-
if (${P} in input) {
|
|
28
|
-
newResult[${P}] = undefined;
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
newResult[${P}] = ${V}.value;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
`):C.write(`
|
|
35
|
-
if (${V}.issues.length) {
|
|
36
|
-
payload.issues = payload.issues.concat(${V}.issues.map(iss => ({
|
|
37
|
-
...iss,
|
|
38
|
-
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
39
|
-
})));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (${V}.value === undefined) {
|
|
43
|
-
if (${P} in input) {
|
|
44
|
-
newResult[${P}] = undefined;
|
|
45
|
-
}
|
|
46
|
-
} else {
|
|
47
|
-
newResult[${P}] = ${V}.value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
`)}C.write("payload.value = newResult;"),C.write("return payload;");const G=C.compile();return(X,V)=>G(N,X,V)};let c;const d=xo,h=!B0.jitless,b=h&&b2.value,x=n.catchall;let w;e._zod.parse=(N,C)=>{w??(w=r.value);const D=N.value;return d(D)?h&&b&&C?.async===!1&&C.jitless!==!0?(c||(c=l(n.shape)),N=c(N,C),x?W0([],D,N,C,w,e):N):i(N,C):(N.issues.push({expected:"object",code:"invalid_type",input:D,inst:e}),N)}});function Kb(e,n,i,r){for(const c of e)if(c.issues.length===0)return n.value=c.value,n;const l=e.filter(c=>!Is(c));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:i,errors:e.map(c=>c.issues.map(d=>ri(d,r,si())))}),n)}const eS=Z("$ZodUnion",(e,n)=>{pt.init(e,n),Qe(e._zod,"optin",()=>n.options.some(l=>l._zod.optin==="optional")?"optional":void 0),Qe(e._zod,"optout",()=>n.options.some(l=>l._zod.optout==="optional")?"optional":void 0),Qe(e._zod,"values",()=>{if(n.options.every(l=>l._zod.values))return new Set(n.options.flatMap(l=>Array.from(l._zod.values)))}),Qe(e._zod,"pattern",()=>{if(n.options.every(l=>l._zod.pattern)){const l=n.options.map(c=>c._zod.pattern);return new RegExp(`^(${l.map(c=>zp(c.source)).join("|")})$`)}});const i=n.options.length===1,r=n.options[0]._zod.run;e._zod.parse=(l,c)=>{if(i)return r(l,c);let d=!1;const h=[];for(const g of n.options){const b=g._zod.run({value:l.value,issues:[]},c);if(b instanceof Promise)h.push(b),d=!0;else{if(b.issues.length===0)return b;h.push(b)}}return d?Promise.all(h).then(g=>Kb(g,l,e,c)):Kb(h,l,e,c)}}),rT=Z("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,eS.init(e,n);const i=e._zod.parse;Qe(e._zod,"propValues",()=>{const l={};for(const c of n.options){const d=c._zod.propValues;if(!d||Object.keys(d).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const[h,g]of Object.entries(d)){l[h]||(l[h]=new Set);for(const b of g)l[h].add(b)}}return l});const r=Rc(()=>{const l=n.options,c=new Map;for(const d of l){const h=d._zod.propValues?.[n.discriminator];if(!h||h.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(d)}"`);for(const g of h){if(c.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);c.set(g,d)}}return c});e._zod.parse=(l,c)=>{const d=l.value;if(!xo(d))return l.issues.push({code:"invalid_type",expected:"object",input:d,inst:e}),l;const h=r.value.get(d?.[n.discriminator]);return h?h._zod.run(l,c):n.unionFallback?i(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:d,path:[n.discriminator],inst:e}),l)}}),oT=Z("$ZodIntersection",(e,n)=>{pt.init(e,n),e._zod.parse=(i,r)=>{const l=i.value,c=n.left._zod.run({value:l,issues:[]},r),d=n.right._zod.run({value:l,issues:[]},r);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([g,b])=>Qb(i,g,b)):Qb(i,c,d)}});function ep(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Js(e)&&Js(n)){const i=Object.keys(n),r=Object.keys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...n};for(const c of r){const d=ep(e[c],n[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};l[c]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const l=e[r],c=n[r],d=ep(l,c);if(!d.valid)return{valid:!1,mergeErrorPath:[r,...d.mergeErrorPath]};i.push(d.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Qb(e,n,i){const r=new Map;let l;for(const h of n.issues)if(h.code==="unrecognized_keys"){l??(l=h);for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).l=!0}else e.issues.push(h);for(const h of i.issues)if(h.code==="unrecognized_keys")for(const g of h.keys)r.has(g)||r.set(g,{}),r.get(g).r=!0;else e.issues.push(h);const c=[...r].filter(([,h])=>h.l&&h.r).map(([h])=>h);if(c.length&&l&&e.issues.push({...l,keys:c}),Is(e))return e;const d=ep(n.value,i.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const lT=Z("$ZodRecord",(e,n)=>{pt.init(e,n),e._zod.parse=(i,r)=>{const l=i.value;if(!Js(l))return i.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),i;const c=[],d=n.keyType._zod.values;if(d){i.value={};const h=new Set;for(const b of d)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){h.add(typeof b=="number"?b.toString():b);const x=n.valueType._zod.run({value:l[b],issues:[]},r);x instanceof Promise?c.push(x.then(w=>{w.issues.length&&i.issues.push(...Ps(b,w.issues)),i.value[b]=w.value})):(x.issues.length&&i.issues.push(...Ps(b,x.issues)),i.value[b]=x.value)}let g;for(const b in l)h.has(b)||(g=g??[],g.push(b));g&&g.length>0&&i.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:g})}else{i.value={};for(const h of Reflect.ownKeys(l)){if(h==="__proto__")continue;let g=n.keyType._zod.run({value:h,issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof h=="string"&&K0.test(h)&&g.issues.length){const w=n.keyType._zod.run({value:Number(h),issues:[]},r);if(w instanceof Promise)throw new Error("Async schemas not supported in object keys currently");w.issues.length===0&&(g=w)}if(g.issues.length){n.mode==="loose"?i.value[h]=l[h]:i.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(w=>ri(w,r,si())),input:h,path:[h],inst:e});continue}const x=n.valueType._zod.run({value:l[h],issues:[]},r);x instanceof Promise?c.push(x.then(w=>{w.issues.length&&i.issues.push(...Ps(h,w.issues)),i.value[g.value]=w.value})):(x.issues.length&&i.issues.push(...Ps(h,x.issues)),i.value[g.value]=x.value)}}return c.length?Promise.all(c).then(()=>i):i}}),cT=Z("$ZodEnum",(e,n)=>{pt.init(e,n);const i=L0(n.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(l=>v2.has(typeof l)).map(l=>typeof l=="string"?Ws(l):l.toString()).join("|")})$`),e._zod.parse=(l,c)=>{const d=l.value;return r.has(d)||l.issues.push({code:"invalid_value",values:i,input:d,inst:e}),l}}),uT=Z("$ZodLiteral",(e,n)=>{if(pt.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(n.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?Ws(r):r?Ws(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,l)=>{const c=r.value;return i.has(c)||r.issues.push({code:"invalid_value",values:n.values,input:c,inst:e}),r}}),dT=Z("$ZodTransform",(e,n)=>{pt.init(e,n),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new M0(e.constructor.name);const l=n.transform(i.value,i);if(r.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(i.value=d,i));if(l instanceof Promise)throw new Ks;return i.value=l,i}});function Zb(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const tS=Z("$ZodOptional",(e,n)=>{pt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Qe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${zp(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(n.innerType._zod.optin==="optional"){const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Zb(c,i.value)):Zb(l,i.value)}return i.value===void 0?i:n.innerType._zod.run(i,r)}}),fT=Z("$ZodExactOptional",(e,n)=>{tS.init(e,n),Qe(e._zod,"values",()=>n.innerType._zod.values),Qe(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(i,r)=>n.innerType._zod.run(i,r)}),pT=Z("$ZodNullable",(e,n)=>{pt.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"pattern",()=>{const i=n.innerType._zod.pattern;return i?new RegExp(`^(${zp(i.source)}|null)$`):void 0}),Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:n.innerType._zod.run(i,r)}),mT=Z("$ZodDefault",(e,n)=>{pt.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);if(i.value===void 0)return i.value=n.defaultValue,i;const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Yb(c,n)):Yb(l,n)}});function Yb(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const hT=Z("$ZodPrefault",(e,n)=>{pt.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=n.defaultValue),n.innerType._zod.run(i,r))}),gT=Z("$ZodNonOptional",(e,n)=>{pt.init(e,n),Qe(e._zod,"values",()=>{const i=n.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>Fb(c,e)):Fb(l,e)}});function Fb(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const yT=Z("$ZodCatch",(e,n)=>{pt.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(c=>(i.value=c.value,c.issues.length&&(i.value=n.catchValue({...i,error:{issues:c.issues.map(d=>ri(d,r,si()))},input:i.value}),i.issues=[]),i)):(i.value=l.value,l.issues.length&&(i.value=n.catchValue({...i,error:{issues:l.issues.map(c=>ri(c,r,si()))},input:i.value}),i.issues=[]),i)}}),bT=Z("$ZodPipe",(e,n)=>{pt.init(e,n),Qe(e._zod,"values",()=>n.in._zod.values),Qe(e._zod,"optin",()=>n.in._zod.optin),Qe(e._zod,"optout",()=>n.out._zod.optout),Qe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const c=n.out._zod.run(i,r);return c instanceof Promise?c.then(d=>ic(d,n.in,r)):ic(c,n.in,r)}const l=n.in._zod.run(i,r);return l instanceof Promise?l.then(c=>ic(c,n.out,r)):ic(l,n.out,r)}});function ic(e,n,i){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},i)}const vT=Z("$ZodReadonly",(e,n)=>{pt.init(e,n),Qe(e._zod,"propValues",()=>n.innerType._zod.propValues),Qe(e._zod,"values",()=>n.innerType._zod.values),Qe(e._zod,"optin",()=>n.innerType?._zod?.optin),Qe(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(i,r)=>{if(r.direction==="backward")return n.innerType._zod.run(i,r);const l=n.innerType._zod.run(i,r);return l instanceof Promise?l.then(Xb):Xb(l)}});function Xb(e){return e.value=Object.freeze(e.value),e}const ST=Z("$ZodCustom",(e,n)=>{ln.init(e,n),pt.init(e,n),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,l=n.fn(r);if(l instanceof Promise)return l.then(c=>Jb(c,i,r,e));Jb(l,i,r,e)}});function Jb(e,n,i,r){if(!e){const l={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(l.params=r._zod.def.params),n.issues.push(wo(l))}}var Wb;class xT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...i){const r=i[0];return this._map.set(n,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const i=this._map.get(n);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(n),this}get(n){const i=n._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const l={...r,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function wT(){return new xT}(Wb=globalThis).__zod_globalRegistry??(Wb.__zod_globalRegistry=wT());const go=globalThis.__zod_globalRegistry;function jT(e,n){return new e({type:"string",...be(n)})}function NT(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...be(n)})}function ev(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...be(n)})}function kT(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...be(n)})}function AT(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(n)})}function CT(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(n)})}function _T(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(n)})}function TT(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...be(n)})}function ET(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...be(n)})}function OT(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(n)})}function DT(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...be(n)})}function zT(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(n)})}function RT(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...be(n)})}function MT(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...be(n)})}function BT(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(n)})}function LT(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(n)})}function qT(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(n)})}function UT(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(n)})}function $T(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(n)})}function IT(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...be(n)})}function PT(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...be(n)})}function VT(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...be(n)})}function GT(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...be(n)})}function HT(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(n)})}function KT(e,n){return new e({type:"string",format:"date",check:"string_format",...be(n)})}function QT(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...be(n)})}function ZT(e,n){return new e({type:"string",format:"duration",check:"string_format",...be(n)})}function YT(e,n){return new e({type:"number",checks:[],...be(n)})}function FT(e,n){return new e({type:"number",coerce:!0,checks:[],...be(n)})}function XT(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...be(n)})}function JT(e,n){return new e({type:"boolean",...be(n)})}function WT(e,n){return new e({type:"null",...be(n)})}function eE(e){return new e({type:"unknown"})}function tE(e,n){return new e({type:"never",...be(n)})}function tv(e,n){return new Z0({check:"less_than",...be(n),value:e,inclusive:!1})}function Ef(e,n){return new Z0({check:"less_than",...be(n),value:e,inclusive:!0})}function nv(e,n){return new Y0({check:"greater_than",...be(n),value:e,inclusive:!1})}function Of(e,n){return new Y0({check:"greater_than",...be(n),value:e,inclusive:!0})}function av(e,n){return new p_({check:"multiple_of",...be(n),value:e})}function nS(e,n){return new h_({check:"max_length",...be(n),maximum:e})}function wc(e,n){return new g_({check:"min_length",...be(n),minimum:e})}function aS(e,n){return new y_({check:"length_equals",...be(n),length:e})}function nE(e,n){return new b_({check:"string_format",format:"regex",...be(n),pattern:e})}function aE(e){return new v_({check:"string_format",format:"lowercase",...be(e)})}function iE(e){return new S_({check:"string_format",format:"uppercase",...be(e)})}function sE(e,n){return new x_({check:"string_format",format:"includes",...be(n),includes:e})}function rE(e,n){return new w_({check:"string_format",format:"starts_with",...be(n),prefix:e})}function oE(e,n){return new j_({check:"string_format",format:"ends_with",...be(n),suffix:e})}function or(e){return new N_({check:"overwrite",tx:e})}function lE(e){return or(n=>n.normalize(e))}function cE(){return or(e=>e.trim())}function uE(){return or(e=>e.toLowerCase())}function dE(){return or(e=>e.toUpperCase())}function fE(){return or(e=>y2(e))}function pE(e,n,i){return new e({type:"array",element:n,...be(i)})}function mE(e,n,i){return new e({type:"custom",check:"custom",fn:n,...be(i)})}function hE(e){const n=gE(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(wo(r,i.value,n._zod.def));else{const l=r;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=i.value),l.inst??(l.inst=n),l.continue??(l.continue=!n._zod.def.abort),i.issues.push(wo(l))}},e(i.value,i)));return n}function gE(e,n){const i=new ln({check:"custom",...be(n)});return i._zod.check=e,i}function iS(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??go,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Et(e,n,i={path:[],schemaPath:[]}){var r;const l=e._zod.def,c=n.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:i.path};n.seen.set(e,d);const h=e._zod.toJSONSchema?.();if(h)d.schema=h;else{const x={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,d.schema,x);else{const N=d.schema,C=n.processors[l.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);C(e,n,N,x)}const w=e._zod.parent;w&&(d.ref||(d.ref=w),Et(w,n,x),n.seen.get(w).isParent=!0)}const g=n.metadataRegistry.get(e);return g&&Object.assign(d.schema,g),n.io==="input"&&Qt(e)&&(delete d.schema.examples,delete d.schema.default),n.io==="input"&&d.schema._prefault&&((r=d.schema).default??(r.default=d.schema._prefault)),delete d.schema._prefault,n.seen.get(e).schema}function sS(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of e.seen.entries()){const h=e.metadataRegistry.get(d[0])?.id;if(h){const g=r.get(h);if(g&&g!==d[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(h,d[0])}}const l=d=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=e.external.registry.get(d[0])?.id,N=e.external.uri??(D=>D);if(w)return{ref:N(w)};const C=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=C,{defId:C,ref:`${N("__shared")}#/${h}/${C}`}}if(d[1]===i)return{ref:"#"};const b=`#/${h}/`,x=d[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:b+x}},c=d=>{if(d[1].schema.$ref)return;const h=d[1],{ref:g,defId:b}=l(d);h.def={...h.schema},b&&(h.defId=b);const x=h.schema;for(const w in x)delete x[w];x.$ref=g};if(e.cycles==="throw")for(const d of e.seen.entries()){const h=d[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/<root>
|
|
51
|
-
|
|
52
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const h=d[1];if(n===d[0]){c(d);continue}if(e.external){const b=e.external.registry.get(d[0])?.id;if(n!==d[0]&&b){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(h.cycle){c(d);continue}if(h.count>1&&e.reused==="ref"){c(d);continue}}}function rS(e,n){const i=e.seen.get(n);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const h=e.seen.get(d);if(h.ref===null)return;const g=h.def??h.schema,b={...g},x=h.ref;if(h.ref=null,x){r(x);const N=e.seen.get(x),C=N.schema;if(C.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(C)):Object.assign(g,C),Object.assign(g,b),d._zod.parent===x)for(const A in g)A==="$ref"||A==="allOf"||A in b||delete g[A];if(C.$ref&&N.def)for(const A in g)A==="$ref"||A==="allOf"||A in N.def&&JSON.stringify(g[A])===JSON.stringify(N.def[A])&&delete g[A]}const w=d._zod.parent;if(w&&w!==x){r(w);const N=e.seen.get(w);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const C in g)C==="$ref"||C==="allOf"||C in N.def&&JSON.stringify(g[C])===JSON.stringify(N.def[C])&&delete g[C]}e.override({zodSchema:d,jsonSchema:g,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(n)?.id;if(!d)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(d)}Object.assign(l,i.def??i.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(c[h.defId]=h.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?l.$defs=c:l.definitions=c);try{const d=JSON.parse(JSON.stringify(l));return Object.defineProperty(d,"~standard",{value:{...n["~standard"],jsonSchema:{input:jc(n,"input",e.processors),output:jc(n,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function Qt(e,n){const i=n??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Qt(r.element,i);if(r.type==="set")return Qt(r.valueType,i);if(r.type==="lazy")return Qt(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Qt(r.innerType,i);if(r.type==="intersection")return Qt(r.left,i)||Qt(r.right,i);if(r.type==="record"||r.type==="map")return Qt(r.keyType,i)||Qt(r.valueType,i);if(r.type==="pipe")return Qt(r.in,i)||Qt(r.out,i);if(r.type==="object"){for(const l in r.shape)if(Qt(r.shape[l],i))return!0;return!1}if(r.type==="union"){for(const l of r.options)if(Qt(l,i))return!0;return!1}if(r.type==="tuple"){for(const l of r.items)if(Qt(l,i))return!0;return!!(r.rest&&Qt(r.rest,i))}return!1}const yE=(e,n={})=>i=>{const r=iS({...i,processors:n});return Et(e,r),sS(r,e),rS(r,e)},jc=(e,n,i={})=>r=>{const{libraryOptions:l,target:c}=r??{},d=iS({...l??{},target:c,io:n,processors:i});return Et(e,d),sS(d,e),rS(d,e)},bE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vE=(e,n,i,r)=>{const l=i;l.type="string";const{minimum:c,maximum:d,format:h,patterns:g,contentEncoding:b}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof d=="number"&&(l.maxLength=d),h&&(l.format=bE[h]??h,l.format===""&&delete l.format,h==="time"&&delete l.format),b&&(l.contentEncoding=b),g&&g.size>0){const x=[...g];x.length===1?l.pattern=x[0].source:x.length>1&&(l.allOf=[...x.map(w=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},SE=(e,n,i,r)=>{const l=i,{minimum:c,maximum:d,format:h,multipleOf:g,exclusiveMaximum:b,exclusiveMinimum:x}=e._zod.bag;typeof h=="string"&&h.includes("int")?l.type="integer":l.type="number",typeof x=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.minimum=x,l.exclusiveMinimum=!0):l.exclusiveMinimum=x),typeof c=="number"&&(l.minimum=c,typeof x=="number"&&n.target!=="draft-04"&&(x>=c?delete l.minimum:delete l.exclusiveMinimum)),typeof b=="number"&&(n.target==="draft-04"||n.target==="openapi-3.0"?(l.maximum=b,l.exclusiveMaximum=!0):l.exclusiveMaximum=b),typeof d=="number"&&(l.maximum=d,typeof b=="number"&&n.target!=="draft-04"&&(b<=d?delete l.maximum:delete l.exclusiveMaximum)),typeof g=="number"&&(l.multipleOf=g)},xE=(e,n,i,r)=>{i.type="boolean"},wE=(e,n,i,r)=>{n.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},jE=(e,n,i,r)=>{i.not={}},NE=(e,n,i,r)=>{},kE=(e,n,i,r)=>{const l=e._zod.def,c=L0(l.entries);c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),i.enum=c},AE=(e,n,i,r)=>{const l=e._zod.def,c=[];for(const d of l.values)if(d===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];i.type=d===null?"null":typeof d,n.target==="draft-04"||n.target==="openapi-3.0"?i.enum=[d]:i.const=d}else c.every(d=>typeof d=="number")&&(i.type="number"),c.every(d=>typeof d=="string")&&(i.type="string"),c.every(d=>typeof d=="boolean")&&(i.type="boolean"),c.every(d=>d===null)&&(i.type="null"),i.enum=c},CE=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_E=(e,n,i,r)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},TE=(e,n,i,r)=>{const l=i,c=e._zod.def,{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(l.minItems=d),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=Et(c.element,n,{...r,path:[...r.path,"items"]})},EE=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object",l.properties={};const d=c.shape;for(const b in d)l.properties[b]=Et(d[b],n,{...r,path:[...r.path,"properties",b]});const h=new Set(Object.keys(d)),g=new Set([...h].filter(b=>{const x=c.shape[b]._zod;return n.io==="input"?x.optin===void 0:x.optout===void 0}));g.size>0&&(l.required=Array.from(g)),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=Et(c.catchall,n,{...r,path:[...r.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},OE=(e,n,i,r)=>{const l=e._zod.def,c=l.inclusive===!1,d=l.options.map((h,g)=>Et(h,n,{...r,path:[...r.path,c?"oneOf":"anyOf",g]}));c?i.oneOf=d:i.anyOf=d},DE=(e,n,i,r)=>{const l=e._zod.def,c=Et(l.left,n,{...r,path:[...r.path,"allOf",0]}),d=Et(l.right,n,{...r,path:[...r.path,"allOf",1]}),h=b=>"allOf"in b&&Object.keys(b).length===1,g=[...h(c)?c.allOf:[c],...h(d)?d.allOf:[d]];i.allOf=g},zE=(e,n,i,r)=>{const l=i,c=e._zod.def;l.type="object";const d=c.keyType,g=d._zod.bag?.patterns;if(c.mode==="loose"&&g&&g.size>0){const x=Et(c.valueType,n,{...r,path:[...r.path,"patternProperties","*"]});l.patternProperties={};for(const w of g)l.patternProperties[w.source]=x}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=Et(c.keyType,n,{...r,path:[...r.path,"propertyNames"]})),l.additionalProperties=Et(c.valueType,n,{...r,path:[...r.path,"additionalProperties"]});const b=d._zod.values;if(b){const x=[...b].filter(w=>typeof w=="string"||typeof w=="number");x.length>0&&(l.required=x)}},RE=(e,n,i,r)=>{const l=e._zod.def,c=Et(l.innerType,n,r),d=n.seen.get(e);n.target==="openapi-3.0"?(d.ref=l.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},ME=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},BE=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.default=JSON.parse(JSON.stringify(l.defaultValue))},LE=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,n.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},qE=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType;let d;try{d=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=d},UE=(e,n,i,r)=>{const l=e._zod.def,c=n.io==="input"?l.in._zod.def.type==="transform"?l.out:l.in:l.out;Et(c,n,r);const d=n.seen.get(e);d.ref=c},$E=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType,i.readOnly=!0},oS=(e,n,i,r)=>{const l=e._zod.def;Et(l.innerType,n,r);const c=n.seen.get(e);c.ref=l.innerType},IE=Z("ZodISODateTime",(e,n)=>{q_.init(e,n),gt.init(e,n)});function lS(e){return HT(IE,e)}const PE=Z("ZodISODate",(e,n)=>{U_.init(e,n),gt.init(e,n)});function VE(e){return KT(PE,e)}const GE=Z("ZodISOTime",(e,n)=>{$_.init(e,n),gt.init(e,n)});function HE(e){return QT(GE,e)}const KE=Z("ZodISODuration",(e,n)=>{I_.init(e,n),gt.init(e,n)});function QE(e){return ZT(KE,e)}const ZE=(e,n)=>{I0.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>E2(e,i)},flatten:{value:i=>T2(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Wf,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Wf,2)}},isEmpty:{get(){return e.issues.length===0}}})},Rn=Z("ZodError",ZE,{Parent:Error}),YE=Mp(Rn),FE=Bp(Rn),XE=Mc(Rn),JE=Bc(Rn),WE=z2(Rn),eO=R2(Rn),tO=M2(Rn),nO=B2(Rn),aO=L2(Rn),iO=q2(Rn),sO=U2(Rn),rO=$2(Rn),ht=Z("ZodType",(e,n)=>(pt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:jc(e,"input"),output:jc(e,"output")}}),e.toJSONSchema=yE(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...i)=>e.clone(ci(n,{checks:[...n.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>ui(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>YE(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>XE(e,i,r),e.parseAsync=async(i,r)=>FE(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>JE(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>WE(e,i,r),e.decode=(i,r)=>eO(e,i,r),e.encodeAsync=async(i,r)=>tO(e,i,r),e.decodeAsync=async(i,r)=>nO(e,i,r),e.safeEncode=(i,r)=>aO(e,i,r),e.safeDecode=(i,r)=>iO(e,i,r),e.safeEncodeAsync=async(i,r)=>sO(e,i,r),e.safeDecodeAsync=async(i,r)=>rO(e,i,r),e.refine=(i,r)=>e.check(WO(i,r)),e.superRefine=i=>e.check(eD(i)),e.overwrite=i=>e.check(or(i)),e.optional=()=>rv(e),e.exactOptional=()=>$O(e),e.nullable=()=>ov(e),e.nullish=()=>rv(ov(e)),e.nonoptional=i=>KO(e,i),e.array=()=>k(e),e.or=i=>Dn([e,i]),e.and=i=>MO(e,i),e.transform=i=>np(e,dS(i)),e.default=i=>VO(e,i),e.prefault=i=>HO(e,i),e.catch=i=>ZO(e,i),e.pipe=i=>np(e,i),e.readonly=()=>XO(e),e.describe=i=>{const r=e.clone();return go.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){return go.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return go.get(e);const r=e.clone();return go.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),cS=Z("_ZodString",(e,n)=>{Lp.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(r,l,c)=>vE(e,r,l);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(nE(...r)),e.includes=(...r)=>e.check(sE(...r)),e.startsWith=(...r)=>e.check(rE(...r)),e.endsWith=(...r)=>e.check(oE(...r)),e.min=(...r)=>e.check(wc(...r)),e.max=(...r)=>e.check(nS(...r)),e.length=(...r)=>e.check(aS(...r)),e.nonempty=(...r)=>e.check(wc(1,...r)),e.lowercase=r=>e.check(aE(r)),e.uppercase=r=>e.check(iE(r)),e.trim=()=>e.check(cE()),e.normalize=(...r)=>e.check(lE(...r)),e.toLowerCase=()=>e.check(uE()),e.toUpperCase=()=>e.check(dE()),e.slugify=()=>e.check(fE())}),oO=Z("ZodString",(e,n)=>{Lp.init(e,n),cS.init(e,n),e.email=i=>e.check(NT(lO,i)),e.url=i=>e.check(TT(cO,i)),e.jwt=i=>e.check(GT(NO,i)),e.emoji=i=>e.check(ET(uO,i)),e.guid=i=>e.check(ev(iv,i)),e.uuid=i=>e.check(kT(sc,i)),e.uuidv4=i=>e.check(AT(sc,i)),e.uuidv6=i=>e.check(CT(sc,i)),e.uuidv7=i=>e.check(_T(sc,i)),e.nanoid=i=>e.check(OT(dO,i)),e.guid=i=>e.check(ev(iv,i)),e.cuid=i=>e.check(DT(fO,i)),e.cuid2=i=>e.check(zT(pO,i)),e.ulid=i=>e.check(RT(mO,i)),e.base64=i=>e.check(IT(xO,i)),e.base64url=i=>e.check(PT(wO,i)),e.xid=i=>e.check(MT(hO,i)),e.ksuid=i=>e.check(BT(gO,i)),e.ipv4=i=>e.check(LT(yO,i)),e.ipv6=i=>e.check(qT(bO,i)),e.cidrv4=i=>e.check(UT(vO,i)),e.cidrv6=i=>e.check($T(SO,i)),e.e164=i=>e.check(VT(jO,i)),e.datetime=i=>e.check(lS(i)),e.date=i=>e.check(VE(i)),e.time=i=>e.check(HE(i)),e.duration=i=>e.check(QE(i))});function u(e){return jT(oO,e)}const gt=Z("ZodStringFormat",(e,n)=>{mt.init(e,n),cS.init(e,n)}),lO=Z("ZodEmail",(e,n)=>{T_.init(e,n),gt.init(e,n)}),iv=Z("ZodGUID",(e,n)=>{C_.init(e,n),gt.init(e,n)}),sc=Z("ZodUUID",(e,n)=>{__.init(e,n),gt.init(e,n)}),cO=Z("ZodURL",(e,n)=>{E_.init(e,n),gt.init(e,n)}),uO=Z("ZodEmoji",(e,n)=>{O_.init(e,n),gt.init(e,n)}),dO=Z("ZodNanoID",(e,n)=>{D_.init(e,n),gt.init(e,n)}),fO=Z("ZodCUID",(e,n)=>{z_.init(e,n),gt.init(e,n)}),pO=Z("ZodCUID2",(e,n)=>{R_.init(e,n),gt.init(e,n)}),mO=Z("ZodULID",(e,n)=>{M_.init(e,n),gt.init(e,n)}),hO=Z("ZodXID",(e,n)=>{B_.init(e,n),gt.init(e,n)}),gO=Z("ZodKSUID",(e,n)=>{L_.init(e,n),gt.init(e,n)}),yO=Z("ZodIPv4",(e,n)=>{P_.init(e,n),gt.init(e,n)}),bO=Z("ZodIPv6",(e,n)=>{V_.init(e,n),gt.init(e,n)}),vO=Z("ZodCIDRv4",(e,n)=>{G_.init(e,n),gt.init(e,n)}),SO=Z("ZodCIDRv6",(e,n)=>{H_.init(e,n),gt.init(e,n)}),xO=Z("ZodBase64",(e,n)=>{K_.init(e,n),gt.init(e,n)}),wO=Z("ZodBase64URL",(e,n)=>{Z_.init(e,n),gt.init(e,n)}),jO=Z("ZodE164",(e,n)=>{Y_.init(e,n),gt.init(e,n)}),NO=Z("ZodJWT",(e,n)=>{X_.init(e,n),gt.init(e,n)}),qp=Z("ZodNumber",(e,n)=>{X0.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(r,l,c)=>SE(e,r,l),e.gt=(r,l)=>e.check(nv(r,l)),e.gte=(r,l)=>e.check(Of(r,l)),e.min=(r,l)=>e.check(Of(r,l)),e.lt=(r,l)=>e.check(tv(r,l)),e.lte=(r,l)=>e.check(Ef(r,l)),e.max=(r,l)=>e.check(Ef(r,l)),e.int=r=>e.check(sv(r)),e.safe=r=>e.check(sv(r)),e.positive=r=>e.check(nv(0,r)),e.nonnegative=r=>e.check(Of(0,r)),e.negative=r=>e.check(tv(0,r)),e.nonpositive=r=>e.check(Ef(0,r)),e.multipleOf=(r,l)=>e.check(av(r,l)),e.step=(r,l)=>e.check(av(r,l)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function y(e){return YT(qp,e)}const kO=Z("ZodNumberFormat",(e,n)=>{J_.init(e,n),qp.init(e,n)});function sv(e){return XT(kO,e)}const AO=Z("ZodBoolean",(e,n)=>{W_.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>xE(e,i,r)});function te(e){return JT(AO,e)}const CO=Z("ZodNull",(e,n)=>{eT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>wE(e,i,r)});function ze(e){return WT(CO,e)}const _O=Z("ZodUnknown",(e,n)=>{tT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>NE()});function Pn(){return eE(_O)}const TO=Z("ZodNever",(e,n)=>{nT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>jE(e,i,r)});function EO(e){return tE(TO,e)}const OO=Z("ZodArray",(e,n)=>{aT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>TE(e,i,r,l),e.element=n.element,e.min=(i,r)=>e.check(wc(i,r)),e.nonempty=i=>e.check(wc(1,i)),e.max=(i,r)=>e.check(nS(i,r)),e.length=(i,r)=>e.check(aS(i,r)),e.unwrap=()=>e.element});function k(e,n){return pE(OO,e,n)}const DO=Z("ZodObject",(e,n)=>{sT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>EE(e,i,r,l),Qe(e,"shape",()=>n.shape),e.keyof=()=>H(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pn()}),e.strict=()=>e.clone({...e._zod.def,catchall:EO()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>N2(e,i),e.safeExtend=i=>k2(e,i),e.merge=i=>A2(e,i),e.pick=i=>w2(e,i),e.omit=i=>j2(e,i),e.partial=(...i)=>C2(fS,e,i[0]),e.required=(...i)=>_2(pS,e,i[0])});function S(e,n){const i={type:"object",shape:e??{},...be(n)};return new DO(i)}const uS=Z("ZodUnion",(e,n)=>{eS.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>OE(e,i,r,l),e.options=n.options});function Dn(e,n){return new uS({type:"union",options:e,...be(n)})}const zO=Z("ZodDiscriminatedUnion",(e,n)=>{uS.init(e,n),rT.init(e,n)});function _o(e,n,i){return new zO({type:"union",options:n,discriminator:e,...be(i)})}const RO=Z("ZodIntersection",(e,n)=>{oT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>DE(e,i,r,l)});function MO(e,n){return new RO({type:"intersection",left:e,right:n})}const BO=Z("ZodRecord",(e,n)=>{lT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>zE(e,i,r,l),e.keyType=n.keyType,e.valueType=n.valueType});function He(e,n,i){return new BO({type:"record",keyType:e,valueType:n,...be(i)})}const tp=Z("ZodEnum",(e,n)=>{cT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(r,l,c)=>kE(e,r,l),e.enum=n.entries,e.options=Object.values(n.entries);const i=new Set(Object.keys(n.entries));e.extract=(r,l)=>{const c={};for(const d of r)if(i.has(d))c[d]=n.entries[d];else throw new Error(`Key ${d} not found in enum`);return new tp({...n,checks:[],...be(l),entries:c})},e.exclude=(r,l)=>{const c={...n.entries};for(const d of r)if(i.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new tp({...n,checks:[],...be(l),entries:c})}});function H(e,n){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new tp({type:"enum",entries:i,...be(n)})}const LO=Z("ZodLiteral",(e,n)=>{uT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>AE(e,i,r),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function De(e,n){return new LO({type:"literal",values:Array.isArray(e)?e:[e],...be(n)})}const qO=Z("ZodTransform",(e,n)=>{dT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>_E(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new M0(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(wo(c,i.value,n));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=i.value),d.inst??(d.inst=e),i.issues.push(wo(d))}};const l=n.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function dS(e){return new qO({type:"transform",transform:e})}const fS=Z("ZodOptional",(e,n)=>{tS.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oS(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function rv(e){return new fS({type:"optional",innerType:e})}const UO=Z("ZodExactOptional",(e,n)=>{fT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>oS(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function $O(e){return new UO({type:"optional",innerType:e})}const IO=Z("ZodNullable",(e,n)=>{pT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>RE(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function ov(e){return new IO({type:"nullable",innerType:e})}const PO=Z("ZodDefault",(e,n)=>{mT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>BE(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VO(e,n){return new PO({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():U0(n)}})}const GO=Z("ZodPrefault",(e,n)=>{hT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>LE(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function HO(e,n){return new GO({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():U0(n)}})}const pS=Z("ZodNonOptional",(e,n)=>{gT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>ME(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function KO(e,n){return new pS({type:"nonoptional",innerType:e,...be(n)})}const QO=Z("ZodCatch",(e,n)=>{yT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>qE(e,i,r,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ZO(e,n){return new QO({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const YO=Z("ZodPipe",(e,n)=>{bT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>UE(e,i,r,l),e.in=n.in,e.out=n.out});function np(e,n){return new YO({type:"pipe",in:e,out:n})}const FO=Z("ZodReadonly",(e,n)=>{vT.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>$E(e,i,r,l),e.unwrap=()=>e._zod.def.innerType});function XO(e){return new FO({type:"readonly",innerType:e})}const JO=Z("ZodCustom",(e,n)=>{ST.init(e,n),ht.init(e,n),e._zod.processJSONSchema=(i,r,l)=>CE(e,i)});function WO(e,n={}){return mE(JO,e,n)}function eD(e){return hE(e)}function tD(e,n){return np(dS(e),n)}function nD(e){return FT(qp,e)}const mS=S({id:u(),name:u(),keyPrefix:u(),scopes:k(u()),projectId:u().nullable(),readOnly:te(),createdAt:u(),lastUsedAt:u().nullable(),revokedAt:u().nullable()});S({keys:k(mS)});S({name:u().min(1).max(100),scopes:k(u()).min(1).optional(),projectId:u().optional()});mS.extend({key:u()});const aD=S({maxConcurrency:y().int().positive(),maxRequestsPerMinute:y().int().positive(),maxRequestsPerDay:y().int().positive()}),Aa=u().min(1),Up=He(u(),u().trim().min(1));u().min(1);const qc=S({label:u().min(1),city:u().min(1),region:u().min(1),country:u().length(2),timezone:u().optional()}),$p=H(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);S({id:u(),projectId:u(),channel:De("webhook"),url:u().url(),urlDisplay:u(),urlHost:u(),events:k($p),enabled:te().default(!0),source:u().optional(),webhookSecret:u().optional(),createdAt:u(),updatedAt:u()});S({channel:De("webhook"),url:u().url(),events:k($p).min(1),source:u().optional()});const hS=H(["cli","api","config-file"]);function iD(e){const n=new Set,i=new Set;for(const r of e){if(n.has(r.label)){i.add(r.label);continue}n.add(r.label)}return[...i]}function sD(e,n){return n?e.some(i=>i.label===n):!0}S({displayName:u().min(1),canonicalDomain:u().min(1),ownedDomains:k(u().min(1)).optional(),aliases:k(u()).optional(),country:u().length(2),language:u().min(2),tags:k(u()).optional(),labels:He(u(),u()).optional(),providers:k(Aa).optional(),providerModels:Up.optional(),locations:k(qc).optional(),defaultLocation:u().nullable().optional(),autoExtractBacklinks:te().optional(),configSource:hS.optional()});const rD=S({id:u(),name:u(),displayName:u().optional(),canonicalDomain:u(),ownedDomains:k(u()).default([]),aliases:k(u()).default([]),country:u().length(2),language:u().min(2),tags:k(u()).default([]),labels:He(u(),u()).default({}),providers:k(u()).default([]),providerModels:Up.default({}),locations:k(qc).default([]),defaultLocation:u().nullable().optional(),autoExtractBacklinks:te().default(!1),configSource:hS.default("cli"),configRevision:y().int().positive().default(1),createdAt:u().optional(),updatedAt:u().optional()});S({id:u(),query:u(),createdAt:u()});S({id:u(),keyword:u(),createdAt:u()});S({queries:k(u().trim().min(1)).min(1)});S({keywords:k(u().trim().min(1)).min(1)});S({provider:Aa,count:y().int().min(1).max(20).optional()});S({id:u(),domain:u(),createdAt:u()});S({competitors:k(u().trim().min(1)).min(1)});function Nc(e){let n=e.trim().toLowerCase();try{n.includes("://")&&(n=new URL(n).hostname.toLowerCase())}catch{}return n.replace(/^www\./,"")}const oD=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function lD(e){const n=Nc(e);if(!n)return"";const i=n.split("/")[0]?.split(":")[0]??"";if(!i)return"";const r=i.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const l=r.slice(-2).join(".");return oD.has(l)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function cD(e){const n=lD(e);return n?n.split(".")[0]??"":""}function uD(e){const n=[e.canonicalDomain,...e.ownedDomains??[]],i=new Set,r=[];for(const l of n){const c=l.trim();if(!c)continue;const d=Nc(c);i.has(d)||(i.add(d),r.push(c))}return r}const dD=S({name:u().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:He(u(),u()).optional().default({})}),fD=S({preset:u().optional(),cron:u().optional(),timezone:u().optional().default("UTC"),providers:k(Aa).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),pD=S({channel:De("webhook"),url:u().url(),events:k($p).min(1)}),mD=S({gsc:S({propertyUrl:u()}).optional(),syncSchedule:S({preset:u().optional(),cron:u().optional()}).optional()}).optional(),lv=k(u().min(1)),hD=S({displayName:u().min(1),canonicalDomain:u().min(1),ownedDomains:k(u().min(1)).optional().default([]),aliases:k(u().min(1)).optional().default([]),country:u().length(2),language:u().min(2),queries:lv.optional(),keywords:lv.optional(),competitors:k(u().min(1)).optional().default([]),providers:k(Aa).optional().default([]),providerModels:Up.optional().default({}),locations:k(qc).optional().default([]),defaultLocation:u().optional(),schedule:fD,notifications:k(pD).optional().default([]),google:mD,autoExtractBacklinks:te().optional().default(!1)}).superRefine((e,n)=>{e.queries!==void 0&&e.keywords!==void 0&&n.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const i=iD(e.locations);i.length>0&&n.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${i.join(", ")}`,path:["locations"]}),sD(e.locations,e.defaultLocation)||n.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});S({apiVersion:De("canonry/v1"),kind:De("Project"),metadata:dD,spec:hD});const gS=H(["introduced","repointed","retired"]),gD=gS.enum;S({modelId:u().trim().min(1),date:u().regex(/^\d{4}-\d{2}-\d{2}$/,"date must be YYYY-MM-DD"),kind:gS,confirmed:te(),sourceUrl:u().url(),note:u().min(1)});const yD=[{modelId:"chatgpt-4o-latest",date:"2024-08-15",kind:"introduced",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim: "Released dynamic model for chatgpt-4o-latest—this model will point to the latest GPT-4o model used by ChatGPT." First moving id in the lineage.'},{modelId:"chatgpt-4o-latest",date:"2026-02-17",kind:"retired",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/deprecations.md",note:'Shutdown 2026-02-17, replacement gpt-5.1-chat-latest. Announced under the heading "2025-11-18: chatgpt-4o-latest snapshot".'},{modelId:"gpt-5.1-chat-latest",date:"2025-11-13",kind:"introduced",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:"Introduced inside the GPT-5.1 launch entry, not as a standalone entry."},{modelId:"gpt-5.2-chat-latest",date:"2025-12-11",kind:"introduced",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:"Introduced inside the GPT-5.2 launch entry."},{modelId:"gpt-5.2-chat-latest",date:"2026-02-10",kind:"repointed",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim: "Updated the gpt-5.2-chat-latest slug to point to the latest model currently used in ChatGPT." Target model NOT named.'},{modelId:"gpt-5.3-chat-latest",date:"2026-03-03",kind:"introduced",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim: "Released gpt-5.3-chat-latest to the Chat Completions and Responses API. This model points to the GPT-5.3 Instant snapshot currently used in ChatGPT."'},{modelId:"gpt-5.3-chat-latest",date:"2026-03-16",kind:"repointed",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim: "Updated the gpt-5.3-chat-latest slug to point to the latest model currently used in ChatGPT." Target model NOT named.'},{modelId:"chat-latest",date:"2026-05-05",kind:"introduced",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim: "Released chat-latest snapshot which points to the latest Instant model currently used in ChatGPT... The underlying model snapshot will be regularly updated."'},{modelId:"chat-latest",date:"2026-05-28",kind:"repointed",confirmed:!1,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'UNCONFIRMED. The entry reads "Released chat-latest snapshot..." — the verb is "Released", the same boilerplate as the 2026-05-05 entry, not "Updated" as used on 2026-06-24. Only "the latest improvements" vs "our latest improvements" differs. Either a real change logged with copy-pasted text, or a duplicated entry; the record does not disambiguate.'},{modelId:"chat-latest",date:"2026-06-24",kind:"repointed",confirmed:!0,sourceUrl:"https://developers.openai.com/api/docs/changelog",note:'Verbatim (re-read at source 2026-07-20): "Updated the chat-latest snapshot, which points to the latest Instant model currently used in ChatGPT." The verb is "Updated", unlike the "Released" boilerplate of 2026-05-05 and 2026-05-28, which is the wording the changelog reserves for a real change. Target model NOT named. The only unambiguous chat-latest change on record.'}];gD.repointed;new Set(yD.map(e=>e.modelId.toLowerCase()));const bD=H(["not-exposed","no-known-change","known-change"]);bD.enum;const vD=S({modelId:u().trim().min(1),date:u().regex(/^\d{4}-\d{2}-\d{2}$/),confirmed:te(),sourceUrl:u().url()}),SD=S({status:H(["no-known-change","known-change"]),modelIds:k(u().trim().min(1)).min(1),changes:k(vD),changeCount:y().int().nonnegative(),unverifiedChangeCount:y().int().nonnegative(),firstChangeDate:u().optional(),lastChangeDate:u().optional(),knownGoodAsOf:u(),checkedThroughPeriodEnd:te()}),xD={openai:"ChatGPT",chatgpt:"ChatGPT",anthropic:"Claude",claude:"Claude",google:"Gemini",gemini:"Gemini",perplexity:"Perplexity"};function wD(e){const n=e.trim().toLowerCase();return xD[n]??e.charAt(0).toUpperCase()+e.slice(1)}function Df(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):0}function co(e){return typeof e=="string"&&e.trim().length>=10?e.trim().slice(0,10):null}function zf(e){return[...new Set(e.filter(n=>n!==null))].sort()}function jD(e,n){const i=wD(e),r=Array.isArray(n.changes)?n.changes:[],l=Df(n.changeCount)||r.length,c=Math.min(l,Df(n.unverifiedChangeCount)||Df(n.unconfirmedChangeCount)||r.filter(x=>x.confirmed===!1).length),d=co(n.knownGoodAsOf),h=n.checkedThroughPeriodEnd!==!1,g={engine:i,confirmedCount:l-c,unconfirmedCount:c,knownGoodAsOf:d,checkedThroughPeriodEnd:h};if(r.length>0)return{...g,confirmedDates:zf(r.filter(x=>x.confirmed!==!1).map(x=>co(x.date))),unconfirmedDates:zf(r.filter(x=>x.confirmed===!1).map(x=>co(x.date)))};const b=zf([co(n.firstChangeDate),co(n.lastChangeDate)]);return l===0?{...g,confirmedDates:[],unconfirmedDates:[]}:c===0?{...g,confirmedDates:b,unconfirmedDates:[]}:g.confirmedCount===0?{...g,confirmedDates:[],unconfirmedDates:b}:{...g,confirmedDates:[],unconfirmedDates:[]}}function ND(e){return e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function cv(e,n){return e.length===0?null:e.length===1&&n<=1?`on ${e[0]}`:`more than once between ${e[0]} and ${e[e.length-1]}`}function kD(e){const n=cv(e.confirmedDates,e.confirmedCount),i=cv(e.unconfirmedDates,e.unconfirmedCount),r=`The model behind ${e.engine}`;if(e.confirmedCount>0&&e.unconfirmedCount===0)return n?`${r} was updated ${n}, inside this period.`:`${r} was updated inside this period.`;if(e.confirmedCount===0)return i?`${r} may have been updated ${i}, inside this period, though that is not confirmed.`:`${r} may have been updated inside this period, though that is not confirmed.`;if(n&&i)return`${r} was updated ${n}, inside this period, and may also have been updated ${i}.`;const l=e.unconfirmedCount>1?"more times":"once more";return`${r} was updated inside this period, and may have been updated ${l}, though that is not confirmed.`}function uv(e){const n=e.filter(r=>!r.checkedThroughPeriodEnd&&r.knownGoodAsOf!==null);return n.length===0?null:`We last checked for model updates on ${n.map(r=>r.knownGoodAsOf).sort()[0]}, and this period runs past that date, so there may be later updates we do not know about.`}function xU(e){const n=Object.entries(e??{}).map(([g,b])=>jD(g,b??{})).sort((g,b)=>g.engine.localeCompare(b.engine));if(n.length===0)return null;const i=n.filter(g=>g.confirmedCount+g.unconfirmedCount>0);if(i.length===0){const g=[...new Set(n.map(C=>C.engine))],b=g.length>1,x=uv(n),w=[...new Set(n.map(C=>C.knownGoodAsOf).filter(C=>C!==null))].sort(),N=x??(w.length>0?`We last checked for model updates on ${w[0]}.`:null);return{kind:"no-known-change",text:`No model updates are on record for ${ND(g)} in this period.`,detail:`${b?"These engines":"This engine"} can be moved onto a different underlying model without the data ever showing a different model name, so we check each period against a record of known updates. Nothing is listed inside this one.${N?` ${N}`:""}`}}const r=i.reduce((g,b)=>g+b.confirmedCount+b.unconfirmedCount,0),l=i.some(g=>g.confirmedCount>0),c=r===1?"this update":"these updates",d=l?`Some of the movement in these numbers may come from ${c} rather than from a real change in how AI answers about you, so compare periods carefully.`:`If so, some of the movement in these numbers may come from ${c} rather than from a real change in how AI answers about you, so compare periods carefully.`,h=uv(n);return{kind:"change",text:`${i.map(kD).join(" ")} ${d}${h?` ${h}`:""}`}}const AD=H(["gsc","ga4","gbp"]);S({id:u(),domain:u(),connectionType:AD,propertyId:u().nullable().optional(),sitemapUrl:u().nullable().optional(),scopes:k(u()).default([]),createdAt:u(),updatedAt:u()});S({date:u(),query:u(),page:u(),country:u().nullable().optional(),device:u().nullable().optional(),clicks:y(),impressions:y(),ctr:y(),position:y()});const CD=S({date:u(),clicks:y(),impressions:y(),ctr:y()});S({totals:S({clicks:y(),impressions:y(),ctr:y(),days:y()}),daily:k(CD)});const ap=S({id:u(),url:u(),indexingState:u().nullable().optional(),verdict:u().nullable().optional(),coverageState:u().nullable().optional(),pageFetchState:u().nullable().optional(),robotsTxtState:u().nullable().optional(),crawlTime:u().nullable().optional(),lastCrawlResult:u().nullable().optional(),isMobileFriendly:te().nullable().optional(),richResults:k(u()).default([]),referringUrls:k(u()).default([]),inspectedAt:u()});H(["stable","reindexed","deindexed","still-missing","new"]);const _D=S({url:u(),previousState:u().nullable(),currentState:u().nullable(),transitionDate:u()}),TD=S({reason:u(),count:y(),urls:k(ap).default([])});S({summary:S({total:y(),indexed:y(),notIndexed:y(),deindexed:y(),percentage:y()}),lastInspectedAt:u().nullable(),lastSyncedAt:u().nullable(),indexed:k(ap).default([]),notIndexed:k(ap).default([]),deindexed:k(_D).default([]),reasonGroups:k(TD).default([])});S({url:u(),type:H(["URL_UPDATED","URL_DELETED"]),notifiedAt:u()});const ED=S({url:u(),type:H(["URL_UPDATED","URL_DELETED"]),notifiedAt:u(),status:H(["success","error"]),error:u().optional()});S({summary:S({total:y().int().nonnegative(),succeeded:y().int().nonnegative(),failed:y().int().nonnegative()}),results:k(ED).default([])});S({date:u(),indexed:y(),notIndexed:y(),reasonBreakdown:He(u(),y()).default({})});const OD=S({siteUrl:u(),permissionLevel:u()});S({sites:k(OD).default([])});const DD=S({type:u(),submitted:u(),indexed:u()}),zD=S({path:u(),lastSubmitted:u().optional(),isPending:te().optional(),isSitemapsIndex:te().optional(),type:u().optional(),lastDownloaded:u().optional(),warnings:u().optional(),errors:u().optional(),contents:k(DD).optional()});S({sitemaps:k(zD).default([])});const RD=S({name:u(),accountName:u().nullable(),type:u().nullable(),role:u().nullable()});S({accounts:k(RD),total:y().int().nonnegative()});const MD=S({id:u(),projectId:u(),accountName:u(),locationName:u(),displayName:u(),primaryCategoryDisplayName:u().nullable(),storefrontAddress:u().nullable(),websiteUri:u().nullable(),placeId:u().nullable(),mapsUri:u().nullable(),additionalCategories:k(u()),description:u().nullable(),serviceArea:He(u(),Pn()).nullable(),regularHours:He(u(),Pn()).nullable(),primaryPhone:u().nullable(),openStatus:u().nullable(),openingDate:u().nullable(),selected:te(),syncedAt:u().nullable(),createdAt:u(),updatedAt:u()});S({locations:k(MD),totalDiscovered:y().int().nonnegative(),totalSelected:y().int().nonnegative()});S({selectAllNew:te().default(!0),accountName:u().optional(),switchAccount:te().default(!1)});S({selected:te()});S({locationNames:k(u()).optional(),daysOfMetrics:y().int().positive().max(540).optional(),monthsOfKeywords:y().int().positive().max(18).optional()});S({runId:u(),status:u()});const BD=S({locationName:u(),date:u(),metric:u(),value:y().int()});S({metrics:k(BD),total:y().int().nonnegative()});const LD=S({locationName:u(),periodStart:u(),periodEnd:u(),keyword:u(),valueCount:y().int().nullable(),valueThreshold:y().int().nullable()});S({keywords:k(LD),total:y().int().nonnegative(),thresholdedPct:y().int().min(0).max(100)});const qD=S({locationName:u(),placeActionLinkName:u(),placeActionType:u(),uri:u().nullable(),isPreferred:te(),providerType:u().nullable()});S({placeActions:k(qD),total:y().int().nonnegative()});const UD=S({locationName:u(),populatedGroupCount:y().int().nonnegative(),syncedAt:u(),attributes:He(u(),Pn())});S({lodging:k(UD),total:y().int().nonnegative()});const $D=S({name:u(),valueType:u(),values:k(Dn([te(),u()])),unsetValues:k(u()),uris:k(u())}),ID=S({locationName:u(),attributeCount:y().int().nonnegative(),syncedAt:u(),attributes:k($D)});S({attributes:k(ID),total:y().int().nonnegative()});const PD=S({locationName:u(),placeId:u(),tier:u(),amenities:k(u()),syncedAt:u(),place:He(u(),Pn())});S({places:k(PD),total:y().int().nonnegative()});S({scope:S({locationName:u().nullable(),locationCount:y().int().nonnegative()}),performance:S({totals:He(u(),y()),recent7d:He(u(),y()),prior7d:He(u(),y()),deltaPct:He(u(),y().nullable())}),freshness:S({dataThroughDate:u().nullable(),latestStoredDate:u().nullable(),pendingDays:y().int().nonnegative()}),timeseries:k(S({date:u(),pending:te(),metrics:He(u(),y())})),keywords:S({total:y().int().nonnegative(),thresholdedCount:y().int().nonnegative(),thresholdedPct:y().int().min(0).max(100)}),placeActions:S({total:y().int().nonnegative(),hasReservationCta:te(),hasBookingCta:te(),hasDirectMerchantCta:te()}),lodging:S({lodgingLocationCount:y().int().nonnegative(),populatedLodgingCount:y().int().nonnegative(),emptyLodgingCount:y().int().nonnegative()}),profileCompleteness:S({locationCount:y().int().nonnegative(),withSecondaryCategories:y().int().nonnegative(),secondaryCategoryTotal:y().int().nonnegative(),withDescription:y().int().nonnegative(),withServiceArea:y().int().nonnegative(),withHours:y().int().nonnegative(),withPrimaryPhone:y().int().nonnegative(),permanentlyClosed:y().int().nonnegative(),temporarilyClosed:y().int().nonnegative()})});const VD={BUSINESS_DIRECTION_REQUESTS:"Direction requests",WEBSITE_CLICKS:"Website clicks",CALL_CLICKS:"Call clicks",BUSINESS_BOOKINGS:"Bookings",BUSINESS_CONVERSATIONS:"Conversations",BUSINESS_FOOD_ORDERS:"Food orders",BUSINESS_FOOD_MENU_CLICKS:"Food menu clicks",BUSINESS_IMPRESSIONS_DESKTOP_SEARCH:"Search impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_SEARCH:"Search impressions (mobile)",BUSINESS_IMPRESSIONS_DESKTOP_MAPS:"Maps impressions (desktop)",BUSINESS_IMPRESSIONS_MOBILE_MAPS:"Maps impressions (mobile)"};function GD(e){const n=e.replace(/^BUSINESS_/,"").split("_").filter(Boolean).map(r=>r.toLowerCase());if(n.length===0)return e;const i=n.join(" ");return i.charAt(0).toUpperCase()+i.slice(1)}function wU(e){return VD[e]??GD(e)}const HD=["BUSINESS_DIRECTION_REQUESTS","WEBSITE_CLICKS","CALL_CLICKS"],KD=["BUSINESS_IMPRESSIONS_DESKTOP_SEARCH","BUSINESS_IMPRESSIONS_MOBILE_SEARCH","BUSINESS_IMPRESSIONS_DESKTOP_MAPS","BUSINESS_IMPRESSIONS_MOBILE_MAPS"];function jU(e){return HD.includes(e)?"conversion":KD.includes(e)?"reach":"other"}S({id:u(),domain:u(),siteUrl:u().nullable().optional(),createdAt:u(),updatedAt:u()});const Rf=S({id:u(),url:u(),httpCode:y().nullable().optional(),inIndex:te().nullable().optional(),lastCrawledDate:u().nullable().optional(),inIndexDate:u().nullable().optional(),inspectedAt:u(),documentSize:y().nullable().optional(),anchorCount:y().nullable().optional(),discoveryDate:u().nullable().optional()});S({summary:S({total:y(),indexed:y(),notIndexed:y(),unknown:y().optional(),percentage:y()}),lastInspectedAt:u().nullable(),indexed:k(Rf).default([]),notIndexed:k(Rf).default([]),unknown:k(Rf).default([]).optional()});S({query:u(),impressions:y(),clicks:y(),ctr:y(),averagePosition:y()});S({date:u(),indexed:y(),notIndexed:y(),unknown:y()});const QD=S({url:u(),status:H(["success","error"]),submittedAt:u(),error:u().optional()});S({summary:S({total:y().int().nonnegative(),succeeded:y().int().nonnegative(),failed:y().int().nonnegative()}),results:k(QD).default([])});const yS=S({url:u(),verified:te()});S({sites:k(yS).default([])});S({connected:te(),domain:u(),siteUrl:u().nullable(),createdAt:u().nullable(),updatedAt:u().nullable()});S({connected:te(),domain:u(),siteUrl:u().nullable(),availableSites:k(yS).default([])});S({siteUrl:u()});const ZD=S({name:u(),alive:te(),lastUsed:u().nullable()});S({connected:te(),endpoint:u(),version:u().optional(),browserVersion:u().optional(),targets:k(ZD).default([])});const lr=H(["live","staging"]);S({projectName:u(),url:u(),stagingUrl:u().optional(),username:u(),defaultEnv:lr,createdAt:u(),updatedAt:u()});const dv=S({url:u(),reachable:te(),pageCount:y().nullable().optional(),version:u().nullable().optional(),error:u().nullable().optional(),plugins:k(u()).optional(),authenticatedUser:S({id:y(),slug:u()}).nullable().optional()});S({connected:te(),projectName:u(),defaultEnv:lr,live:dv.nullable(),staging:dv.nullable(),adminUrl:u().nullable().optional()});const YD=S({id:y(),slug:u(),title:u(),status:u(),modifiedAt:u().nullable().optional(),link:u().nullable().optional()}),bS=S({title:u().nullable(),description:u().nullable(),noindex:te().nullable(),writable:te().default(!1),writeTargets:k(u()).default([])}),FD=S({type:u(),json:He(u(),Pn())}),XD=YD.extend({env:lr,content:u(),seo:bS,schemaBlocks:k(FD).default([])}),fv=XD.extend({contentHash:u(),contentSnippet:u()}),vS=S({manualRequired:De(!0),targetUrl:u(),adminUrl:u().nullable().optional(),content:u(),nextSteps:k(u()).default([])}),JD=S({slug:u(),severity:H(["high","medium","low"]),code:H(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:u()});S({slug:u(),title:u(),status:u(),wordCount:y(),seo:bS,schemaPresent:te(),issues:k(JD).default([])});const WD=S({slug:u(),status:H(["applied","skipped","manual"]),error:u().optional(),manualAssist:vS.optional()});S({env:lr,strategy:H(["plugin","manual"]),results:k(WD)});const ez=S({slug:u(),status:H(["deployed","stripped","skipped","failed"]),schemasInjected:k(u()).optional(),manualAssist:vS.optional(),error:u().optional()});S({env:lr,results:k(ez)});const tz=S({slug:u(),title:u(),canonrySchemas:k(u()),thirdPartySchemas:k(u()),hasCanonrySchema:te()});S({env:lr,pages:k(tz)});const nz=S({name:u(),status:H(["completed","skipped","failed"]),summary:u().optional(),error:u().optional()});S({projectName:u(),steps:k(nz)});S({slug:u(),live:fv,staging:fv,hasDifferences:te(),differences:S({title:te(),slug:te(),content:te(),seoTitle:te(),seoDescription:te(),noindex:te(),schema:te()})});const az=S({name:u(),displayName:u().optional(),keyUrl:u().optional(),modelHint:u().optional(),model:u().optional(),defaultModel:u().optional(),configured:te(),quota:aD.optional(),vertexConfigured:te().optional()}),iz=S({name:u(),displayName:u(),mode:H(["api","browser"]),modelConfigurable:te(),defaultModel:u(),knownModels:k(S({id:u(),displayName:u(),tier:H(["flagship","standard","fast","economy"])})).default([]),modelValidationPattern:S({source:u(),flags:u()}),modelValidationHint:u()}),pv=S({configured:te()});S({providers:k(az).default([]),providerCatalog:k(iz).default([]),google:pv,bing:pv});const Ii=H(["queued","running","completed","partial","failed","cancelled"]),Yt=Ii.enum,SS=H(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe","gbp-sync","ads-sync"]),Ce=SS.enum,Ip=H(["manual","scheduled","config-apply","backfill","probe"]),Qs=Ip.enum,oi=H(["cited","not-cited"]),kc=oi.enum,Ac=H(["visible","not-visible"]);Ac.enum;const jo=H(["mentioned","not-mentioned"]);jo.enum;const xS=H(["new","cited","lost","emerging","not-cited"]);xS.enum;const sz=H(["new","mentioned","lost","emerging","not-mentioned"]);sz.enum;const rz=H([Qs.manual,Qs.probe]);S({kind:De(Ce["answer-visibility"]).optional(),trigger:rz.optional(),providers:k(Aa).optional(),queries:k(u().min(1)).min(1).optional(),location:u().min(1).optional(),allLocations:te().optional(),noLocation:te().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const oz=S({message:u(),raw:Pn().optional()}),lz=S({message:u().optional(),providers:He(u(),oz).optional()}),cz=S({id:u(),projectId:u(),kind:SS,status:Ii,trigger:Ip.default("manual"),location:u().nullable().optional(),queries:k(u()).nullable().optional(),startedAt:u().nullable().optional(),finishedAt:u().nullable().optional(),error:lz.nullable().optional(),createdAt:u()});function Pp(e){if(e.providers){const n=Object.entries(e.providers);if(n.length===1){const[i,r]=n[0];return`${i}: ${r.message}`}if(n.length>1)return n.map(([i,r])=>`${i}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const Vp=S({uri:u(),title:u()}),wS=S({id:u(),runId:u(),queryId:u(),query:u().optional(),provider:Aa,citationState:oi,answerMentioned:te().optional(),visibilityState:Ac.optional(),mentionState:jo.optional(),transition:xS.optional(),answerText:u().nullable().optional(),citedDomains:k(u()).default([]),competitorOverlap:k(u()).default([]),recommendedCompetitors:k(u()).default([]),matchedTerms:k(u()).default([]),groundingSources:k(Vp).default([]),searchQueries:k(u()).default([]),model:u().nullable().optional(),servedModel:u().nullable().optional(),location:u().nullable().optional(),createdAt:u()});S({snapshots:k(wS),total:y().int().nonnegative()});const uz=S({queryId:u().nullable(),query:u().nullable(),run1State:oi.nullable(),run2State:oi.nullable(),run1AnswerMentioned:te().nullable(),run2AnswerMentioned:te().nullable(),run1VisibilityState:Ac.nullable(),run2VisibilityState:Ac.nullable(),run1MentionState:jo.nullable().optional(),run2MentionState:jo.nullable().optional(),changed:te(),visibilityChanged:te()});S({run1:u(),run2:u(),diff:k(uz)});const dz=cz.extend({snapshots:k(wS).optional()}),fz=S({totalRuns:y().int().nonnegative(),run:dz.nullable()});S({id:u(),projectId:u().nullable().optional(),actor:u(),action:u(),entityType:u(),entityId:u().nullable().optional(),diff:Pn().optional(),userAgent:u().nullable().optional(),actorSession:u().nullable().optional(),createdAt:u()});const pz=H(["yes","no","unknown","not-mentioned"]),mv=k(u().min(1));S({companyName:u().min(1),domain:u().min(1),queries:mv.optional(),phrases:mv.optional(),competitors:k(u().min(1)).optional().default([])}).superRefine((e,n)=>{e.queries!==void 0&&e.phrases!==void 0&&n.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const mz=S({name:u(),count:y().int().nonnegative()}),hz=S({id:u(),name:u(),weight:y(),score:y(),findings:k(S({type:u(),message:u()})).default([]),recommendations:k(u()).default([])}),gz=S({url:u(),finalUrl:u(),auditedAt:u(),overallScore:y(),summary:u(),factors:k(hz).default([])}),yz=S({industry:u(),summary:u(),services:k(u()).default([]),categoryTerms:k(u()).default([])}),bz=S({provider:u(),displayName:u(),model:u().nullable().optional(),mentioned:te(),cited:te(),describedAccurately:pz,accuracyNotes:u().nullable().optional(),incorrectClaims:k(u()).default([]),recommendedCompetitors:k(u()).default([]),citedDomains:k(u()).default([]),groundingSources:k(Vp).default([]),searchQueries:k(u()).default([]),answerText:u(),error:u().nullable().optional()}),vz=S({query:u(),providerResults:k(bz).default([])}),Sz=S({totalQueries:y().int().nonnegative(),totalProviders:y().int().nonnegative(),totalComparisons:y().int().nonnegative(),mentionCount:y().int().nonnegative(),citationCount:y().int().nonnegative(),topCompetitors:k(mz).default([]),visibilityGap:u(),whatThisMeans:k(u()).default([]),recommendedActions:k(u()).default([])});S({companyName:u(),domain:u(),homepageUrl:u(),generatedAt:u(),queries:k(u()).default([]),competitors:k(u()).default([]),profile:yz,audit:gz,queryResults:k(vz).default([]),summary:Sz});const jS=H(["pass","partial","fail"]);jS.enum;const NS=H(["up","down","flat"]);NS.enum;const xz=S({id:u(),name:u(),weight:y(),avgScore:y(),status:jS,pagesPassing:y().int().nonnegative(),pagesPartial:y().int().nonnegative(),pagesFailing:y().int().nonnegative()}),wz=S({factorId:u(),factorName:u(),avgScore:y(),affectedPages:y().int().nonnegative(),totalPages:y().int().nonnegative(),affectedPct:y().int().nonnegative(),topRecommendations:k(u()).default([])});S({project:u(),hasData:te(),runId:u().nullable(),runStatus:Ii.nullable(),sitemapUrl:u().nullable(),auditedAt:u().nullable(),aggregateScore:y(),pagesDiscovered:y().int().nonnegative(),pagesAudited:y().int().nonnegative(),pagesSkipped:y().int().nonnegative(),pagesErrored:y().int().nonnegative(),deltaScore:y().nullable(),trend:NS.nullable(),previousScore:y().nullable(),previousAuditedAt:u().nullable(),factors:k(xz).default([]),crossCuttingIssues:k(wz).default([]),prioritizedFixes:k(u()).default([])});const jz=S({id:u(),name:u(),weight:y(),score:y()}),Nz=S({url:u(),overallScore:y(),status:H(["success","error"]),error:u().nullable().optional(),factors:k(jz).default([])});S({project:u(),runId:u().nullable(),auditedAt:u().nullable(),total:y().int().nonnegative(),pages:k(Nz).default([])});const kz=S({runId:u(),auditedAt:u(),aggregateScore:y(),pagesAudited:y().int().nonnegative()});S({project:u(),points:k(kz).default([])});S({sitemapUrl:u().url().optional(),limit:y().int().positive().max(2e3).optional()});S({runId:u(),status:Ii});const Gp=H(["answer-visibility","traffic-sync","gbp-sync","data-refresh","backlinks-sync","site-audit","ads-sync"]);Gp.enum;S({id:u(),projectId:u(),kind:Gp,cronExpr:u(),preset:u().nullable().optional(),timezone:u().default("UTC"),enabled:te().default(!0),providers:k(Aa).default([]),sourceId:u().nullable().optional(),lastRunAt:u().nullable().optional(),nextRunAt:u().nullable().optional(),createdAt:u(),updatedAt:u()});S({kind:Gp.optional(),preset:u().optional(),cron:u().optional(),timezone:u().optional().default("UTC"),enabled:te().optional().default(!0),providers:k(Aa).optional().default([]),sourceId:u().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const Hp=H(["competitor","directory","social","forum","news","reference","blog","ecommerce","video","academic","other"]);Hp.enum;const Kp=H(["cited","aspirational","wasted-surface"]),hv=Kp.enum;hv.cited,hv.aspirational;const Uc=H(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),Az=Uc.enum;Az["direct-competitor"];const $c=H(["queued","seeding","probing","completed","failed"]);$c.enum;const kS=S({domain:u().min(1),hits:y().int().positive(),competitorType:Uc.default("unknown")}),Cz=S({id:u(),sessionId:u(),projectId:u(),query:u(),bucket:Kp.nullable().default(null),citationState:oi,citedDomains:k(u()).default([]),answerMentioned:te().nullable().default(null),createdAt:u()}),_z=S({id:u(),projectId:u(),status:$c,icpDescription:u().nullable().optional(),seedProvider:u().nullable().optional(),seedCountRaw:y().int().nullable().optional(),seedCount:y().int().nullable().optional(),seedFromAnswerCount:y().int().nullable().optional(),seedFromGroundingCount:y().int().nullable().optional(),seedBrandFilteredCount:y().int().nullable().optional(),buyerDescription:u().nullable().optional(),locations:k(qc).nullable().optional(),seedRawCandidates:k(u()).nullable().optional(),dedupClusterMinSims:k(y()).nullable().optional(),dedupBandPairFraction:y().nullable().optional(),dedupPairsTotal:y().int().nullable().optional(),seedProviders:k(u()).nullable().optional(),seedProviderCounts:He(u(),y().int()).nullable().optional(),canonicalCount:y().int().nullable().optional(),dedupThreshold:y().nullable().optional(),probeCount:y().int().nullable().optional(),citedCount:y().int().nullable().default(null),aspirationalCount:y().int().nullable().default(null),wastedCount:y().int().nullable().default(null),competitorMap:k(kS).default([]),warning:u().nullable().optional(),error:u().nullable().optional(),startedAt:u().nullable().optional(),finishedAt:u().nullable().optional(),createdAt:u()});_z.extend({probes:k(Cz).default([])});const Tz=500,Ez=8,Oz=["gemini","openai"],Dz=H(Oz);S({icpDescription:u().min(1).optional(),buyerDescription:u().min(1).optional(),seedProviders:k(Dz).min(1).transform(e=>[...new Set(e)].sort()).optional(),dedupThreshold:y().min(0).max(1).optional(),maxProbes:y().int().positive().max(Tz).optional(),probeConcurrency:y().int().min(1).max(Ez).optional(),locations:k(u().min(1)).optional()});S({buckets:k(Kp).min(1).optional(),includeCompetitors:te().optional(),competitorTypes:k(Uc).min(1).optional()});S({sessionId:u(),projectId:u(),status:$c,queriesByBucket:S({cited:k(u()),aspirational:k(u()),"wasted-surface":k(u())}),suggestedCompetitors:k(kS)});S({sessionId:u(),projectId:u(),promoted:S({queries:k(u()),competitors:k(u())}),skipped:S({queries:k(u()),competitors:k(u())})});Dn([De("cli"),u().regex(/^discovery:.+$/)]);const zz=S({query:u().min(1),probeHits:y().int().positive()}),Rz=S({rawCandidates:y().int().nonnegative(),admitted:y().int().nonnegative(),rejected:S({belowFloor:y().int().nonnegative(),length:y().int().nonnegative(),navigational:y().int().nonnegative(),duplicate:y().int().nonnegative(),offAnchor:y().int().nonnegative(),semanticDuplicate:y().int().nonnegative()})});S({sessionId:u(),projectId:u(),provider:u(),status:$c,minProbeHits:y().int().positive(),anchorApplied:te(),semanticNoveltyApplied:te(),candidates:k(zz),stats:Rz});const Qp=H(["own","direct-competitor","ota-aggregator","editorial-media","other"]);Qp.enum;const AS=H(["7d","30d","90d","all"]),gv=H(["improving","declining","stable"]),Mz=H(["mentioned","cited"]);Mz.enum;const ip=S({citationRate:y(),cited:y().int(),total:y().int(),mentionRate:y(),mentionedCount:y().int()}),Zp=u().trim().min(1),Bz=k(Zp).min(1).superRefine((e,n)=>{for(let i=1;i<e.length;i+=1)e[i-1]>=e[i]&&n.addIssue({code:"custom",message:"mixed model IDs must be sorted and unique",path:[i]})}),er=_o("status",[S({status:De("known"),model:Zp}),S({status:De("unknown")}),S({status:De("mixed"),models:Bz,includesUnknown:te()})]),Lz=S({observedAt:u(),bucketStartDate:u(),from:er,to:er,fromPreWindowAnchor:te().optional(),anchorObservedAt:u().optional()}),CS=S({latestObservation:S({observedAt:u(),state:er}),events:k(Lz),eventTotal:y().int().nonnegative().optional(),anchorUnavailable:te().optional()}),qz=He(u(),CS),Uz=CS.extend({latestServedModelIds:k(Zp).default([])}),$z=He(u(),Uz),Iz=S({observedAt:u(),configured:er,served:er}),Pz=S({rate:y().nullable(),projectMentionSnapshots:y().int().nonnegative(),competitorMentionSnapshots:y().int().nonnegative()}),Vz=S({startDate:u(),endDate:u(),dataStartDate:u(),dataEndDate:u(),sweepCount:y().int().nonnegative(),citationRate:y(),cited:y().int(),total:y().int(),queryCount:y().int(),mentionRate:y(),mentionedCount:y().int(),mentionShare:Pz,byProvider:He(u(),ip),modelEvidenceByProvider:He(u(),er).default({})}),Gz=S({date:u(),delta:y().int(),label:u()});S({window:AS,buckets:k(Vz),overall:ip,byProvider:He(u(),ip),trend:gv,mentionTrend:gv,queryChanges:k(Gz),modelAttribution:qz.default({}),servedModelAttribution:$z.default({}),modelServiceMismatch:He(u(),Iz).default({}),modelPointerChanges:He(u(),SD).default({})});const yv=S({category:Hp,label:u(),count:y().int(),percentage:y(),topDomains:k(S({domain:u(),count:y().int()}))}),Hz=S({domain:u(),count:y().int(),percentage:y(),category:Hp,label:u(),surfaceClass:Qp}),Kz=S({surfaceClass:Qp,label:u(),count:y().int(),percentage:y(),domainCount:y().int()}),bv=S({totalCitedSlots:y().int(),domainTotal:y().int(),entries:k(Hz),truncatedDomainCount:y().int(),truncatedCitedSlots:y().int(),bySurfaceClass:k(Kz)});S({overall:k(yv),byQuery:He(u(),k(yv)),ranked:bv,byProvider:He(u(),bv),runId:u(),window:AS,limit:y().int().nullable()});const Yp=S({total:y().int(),checked:y().int(),mentioned:y().int(),cited:y().int(),mentionRate:y().nullable(),citedRate:y().nullable()}),_S=Yp.extend({provider:u(),firstObserved:u(),lastObserved:u()}),Qz=Yp.extend({queryId:u().nullable(),query:u(),firstObserved:u(),lastObserved:u(),providers:k(_S).optional()}),Zz=S({since:u().nullable(),until:u().nullable(),lastRuns:y().int().nullable(),runCount:y().int()}),Yz=H(["provider"]),sp=S({domain:u(),mentions:y().int()}),Fz=S({percent:y().nullable(),projectMentions:y().int(),competitorMentions:y().int(),snapshotsWithAnswerText:y().int(),perCompetitor:k(sp)});S({project:u(),groupBy:Yz.optional(),window:Zz,totals:Yp,byProvider:k(_S).optional(),queries:k(Qz),shareOfVoice:Fz.optional()});const Xz=H(["within-noise","moved","insufficient-data","model-discontinuous","model-unknown"]),Jz=H(["up","down","flat"]),vv=S({point:y().nullable(),ciLow:y().nullable(),ciHigh:y().nullable(),numerator:y().int(),denominator:y().int()}),Wz=H(["mention-share-of-voice","cited-share-of-voice","mention-rate","cited-rate"]),eR=S({key:Wz,label:u(),driftRobust:te(),from:vv,to:vv,rateRatio:y().nullable(),direction:Dn([Jz,ze()]),verdict:Xz}),Sv=S({month:u(),since:u(),until:u(),runCount:y().int(),lowRunCount:te()}),tR=S({queryCount:y().int(),excludedFromOnly:y().int(),excludedToOnly:y().int(),providers:k(u()),excludedProviders:k(u())}),nR=S({provider:u(),fromModels:k(u()),toModels:k(u())}),aR=H(["included","model-discontinuous","model-unknown"]),iR=S({provider:u(),status:aR,fromModels:k(u()),toModels:k(u())}),sR=H(["comparable","model-discontinuous","model-unknown","insufficient-data"]),rR=S({status:sR,comparedProviders:k(u()),providers:k(iR)}),oR=S({provider:u(),from:S({checked:y().int(),mentioned:y().int(),cited:y().int()}),to:S({checked:y().int(),mentioned:y().int(),cited:y().int()})}),lR=S({from:S({count:y().int(),of:y().int()}),to:S({count:y().int(),of:y().int()})});S({project:u(),from:Sv,to:Sv,basket:tR,metrics:k(eR),queriesMentioned:lR,byProvider:k(oR),modelChanges:k(nR),continuity:rR,competitors:S({from:k(sp),to:k(sp)})});H(["json","csv"]);const cR=S({runId:u(),runKind:De("answer-visibility"),runStatus:Ii,runTrigger:Ip,runCreatedAt:u(),runStartedAt:u().nullable(),runFinishedAt:u().nullable(),snapshotId:u(),snapshotCreatedAt:u(),queryId:u().nullable(),query:u().nullable(),provider:u(),model:u().nullable(),location:u().nullable(),citationState:oi,cited:te(),answerMentioned:te().nullable(),mentionState:Dn([jo,ze()]),citedDomains:k(u()),competitorOverlap:k(u()),recommendedCompetitors:k(u()),answerText:u().nullable(),groundingSources:k(Vp),searchQueries:k(u())}),uR=S({since:u().nullable(),until:u().nullable(),includeProbes:te()});S({schemaVersion:De("canonry.results-export/v1"),generatedAt:u(),project:S({id:u(),name:u(),displayName:u(),canonicalDomain:u(),country:u(),language:u()}),filters:uR,recordCount:y().int().nonnegative(),records:k(cR)});const Ic=H(["organic","paid"]);Ic.enum;S({id:u(),projectId:u(),propertyId:u(),clientEmail:u(),connected:te(),createdAt:u(),updatedAt:u()});S({date:u(),landingPage:u(),sessions:y(),organicSessions:y(),users:y()});const Fp=H(["session","first_user","manual_utm"]),dR=S({source:u(),medium:u(),trafficClass:Ic,sessions:y(),users:y(),sourceDimension:Fp}),fR=S({source:u(),medium:u(),trafficClass:Ic,sourceDimension:Fp,landingPage:u(),sessions:y(),users:y()}),pR=S({source:u(),medium:u(),sessions:y(),users:y(),channelGroup:u()}),uo=S({sessions:y(),sharePct:y(),sharePctDisplay:u()}),mR=S({organic:uo,social:uo,direct:uo,ai:uo,other:uo});S({totalSessions:y(),totalOrganicSessions:y(),totalDirectSessions:y(),totalUsers:y(),topPages:k(S({landingPage:u(),sessions:y(),organicSessions:y(),directSessions:y(),users:y()})),aiReferrals:k(dR),aiReferralLandingPages:k(fR),aiSessionsDeduped:y(),aiUsersDeduped:y(),paidAiSessionsDeduped:y(),paidAiUsersDeduped:y(),organicAiSessionsDeduped:y(),organicAiUsersDeduped:y(),aiSessionsBySession:y(),aiUsersBySession:y(),paidAiSessionsBySession:y(),paidAiUsersBySession:y(),organicAiSessionsBySession:y(),organicAiUsersBySession:y(),socialReferrals:k(pR),socialSessions:y(),socialUsers:y(),channelBreakdown:mR,organicSharePct:y(),aiSharePct:y(),aiSharePctBySession:y(),paidAiSharePct:y(),paidAiSharePctBySession:y(),organicAiSharePct:y(),organicAiSharePctBySession:y(),directSharePct:y(),socialSharePct:y(),organicSharePctDisplay:u(),aiSharePctDisplay:u(),aiSharePctBySessionDisplay:u(),paidAiSharePctDisplay:u(),paidAiSharePctBySessionDisplay:u(),organicAiSharePctDisplay:u(),organicAiSharePctBySessionDisplay:u(),directSharePctDisplay:u(),socialSharePctDisplay:u(),otherSessions:y(),otherSharePct:y(),otherSharePctDisplay:u(),lastSyncedAt:u().nullable()});S({connected:te(),propertyId:u().nullable(),clientEmail:u().nullable(),authMethod:H(["service-account","oauth"]).nullable(),lastSyncedAt:u().nullable(),createdAt:u().nullable().optional(),updatedAt:u().nullable().optional()});S({synced:te(),rowCount:y().int().nonnegative(),aiReferralCount:y().int().nonnegative(),socialReferralCount:y().int().nonnegative(),days:y().int().nonnegative(),syncedAt:u(),syncedComponents:k(u()).optional()});S({date:u(),source:u(),medium:u(),trafficClass:Ic,landingPage:u(),sessions:y(),users:y(),sourceDimension:Fp});S({date:u(),source:u(),medium:u(),sessions:y(),users:y(),channelGroup:u()});S({date:u(),sessions:y(),organicSessions:y(),users:y(),usersSource:H(["deduplicated","landing-page-sum"])});function Cc(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}S({id:u(),projectId:u(),runId:u().nullable(),overallCitedRate:y(),overallMentionRate:y(),totalPairs:y().int().nonnegative(),citedPairs:y().int().nonnegative(),mentionedPairs:y().int().nonnegative(),providerBreakdown:He(u(),S({citedRate:y(),mentionRate:y(),cited:y().int().nonnegative(),mentioned:y().int().nonnegative(),total:y().int().nonnegative()})),createdAt:u(),status:H(["ready","no-data"]),reason:De("no-runs-yet").optional()});const TS=H(["claude","openai","gemini","zai","deepinfra"]),hR=S({id:TS,label:u(),defaultModel:u(),configured:te(),keySource:H(["config","env"]).nullable()});S({providers:k(hR).default([]),defaultProvider:TS.nullable()});const gR=H(["aero","user","compaction"]);gR.enum;const ES=128;S({key:u().min(1).max(ES),value:u().min(1)});S({key:u().min(1).max(ES)});const cr=H(["commoncrawl","bing-webmaster"]);cr.enum;const Xp=H(["queued","downloading","querying","ready","failed"]);Xp.enum;S({id:u(),release:u(),status:Xp,phaseDetail:u().nullable().optional(),vertexPath:u().nullable().optional(),edgesPath:u().nullable().optional(),vertexSha256:u().nullable().optional(),edgesSha256:u().nullable().optional(),vertexBytes:y().int().nullable().optional(),edgesBytes:y().int().nullable().optional(),projectsProcessed:y().int().nullable().optional(),domainsDiscovered:y().int().nullable().optional(),downloadStartedAt:u().nullable().optional(),downloadFinishedAt:u().nullable().optional(),queryStartedAt:u().nullable().optional(),queryFinishedAt:u().nullable().optional(),error:u().nullable().optional(),createdAt:u(),updatedAt:u()});const yR=S({linkingDomain:u(),numHosts:y().int(),source:cr}),bR=S({projectId:u(),release:u(),targetDomain:u(),totalLinkingDomains:y().int(),totalHosts:y().int(),top10HostsShare:u(),queriedAt:u(),source:cr,excludedLinkingDomains:y().int().optional(),excludedHosts:y().int().optional()});S({source:cr,summary:bR.nullable(),total:y().int(),rows:k(yR)});S({release:u(),totalLinkingDomains:y().int(),totalHosts:y().int(),top10HostsShare:u(),queriedAt:u(),source:cr});const vR=S({source:cr,connected:te(),hasData:te(),latestRelease:u().nullable(),totalLinkingDomains:y().int(),lastSyncedAt:u().nullable()});S({projectId:u(),targetDomain:u(),sources:k(vR),anyConnected:te(),anyData:te()});S({duckdbInstalled:te(),duckdbVersion:u().nullable().optional(),duckdbSpec:u(),pluginDir:u()});S({installed:te(),version:u(),path:u(),alreadyPresent:te()});S({release:u(),vertexUrl:u(),edgesUrl:u(),vertexBytes:y().int().nullable(),edgesBytes:y().int().nullable(),lastModified:u().nullable()});S({release:u(),syncStatus:Xp.nullable(),bytes:y().int(),lastUsedAt:u().nullable()});const Jp=H(["positive","caution","negative","neutral"]),ni=S({label:u(),value:u(),delta:u(),tone:Jp,description:u(),tooltip:u().optional(),trend:k(y()),progress:y().optional(),providerCoverage:u().optional()}),SR=ni.extend({breakdown:S({projectMentionSnapshots:y().int().nonnegative(),competitorMentionSnapshots:y().int().nonnegative(),perCompetitor:k(S({domain:u(),mentionSnapshots:y().int().nonnegative(),shareOfCompetitiveTotal:y()})),snapshotsWithAnswerText:y().int().nonnegative(),snapshotsTotal:y().int().nonnegative()})}),Mf=S({gained:y().int().nonnegative(),lost:y().int().nonnegative(),tone:Jp,hasPreviousRun:te(),gainedQueries:k(u()).optional(),lostQueries:k(u()).optional()}),xR=S({hasPreviousRun:te(),comparable:te(),querySetChanged:te(),previousRunAt:u().nullable(),currentQueryCount:y().int().nonnegative(),previousQueryCount:y().int().nonnegative(),comparableQueryCount:y().int().nonnegative(),addedQueryCount:y().int().nonnegative(),removedQueryCount:y().int().nonnegative(),addedQueries:k(u()),removedQueries:k(u())}),wR=S({id:u(),projectId:u(),runId:u().nullable(),type:H(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:H(["critical","high","medium","low"]),title:u(),query:u(),provider:u(),recommendation:S({action:u(),target:u().optional(),reason:u()}).optional(),cause:S({cause:u(),competitorDomain:u().optional(),details:u().optional()}).optional(),dismissed:te(),createdAt:u()}),jR=S({id:u(),projectId:u(),runId:u().nullable(),overallCitedRate:y(),overallMentionRate:y(),totalPairs:y().int().nonnegative(),citedPairs:y().int().nonnegative(),mentionedPairs:y().int().nonnegative(),providerBreakdown:He(u(),S({citedRate:y(),mentionRate:y(),cited:y().int().nonnegative(),mentioned:y().int().nonnegative(),total:y().int().nonnegative()})),createdAt:u(),status:H(["ready","no-data"]),reason:De("no-runs-yet").optional()});S({project:rD,latestRun:fz,health:jR.nullable(),topInsights:k(wR),queryCounts:S({totalQueries:y().int().nonnegative(),citedQueries:y().int().nonnegative(),notCitedQueries:y().int().nonnegative(),citedRate:y(),mentionedQueries:y().int().nonnegative(),notMentionedQueries:y().int().nonnegative(),mentionRate:y()}),providers:k(S({provider:u(),citedRate:y(),cited:y().int().nonnegative(),total:y().int().nonnegative()})),transitions:S({since:u().nullable(),gained:y().int().nonnegative(),lost:y().int().nonnegative(),emerging:y().int().nonnegative()}),scores:S({mention:ni,visibility:ni,mentionShare:SR,gapQueries:ni,mentionGaps:ni,indexCoverage:ni,competitorPressure:ni,runStatus:ni}),movementSummary:Mf,citationMovement:Mf,mentionMovement:Mf,movementComparison:xR,competitors:k(S({id:u(),domain:u(),citationCount:y().int().nonnegative(),totalQueries:y().int().nonnegative(),pressureLabel:H(["None","Low","Moderate","High"]),citedQueries:k(u())})),providerScores:k(S({provider:u(),model:u().nullable(),score:y(),cited:y().int().nonnegative(),total:y().int().nonnegative(),trend:k(y()).optional()})),attentionItems:k(S({id:u(),tone:Jp,title:u(),detail:u(),actionLabel:u(),href:u()})),runHistory:k(S({runId:u(),createdAt:u(),citedCount:y().int().nonnegative(),totalCount:y().int().nonnegative(),citationRate:y(),mentionedCount:y().int().nonnegative(),mentionRate:y(),status:u()})),suggestedQueries:S({rows:k(S({query:u(),impressions:y(),clicks:y(),avgPosition:y(),reason:u()})),totalCandidates:y().int().nonnegative(),skippedAlreadyTracked:y().int().nonnegative()}),dateRangeLabel:u(),contextLabel:u()});H(["snapshot","insight"]);const NR=S({kind:De("snapshot"),id:u(),runId:u(),query:u(),provider:u(),model:u().nullable(),citationState:oi,matchedField:H(["answerText","citedDomains","searchQueries","query"]),snippet:u(),createdAt:u()}),kR=S({kind:De("insight"),id:u(),runId:u().nullable(),type:H(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost","gbp-lodging-gap","gbp-listing-discrepancy","gbp-cta-gap","gbp-description-missing","gbp-metric-drop","gbp-keyword-drop"]),severity:H(["critical","high","medium","low"]),title:u(),query:u(),provider:u(),matchedField:H(["title","query","recommendation","cause"]),snippet:u(),dismissed:te(),createdAt:u()}),AR=_o("kind",[NR,kR]);S({query:u(),totalHits:y().int().nonnegative(),truncated:te(),hits:k(AR)});const OS=H(["create","expand","refresh","add-schema"]);OS.enum;function NU(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const DS=H(["gsc","competitor-evidence","both"]);DS.enum;const zS=H(["high","medium","low"]);zS.enum;const CR=H(["blog-post","comparison","listicle","how-to","guide","glossary"]);CR.enum;const RS=H(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);RS.enum;const Wp=H(["ownable","ceded"]);Wp.enum;const _R=S({url:u(),gscImpressions:y().nonnegative(),gscClicks:y().nonnegative(),gscAvgPosition:y().nonnegative().nullable(),organicSessions:y().nonnegative()}),TR=S({domain:u(),url:u(),title:u(),citationCount:y().int().nonnegative()}),ER=S({demand:y(),competitor:y(),absence:y(),gapSeverity:y()}),OR=S({actionId:u(),state:RS,lastUpdated:u()}),MS=S({targetRef:u(),query:u(),action:OS,ourBestPage:_R.nullable(),winningCompetitor:TR.nullable(),score:y(),scoreBreakdown:ER,drivers:k(u()),demandSource:DS,actionConfidence:zS,existingAction:OR.nullable(),winnabilityClass:Wp,winnability:y().min(0).max(1).nullable()});S({targets:k(MS),contextMetrics:S({totalAiReferralSessions:y().int().nonnegative(),latestRunId:u(),runTimestamp:u()})});const DR=S({targetRef:u(),addressedUrl:u().nullable(),note:u().nullable(),dismissedAt:u()});S({dismissals:k(DR)});S({targetRef:u().min(1),addressedUrl:u().url().optional(),note:u().max(500).optional()});S({targetRef:u(),promptVersion:u(),provider:u(),model:u(),responseText:u(),costMillicents:y().int().nonnegative(),generatedAt:u()});S({provider:u().optional(),model:u().optional(),forceRefresh:te().optional()});const zR=S({targetQuery:u().trim().min(1),winnabilityClass:Wp,angle:u().trim().min(1),whyWinnable:u().trim().min(1),schemaHookup:u().trim().min(1),controllableSurfaceRationale:u().trim().min(1)});S({targetRef:u(),promptVersion:u(),provider:u(),model:u(),brief:zR,costMillicents:y().int().nonnegative(),generatedAt:u()});const RR=S({domain:u(),competitorType:Uc,hits:y().int().nonnegative(),updatedAt:u()});S({classifications:k(RR)});const MR=S({uri:u(),title:u(),domain:u(),isOurDomain:te(),isCompetitor:te(),citationCount:y().int().nonnegative(),providers:k(Aa)}),BS=S({query:u(),groundingSources:k(MR)});S({sources:k(BS),latestRunId:u()});const LS=S({query:u(),competitorDomains:k(u()),competitorCount:y().int().nonnegative(),missRate:y().min(0).max(1),lastSeenInRunId:u()});S({gaps:k(LS),latestRunId:u()});const qS=H(["ok","warn","fail","skipped"]);qS.enum;const em=H(["global","project"]);em.enum;const US=H(["auth","config","providers","integrations","database","schedules","agent"]);US.enum;const BR=S({id:u(),category:US,scope:em,title:u(),status:qS,code:u().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:u(),remediation:u().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:He(u(),Pn()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:y().int().nonnegative().describe("How long the check took to execute.")});S({scope:em,project:u().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:u().describe("ISO-8601 timestamp when this doctor run started."),durationMs:y().int().nonnegative(),summary:S({total:y().int().nonnegative(),ok:y().int().nonnegative(),warn:y().int().nonnegative(),fail:y().int().nonnegative(),skipped:y().int().nonnegative()}),checks:k(BR)});const LR=S({provider:u(),citationState:oi,cited:te(),mentioned:te(),runId:u(),runCreatedAt:u()}),qR=S({queryId:u(),query:u(),providers:k(LR),citedCount:y().int().nonnegative(),mentionedCount:y().int().nonnegative(),totalProviders:y().int().nonnegative()}),UR=S({queryId:u(),query:u(),provider:u(),citingCompetitors:k(u()),runId:u(),runCreatedAt:u()}),$R=S({providersConfigured:y().int().nonnegative(),providersCiting:y().int().nonnegative(),providersMentioning:y().int().nonnegative(),totalQueries:y().int().nonnegative(),queriesCitedAndMentioned:y().int().nonnegative(),queriesCitedOnly:y().int().nonnegative(),queriesMentionedOnly:y().int().nonnegative(),queriesInvisible:y().int().nonnegative(),latestRunId:u().nullable(),latestRunAt:u().nullable()});S({summary:$R,byQuery:k(qR),competitorGaps:k(UR),status:H(["ready","no-data"]),reason:H(["no-runs-yet","no-queries"]).optional()});const kU=[7,14,30,90],AU=30;Dn([De(7),De(14),De(30),De(90)]).describe("Report window in days (7, 14, 30, or 90). Defaults to 30 when omitted.");const IR=H(["prompt","request-param","browser-geo","ignored"]),PR=S({label:u(),city:u(),region:u(),country:u(),otherConfiguredLabels:k(u())}),VR=S({provider:u(),treatment:IR,description:u()}),GR=S({generatedAt:u(),project:S({id:u(),name:u(),displayName:u(),canonicalDomain:u(),country:u(),language:u()}),location:PR.nullable(),providerLocationHandling:k(VR),periodStart:u().nullable(),periodEnd:u().nullable(),periodDays:y().int().positive()}),HR=S({citationRate:y(),citedQueryCount:y(),totalQueryCount:y(),mentionRate:y(),mentionedQueryCount:y(),trend:H(["up","down","flat","unknown"]),queryCount:y(),competitorCount:y(),providerCount:y(),gsc:S({clicks:y(),impressions:y(),ctr:y(),avgPosition:y(),periodStart:u(),periodEnd:u()}).nullable(),ga:S({sessions:y(),users:y(),periodStart:u(),periodEnd:u()}).nullable(),findings:k(S({title:u(),detail:u(),tone:H(["positive","caution","negative","neutral"])}))}),KR=S({citationState:H(["cited","not-cited","pending"]),answerMentioned:te().nullable(),model:u().nullable()}),QR=S({queries:k(u()),providers:k(u()),matrix:k(k(KR.nullable())),providerRates:k(S({provider:u(),citedCount:y(),mentionedCount:y(),totalCount:y(),citationRate:y(),mentionRate:y()}))}),ZR=S({domain:u(),citationCount:y(),totalCount:y(),pressureLabel:H(["High","Moderate","Low","None"]),citedQueries:k(u()),sharePct:y(),theirCitedPages:k(S({url:u(),citedFor:k(u())}))}),YR=S({projectCitationCount:y(),competitors:k(ZR)}),FR=S({domain:u(),mentionCount:y(),totalCount:y(),pressureLabel:H(["High","Moderate","Low","None"]),mentionedQueries:k(u()),sharePct:y()}),XR=S({projectMentionCount:y(),totalAnswerSnapshots:y(),competitors:k(FR)}),JR=S({category:u(),label:u(),count:y(),sharePct:y()}),WR=S({categories:k(JR),topDomains:k(S({domain:u(),count:y(),isCompetitor:te()}))}),e4=S({query:u(),clicks:y(),impressions:y(),ctr:y(),avgPosition:y(),category:H(["brand","lead-gen","industry","other"])}),t4=S({periodStart:u(),periodEnd:u(),totalClicks:y(),totalImpressions:y(),ctr:y(),avgPosition:y(),topQueries:k(e4),categoryBreakdown:k(S({category:H(["brand","lead-gen","industry","other"]),clicks:y(),impressions:y(),sharePct:y()})),trend:k(S({date:u(),clicks:y(),impressions:y()})),trackedButNoGsc:k(u()),gscButNotTracked:k(u())}),n4=S({totalSessions:y(),totalUsers:y(),totalOrganicSessions:y(),periodStart:u(),periodEnd:u(),topLandingPages:k(S({page:u(),sessions:y(),users:y(),organicSessions:y()})),channelBreakdown:k(S({channel:u(),sessions:y(),sharePct:y()}))}),a4=S({totalSessions:y(),organicSessions:y(),paidSessions:y(),channels:k(S({channelGroup:u(),sessions:y(),sharePct:y()})),topCampaigns:k(S({source:u(),medium:u(),sessions:y()}))}),i4=S({totalSessions:y(),paidSessions:y(),organicSessions:y(),totalUsers:y().optional(),paidUsers:y().optional(),organicUsers:y().optional(),bySource:k(S({source:u(),sessions:y(),users:y().optional(),paidSessions:y(),organicSessions:y(),sharePct:y()})),trend:k(S({date:u(),sessions:y()})),topLandingPages:k(S({page:u(),sessions:y(),users:y().optional()}))}),s4=S({windowStart:u(),windowEnd:u(),hasData:te(),verifiedCrawlerHits:S({current:y(),prior:y(),deltaPct:y().nullable()}),unverifiedCrawlerHits:S({current:y(),prior:y(),deltaPct:y().nullable()}),aiUserFetchHits:S({current:y(),prior:y(),deltaPct:y().nullable()}),referralArrivals:S({current:y(),prior:y(),deltaPct:y().nullable()}),referralArrivalsByClass:S({paid:S({current:y(),prior:y(),deltaPct:y().nullable()}),organic:S({current:y(),prior:y(),deltaPct:y().nullable()}),unclassified:S({current:y(),prior:y(),deltaPct:y().nullable()})}),referralArrivalsClassSummary:u(),byOperator:k(S({operator:u(),verifiedHits:y(),unverifiedHits:y(),userFetchHits:y(),referralArrivals:y(),deltaPct:y().nullable()})),topCrawledPaths:k(S({path:u(),verifiedHits:y(),distinctOperators:y()})),referralProducts:k(S({product:u(),arrivals:y(),distinctLandingPaths:y()})),dailyTrend:k(S({date:u(),verifiedCrawlerHits:y(),userFetchHits:y(),referralArrivals:y()})),topReferralLandingPaths:k(S({path:u(),arrivals:y(),distinctProducts:y()}))}),r4=S({provider:H(["google","bing"]).nullable(),total:y(),indexed:y(),notIndexed:y(),deindexed:y(),unknown:y(),indexedPct:y()}),o4=S({runId:u(),date:u(),citationRate:y(),citedQueryCount:y(),totalQueryCount:y(),mentionRate:y(),mentionedQueryCount:y(),providerRates:k(S({provider:u(),citationRate:y(),mentionRate:y()}))}),rp=S({id:u(),type:H(["regression","gain","opportunity"]),severity:H(["critical","high","medium","low"]),title:u(),query:u(),provider:u(),recommendation:u().nullable(),createdAt:u(),instanceCount:y()}),l4=S({horizon:H(["immediate","short-term","medium-term"]),title:u(),rationale:u()}),qs=S({current:y(),prior:y(),deltaAbs:y(),deltaPct:y().nullable(),direction:H(["up","down","flat"]),window:y().optional()}),c4=S({provider:u(),current:y(),prior:y(),deltaAbs:y(),direction:H(["up","down","flat"])}),u4=S({enoughHistory:te(),headline:u(),citationRate:qs.nullable(),mentionRate:qs.nullable(),citedQueryCount:qs.nullable(),mentionedQueryCount:qs.nullable(),gscClicksDelta:qs.nullable(),aiReferralsDelta:qs.nullable(),comparisonWindowDays:y().int().positive(),providerMovements:k(c4),wins:k(rp),regressions:k(rp)});H(["agency","client"]);const d4=H(["agency","client","both"]),f4=H(["immediate","short-term","medium-term"]),p4=H(["high","medium","low"]);H(["positive","caution","negative","neutral"]);const m4=H(["content","competitors","provider","search-demand","indexing","location","monitoring"]),tm=S({audience:d4,priority:y(),horizon:f4,category:m4,title:u(),action:u(),why:k(u()),evidence:k(u()),successMetric:u(),confidence:p4,targetRef:u().optional()}),h4=S({headline:u(),overview:u(),actionItems:k(tm),confidenceNotes:k(u())}),g4=S({title:u(),detail:u(),severity:H(["positive","caution","negative","neutral"]),evidence:k(u())}),y4=S({priorities:k(tm),diagnostics:k(g4)});function CU(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function _U(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function TU(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function EU(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function OU(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}S({meta:GR,executiveSummary:HR,citationScorecard:QR,competitorLandscape:YR,mentionLandscape:XR,aiSourceOrigin:WR,gsc:t4.nullable(),ga:n4.nullable(),socialReferrals:a4.nullable(),aiReferrals:i4.nullable(),serverActivity:s4.nullable(),indexingHealth:r4.nullable(),citationsTrend:k(o4),whatsChanged:u4,insights:k(rp),recommendedNextSteps:k(l4),actionPlan:k(tm),clientSummary:h4,agencyDiagnostics:y4,contentOpportunities:k(MS),contentGaps:k(LS),groundingSources:k(BS)});const b4=H(["claude","codex"]);b4.enum;const v4=H(["claude","codex","all"]);v4.enum;const $S=S({content:y().int().nonnegative(),sitemap:y().int().nonnegative(),robots:y().int().nonnegative(),asset:y().int().nonnegative(),other:y().int().nonnegative()}),S4=H(["content","sitemap","robots","asset","other"]),nm=H(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);nm.enum;const x4=H(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);x4.enum;const w4=H(["raw-request","aggregate-bucket"]),j4=w4.enum,N4=H(["observed","provider-aggregated","inferred"]),k4=N4.enum,A4=S({type:u().nullable(),labels:He(u(),u())}),C4=S({sourceType:nm,evidenceKind:De(j4["raw-request"]),confidence:De(k4.observed),eventId:u().min(1),observedAt:u().min(1),method:u().nullable(),requestUrl:u().nullable(),host:u().nullable(),path:u().min(1),queryString:u().nullable(),status:y().int().nullable(),userAgent:u().nullable(),remoteIp:u().nullable(),referer:u().nullable(),latencyMs:y().nullable(),requestSizeBytes:y().int().nullable(),responseSizeBytes:y().int().nullable(),providerResource:A4,providerLabels:He(u(),u())});S({events:k(C4),rawEntryCount:y().int().nonnegative(),skippedEntryCount:y().int().nonnegative(),nextPageToken:u().optional(),filter:u()});const IS=H(["connected","paused","error","archived"]),DU=IS.enum,PS=H(["oauth","service-account"]);PS.enum;const _4=H(["verified","claimed_unverified","unknown_ai_like"]),zU=_4.enum;S({gcpProjectId:u().min(1),serviceName:u().nullable().optional(),location:u().nullable().optional(),authMode:PS});S({baseUrl:u().url(),username:u().min(1)});const am=H(["production","preview"]);am.enum;S({projectId:u().min(1),teamId:u().min(1),environment:am});const VS=S({id:u(),projectId:u(),sourceType:nm,displayName:u(),status:IS,lastSyncedAt:u().nullable(),lastCursor:u().nullable(),lastError:u().nullable(),archivedAt:u().nullable(),config:He(u(),Pn()),createdAt:u(),updatedAt:u()});S({gcpProjectId:u().min(1),serviceName:u().min(1).optional(),location:u().min(1).optional(),displayName:u().min(1).optional(),keyJson:u().optional()});S({baseUrl:u().url(),username:u().min(1),applicationPassword:u().min(1),displayName:u().min(1).optional()});S({projectId:u().min(1),teamId:u().min(1),token:u().min(1),environment:am.optional(),displayName:u().min(1).optional()});S({sourceId:u(),runId:u(),syncedAt:u(),pulledEvents:y().int().nonnegative(),selfTrafficExcluded:y().int().nonnegative(),crawlerHits:y().int().nonnegative(),aiUserFetchHits:y().int().nonnegative(),aiReferralHits:y().int().nonnegative(),unknownHits:y().int().nonnegative(),crawlerBucketRows:y().int().nonnegative(),aiUserFetchBucketRows:y().int().nonnegative(),aiReferralBucketRows:y().int().nonnegative(),sampleRows:y().int().nonnegative(),windowStart:u(),windowEnd:u()});S({days:y().int().positive().optional()});S({advanceToNow:De(!0)});S({sourceId:u(),runId:u(),status:Ii,windowStart:u(),windowEnd:u(),daysRequested:y().int().positive(),daysApplied:y().int().positive()});const T4=S({crawlerHits:y().int().nonnegative(),crawlerContentHits:y().int().nonnegative(),crawlerInfraHits:y().int().nonnegative(),crawlerSegments:$S,aiUserFetchHits:y().int().nonnegative(),aiReferralHits:y().int().nonnegative(),sampleCount:y().int().nonnegative()});S({sources:k(VS)});const E4=VS.extend({totals24h:T4,latestRun:S({runId:u(),status:Ii,startedAt:u().nullable(),finishedAt:u().nullable(),error:u().nullable()}).nullable()});S({sources:k(E4)});const O4=H(["crawler","ai-user-fetch","ai-referral"]),im=O4.enum,GS=H(["hour","day"]);GS.enum;const D4=S({bucket:u(),crawlerHits:y().int().nonnegative(),aiUserFetchHits:y().int().nonnegative(),aiReferralHits:y().int().nonnegative()}),z4=S({kind:De(im.crawler),sourceId:u(),tsHour:u(),botId:u(),operator:u(),verificationStatus:u(),pathNormalized:u(),pathClass:S4,status:y().int(),hits:y().int().nonnegative()}),R4=S({kind:De(im["ai-user-fetch"]),sourceId:u(),tsHour:u(),botId:u(),operator:u(),verificationStatus:u(),pathNormalized:u(),status:y().int(),hits:y().int().nonnegative()}),M4=S({kind:De(im["ai-referral"]),sourceId:u(),tsHour:u(),product:u(),operator:u(),sourceDomain:u(),evidenceType:u(),landingPathNormalized:u(),status:y().int(),hits:y().int().nonnegative(),paidHits:y().int().nonnegative(),organicHits:y().int().nonnegative(),unknownHits:y().int().nonnegative()}),B4=_o("kind",[z4,R4,M4]);S({windowStart:u(),windowEnd:u(),series:S({granularity:GS,points:k(D4)}),totals:S({crawlerHits:y().int().nonnegative(),crawlerContentHits:y().int().nonnegative(),crawlerInfraHits:y().int().nonnegative(),crawlerSegments:$S,aiUserFetchHits:y().int().nonnegative(),aiReferralHits:y().int().nonnegative(),aiReferralPaidHits:y().int().nonnegative(),aiReferralOrganicHits:y().int().nonnegative(),aiReferralUnknownHits:y().int().nonnegative()}),eventRows:S({total:y().int().nonnegative(),returned:y().int().nonnegative(),truncated:te()}),events:k(B4)});S({apiKey:u().min(1)});S({id:u(),name:u(),status:u(),currencyCode:u().nullable(),timezone:u().nullable(),url:u().nullable(),reviewStatus:u().nullable(),integrityReviewStatus:u().nullable(),integrityDecision:u().nullable()});S({q:u().trim().min(1).max(200),limit:y().int().min(1).max(100).default(20)});const L4=S({id:u(),type:u(),canonicalName:u(),countryCode:u(),name:u(),regionCode:u().nullable()});S({count:y().int().nonnegative(),query:u(),results:k(L4)});const q4=S({id:u(),clientType:u().optional(),name:u().optional(),pixelId:u().optional()});S({pixels:k(q4)});const U4=S({id:u(),name:u().optional()}),$4=S({id:u(),name:u().optional(),eventType:u().optional(),customEventName:u().nullable().optional(),attributionWindowDays:y().int().positive().optional(),adAccountId:u().optional(),sourceIds:k(u()).optional(),sources:k(U4).optional(),archived:te().optional(),version:y().int().nonnegative().optional()});S({eventSettings:k($4)});S({connected:te(),adAccountId:u().nullable().optional(),displayName:u().nullable().optional(),currencyCode:u().nullable().optional(),timezone:u().nullable().optional(),status:u().nullable().optional(),reviewStatus:u().nullable().optional(),integrityReviewStatus:u().nullable().optional(),integrityDecision:u().nullable().optional(),lastSyncedAt:u().nullable().optional(),conversionTrackingConfigured:te().optional()});S({disconnected:te()});S({runId:u(),status:u()});const I4=S({type:u().nullable().optional(),title:u().nullable().optional(),body:u().nullable().optional(),targetUrl:u().nullable().optional(),fileId:u().nullable().optional()}),Pc=H(["impressions","clicks"]),P4=Pc.enum,Vc=H(["impression","click"]);Vc.enum;const V4=S({id:u(),adGroupId:u(),name:u(),status:u(),reviewStatus:u().nullable().optional(),creative:I4.nullable().optional(),upstreamUpdatedAt:y().int().nullable().optional(),syncedAt:u().optional()}),G4=S({id:u(),campaignId:u(),name:u(),description:u().nullable().optional(),status:u(),billingEventType:Dn([Vc,ze()]).optional(),maxBidMicros:y().int().nullable().optional(),contextHints:k(u()).default([]),ads:k(V4).default([]),upstreamUpdatedAt:y().int().nullable().optional(),syncedAt:u().optional()}),H4=S({id:u(),name:u(),description:u().nullable().optional(),status:u(),startTime:y().int().nullable().optional(),endTime:y().int().nullable().optional(),biddingType:Dn([Pc,ze()]).optional(),dailySpendLimitMicros:y().int().nullable().optional(),lifetimeSpendLimitMicros:y().int().nullable().optional(),conversionEventSettingIds:k(u()).default([]),locationIds:k(u()).optional(),adGroups:k(G4).default([]),upstreamUpdatedAt:y().int().nullable().optional(),syncedAt:u().optional()});S({campaigns:k(H4)});const HS=H(["campaign","ad_group"]);HS.enum;const K4=S({level:HS,entityId:u(),date:u(),impressions:y().int(),clicks:y().int(),spendMicros:y().int(),conversions:y().int(),ctr:y().nullable(),cpcMicros:y().int().nullable()});S({rows:k(K4),currencyCode:u().nullable().optional()});const Q4=S({impressions:y().int(),clicks:y().int(),spendMicros:y().int(),conversions:y().int(),ctr:y().nullable(),cpcMicros:y().int().nullable()});S({connected:te(),displayName:u().nullable().optional(),currencyCode:u().nullable().optional(),lastSyncedAt:u().nullable().optional(),campaignCount:y().int(),adGroupCount:y().int(),adCount:y().int(),window:S({from:u().nullable(),to:u().nullable()}),totals:Q4});const Ca=u().min(8).max(128).regex(/^[\w.:-]+$/,"operationKey may contain letters, numbers, dot, underscore, colon, and hyphen"),ft=u().min(1).max(200),Pi=u().min(3).max(1e3).refine(e=>e.trim().length>0),tr=y().int().min(946684800).max(4102444800),nr=y().int().positive().max(Number.MAX_SAFE_INTEGER),sm=u().regex(/^[a-f0-9]{64}$/),KS=k(ft).max(100).refine(e=>new Set(e).size===e.length,"conversionEventSettingIds must be unique"),QS=u().url().refine(e=>new URL(e).protocol==="https:",{message:"URL must use https"}),ZS=H(["image_upload","campaign_create","campaign_update","campaign_pause","campaign_tree_activate","ad_group_create","ad_group_update","ad_group_pause","ad_create","ad_update","ad_pause"]);ZS.enum;const YS=H(["pending","reconciling","succeeded","failed","unknown"]),Zs=YS.enum,FS=H(["known_entity","create_fingerprint","manual_only"]);FS.enum;const XS=H([Zs.pending,Zs.unknown,Zs.reconciling]);XS.enum;const JS=H(["active","paused","archived"]);JS.enum;const WS=H(["file","campaign","ad_group","ad"]);WS.enum;const e1=H(["campaign","ad_group","ad"]);e1.enum;const rm=S({id:ft,expectedUpdatedAt:y().int().nonnegative()}).strict(),Z4=rm,_c=100,Y4=rm.extend({ads:k(Z4).min(1).max(_c-1)}).strict(),F4=rm.extend({adGroups:k(Y4).min(1).max(_c-1)}).strict();function X4(e,n){return e<n?-1:e>n?1:0}function xv(e,n,i){for(let r=1;r<e.length;r+=1)if(X4(e[r-1].id,e[r].id)>=0){i.addIssue({code:"custom",path:n,message:"Activation manifest entities must be uniquely sorted by id"});return}}const t1=S({campaign:F4}).strict().superRefine((e,n)=>{1+e.campaign.adGroups.reduce((l,c)=>l+1+c.ads.length,0)>_c&&n.addIssue({code:"custom",path:["campaign"],message:`Activation manifests may contain at most ${_c} entities`}),xv(e.campaign.adGroups,["campaign","adGroups"],n);const r=new Set;for(let l=0;l<e.campaign.adGroups.length;l+=1){const c=e.campaign.adGroups[l];xv(c.ads,["campaign","adGroups",l,"ads"],n);for(let d=0;d<c.ads.length;d+=1){const h=c.ads[d];r.has(h.id)&&n.addIssue({code:"custom",path:["campaign","adGroups",l,"ads",d,"id"],message:"An ad may appear only once in an activation manifest"}),r.add(h.id)}}}),n1=sm,J4=H(["approved","executing","consumed","revoked","expired","unknown"]),wa=J4.enum,W4=H(["pending","executing","active","failed","rollback_executing","rolled_back","rollback_failed","unknown"]),di=W4.enum,e3=S({name:Pi.optional(),description:u().max(4e3).nullable().optional(),status:JS.optional(),startTime:tr.nullable().optional(),endTime:tr.nullable().optional(),lifetimeSpendLimitMicros:nr.min(1e6).optional(),locationIds:k(ft).max(100).optional(),biddingType:Pc.optional(),conversionEventSettingIds:KS.optional(),campaignId:ft.optional(),contextHints:k(u().min(1).max(1e3)).max(100).optional(),maxBidMicros:nr.max(1e8).optional(),billingEventType:Vc.optional(),adGroupId:ft.optional(),creativeFingerprint:sm.optional()}).strict();S({operationKey:Ca,imageUrl:QS});S({operationKey:Ca,name:Pi,description:u().max(4e3).optional(),startTime:tr.optional(),endTime:tr.optional(),lifetimeSpendLimitMicros:nr.min(1e6),locationIds:k(ft).min(1).max(100),biddingType:Pc.optional(),conversionEventSettingIds:KS.optional()}).superRefine((e,n)=>{e.startTime!==void 0&&e.endTime!==void 0&&e.endTime<=e.startTime&&n.addIssue({code:"custom",path:["endTime"],message:"endTime must be after startTime"}),e.biddingType===P4.clicks&&(e.conversionEventSettingIds===void 0||e.conversionEventSettingIds.length===0)&&n.addIssue({code:"custom",path:["conversionEventSettingIds"],message:"conversionEventSettingIds must be non-empty when biddingType is clicks"})});S({operationKey:Ca,campaignId:ft,name:Pi,description:u().max(4e3).optional(),contextHints:k(u().min(1).max(1e3)).min(1).max(100),maxBidMicros:nr.max(1e8),billingEventType:Vc.optional()});const a1=S({title:u().min(3).max(50),body:u().min(1).max(100),targetUrl:QS,fileId:ft});S({operationKey:Ca,adGroupId:ft,name:Pi,creative:a1});function om(e){return Object.keys(e).some(n=>n!=="operationKey"&&n!=="expectedUpdatedAt")}S({operationKey:Ca,expectedUpdatedAt:y().int().nonnegative(),name:Pi.optional(),description:u().max(4e3).nullable().optional(),startTime:tr.nullable().optional(),endTime:tr.nullable().optional(),lifetimeSpendLimitMicros:nr.min(1e6).optional(),locationIds:k(ft).min(1).max(100).optional()}).refine(om,{message:"At least one campaign field must be updated"});S({operationKey:Ca,expectedUpdatedAt:y().int().nonnegative(),name:Pi.optional(),description:u().max(4e3).nullable().optional(),contextHints:k(u().min(1).max(1e3)).min(1).max(100).optional(),maxBidMicros:nr.max(1e8).optional()}).refine(om,{message:"At least one ad group field must be updated"});S({operationKey:Ca,expectedUpdatedAt:y().int().nonnegative(),name:Pi.optional(),creative:a1.optional()}).refine(om,{message:"At least one ad field must be updated"});S({operationKey:Ca});const Gc=S({id:u(),adAccountId:u().nullable(),operationKey:u(),kind:ZS,state:YS,entityType:Dn([WS,ze()]),entityId:u().nullable(),upstreamUpdatedAt:y().int().nullable(),errorCode:u().nullable(),errorMessage:u().nullable(),reconcileStrategy:Dn([FS,ze()]),reconcileParentId:ft.nullable(),reconcileFingerprint:sm.nullable(),reconcileFields:e3.nullable(),reconcileAttempts:y().int().nonnegative(),lastReconciledAt:u().nullable(),createdAt:u(),updatedAt:u()});S({operation:Gc,replayed:te()});const rt=lS({offset:!0}),ur={id:ft,projectId:ft,adAccountId:ft,manifestHash:n1,manifest:t1,executorApiKeyId:ft,approverApiKeyId:ft,expiresAt:rt,approvedAt:rt,createdAt:rt,updatedAt:rt,revocationRequestedAt:rt.nullable()},t3=S({...ur,state:De(wa.approved),operationId:ze(),executionStartedAt:ze(),consumedAt:ze(),revokedAt:ze(),expiredAt:ze()}).strict(),n3=S({...ur,state:De(wa.executing),operationId:ft,executionStartedAt:rt,consumedAt:ze(),revokedAt:ze(),expiredAt:ze()}).strict(),a3=S({...ur,state:De(wa.consumed),operationId:ft,executionStartedAt:rt,consumedAt:rt,revokedAt:ze(),expiredAt:ze()}).strict(),i3=S({...ur,state:De(wa.revoked),operationId:ze(),executionStartedAt:ze(),consumedAt:ze(),revokedAt:rt,expiredAt:ze()}).strict(),s3=S({...ur,state:De(wa.expired),operationId:ze(),executionStartedAt:ze(),consumedAt:ze(),revokedAt:ze(),expiredAt:rt}).strict(),r3=S({...ur,state:De(wa.unknown),operationId:ft,executionStartedAt:rt,consumedAt:ze(),revokedAt:ze(),expiredAt:ze()}).strict(),i1=_o("state",[t3,n3,a3,i3,s3,r3]).superRefine((e,n)=>{e.executorApiKeyId===e.approverApiKeyId&&n.addIssue({code:"custom",path:["executorApiKeyId"],message:"The activation executor must use a different API key from the approver"}),e.revocationRequestedAt!==null&&e.state!==wa.executing&&e.state!==wa.unknown&&e.state!==wa.consumed&&n.addIssue({code:"custom",path:["revocationRequestedAt"],message:"Only an executing, cancelled, or unresolved activation can carry a cancellation request"})}),fi={id:ft,operationId:ft,ordinal:y().int().nonnegative(),entityType:e1,entityId:ft,expectedUpdatedAt:y().int().nonnegative(),createdAt:rt,updatedAt:rt},To={errorCode:ze(),errorMessage:ze()},lm={errorCode:u().min(1).max(100),errorMessage:u().min(1).max(500),remediation:u().min(1).max(500)},o3=S({...fi,...To,state:De(di.pending),providerUpdatedAt:ze(),remediation:ze(),startedAt:ze(),finishedAt:ze()}).strict(),l3=S({...fi,...To,state:De(di.executing),providerUpdatedAt:ze(),remediation:ze(),startedAt:rt,finishedAt:ze()}).strict(),c3=S({...fi,...To,state:De(di.active),providerUpdatedAt:y().int().nonnegative(),remediation:ze(),startedAt:rt,finishedAt:rt}).strict(),u3=S({...fi,...lm,state:De(di.failed),providerUpdatedAt:Dn([y().int().nonnegative(),ze()]),startedAt:rt,finishedAt:rt}).strict(),d3=S({...fi,...To,state:De(di.rollback_executing),providerUpdatedAt:y().int().nonnegative(),remediation:u().min(1).max(500),startedAt:rt,finishedAt:ze()}).strict(),f3=S({...fi,...To,state:De(di.rolled_back),providerUpdatedAt:y().int().nonnegative(),remediation:u().min(1).max(500),startedAt:rt,finishedAt:rt}).strict(),p3=S({...fi,...lm,state:De(di.rollback_failed),providerUpdatedAt:y().int().nonnegative(),startedAt:rt,finishedAt:rt}).strict(),m3=S({...fi,...lm,state:De(di.unknown),providerUpdatedAt:Dn([y().int().nonnegative(),ze()]),startedAt:rt,finishedAt:rt}).strict(),h3=_o("state",[o3,l3,c3,u3,d3,f3,p3,m3]),op={exact:"exact",refreshSemanticallyUnchanged:"refresh_semantically_unchanged"},g3=H([op.exact,op.refreshSemanticallyUnchanged]);S({manifest:t1,executorApiKeyId:ft,expiresAt:rt,versionPolicy:g3.default(op.exact)}).strict();S({grant:i1}).strict();S({}).strict();S({operationKey:Ca,grantId:ft,manifestHash:n1}).strict();S({grant:i1,operation:Gc,steps:k(h3)}).strict();const y3=[Zs.pending,Zs.unknown,Zs.reconciling];function b3(e){if(e===void 0||e==="")return y3;if(Array.isArray(e)){const n=[];for(const i of e)typeof i=="string"?n.push(...i.split(",")):n.push(i);return n}return typeof e=="string"?e.split(",").filter(Boolean):e}S({state:tD(b3,k(XS).min(1).max(3).refine(e=>new Set(e).size===e.length,"state values must be unique")),limit:nD().int().min(1).max(200).default(100),cursor:u().min(1).max(1e3).optional()});S({operations:k(Gc),count:y().int().nonnegative(),nextCursor:u().nullable()});S({}).strict();S({operation:Gc,resolved:te()});var v3=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(v3||{});const RU={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},MU={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},BU=Pp;function S3(e){const n=[];if(e.message&&n.push(e.message),e.providers)for(const[i,r]of Object.entries(e.providers)){const l=`[${i}] ${r.message}`;r.raw!==void 0?n.push(`${l}
|
|
53
|
-
|
|
54
|
-
${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
|
|
55
|
-
|
|
56
|
-
`):"Run failed."}function x3(e){return e.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}function LU(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function qU(e){return e===null?"Unknown":e?"Pass":"Fail"}function wv(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function UU(e,n){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${n}`:`daily@${n}`}function $U(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 IU(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 ${wv(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 ${wv(h)} · ${r}`}return`${e} · ${r}`}function w3(e,n){return n&&n!==e?`${e} · ${n}`:e}function PU(){const e=Intl.DateTimeFormat().resolvedOptions().timeZone,n=new Intl.DateTimeFormat("en-US",{timeZoneName:"short"}).formatToParts().find(i=>i.type==="timeZoneName")?.value;return w3(e,n)}function j3(e){const n=e.replace(/\/+$/,"")||"/";return n==="/"?"overview":n==="/projects"?"projects":n.startsWith("/projects/")?"project":n==="/runs"?"runs":n==="/traffic"||n.startsWith("/traffic/")?"traffic":n==="/backlinks"?"backlinks":n==="/settings"?"settings":n==="/setup"?"setup":"other"}function N3(e,n){return!n||n.includes(e)}function VU(e,n){return N3(e,n)||!n||n.length===0?e:n.includes("overview")?"overview":n[0]}const jv={bg:"--canonry-embed-bg",fg:"--canonry-embed-fg",accent:"--color-link"},k3=/^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|rgba?\([0-9.,%\s/]+\)|hsla?\([0-9.,%\s/a-z]+\))$/i,A3=/^[a-z0-9][a-z0-9 -]{0,48}$/i;function s1(e){const n=e?.font?.trim();return n&&A3.test(n)?n:void 0}function C3(e){const n=e?.mode?.trim();return n==="light"||n==="dark"?n:void 0}function _3(e){if(!e)return{};const n={};for(const[r,l]of Object.entries(e)){const c=Object.hasOwn(jv,r)?jv[r]:void 0;if(!c||typeof l!="string")continue;const d=l.trim();k3.test(d)&&(n[c]=d)}const i=s1(e);return i&&(n["--font-sans"]=`"${i}", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif`),n}function T3(e){const n=s1(e);if(n)return`https://fonts.googleapis.com/css2?family=${n.replace(/ /g,"+")}:wght@400;500;600;700&display=swap`}const Ne=(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]},E3=e=>Ne("getApiV1ProjectsByName",e),O3=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await b0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:E3(e)}),Vi=e=>Ne("getApiV1Projects",e),Hc=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Vi(e)}),D3=e=>Ne("getApiV1ProjectsByNameRuns",e),z3=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await v0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:D3(e)}),cm=e=>Ne("getApiV1Runs",e),um=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await DN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cm(e)}),R3=e=>Ne("getApiV1RunsById",e),r1=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await S0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:R3(e)}),M3=e=>Ne("getApiV1ProjectsByNameHistory",e),GU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await MN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:M3(e)}),B3=e=>Ne("getApiV1History",e),HU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await BN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:B3(e)}),L3=e=>Ne("getApiV1ProjectsByNameSnapshotsDiff",e),KU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await UN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:L3(e)}),q3=e=>Ne("getApiV1Settings",e),U3=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await x0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:q3(e)}),$3=e=>Ne("getApiV1ProjectsByNameGoogleConnections",e),QU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await JN({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:$3(e)}),I3=e=>Ne("getApiV1ProjectsByNameGoogleProperties",e),ZU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await tk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:I3(e)}),P3=e=>Ne("getApiV1ProjectsByNameGoogleGscPerformance",e),YU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:P3(e)}),V3=e=>Ne("getApiV1ProjectsByNameGoogleGscPerformanceDaily",e),FU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await rk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:V3(e)}),G3=e=>Ne("getApiV1ProjectsByNameGoogleGscInspections",e),XU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await lk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:G3(e)}),H3=e=>Ne("getApiV1ProjectsByNameGoogleGscDeindexed",e),JU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await ck({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:H3(e)}),K3=e=>Ne("getApiV1ProjectsByNameGoogleGscCoverage",e),WU=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await w0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:K3(e)}),Q3=e=>Ne("getApiV1ProjectsByNameGoogleGscCoverageHistory",e),e$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await uk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Q3(e)}),t$=e=>Ne("getApiV1ProjectsByNameGoogleGscSitemaps",e),Z3=e=>Ne("getApiV1ProjectsByNameGbpLocations",e),n$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Z3(e)}),a$=e=>({mutationFn:async i=>{const{data:r}=await gk({...e,...i,throwOnError:!0});return r}}),i$=e=>({mutationFn:async i=>{const{data:r}=await yk({...e,...i,throwOnError:!0});return r}}),Y3=e=>Ne("getApiV1ProjectsByNameGbpKeywords",e),s$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:Y3(e)}),F3=e=>Ne("getApiV1ProjectsByNameGbpPlaceActions",e),r$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:F3(e)}),X3=e=>Ne("getApiV1ProjectsByNameGbpLodging",e),o$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Sk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:X3(e)}),J3=e=>Ne("getApiV1ProjectsByNameGbpPlaces",e),l$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:J3(e)}),W3=e=>Ne("getApiV1ProjectsByNameGbpSummary",e),c$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:W3(e)}),eM=e=>Ne("getApiV1ProjectsByNameBingStatus",e),u$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:eM(e)}),tM=e=>Ne("getApiV1ProjectsByNameBingSites",e),d$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Ak({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:tM(e)}),nM=e=>Ne("getApiV1ProjectsByNameBingCoverage",e),f$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await j0({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:nM(e)}),aM=e=>Ne("getApiV1ProjectsByNameBingInspections",e),p$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await _k({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:aM(e)}),iM=e=>Ne("getApiV1ProjectsByNameBingPerformance",e),m$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Dk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:iM(e)}),sM=e=>Ne("getApiV1ProjectsByNameGaStatus",e),h$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Mk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:sM(e)}),rM=e=>Ne("getApiV1ProjectsByNameGaTraffic",e),g$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Lk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:rM(e)}),oM=e=>Ne("getApiV1ProjectsByNameGaAiReferralHistory",e),y$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await qk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:oM(e)}),lM=e=>Ne("getApiV1ProjectsByNameGaSocialReferralHistory",e),b$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Uk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:lM(e)}),cM=e=>Ne("getApiV1ProjectsByNameGaSessionHistory",e),v$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await $k({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:cM(e)}),uM=e=>Ne("getApiV1ProjectsByNameReport",e),S$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Pk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:uM(e)}),dM=e=>Ne("getApiV1ProjectsByNameHealthHistory",e),x$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Vk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:dM(e)}),fM=e=>Ne("getApiV1ProjectsByNameCitationsVisibility",e),w$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await Gk({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:fM(e)}),pM=e=>Ne("getApiV1ProjectsByNameTrafficSources",e),j$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await fA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:pM(e)}),mM=e=>Ne("getApiV1ProjectsByNameTrafficStatus",e),N$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await pA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:mM(e)}),hM=e=>Ne("getApiV1ProjectsByNameTrafficSourcesById",e),k$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await mA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:hM(e)}),gM=e=>Ne("getApiV1ProjectsByNameTrafficEvents",e),A$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await hA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:gM(e)}),yM=e=>Ne("getApiV1ProjectsByNameDiscoverSessions",e),C$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await yA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:yM(e)}),bM=e=>Ne("getApiV1ProjectsByNameDiscoverSessionsById",e),_$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await bA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:bM(e)}),vM=e=>Ne("getApiV1ProjectsByNameDiscoverSessionsByIdPromote",e),T$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await vA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:vM(e)}),SM=e=>Ne("getApiV1ProjectsByNameTechnicalAeo",e),E$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await xA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:SM(e)}),xM=e=>Ne("getApiV1ProjectsByNameTechnicalAeoPages",e),O$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await wA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:xM(e)}),wM=e=>Ne("getApiV1ProjectsByNameTechnicalAeoTrend",e),D$=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await jA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:wM(e)}),jM=e=>Ne("getApiV1ProjectsByNameAgentProviders",e),NM=e=>ke({queryFn:async({queryKey:n,signal:i})=>{const{data:r}=await kA({...e,...n[0],signal:i,throwOnError:!0});return r},queryKey:jM(e)});function Nv(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function o1(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 z$(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 R$(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}const M$={positive:"text-positive-400",caution:"text-caution-400",negative:"text-negative-400",neutral:"text-secondary"};function kM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function ar(e){const n=[e.detail,e.hint].filter(Boolean);return n.length>0?n.join(`
|
|
57
|
-
`):void 0}function AM(e,n,i){return e.map(r=>{if(r.id==="api")return{...r,tone:Nv(n.apiStatus),detail:n.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:n.apiStatus.detail};if(r.id==="worker")return{...r,tone:Nv(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=>kM(g)).join(" · ");return{...r,label:"Providers",tone:d?"positive":"caution",detail:`${l} of ${c} configured`,meta:h||"None configured"}})}function CM(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 _M(e,n,i){const r=CM(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 l1="canonry.run-tracker",lp=new Set;let kv=!1,TM=0,Kc={runs:{},batches:{}};function EM(){const e=Na();for(const n of lp)n(e)}function OM(e){if(!e)return{runs:{},batches:{}};try{const n=JSON.parse(e);return{runs:n.runs??{},batches:n.batches??{}}}catch{return{runs:{},batches:{}}}}function DM(){typeof window>"u"||window.sessionStorage.setItem(l1,JSON.stringify(Kc))}function c1(){kv||(kv=!0,!(typeof window>"u")&&(Kc=OM(window.sessionStorage.getItem(l1))))}function Qc(e){Kc=e,DM(),EM()}function Na(){return c1(),Kc}function u1(e){return c1(),lp.add(e),()=>{lp.delete(e)}}function dm(e){const n=Na();Qc({...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 Bf(e){const n=Na();if(!n.runs[e])return;const{[e]:i,...r}=n.runs;Qc({...n,runs:r})}function zM(e){const n=Na(),i=`batch_${Date.now()}_${++TM}`;return Qc({...n,batches:{...n.batches,[i]:{batchId:i,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),i}function RM(e){const n=Na();if(!n.batches[e])return;const{[e]:i,...r}=n.batches;Qc({...n,batches:r})}function MM(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}const BM=10*6e4;function LM(e,n,i,r){return e.filter(l=>!n.has(l.runId)&&i-(l.trackedAt??0)>=r)}function qM(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 Av=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Cv=d0,d1=(e,n)=>i=>{var r;if(n?.variants==null)return Cv(e,i?.class,i?.className);const{variants:l,defaultVariants:c}=n,d=Object.keys(l).map(b=>{const x=i?.[b],w=c?.[b];if(x===null)return null;const N=Av(x)||Av(w);return l[b][N]}),h=i&&Object.entries(i).reduce((b,x)=>{let[w,N]=x;return N===void 0||(b[w]=N),b},{}),g=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((b,x)=>{let{class:w,className:N,...C}=x;return Object.entries(C).every(D=>{let[A,E]=D;return Array.isArray(E)?E.includes({...c,...h}[A]):{...c,...h}[A]===E})?[...b,w,N]:b},[]);return Cv(e,d,g,i?.class,i?.className)},UM=(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},$M=(e,n)=>({classGroupId:e,validator:n}),f1=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Tc="-",_v=[],IM="arbitrary..",PM=e=>{const n=GM(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return VM(d);const h=d.split(Tc),g=h[0]===""&&h.length>1?1:0;return p1(h,g,n)},getConflictingClassGroupIds:(d,h)=>{if(h){const g=r[d],b=i[d];return g?b?UM(b,g):g:b||_v}return i[d]||_v}}},p1=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const l=e[n],c=i.nextPart.get(l);if(c){const b=p1(e,n+1,c);if(b)return b}const d=i.validators;if(d===null)return;const h=n===0?e.join(Tc):e.slice(n).join(Tc),g=d.length;for(let b=0;b<g;b++){const x=d[b];if(x.validator(h))return x.classGroupId}},VM=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?IM+r:void 0})(),GM=e=>{const{theme:n,classGroups:i}=e;return HM(i,n)},HM=(e,n)=>{const i=f1();for(const r in e){const l=e[r];fm(l,i,r,n)}return i},fm=(e,n,i,r)=>{const l=e.length;for(let c=0;c<l;c++){const d=e[c];KM(d,n,i,r)}},KM=(e,n,i,r)=>{if(typeof e=="string"){QM(e,n,i);return}if(typeof e=="function"){ZM(e,n,i,r);return}YM(e,n,i,r)},QM=(e,n,i)=>{const r=e===""?n:m1(n,e);r.classGroupId=i},ZM=(e,n,i,r)=>{if(FM(e)){fm(e(r),n,i,r);return}n.validators===null&&(n.validators=[]),n.validators.push($M(i,e))},YM=(e,n,i,r)=>{const l=Object.entries(e),c=l.length;for(let d=0;d<c;d++){const[h,g]=l[d];fm(g,m1(n,h),i,r)}},m1=(e,n)=>{let i=e;const r=n.split(Tc),l=r.length;for(let c=0;c<l;c++){const d=r[c];let h=i.nextPart.get(d);h||(h=f1(),i.nextPart.set(d,h)),i=h}return i},FM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,XM=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)}}},cp="!",Tv=":",JM=[],Ev=(e,n,i,r,l)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:r,isExternal:l}),WM=e=>{const{prefix:n,experimentalParseClassName:i}=e;let r=l=>{const c=[];let d=0,h=0,g=0,b;const x=l.length;for(let A=0;A<x;A++){const E=l[A];if(d===0&&h===0){if(E===Tv){c.push(l.slice(g,A)),g=A+1;continue}if(E==="/"){b=A;continue}}E==="["?d++:E==="]"?d--:E==="("?h++:E===")"&&h--}const w=c.length===0?l:l.slice(g);let N=w,C=!1;w.endsWith(cp)?(N=w.slice(0,-1),C=!0):w.startsWith(cp)&&(N=w.slice(1),C=!0);const D=b&&b>g?b-g:void 0;return Ev(c,C,N,D)};if(n){const l=n+Tv,c=r;r=d=>d.startsWith(l)?c(d.slice(l.length)):Ev(JM,!1,d,void 0,!0)}if(i){const l=r;r=c=>i({className:c,parseClassName:l})}return r},eB=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}},tB=e=>({cache:XM(e.cacheSize),parseClassName:WM(e),sortModifiers:eB(e),...PM(e)}),nB=/\s+/,aB=(e,n)=>{const{parseClassName:i,getClassGroupId:r,getConflictingClassGroupIds:l,sortModifiers:c}=n,d=[],h=e.trim().split(nB);let g="";for(let b=h.length-1;b>=0;b-=1){const x=h[b],{isExternal:w,modifiers:N,hasImportantModifier:C,baseClassName:D,maybePostfixModifierPosition:A}=i(x);if(w){g=x+(g.length>0?" "+g:g);continue}let E=!!A,R=r(E?D.substring(0,A):D);if(!R){if(!E){g=x+(g.length>0?" "+g:g);continue}if(R=r(D),!R){g=x+(g.length>0?" "+g:g);continue}E=!1}const G=N.length===0?"":N.length===1?N[0]:c(N).join(":"),X=C?G+cp:G,V=X+R;if(d.indexOf(V)>-1)continue;d.push(V);const P=l(R,E);for(let re=0;re<P.length;++re){const O=P[re];d.push(X+O)}g=x+(g.length>0?" "+g:g)}return g},iB=(...e)=>{let n=0,i,r,l="";for(;n<e.length;)(i=e[n++])&&(r=h1(i))&&(l&&(l+=" "),l+=r);return l},h1=e=>{if(typeof e=="string")return e;let n,i="";for(let r=0;r<e.length;r++)e[r]&&(n=h1(e[r]))&&(i&&(i+=" "),i+=n);return i},sB=(e,...n)=>{let i,r,l,c;const d=g=>{const b=n.reduce((x,w)=>w(x),e());return i=tB(b),r=i.cache.get,l=i.cache.set,c=h,h(g)},h=g=>{const b=r(g);if(b)return b;const x=aB(g,i);return l(g,x),x};return c=d,(...g)=>c(iB(...g))},rB=[],zt=e=>{const n=i=>i[e]||rB;return n.isThemeGetter=!0,n},g1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oB=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lB=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cB=/\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$/,uB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dB=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fB=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ei=e=>oB.test(e),Re=e=>!!e&&!Number.isNaN(Number(e)),ti=e=>!!e&&Number.isInteger(Number(e)),Lf=e=>e.endsWith("%")&&Re(e.slice(0,-1)),va=e=>lB.test(e),b1=()=>!0,pB=e=>cB.test(e)&&!uB.test(e),pm=()=>!1,mB=e=>dB.test(e),hB=e=>fB.test(e),gB=e=>!he(e)&&!ge(e),yB=e=>pi(e,x1,pm),he=e=>g1.test(e),zi=e=>pi(e,w1,pB),Ov=e=>pi(e,kB,Re),bB=e=>pi(e,N1,b1),vB=e=>pi(e,j1,pm),Dv=e=>pi(e,v1,pm),SB=e=>pi(e,S1,hB),rc=e=>pi(e,k1,mB),ge=e=>y1.test(e),fo=e=>Gi(e,w1),xB=e=>Gi(e,j1),zv=e=>Gi(e,v1),wB=e=>Gi(e,x1),jB=e=>Gi(e,S1),oc=e=>Gi(e,k1,!0),NB=e=>Gi(e,N1,!0),pi=(e,n,i)=>{const r=g1.exec(e);return r?r[1]?n(r[1]):i(r[2]):!1},Gi=(e,n,i=!1)=>{const r=y1.exec(e);return r?r[1]?n(r[1]):i:!1},v1=e=>e==="position"||e==="percentage",S1=e=>e==="image"||e==="url",x1=e=>e==="length"||e==="size"||e==="bg-size",w1=e=>e==="length",kB=e=>e==="number",j1=e=>e==="family-name",N1=e=>e==="number"||e==="weight",k1=e=>e==="shadow",AB=()=>{const e=zt("color"),n=zt("font"),i=zt("text"),r=zt("font-weight"),l=zt("tracking"),c=zt("leading"),d=zt("breakpoint"),h=zt("container"),g=zt("spacing"),b=zt("radius"),x=zt("shadow"),w=zt("inset-shadow"),N=zt("text-shadow"),C=zt("drop-shadow"),D=zt("blur"),A=zt("perspective"),E=zt("aspect"),R=zt("ease"),G=zt("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...V(),ge,he],re=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],L=()=>[ge,he,g],ae=()=>[ei,"full","auto",...L()],_e=()=>[ti,"none","subgrid",ge,he],Me=()=>["auto",{span:["full",ti,ge,he]},ti,ge,he],ve=()=>[ti,"auto",ge,he],it=()=>["auto","min","max","fr",ge,he],oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],fe=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...L()],W=()=>[ei,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],pe=()=>[ei,"screen","full","dvw","lvw","svw","min","max","fit",...L()],je=()=>[ei,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],le=()=>[e,ge,he],Xe=()=>[...V(),zv,Dv,{position:[ge,he]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ue=()=>["auto","cover","contain",wB,yB,{size:[ge,he]}],ee=()=>[Lf,fo,zi],de=()=>["","none","full",b,ge,he],ie=()=>["",Re,fo,zi],Ae=()=>["solid","dashed","dotted","double"],st=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],xe=()=>[Re,Lf,zv,Dv],Pe=()=>["","none",D,ge,he],Ze=()=>["none",Re,ge,he],Bt=()=>["none",Re,ge,he],Hn=()=>[Re,ge,he],Lt=()=>[ei,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[va],breakpoint:[va],color:[b1],container:[va],"drop-shadow":[va],ease:["in","out","in-out"],font:[gB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[va],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[va],shadow:[va],spacing:["px",Re],text:[va],"text-shadow":[va],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ei,he,ge,E]}],container:["container"],columns:[{columns:[Re,he,ge,h]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:P()}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[ti,"auto",ge,he]}],basis:[{basis:[ei,"full","auto",h,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,ei,"auto","initial","none",he]}],grow:[{grow:["",Re,ge,he]}],shrink:[{shrink:["",Re,ge,he]}],order:[{order:[ti,"first","last","none",ge,he]}],"grid-cols":[{"grid-cols":_e()}],"col-start-end":[{col:Me()}],"col-start":[{"col-start":ve()}],"col-end":[{"col-end":ve()}],"grid-rows":[{"grid-rows":_e()}],"row-start-end":[{row:Me()}],"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":it()}],"auto-rows":[{"auto-rows":it()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...oe(),"normal"]}],"justify-items":[{"justify-items":[...fe(),"normal"]}],"justify-self":[{"justify-self":["auto",...fe()]}],"align-content":[{content:["normal",...oe()]}],"align-items":[{items:[...fe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...fe(),{baseline:["","last"]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...fe(),"baseline"]}],"place-self":[{"place-self":["auto",...fe()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],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":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"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,fo,zi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,NB,bB]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lf,he]}],"font-family":[{font:[xB,vB,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":[Re,"none",ge,Ov]}],leading:[{leading:[c,...L()]}],"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:le()}],"text-color":[{text:le()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",ge,zi]}],"text-decoration-color":[{decoration:le()}],"underline-offset":[{"underline-offset":[Re,"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:L()}],"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:Xe()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ti,ge,he],radial:["",ge,he],conic:[ti,ge,he]},jB,SB]}],"bg-color":[{bg:le()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:le()}],"gradient-via":[{via:le()}],"gradient-to":[{to:le()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:le()}],"border-color-x":[{"border-x":le()}],"border-color-y":[{"border-y":le()}],"border-color-s":[{"border-s":le()}],"border-color-e":[{"border-e":le()}],"border-color-bs":[{"border-bs":le()}],"border-color-be":[{"border-be":le()}],"border-color-t":[{"border-t":le()}],"border-color-r":[{"border-r":le()}],"border-color-b":[{"border-b":le()}],"border-color-l":[{"border-l":le()}],"divide-color":[{divide:le()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,ge,he]}],"outline-w":[{outline:["",Re,fo,zi]}],"outline-color":[{outline:le()}],shadow:[{shadow:["","none",x,oc,rc]}],"shadow-color":[{shadow:le()}],"inset-shadow":[{"inset-shadow":["none",w,oc,rc]}],"inset-shadow-color":[{"inset-shadow":le()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:le()}],"ring-offset-w":[{"ring-offset":[Re,zi]}],"ring-offset-color":[{"ring-offset":le()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":le()}],"text-shadow":[{"text-shadow":["none",N,oc,rc]}],"text-shadow-color":[{"text-shadow":le()}],opacity:[{opacity:[Re,ge,he]}],"mix-blend":[{"mix-blend":[...st(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":st()}],"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":[Re]}],"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":le()}],"mask-image-linear-to-color":[{"mask-linear-to":le()}],"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":le()}],"mask-image-t-to-color":[{"mask-t-to":le()}],"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":le()}],"mask-image-r-to-color":[{"mask-r-to":le()}],"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":le()}],"mask-image-b-to-color":[{"mask-b-to":le()}],"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":le()}],"mask-image-l-to-color":[{"mask-l-to":le()}],"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":le()}],"mask-image-x-to-color":[{"mask-x-to":le()}],"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":le()}],"mask-image-y-to-color":[{"mask-y-to":le()}],"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":le()}],"mask-image-radial-to-color":[{"mask-radial-to":le()}],"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":V()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"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":le()}],"mask-image-conic-to-color":[{"mask-conic-to":le()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Xe()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,he]}],filter:[{filter:["","none",ge,he]}],blur:[{blur:Pe()}],brightness:[{brightness:[Re,ge,he]}],contrast:[{contrast:[Re,ge,he]}],"drop-shadow":[{"drop-shadow":["","none",C,oc,rc]}],"drop-shadow-color":[{"drop-shadow":le()}],grayscale:[{grayscale:["",Re,ge,he]}],"hue-rotate":[{"hue-rotate":[Re,ge,he]}],invert:[{invert:["",Re,ge,he]}],saturate:[{saturate:[Re,ge,he]}],sepia:[{sepia:["",Re,ge,he]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,he]}],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Re,ge,he]}],"backdrop-contrast":[{"backdrop-contrast":[Re,ge,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,ge,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,ge,he]}],"backdrop-invert":[{"backdrop-invert":["",Re,ge,he]}],"backdrop-opacity":[{"backdrop-opacity":[Re,ge,he]}],"backdrop-saturate":[{"backdrop-saturate":[Re,ge,he]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,ge,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"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:[Re,"initial",ge,he]}],ease:[{ease:["linear","initial",R,ge,he]}],delay:[{delay:[Re,ge,he]}],animate:[{animate:["none",G,ge,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,ge,he]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ze()}],"rotate-x":[{"rotate-x":Ze()}],"rotate-y":[{"rotate-y":Ze()}],"rotate-z":[{"rotate-z":Ze()}],scale:[{scale:Bt()}],"scale-x":[{"scale-x":Bt()}],"scale-y":[{"scale-y":Bt()}],"scale-z":[{"scale-z":Bt()}],"scale-3d":["scale-3d"],skew:[{skew:Hn()}],"skew-x":[{"skew-x":Hn()}],"skew-y":[{"skew-y":Hn()}],transform:[{transform:[ge,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],accent:[{accent:le()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:le()}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",...le()]}],"stroke-w":[{stroke:[Re,fo,zi,Ov]}],stroke:[{stroke:["none",...le()]}],"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"]}},CB=sB(AB);function Mn(...e){return CB(d0(e))}const _B=d1("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-mono-400 focus-visible:ring-offset-2 focus-visible:ring-offset-overlay-scrim disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-accent text-on-inverse hover:bg-mono-200",secondary:"border border-base bg-bg text-heading hover:bg-bg-elevated",ghost:"text-secondary hover:bg-bg-elevated hover:text-primary",outline:"border border-base bg-transparent text-heading hover:bg-bg-elevated",destructive:"bg-negative-600 text-on-emphasis hover:bg-negative-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"}}),Ie=q.forwardRef(({className:e,variant:n,size:i,asChild:r=!1,...l},c)=>{const d=r?Kj:"button";return p.jsx(d,{ref:c,className:Mn(_B({variant:n,size:i,className:e})),...l})});Ie.displayName="Button";const TB=d1("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-base bg-bg text-neutral",success:"border-positive bg-positive-soft text-positive",warning:"border-caution-500/25 bg-caution-soft text-caution",destructive:"border-negative bg-negative-soft text-negative"}},defaultVariants:{variant:"neutral"}});function A1({className:e,variant:n,...i}){return p.jsx("div",{className:Mn(TB({variant:n}),e),...i})}const EB=220;function Rv({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)},EB)};return e?p.jsxs(tt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[p.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),p.jsx("span",{className:"brand-copy",children:p.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):p.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[p.jsx(tt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:p.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),p.jsxs("div",{className:"brand-copy",children:[p.jsx(tt,{to:"/",className:"brand-mark",children:"Canonry"}),h?p.jsxs("span",{className:`brand-update-bubble ${c?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[p.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:[p.jsxs("span",{className:"brand-update-bubble-from",children:["v",i.current]}),p.jsx(NC,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),p.jsxs("span",{className:"brand-update-bubble-to",children:["v",i.latest]})]}),p.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:g,"aria-label":`Dismiss update notification for v${i.latest}`,children:p.jsx(rr,{className:"size-3","aria-hidden":"true"})})]}):l?p.jsxs("span",{className:"brand-version",children:["v",n]}):null]})]})}function OB({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"},r=Object.hasOwn(n,e)?`provider-badge--${e} ${n[e]}`:"border-zinc-700 bg-zinc-800 text-zinc-300";return p.jsx("span",{className:`provider-badge inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${r}`,children:e})}function Cn({tone:e,children:n,...i}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return p.jsx(A1,{variant:r,...i,children:n})}function mm({status:e}){return p.jsx(Cn,{tone:o1(e),children:x3(e)})}const DB=u0,zB=o0,C1=q.forwardRef(({className:e,...n},i)=>p.jsx(xp,{ref:i,className:Mn("fixed inset-0 z-50 bg-overlay-scrim/70 backdrop-blur-sm",e),...n}));C1.displayName=xp.displayName;const RB=400,MB=1200,BB=720,_1=q.forwardRef(({className:e,children:n,...i},r)=>{const[l,c]=q.useState(BB),d=q.useRef(!1),h=q.useRef(0),g=q.useRef(0),b=q.useCallback(N=>{d.current=!0,h.current=N.clientX,g.current=l,N.target.setPointerCapture(N.pointerId),N.preventDefault()},[l]),x=q.useCallback(N=>{if(!d.current)return;const C=h.current-N.clientX,D=Math.min(MB,Math.max(RB,g.current+C));c(D)},[]),w=q.useCallback(()=>{d.current=!1},[]);return p.jsxs(zB,{children:[p.jsx(C1,{}),p.jsxs(wp,{ref:r,className:Mn("fixed z-50 flex flex-col bg-bg 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-base",e),style:{width:`min(${l}px, 100vw)`},...i,children:[p.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-mono-700/50 active:bg-mono-600/50 transition-colors max-md:hidden",onPointerDown:b,onPointerMove:x,onPointerUp:w}),n,p.jsxs(l0,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-muted transition hover:bg-bg-elevated hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400",children:[p.jsx(rr,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});_1.displayName=wp.displayName;const LB=({className:e,...n})=>p.jsx("div",{className:Mn("flex flex-col gap-1.5 pr-10",e),...n}),T1=q.forwardRef(({className:e,...n},i)=>p.jsx(jp,{ref:i,className:Mn("text-lg font-medium text-primary",e),...n}));T1.displayName=jp.displayName;const E1=q.forwardRef(({className:e,...n},i)=>p.jsx(c0,{ref:i,className:Mn("text-sm text-muted",e),...n}));E1.displayName=c0.displayName;function qf({title:e,subtitle:n,children:i,open:r,onClose:l}){return p.jsx(DB,{open:r,onOpenChange:c=>c?void 0:l(),children:p.jsxs(_1,{children:[p.jsxs(LB,{className:"drawer-head",children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:n}),p.jsx(T1,{id:"drawer-title",children:e}),p.jsx(E1,{className:"sr-only",children:n})]}),p.jsx("div",{className:"drawer-body",children:i})]})})}function po({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 p.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:l,onMouseLeave:c,children:[p.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:p.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[p.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),n!==null&&qj.createPortal(p.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:"var(--color-neutral-text)",backgroundColor:"var(--color-bg-elevated)",border:"1px solid color-mix(in oklab, var(--color-border-strong) 60%, transparent)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px var(--color-shadow-tooltip), 0 4px 6px -4px var(--color-shadow-tooltip)"},children:e}),document.body)]})}const qB=/[\s\-_]+/;function UB(e){const n=e.split(qB).filter(Boolean);return n.length===0?null:n.map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function Mv(e,n){const i=$B(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,x)=>b.type==="bold"?Ls.createElement("strong",{key:`b-${x}`,className:"text-strong font-semibold"},b.value):b.value).filter(Boolean);const d=[...l].sort((b,x)=>x.length-b.length).map(UB).filter(b=>!!b);if(d.length===0)return r.map((b,x)=>b.type==="bold"?Ls.createElement("strong",{key:`b-${x}`,className:"text-strong 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 x of b.terms){const w=Cc(x);w&&!g.has(w)&&g.set(w,b.className)}return r.flatMap((b,x)=>b.value.split(h).map((N,C)=>{if(!N)return null;if(C%2===1){const A=g.get(Cc(N))??"answer-highlight";return b.type==="bold"?Ls.createElement("mark",{key:`hl-${x}-${C}`,className:A},Ls.createElement("strong",{className:"text-strong font-semibold"},N)):Ls.createElement("mark",{key:`hl-${x}-${C}`,className:A},N)}return b.type==="bold"?Ls.createElement("strong",{key:`b-${x}-${C}`,className:"text-strong font-semibold"},N):N})).filter(Boolean)}function $B(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function up(e){const n=(e??"").trim();return n&&(n.startsWith("/")||/^https?:\/\//i.test(n)||/^mailto:/i.test(n))?n:null}function Uf(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 IB({evidence:e,project:n,onClose:i}){const[r,l]=q.useState(!1),[c,d]=q.useState("mentions"),[h,g]=q.useState(-1),[b,x]=q.useState(null),[w,N]=q.useState(!1),[C,D]=q.useState({}),A=uD(n.project),E=new Set(A.map(Nc)),R=e.runHistory,G=R.length>1,[X,V]=q.useState(null),P=q.useRef(!1);q.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const ee=R.at(-1);ee&&(P.current=!0,vc(ee.runId).then(de=>{const ie=de.snapshots?.find(Ae=>Ae.query===e.query&&Ae.provider===e.provider);ie&&V({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ee.visibilityTransition,provider:ie.provider,model:ie.model??e.model,answerSnippet:ie.answerText??e.answerSnippet,citedDomains:ie.citedDomains??e.citedDomains,competitorDomains:ie.competitorOverlap??e.competitorDomains,recommendedCompetitors:ie.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ie.matchedTerms??e.matchedTerms??[],groundingSources:ie.groundingSources??e.groundingSources,searchQueries:ie.searchQueries,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,R]);const re=h>=0&&b!==null,O=re?b:X||{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},L=O.visibilityState==="pending"||O.citationState==="pending",ae=L?!1:O.visibilityState!=null?O.visibilityState==="visible":O.answerMentioned!=null?O.answerMentioned:O.citationState===kc.cited||O.citationState==="emerging",_e=O.answerMentioned!=null||O.visibilityState!=null||O.recommendedCompetitors.length>0,Me=O.citedDomains.length>0||O.groundingSources.length>0||O.evidenceUrls.length>0,ve=n.project.displayName||n.project.name,it=[...A.map(Nc),ve,ve.split(" ").slice(0,2).join(" "),...O.matchedTerms].filter(ee=>ee.trim().length>2),oe=[...O.competitorDomains.flatMap(ee=>{const de=cD(ee);return de.length>=4?[de]:[]}),...O.recommendedCompetitors].filter(ee=>ee.trim().length>2),fe=[{terms:it,className:"answer-highlight-brand"},...oe.length>0?[{terms:oe,className:"answer-highlight-competitor"}]:[]],$=L?"pending":O.visibilityTransition==="lost"?"lost":ae?"mentioned":"not-mentioned",W=q.useRef(0),pe=q.useCallback(async ee=>{const de=++W.current;if(ee===-1||ee===R.length-1){g(-1),x(null),l(!1);return}g(ee),l(!1);const ie=R[ee],Ae=`${ie.runId}::${e.query}::${e.provider}`;if(C[Ae]){x(C[Ae]);return}N(!0);try{const st=await vc(ie.runId);if(de!==W.current)return;const xe=st.snapshots?.find(Ze=>Ze.query===e.query&&Ze.provider===e.provider)??st.snapshots?.find(Ze=>Ze.query===e.query),Pe=xe?{citationState:xe.citationState,answerMentioned:xe.answerMentioned,visibilityState:xe.visibilityState,visibilityTransition:ie.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:Uf(ie.mentionTransition??ie.visibilityTransition,ie.mentionState??ie.visibilityState),summary:""}:{citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:Uf(ie.mentionTransition??ie.visibilityTransition,ie.mentionState??ie.visibilityState),summary:"Snapshot data not available for this run."};D(Ze=>({...Ze,[Ae]:Pe})),x(Pe)}catch{if(de!==W.current)return;x({citationState:ie.citationState,answerMentioned:ie.answerMentioned,visibilityState:ie.visibilityState,visibilityTransition:ie.visibilityTransition,provider:e.provider,model:ie.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],searchQueries:[],evidenceUrls:[],changeLabel:Uf(ie.mentionTransition??ie.visibilityTransition,ie.mentionState??ie.visibilityState),summary:"Failed to load historical run data."})}finally{de===W.current&&N(!1)}},[R,e.query,e.provider,C]),le=(re||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,Xe=!re&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",J=ae?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:le}:O.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:le}:L?{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:le},ue=()=>{if(!O.answerSnippet)return null;const ee=O.answerSnippet.split(`
|
|
58
|
-
`),de=[];let ie=[],Ae=0;const st=()=>{if(ie.length===0)return;const xe=ie.join(" ").trim();xe&&de.push(p.jsx("p",{className:de.length>0?"mt-2.5":"",children:Mv(xe,fe)},Ae++)),ie=[]};for(const xe of ee){const Pe=xe.trim();if(/^[-\u2013\u2014]{3,}$/.test(Pe)){st(),de.push(p.jsx("hr",{className:"border-default my-3"},Ae++));continue}const Ze=Pe.match(/^(#{1,3})\s+(\S.*)$/);if(Ze){st();const Bt=Ze[1].length,Hn=Ze[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||Ze[2],Lt=Bt===1?"text-[13px] font-semibold text-heading mt-4 mb-1":Bt===2?"text-xs font-semibold text-strong mt-3 mb-0.5":"text-xs font-medium text-neutral mt-2";de.push(p.jsx("p",{className:Lt,children:Mv(Hn,fe)},Ae++));continue}if(Pe===""){st();continue}ie.push(Pe)}return st(),de};return p.jsx(u0,{open:!0,onOpenChange:ee=>{ee||i()},children:p.jsxs(o0,{children:[p.jsx(xp,{className:"fixed inset-0 z-50 bg-overlay-scrim/80 backdrop-blur-sm"}),p.jsxs(wp,{className:"evidence-modal","aria-describedby":void 0,children:[p.jsxs("div",{className:"evidence-modal-header",children:[p.jsxs("div",{className:"min-w-0 flex-1",children:[p.jsxs("p",{className:"eyebrow eyebrow-soft",children:[n.project.name," ","·"," ",O.provider||"All providers"]}),p.jsx(jp,{className:"text-lg font-semibold text-primary truncate",children:e.query})]}),p.jsxs(l0,{className:"inline-flex size-8 items-center justify-center rounded-md text-muted transition hover:bg-mono-800 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 shrink-0",children:[p.jsx(rr,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]}),G&&p.jsxs("div",{className:"evidence-modal-timeline",children:[p.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),p.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:R.map((ee,de)=>{const ie=h===-1&&de===R.length-1||h===de,Ae=ee.visibilityState??(ee.answerMentioned?"visible":"not-visible"),st=ee.visibilityTransition??Ae,xe=Ae==="visible"?"bg-positive-400":st==="emerging"?"bg-caution-400":st==="lost"?"bg-negative-400":"bg-mono-600",Ze=new Date(ee.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Bt=!!(ee.model&&de>0&&R[de-1]?.model&&R[de-1].model!==ee.model);return p.jsxs("button",{type:"button",className:`evidence-run-dot ${ie?"evidence-run-dot--selected":""}`,onClick:()=>{pe(de===R.length-1?-1:de)},"aria-label":[`Run ${Ze}: ${Ae}`,ee.model?`model ${ee.model}`:null,Bt?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ie,children:[p.jsx("span",{className:`size-2 rounded-full ${xe} ${Bt?"ring-1 ring-caution-300/80 ring-offset-2 ring-offset-bg":""}`,"aria-hidden":"true"}),p.jsx("span",{className:"text-[10px] text-muted",children:Ze})]},de)})}),h>=0&&h<R.length&&p.jsxs("p",{className:"text-[11px] text-muted mt-1",children:["Viewing run from ",new Date(R[h].createdAt).toLocaleString()," ","—"," ",p.jsx("span",{className:"capitalize",children:R[h].visibilityState??(R[h].answerMentioned?"visible":"not-visible")}),p.jsxs("button",{type:"button",className:"text-secondary hover:text-strong ml-2",onClick:()=>{pe(-1)},children:["←"," Back to latest"]})]}),!re&&(e.modelTransitions?.length??0)>0&&p.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(ee=>p.jsx("span",{className:"inline-flex items-center rounded-full border border-caution-400/30 bg-caution-400/10 px-2 py-1 text-[10px] text-caution-100",children:`${ee.fromModel??"unknown"} -> ${ee.toModel??"unknown"} on ${new Date(ee.createdAt).toLocaleDateString()}`},`${ee.runId}:${ee.toModel??"unknown"}`))})]}),p.jsxs("div",{className:"evidence-modal-body",children:[w&&p.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-muted text-sm",children:["Loading historical run data","…"]}),!w&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{className:"evidence-modal-main",children:[p.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${$}`,children:[p.jsx("p",{className:`evidence-position-label evidence-position-label--${$}`,children:J.label}),p.jsx("p",{className:`evidence-position-title evidence-position-title--${$}`,children:J.title}),p.jsx("p",{className:"evidence-position-meta",children:J.meta}),Xe&&p.jsx("p",{className:"mt-1 text-[11px] text-muted",children:Xe})]}),O.answerSnippet&&p.jsxs("div",{children:[p.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),p.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:ue()}),O.answerSnippet.length>280&&p.jsx("button",{type:"button",className:"mt-1.5 text-xs text-muted hover:text-neutral transition-colors",onClick:()=>l(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!O.answerSnippet&&!w&&p.jsx("div",{className:"rounded-lg border border-subtle bg-surface-subtle px-4 py-8 text-center text-faint text-sm",children:"No answer text recorded for this run"}),O.searchQueries.length>0&&p.jsxs("div",{children:[p.jsxs("div",{className:"drawer-section-label flex items-center",children:[p.jsx("span",{children:"Web searches the model ran"}),p.jsx(po,{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)."})]}),p.jsx("ul",{className:"grid gap-1",children:O.searchQueries.map((ee,de)=>p.jsxs("li",{className:"flex items-start gap-2 text-sm text-neutral",children:[p.jsx(c2,{className:"size-3.5 mt-0.5 shrink-0 text-faint","aria-hidden":"true"}),p.jsx("span",{className:"break-words",children:ee})]},`${de}-${ee}`))})]}),!re&&e.relatedTechnicalSignals.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"drawer-section-label",children:ae?"Why you're visible":"What to fix"}),p.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((ee,de)=>p.jsxs("div",{className:"action-item",children:[p.jsx("svg",{className:`action-item-icon ${ae?"text-positive-400":"text-caution-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:ae?p.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):p.jsxs(p.Fragment,{children:[p.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),p.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),p.jsx("span",{className:"action-item-text",children:ee})]},de))})]}),O.summary&&p.jsx("p",{className:"text-xs text-faint border-t border-subtle pt-3 mt-1",children:O.summary})]}),p.jsxs("div",{className:"evidence-modal-sidebar",children:[(_e||Me)&&p.jsxs("div",{className:"sidebar-tabs",children:[p.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"}),p.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"&&p.jsxs(p.Fragment,{children:[p.jsxs("div",{children:[p.jsxs("div",{className:"drawer-section-label flex items-center",children:[p.jsx("span",{children:"Mention in answer"}),p.jsx(po,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),p.jsxs("div",{className:`mention-status mention-status--${ae?"mentioned":"not-mentioned"}`,children:[p.jsx("span",{className:"mention-status-icon",children:L?"…":ae?"✓":"—"}),p.jsx("span",{className:"mention-status-label",children:L?"Pending":ae?"Mentioned":"Not mentioned"})]}),O.matchedTerms.length>0&&p.jsxs("div",{className:"mt-2",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted mb-1.5",children:"Matched in answer"}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:O.matchedTerms.map(ee=>p.jsx("span",{className:"mention-chip mention-chip--brand",children:ee},ee))})]}),!L&&!ae&&O.matchedTerms.length===0&&p.jsxs("div",{className:"mt-2",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted mb-1.5",children:"Searched for"}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:it.map(ee=>p.jsx("span",{className:"mention-chip mention-chip--muted",children:ee},ee))}),p.jsx("p",{className:"text-[11px] text-faint mt-1.5",children:"None of these appear in the answer text."})]})]}),(O.recommendedCompetitors.length>0||O.competitorDomains.length>0)&&p.jsxs("div",{children:[p.jsxs("div",{className:"drawer-section-label flex items-center",children:[p.jsx("span",{children:"Competitors in answer"}),p.jsx(po,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const ee=O.competitorDomains.map(Ae=>Ae.replace(/^www\./,"")),de=new Set(ee.map(Ae=>Cc(Ae.replace(/\.[^.]+$/,""))));return[...O.recommendedCompetitors.filter(Ae=>!de.has(Cc(Ae))),...ee].map(Ae=>p.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ae},Ae))})()})]})]}),c==="sources"&&p.jsxs(p.Fragment,{children:[O.citedDomains.length>0&&p.jsxs("div",{children:[p.jsxs("div",{className:"drawer-section-label flex items-center",children:[p.jsx("span",{children:"Domains from source links"}),p.jsx(po,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),p.jsx("div",{className:"citation-leaderboard",children:O.citedDomains.map((ee,de)=>{const ie=ee.toLowerCase().replace(/^www\./,""),Ae=E.has(ie),st=!Ae&&O.competitorDomains.some(Pe=>Pe.toLowerCase().replace(/^www\./,"")===ie),xe=Ae?"you":st?"competitor":"other";return p.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${xe}`,children:[p.jsxs("span",{className:"citation-leaderboard-rank",children:["#",de+1]}),p.jsx("span",{className:"citation-leaderboard-domain",children:ee}),Ae&&p.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),st&&p.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},ee)})})]}),O.groundingSources.length>0&&p.jsxs("div",{children:[p.jsxs("div",{className:"drawer-section-label flex items-center",children:[p.jsxs("span",{children:["Grounding source links (",O.groundingSources.length,")"]}),p.jsx(po,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),p.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((ee,de)=>{const ie=up(ee.uri),Ae=ee.title||ee.uri;return p.jsx("li",{className:"truncate text-sm",children:ie?p.jsx("a",{href:ie,target:"_blank",rel:"noopener noreferrer",className:"text-secondary hover:text-strong transition-colors",children:Ae}):p.jsx("span",{className:"text-secondary",children:Ae})},de)})})]}),O.evidenceUrls.length>0&&p.jsxs("div",{children:[p.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),p.jsx("ul",{className:"grid gap-1",children:O.evidenceUrls.map(ee=>{const de=up(ee);return p.jsx("li",{className:"truncate text-sm",children:de?p.jsx("a",{href:de,target:"_blank",rel:"noopener noreferrer",className:"text-secondary hover:text-strong transition-colors",children:ee}):p.jsx("span",{className:"text-secondary",children:ee})},ee)})})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&p.jsxs("div",{className:"flex items-center justify-center h-24 text-faint text-sm",children:["No source data ",re?"for this run":"yet"]})]}),!_e&&!Me&&p.jsxs("div",{className:"flex items-center justify-center h-24 text-faint text-sm",children:["No answer visibility data ",re?"for this run":"yet"]})]})]})]})]})]})})}function PB(e){const n=e.match(/^\/projects\/([^/]+)/);if(!n)return null;try{return decodeURIComponent(n[1])}catch{return n[1]}}function VB(e,n){return e?n?.projects.find(r=>r.project.name===e||r.project.id===e)?.project.name??e:null}function GB(e,n){return VB(PB(e),n)}function $n(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 $f=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},providers:[],providerModels:{},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:[],providerModels:{},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:[],providerModels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Zc(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 HB=Zc({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"}),KB=Zc({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"}),QB=Zc({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"}),ZB=Zc({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"}),YB=[{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:$n(["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:$n(["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:$n(["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:$n(["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:$n(["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:$n(["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:$n(["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:$n(["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:$n(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];$f[0],Math.round(1/9*100),Math.round(2/9*100),$f[1],$n(["cited","cited","cited","cited","cited"]),$f[2],Math.round(2/7*100),Math.round(3/7*100),$n(["not-cited","not-cited","not-cited","cited"]);function FB(e,n){return e.runs.find(i=>i.id===n)}function XB(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 JB(e,n,i){if(e){const r=e.visibilityEvidence.find(l=>l.id===i);if(r)return{project:e,evidence:r}}if(n)return XB(n,i)}const WB={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-description-missing":"caution","gbp-metric-drop":"negative","gbp-keyword-drop":"negative"},eL={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-description-missing":"write","gbp-metric-drop":"investigate","gbp-keyword-drop":"investigate"},tL={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-description-missing":"not-cited","gbp-metric-drop":"lost","gbp-keyword-drop":"lost"},nL={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-description-missing":"Description gap","gbp-metric-drop":"Metric drop","gbp-keyword-drop":"Keyword drop"};function aL(e){return{id:e.id,tone:WB[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??nL[e.type],actionGroup:eL[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:tL[e.type]}]}}function iL(e){return e.filter(n=>!n.dismissed).map(aL)}function O1(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??[],providerModels:e.providerModels??{},locations:e.locations??[],defaultLocation:e.defaultLocation??null,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Bv(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function sL(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 Ce["answer-visibility"]:return"Answer visibility sweep";case Ce["gsc-sync"]:return"GSC sync";case Ce["inspect-sitemap"]:return"Sitemap inspection";case Ce["ga-sync"]:return"GA sync";case Ce["traffic-sync"]:return"Traffic sync";case Ce["bing-inspect"]:return"Bing URL inspection";case Ce["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ce["site-audit"]:return"Site audit";case Ce["backlink-extract"]:return"Backlink extract";case Ce["aeo-discover-seed"]:return"Discovery (seed phase)";case Ce["aeo-discover-probe"]:return"Discovery (probe phase)";case Ce["gbp-sync"]:return"Business Profile sync";case Ce["ads-sync"]:return"ChatGPT ads sync"}}function rL(e){return e===Qs.manual?"Manual":e===Qs.scheduled?"Scheduled":e===Qs["config-apply"]?"Config apply":e}function Yc(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?Bv(e.startedAt):Bv(e.createdAt),duration:sL(e.startedAt??null,e.finishedAt??null),statusDetail:e.error?z1(e.error):oL(e),summary:lL(e),triggerLabel:rL(e.trigger)}}function z1(e){const n=Pp(e);return n.length>200?n.slice(0,200)+"…":n}function oL(e){switch(e.status){case Yt.queued:return"Waiting for execution slot.";case Yt.running:return"Provider queries in progress.";case Yt.completed:return"All queries checked.";case Yt.partial:return"Run completed with some queries skipped.";case Yt.failed:return e.error?z1(e.error):"Run failed.";case Yt.cancelled:return"Run was cancelled.";default:return""}}function lL(e){const n=D1(e.kind);switch(e.status){case Yt.queued:return`${n} queued`;case Yt.running:return`${n} in progress`;case Yt.completed:return`${n} completed`;case Yt.partial:return`${n} partially completed`;case Yt.failed:return`${n} failed`;case Yt.cancelled:return`${n} cancelled`;default:return e.status}}function cL(e,n,i,r){const l=[];let c=0;const d=new Set;if(i.length>0){const h=i.flatMap(D=>D.snapshots??[]),g=new Map;for(const D of h)if(D.query){const A=`${D.query}::${D.provider}::${D.location??""}`;g.set(A,D)}const b=new Set(h.map(D=>D.location??null));b.size===0&&b.add(null);const x=new Set(h.map(D=>D.provider)),w=new Set(n.flatMap(D=>Object.keys(D.providerRuns??{}))),N=[...new Set([...x,...w])].sort(),C=N.length>0?N:["gemini"];for(const D of n){if(D.runs.length===0)continue;d.add(D.query);const A=D.runs.at(-1),E=A?.transition??"not-cited";for(const R of C){const G=[...b].filter(P=>g.has(`${D.query}::${R}::${P??""}`)),X=(D.providerRuns?.[R]?.length??0)>0,V=G.length>0?G:X?[null]:[];for(const P of V){const re=P??"",O=g.get(`${D.query}::${R}::${re}`),L=O?.model??null,ae=L?`${R}:${L}`:null,_e=D.providerRuns?.[R],Me=ae?D.modelRuns?.[ae]:void 0,ve=Pe=>Pe?.filter(Ze=>(Ze.location??null)===P),it=G.length>0?ve(_e):_e,oe=G.length>0?ve(Me):Me,fe=(it?.length?it:null)??(oe?.length?oe:null),$=it?.length?"provider":oe?.length?"model":"query",W=fe?fe.at(-1).transition:E,pe=fe?fe.at(-1).visibilityTransition??(fe.at(-1).visibilityState==="visible"?"visible":"not-visible"):A?.visibilityTransition??(A?.visibilityState==="visible"?"visible":"not-visible"),je=fe?.at(-1)?.citationState,le=fe?.at(-1)?.visibilityState,Xe=O?W==="lost"?"lost":W==="emerging"?"emerging":O.citationState===kc.cited?"cited":"not-cited":je===kc.cited?"cited":"not-cited",J=O?.visibilityState??(le==="visible"?"visible":le==="pending"?"pending":"not-visible"),ue=Lv(fe||D.runs),ee=qv(fe||D.runs),de=uL(D,R),ie=(fe??D.runs).map(Pe=>({runId:Pe.runId,citationState:Pe.citationState,createdAt:Pe.createdAt,model:de.get(Pe.runId)??null,answerMentioned:Pe.answerMentioned,visibilityState:Pe.visibilityState,visibilityTransition:Pe.visibilityTransition,mentionState:Pe.mentionState,mentionTransition:Pe.mentionTransition})),Ae=dL(ie),st=$==="provider"&&Ae.length<=1?"model":$,xe=fL(ie);l.push({id:`evidence_${e}_${c++}`,query:D.query,provider:O?.provider??R,model:O?.model??null,location:O?.location??P,citationState:Xe,answerMentioned:O?.answerMentioned,visibilityState:J,visibilityChangeLabel:Uv(pe,ee,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:Uv(W,ue),answerSnippet:O?.answerText??"",citedDomains:O?.citedDomains??[],evidenceUrls:[],competitorDomains:O?.competitorOverlap??[],recommendedCompetitors:O?.recommendedCompetitors??[],matchedTerms:O?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:O?.groundingSources??[],searchQueries:O?.searchQueries??[],summary:pL(J,pe,D.query),runHistory:ie,historyScope:st,modelsSeen:Ae,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 uL(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 dL(e){const n=new Set;for(const i of e)i.model&&n.add(i.model);return[...n]}function fL(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 Lv(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 qv(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 Uv(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?`${mo(r.positive)} in latest run`:`${mo(r.positive)} for ${n} runs`;case"lost":return"Lost since last run";case"emerging":return mo(r.first);case"not-cited":case"not-visible":return n<=1?`${mo(r.negative)} in latest run`:`${mo(r.negative)} across ${n} runs`;default:return e}}function mo(e){return e.charAt(0).toUpperCase()+e.slice(1)}function pL(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 R1(e){const n=O1(e.project),i=cL(n.name,e.timeline,e.latestRunDetails,e.queries),l=[...e.runs].sort((c,d)=>d.createdAt.localeCompare(c.createdAt)).map(c=>Yc(c,e.project.displayName||e.project.name));return e.overview?mL(n,e.overview,i,l):hL(n,i,l)}function mL(e,n,i,r){const l=iL(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,citationMovement:n.citationMovement,mentionMovement:n.mentionMovement,movementComparison:n.movementComparison,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 hL(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"},citationMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},mentionMovement:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},movementComparison:{hasPreviousRun:!1,comparable:!1,querySetChanged:!1,previousRunAt:null,currentQueryCount:0,previousQueryCount:0,comparableQueryCount:0,addedQueryCount:0,removedQueryCount:0,addedQueries:[],removedQueries:[]},insights:[],visibilityEvidence:n,competitors:[],recentRuns:i.slice(0,5),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function gL(e){const n=O1(e.project),i=[...e.runs].sort((N,C)=>C.createdAt.localeCompare(N.createdAt)),r=i.find(N=>N.kind===Ce["answer-visibility"])??i[0]??e.overview?.latestRun?.run??void 0,l=e.project.displayName||e.project.name,c=r?Yc(r,l):yL(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,x=d.queryCounts.totalQueries,w=d.providers.length;return{project:n,mentionScore:g,mentionDelta:x>0?`${b} of ${x} queries`:"No data",mentionTone:h.tone,providerCoverage:h.providerCoverage,lastRun:c,insight:x>0?`${b} of ${x} queries mentioned across ${w} provider${w===1?"":"s"}.`:"No runs completed yet.",trend:h.trend??[],competitorPressureLabel:d.scores.competitorPressure.value}}function yL(e,n){return{id:"none",projectId:e,projectName:n,kind:Ce["answer-visibility"],kindLabel:"No runs yet",status:Yt.queued,trigger:Qs.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function bL(e,n){const i=[],r=[],l=[];for(const d of e){r.push(R1(d)),l.push(gL(d));const h=[...d.runs].sort((g,b)=>b.createdAt.localeCompare(g.createdAt));for(const g of h)i.push(Yc(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?vL(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 vL(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/${encodeURIComponent(i.project.name)}`});const l=i.recentRuns.filter(c=>c.status===Yt.running||c.status===Yt.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 Eo(){return q.useContext(M1)}function Fc(e,n={}){const r=Eo()?.dashboard??null,l=n.includeSettings??!0,c=on({...Hc({client:ne}),enabled:!r,refetchInterval:mC}),d=on({...um({client:ne,query:{kind:"answer-visibility"}}),enabled:!r,staleTime:Xs,refetchInterval:E=>E.state.data?.some(X=>X.status==="running"||X.status==="queued")?3e3:Xs}),h=on({...U3({client:ne}),enabled:!r&&l}),g=c.data??[],b=d.data??[],x=Uj({queries:g.map(E=>{const R=b.filter(V=>V.projectId===E.id),G=R.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,P)=>P.createdAt.localeCompare(V.createdAt)),X=G.length>0?G[0].id:"no-run";return{queryKey:["project-overview-slim",E.id,X],queryFn:async()=>{const V=await A0(E.name).catch(()=>null);return{project:E,runs:R,queries:[],competitors:[],timeline:[],latestRunDetails:[],previousRunDetails:[],gscCoverage:null,bingCoverage:null,dbInsights:null,overview:V}},enabled:!r&&c.isSuccess&&d.isSuccess,staleTime:Jf}})}),w=x.every(E=>E.isSuccess),N=q.useMemo(()=>{if(r)return r;if(!c.data||!d.data||g.length>0&&!w)return null;const E=x.map(R=>R.data?{...R.data,runs:b.filter(G=>G.projectId===R.data.project.id)}:null).filter(R=>R!=null);return bL(E,h.data??null)},[r,c.data,d.data,h.data,w,x,g.length,b]),C=!r&&(c.isError||d.isError),D=!r&&!N&&!C,A=q.useCallback(async()=>{const E=[c.refetch(),d.refetch()];l&&E.push(h.refetch()),await Promise.all(E)},[l,c.refetch,d.refetch,h.refetch]);return{dashboard:N,isLoading:D,isError:C,refetch:A}}const SL=20;function xL(e){const n=Eo(),i=q.useMemo(()=>!n||!e?null:n.dashboard.projects.find(A=>A.project.name===e)??null,[n,e]),r=on({...O3({client:ne,path:{name:e??""}}),enabled:!!e&&!i,staleTime:Jf,refetchOnWindowFocus:"always"}),l=on({...z3({client:ne,path:{name:e??""},query:{kind:"answer-visibility"}}),enabled:!!e,staleTime:Xs,refetchOnWindowFocus:"always",refetchInterval:A=>A.state.data?.some(G=>G.projectId===r.data?.id&&(G.status==="running"||G.status==="queued"))?3e3:Xs}),c=r.data??null,d=q.useMemo(()=>c?(l.data??[]).filter(A=>A.projectId===c.id):[],[c,l.data]),{latestRunIds:h,previousRunIds:g,latestRunIdsKey:b,latestVisibilityRevision:x}=q.useMemo(()=>{const A=d.filter(V=>(V.status==="completed"||V.status==="partial")&&V.kind==="answer-visibility"&&V.trigger!=="probe").sort((V,P)=>P.createdAt.localeCompare(V.createdAt)),E=A[0]?.createdAt??null,R=E?A.filter(V=>V.createdAt===E).map(V=>V.id):[],G=A.find(V=>V.createdAt!==E)?.createdAt??null,X=G?A.filter(V=>V.createdAt===G).map(V=>V.id):[];return{latestRunIds:R,previousRunIds:X,latestRunIdsKey:[...R].sort().join(","),latestVisibilityRevision:E?`${E}:${[...R].sort().join(",")}`:"none"}},[d]),w=on({queryKey:["project-dashboard-full",c?.id??null,b||"none"],queryFn:async()=>{if(!c||!e)return null;const[A,E,R,G,X,V,P,re,O]=await Promise.all([qA(e).catch(()=>[]),UA(e).catch(()=>[]),$A(e,void 0,SL).catch(()=>[]),h.length?Promise.all(h.map(L=>vc(L).catch(()=>null))).then(L=>L.filter(ae=>ae!=null)):Promise.resolve([]),g.length?Promise.all(g.map(L=>vc(L).catch(()=>null))).then(L=>L.filter(ae=>ae!=null)):Promise.resolve([]),WA(e).catch(()=>null),aC(e).catch(()=>null),iC(e).catch(()=>null),A0(e).catch(()=>null)]);return{project:c,runs:d,queries:A,competitors:E,timeline:R,latestRunDetails:G,previousRunDetails:X,gscCoverage:V,bingCoverage:P,dbInsights:re,overview:O}},enabled:!!c&&!!e&&l.isSuccess,staleTime:Jf,refetchOnWindowFocus:"always"}),N=q.useMemo(()=>w.data?R1({...w.data,runs:d}):i||null,[w.data,d,i]),C=q.useCallback(async()=>{await Promise.all([r.refetch(),l.refetch(),w.refetch()])},[r.refetch,l.refetch,w.refetch]),D=!N&&(r.isLoading||l.isLoading||w.isLoading);return{commandCenter:N,project:c,isLoading:D,isError:r.isError||l.isError||w.isError,latestVisibilityRevision:x,refetch:C}}const wL=["health"];async function jL(){const e=await rC("/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 hm(e,n){return on({queryKey:wL,queryFn:jL,enabled:e,refetchInterval:15e3,initialData:n})}function NL(e){return on({...r1({client:ne,path:{id:e??""}}),enabled:!!e,refetchInterval:n=>{const i=n.state.data?.status;return i==="running"||i==="queued"?3e3:!1}})}function gm(){const e=Dc(),n=$j({strict:!1}),i=Ij({select:g=>g.location.pathname}),r=n.runId??null,l=n.evidenceId??null;return{runId:r,evidenceId:l,openRun:g=>{e({to:i,from:Jt.to,search:b=>({...b,runId:g,evidenceId:void 0})})},openEvidence:g=>{e({to:i,from:Jt.to,search:b=>({...b,evidenceId:g,runId:void 0})})},closeDrawer:()=>{e({to:i,from:Jt.to,search:g=>({...g,runId:void 0,evidenceId:void 0})})}}}const kL={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function AL(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function CL(){const e=q.useSyncExternalStore(fC,Lb,Lb),n=Dc(),{openRun:i}=gm(),r=q.useCallback(c=>{Xf(c)},[]),l=q.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?i(c.cta.runId):n({to:"/runs"}),Xf(c.id))},[n,i]);return e.length===0?null:p.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>p.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${kL[c.tone]}`,children:[p.jsxs("div",{className:"toast-copy",children:[p.jsx("p",{className:"toast-title",children:c.title}),c.detail?p.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?p.jsx("button",{type:"button",className:"toast-action",onClick:()=>l(c),"aria-label":AL(c),children:c.cta.label}):null]}),p.jsx("button",{type:"button",onClick:()=>r(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:p.jsx(rr,{className:"size-3.5"})})]},c.id))})}function bo(e){switch(e){case Ce["answer-visibility"]:return"Visibility sweep";case Ce["gsc-sync"]:return"GSC sync";case Ce["inspect-sitemap"]:return"Sitemap inspection";case Ce["ga-sync"]:return"GA sync";case Ce["traffic-sync"]:return"Traffic sync";case Ce["bing-inspect"]:return"Bing URL inspection";case Ce["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ce["site-audit"]:return"Technical audit";case Ce["backlink-extract"]:return"Backlink extract";case Ce["aeo-discover-seed"]:return"Discovery (seed phase)";case Ce["aeo-discover-probe"]:return"Discovery (probe phase)";case Ce["gbp-sync"]:return"Business Profile sync";case Ce["ads-sync"]:return"ChatGPT ads sync"}}function $v(e){return e==="running"?"Running":e==="queued"?"Queued":e==="partial"?"Partial":e==="completed"?"Completed":e==="failed"?"Failed":e==="cancelled"?"Cancelled":"Starting"}function _L(){const e=q.useSyncExternalStore(u1,Na,Na),n=q.useMemo(()=>Object.values(e.runs),[e.runs]),i=n.length>0,r=on({...um({client:ne}),enabled:i,staleTime:Xs}),l=q.useMemo(()=>new Map((r.data??[]).map(h=>[h.id,h.status])),[r.data]);if(!i)return null;const c=n.map(h=>({...h,status:l.get(h.runId)??h.lastAnnouncedStatus})),d=c.length===1?bo(c[0].kind):`${c.length} active tasks`;return p.jsxs("div",{className:"task-center",children:[p.jsxs("p",{className:"sr-only",role:"status","aria-live":"polite",children:[c.length," active ",c.length===1?"task":"tasks","."," ",c.map(h=>`${bo(h.kind)} ${$v(h.status)}`).join(". "),"."]}),p.jsxs("details",{className:"task-center-details",children:[p.jsxs("summary",{className:"task-center-trigger",children:[p.jsx(D0,{className:"size-3.5 shrink-0 motion-safe:animate-spin","aria-hidden":"true"}),p.jsx("span",{className:"task-center-summary",children:d}),p.jsx("span",{className:"task-center-count","aria-hidden":"true",children:c.length}),p.jsx(O0,{className:"task-center-chevron size-3.5 shrink-0","aria-hidden":"true"})]}),p.jsxs("div",{className:"task-center-panel",children:[p.jsxs("div",{className:"task-center-heading",children:[p.jsx("span",{children:"Active tasks"}),p.jsx("span",{className:"tabular-nums text-faint",children:c.length})]}),p.jsx("ul",{className:"task-center-list",children:c.map(h=>p.jsxs("li",{className:"task-center-item",children:[p.jsxs("div",{className:"min-w-0",children:[p.jsx("p",{className:"truncate text-[13px] font-medium text-strong",children:bo(h.kind)}),p.jsx("p",{className:"mt-0.5 truncate text-xs text-muted",children:h.projectLabel??h.projectId})]}),p.jsx(Cn,{tone:h.status==="failed"?"negative":h.status==="partial"?"caution":"neutral",children:$v(h.status)})]},h.runId))}),p.jsx(tt,{to:"/runs",className:"task-center-footer-link",children:"View all runs"})]})]})]})}function TL(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 x=g.scrollHeight;x>l.current.scrollHeight&&l.current.wasAtEnd&&(g.scrollTop=x),l.current.scrollHeight=x});return b.observe(g),g.firstElementChild&&b.observe(g.firstElementChild),()=>b.disconnect()},[]),{ref:r,scrollToEnd:h,isAtEnd:d}}async function ym(e){try{return await e.json()}catch{return{}}}function EL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const bm=EL();function vm(e){e===401&&Cp()}async function Iv(e){const n=await fetch(`${bm}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!n.ok){vm(n.status);const i=await ym(n);throw new In(i.error?.message??`transcript fetch failed: ${n.status}`,n.status,i.error?.code)}return await n.json()}async function OL(e){const n=await fetch(`${bm}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!n.ok){vm(n.status);const i=await ym(n);throw new In(i.error?.message??`reset failed: ${n.status}`,n.status,i.error?.code)}}async function DL({project:e,prompt:n,provider:i,modelId:r,scope:l,profile:c,signal:d,onEvent:h}){const g={prompt:n};i&&(g.provider=i),r&&(g.modelId=r),l&&(g.scope=l),c&&(g.profile=c);const b=await fetch(`${bm}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(g),signal:d});if(!b.ok||!b.body){vm(b.status);const D=await ym(b);throw new In(D.error?.message??`prompt failed: ${b.status}`,b.status,D.error?.code)}const x=b.body.getReader(),w=new TextDecoder;let N="";const C=()=>{x.cancel().catch(()=>{})};d?.addEventListener("abort",C,{once:!0});try{for(;;){const{value:D,done:A}=await x.read();if(A)break;N+=w.decode(D,{stream:!0});let E=N.indexOf(`
|
|
59
|
-
|
|
60
|
-
`);for(;E!==-1;){const R=N.slice(0,E);N=N.slice(E+2);for(const G of R.split(`
|
|
61
|
-
`)){if(!G.startsWith("data:"))continue;const X=G.slice(5).trim();if(X)try{h(JSON.parse(X))}catch{}}E=N.indexOf(`
|
|
62
|
-
|
|
63
|
-
`)}}}finally{d?.removeEventListener("abort",C);try{x.releaseLock()}catch{}}}function B1(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const zL=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],RL=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],lc=e=>`canonry:aero:provider:${e}`,Pv=e=>`canonry:aero:scope:${e}`;function ML({projectName:e}){const[n,i]=q.useState(!1),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState(""),[b,x]=q.useState(!1),[w,N]=q.useState([]),[C,D]=q.useState(""),[A,E]=q.useState(null),[R,G]=q.useState(()=>typeof window>"u"?null:window.localStorage.getItem(lc(e))??null),[X,V]=q.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Pv(e))==="all"?"all":"read-only"),P=q.useRef(null),{ref:re}=TL([c,C,w]),O=q.useRef(null),[L,ae]=q.useState(0),_e=q.useMemo(()=>{const J=h.trimStart();if(!J.startsWith("/"))return[];if(/\s/.test(J))return[];const ue=J.toLowerCase();return RL.filter(ee=>ee.command.startsWith(ue)||ee.label.toLowerCase().includes(ue.slice(1)))},[h]);q.useEffect(()=>{ae(J=>_e.length===0?0:Math.min(J,_e.length-1))},[_e.length]);const Me=on({...NM({client:ne,path:{name:e}}),enabled:n,staleTime:6e4}),ve=q.useMemo(()=>{const J=Me.data?.providers??[];if(R){const ee=J.find(de=>de.id===R&&de.configured);if(ee)return ee}const ue=Me.data?.defaultProvider;return ue?J.find(ee=>ee.id===ue)??null:null},[R,Me.data]);q.useEffect(()=>{if(!Me.data||!R)return;Me.data.providers.find(ue=>ue.id===R&&ue.configured)||(G(null),window.localStorage.removeItem(lc(e)))},[Me.data,R,e]);const it=q.useCallback(J=>{G(J),!(typeof window>"u")&&(J?window.localStorage.setItem(lc(e),J):window.localStorage.removeItem(lc(e)))},[e]),oe=q.useCallback(()=>{V(J=>{const ue=J==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Pv(e),ue),ue})},[e]);q.useEffect(()=>{if(!n)return;const J=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n,r]),q.useEffect(()=>{if(!n)return;let J=!1;E(null);const ue=()=>{J||b||Iv(e).then(ie=>{J||d(ie.messages)}).catch(ie=>{J||E(ie instanceof Error?ie.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{J=!0,window.clearInterval(de)}},[n,e,b]),q.useEffect(()=>()=>{P.current?.abort()},[e]);async function fe(J){const ue=J.trim();if(!ue||b)return;E(null),g(""),x(!0),D(""),N([]);const ee={role:"user",content:ue,timestamp:Date.now()};d(ie=>[...ie,ee]);const de=new AbortController;P.current=de;try{await DL({project:e,prompt:ue,provider:R??void 0,scope:X,signal:de.signal,onEvent:$});const ie=await Iv(e);d(ie.messages)}catch(ie){ie.name!=="AbortError"&&E(ie instanceof Error?ie.message:"Prompt failed")}finally{x(!1),D(""),P.current=null}}function $(J){switch(J.type){case"message_update":D(B1(J.message));break;case"message_end":J.message.role==="assistant"&&D("");break;case"tool_execution_start":N(ue=>[...ue,{id:J.toolCallId,name:J.toolName,args:J.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(ee=>ee.id===J.toolCallId?{...ee,endedAt:Date.now(),isError:J.isError,result:J.result}:ee));break;case"error":E(J.message);break}}async function W(){P.current?.abort();try{await OL(e),d([]),E(null)}catch(J){E(J instanceof Error?J.message:"Reset failed")}}const pe=c.length===0,je=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-bg/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",le=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-mono-800/80 bg-bg/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Xe=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-strong":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-strong";return p.jsx("div",{className:je,onClick:J=>{r&&J.target===J.currentTarget&&l(!1)},children:p.jsx("div",{className:le,children:n?p.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-mono-800/80 bg-bg/95 shadow-xl backdrop-blur",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-mono-800/70 px-4 py-2.5",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(Ib,{className:"h-4 w-4 text-positive-400","aria-hidden":"true"}),p.jsx("span",{className:"text-sm font-medium text-heading",children:"Aero"}),p.jsx("span",{className:"text-[10px] uppercase tracking-wider text-muted",children:b?"working…":e})]}),p.jsxs("div",{className:"flex items-center gap-1",children:[p.jsx(BL,{providers:Me.data?.providers??[],active:ve,override:R,onPick:it,disabled:b}),p.jsx("button",{type:"button",onClick:_n(W),className:"rounded-md p-1.5 text-muted transition hover:bg-surface-inset hover:text-strong","aria-label":"Reset conversation",title:"Reset conversation",children:p.jsx(z0,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),p.jsx("button",{type:"button",onClick:()=>l(J=>!J),className:"rounded-md p-1.5 text-muted transition hover:bg-surface-inset hover:text-strong","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?p.jsx(JC,{className:"h-3.5 w-3.5","aria-hidden":"true"}):p.jsx(ZC,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),p.jsx("button",{type:"button",onClick:()=>{l(!1),i(!1)},className:"rounded-md p-1.5 text-muted transition hover:bg-surface-inset hover:text-strong","aria-label":"Close Aero",children:p.jsx(rr,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),p.jsxs("div",{ref:re,className:Xe,children:[A&&p.jsx("div",{className:"mb-2 rounded-md border border-negative-700/40 bg-negative-950/40 px-3 py-2 text-xs text-negative-200",children:A}),pe&&!b&&p.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[p.jsxs("p",{className:"text-xs text-muted",children:["Ask anything about ",p.jsx("span",{className:"text-neutral",children:e}),", or start with:"]}),p.jsx("div",{className:"flex flex-wrap gap-1.5",children:zL.map(J=>p.jsx("button",{type:"button",onClick:()=>{fe(J.prompt)},className:"rounded-full border border-base bg-bg-elevated/70 px-3 py-1 text-xs text-neutral transition hover:border-strong hover:bg-mono-800/70 hover:text-heading",children:J.label},J.label))})]}),IL(c,e,R,X),w.length>0&&p.jsx("div",{className:"mt-3 space-y-1.5",children:w.map(J=>p.jsx(L1,{trail:J},J.id))}),b&&C&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-positive-400",children:"Aero"}),p.jsx(q1,{content:C})]}),b&&!C&&w.every(J=>J.endedAt!==void 0)&&p.jsx(HL,{})]}),p.jsx(LL,{projectName:e,activeProvider:ve,scope:X,onToggleScope:oe,disabled:b}),p.jsxs("div",{className:"relative",children:[_e.length>0&&p.jsx(qL,{matches:_e,selectedIndex:L,onHover:ae,onPick:J=>{g(""),O.current?.focus(),J.action==="clear"?W():fe(J.prompt)}}),p.jsxs("form",{className:"flex items-end gap-2 border-t border-mono-800/70 bg-bg/80 px-3 py-2.5",onSubmit:J=>{if(J.preventDefault(),_e.length>0){const ue=_e[L];g(""),ue.action==="clear"?W():fe(ue.prompt);return}fe(h)},children:[p.jsx("textarea",{ref:O,value:h,onChange:J=>g(J.target.value),onKeyDown:J=>{if(_e.length>0){if(J.key==="ArrowDown"){J.preventDefault(),ae(ue=>(ue+1)%_e.length);return}if(J.key==="ArrowUp"){J.preventDefault(),ae(ue=>(ue-1+_e.length)%_e.length);return}if(J.key==="Tab"){J.preventDefault();const ue=_e[L];g(`${ue.command} `);return}if(J.key==="Escape"){J.preventDefault(),g("");return}}if(J.key==="Enter"&&!J.shiftKey)if(J.preventDefault(),_e.length>0){const ue=_e[L];g(""),ue.action==="clear"?W():fe(ue.prompt)}else fe(h)},placeholder:"Ask Aero, or / for commands…",disabled:b,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-heading placeholder:text-mono-600 focus:outline-none disabled:opacity-60"}),p.jsx("button",{type:"submit",disabled:b||!h.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-positive-500 text-accent-fg transition hover:bg-positive-400 disabled:opacity-40","aria-label":"Send",children:p.jsx(AC,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):p.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full items-center justify-between rounded-full border border-mono-800/80 bg-bg/95 px-4 py-2 text-left text-sm text-secondary shadow-lg backdrop-blur transition hover:border-strong hover:bg-bg-elevated/90 hover:text-strong",children:[p.jsxs("span",{className:"flex items-center gap-2",children:[p.jsx(Ib,{className:"h-4 w-4 text-positive-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),p.jsx("span",{className:"text-[10px] uppercase tracking-wider text-faint",children:"Enter"})]})})})}function BL({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=q.useState(!1),h=q.useRef(null);if(q.useEffect(()=>{if(!c)return;const x=N=>{h.current?.contains(N.target)||d(!1)},w=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",x),window.addEventListener("keydown",w),()=>{window.removeEventListener("mousedown",x),window.removeEventListener("keydown",w)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",b=n?.defaultModel;return p.jsxs("div",{ref:h,className:"relative",children:[p.jsxs("button",{type:"button",onClick:()=>d(x=>!x),disabled:l,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-secondary transition hover:bg-surface-inset hover:text-strong disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":c,title:n?`${n.label} · ${n.defaultModel}`:"Pick a provider",children:[p.jsx("span",{className:"font-medium text-strong",children:g}),b&&p.jsx("span",{className:"hidden font-mono text-[10px] text-muted sm:inline",children:b}),p.jsx(O0,{className:"h-3 w-3","aria-hidden":"true"})]}),c&&p.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-base bg-bg shadow-xl",children:[p.jsx("div",{className:"border-b border-default px-3 py-2 text-[10px] uppercase tracking-wider text-muted",children:"Aero provider"}),p.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(x=>{const w=n?.id===x.id,N=i===x.id;return p.jsx("li",{children:p.jsxs("button",{type:"button",role:"option","aria-selected":w,disabled:!x.configured,onClick:()=>{x.configured&&(r(N?null:x.id),d(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-50",children:[p.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:w?p.jsx(E0,{className:"h-3 w-3 text-positive-400","aria-hidden":"true"}):null}),p.jsxs("span",{className:"flex-1",children:[p.jsxs("span",{className:"flex items-center gap-1.5",children:[p.jsx("span",{className:"font-medium text-heading",children:x.label}),N&&p.jsx("span",{className:"rounded-full border border-positive-800/60 bg-positive-950/60 px-1.5 text-[9px] uppercase tracking-wider text-positive",children:"Pinned"}),!x.configured&&p.jsx("span",{className:"rounded-full border border-base px-1.5 text-[9px] uppercase tracking-wider text-muted",children:"Key missing"})]}),p.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-muted",children:x.defaultModel}),x.keySource==="env"&&p.jsx("span",{className:"mt-0.5 block text-[10px] text-faint",children:"via env var"}),!x.configured&&p.jsxs("span",{className:"mt-0.5 block text-[10px] text-faint",children:["Add key in config.yaml or export"," ",p.jsx("code",{className:"font-mono text-secondary",children:UL(x.id)})]})]})]})},x.id)})}),i&&p.jsx("button",{type:"button",onClick:()=>{r(null),d(!1)},className:"w-full border-t border-default px-3 py-2 text-left text-[11px] text-secondary transition hover:bg-bg-elevated hover:text-heading",children:"Reset to auto-detected default"})]})]})}function LL({projectName:e,activeProvider:n,scope:i,onToggleScope:r,disabled:l}){const c=n?.label.replace(/\s+\(.+\)$/,"")??null,d=i==="all";return p.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-mono-800/70 bg-bg/80 px-3 pt-2",children:[p.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-base bg-bg-elevated/70 px-2 py-0.5 text-[10px] text-secondary",children:[p.jsx("span",{className:"text-faint",children:"project"}),p.jsx("span",{className:"font-medium text-strong",children:e})]}),c&&p.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-base bg-bg-elevated/70 px-2 py-0.5 text-[10px] text-secondary",children:[p.jsx("span",{className:"text-faint",children:"model"}),p.jsx("span",{className:"font-medium text-strong",children:c})]}),p.jsxs("button",{type:"button",onClick:r,disabled:l,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${d?"border-caution-800/60 bg-caution-950/40 text-caution hover:border-caution-700 hover:text-caution-200":"border-base bg-bg-elevated/70 text-secondary hover:border-strong hover:text-strong"}`,title:d?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[p.jsx("span",{className:d?"text-caution-500":"text-faint",children:"scope"}),p.jsx("span",{className:"font-medium",children:d?"all tools":"read-only"})]})]})}function qL({matches:e,selectedIndex:n,onHover:i,onPick:r}){return p.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-base bg-bg/98 shadow-2xl",children:[p.jsx("div",{className:"border-b border-default px-3 py-1.5 text-[10px] uppercase tracking-wider text-muted",children:"Commands"}),p.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((l,c)=>{const d=c===n;return p.jsx("li",{children:p.jsxs("button",{type:"button",role:"option","aria-selected":d,onMouseEnter:()=>i(c),onClick:()=>r(l),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${d?"bg-bg-elevated text-heading":"text-neutral hover:bg-bg-elevated/60"}`,children:[p.jsx("span",{className:"font-mono text-[11px] text-positive-400",children:l.command}),p.jsx("span",{className:"font-medium",children:l.label}),p.jsx("span",{className:"ml-auto text-[10px] text-muted",children:l.hint})]})},l.command)})}),p.jsxs("div",{className:"border-t border-default px-3 py-1.5 text-[10px] text-faint",children:[p.jsx("span",{className:"mr-3",children:"↑↓ to select"}),p.jsx("span",{className:"mr-3",children:"Enter to run"}),p.jsx("span",{children:"Tab to autocomplete"})]})]})}function UL(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY";case"deepinfra":return"DEEPINFRA_TOKEN"}}function $L(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function IL(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=$L(d,c);if(d.role==="user"){const g=typeof d.content=="string"?d.content:JSON.stringify(d.content);if(g.startsWith("[system]"))continue;l.push(p.jsx(PL,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let b=c+1;for(;b<e.length&&e[b].role==="toolResult";){const N=e[b];g.set(N.toolCallId,N),b++}const x=GL(d,g,d.timestamp??0),w=B1(d);l.push(p.jsxs(q.Fragment,{children:[x.length>0&&p.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(N=>p.jsx(L1,{trail:N},N.id))}),w.trim()&&p.jsxs("div",{className:"mt-3",children:[p.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-positive-400",children:"Aero"}),p.jsx(q1,{content:w})]})]},h)),c=b-1;continue}}return l}function PL({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=q.useState(!1),d=q.useMemo(()=>VL(n,e,i,r),[n,e,i,r]);async function h(){try{await navigator.clipboard.writeText(d),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return p.jsxs("div",{className:"group relative mt-3 rounded-md bg-bg-elevated/60 px-3 py-2 text-strong",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted",children:"You"}),p.jsx("button",{type:"button",onClick:_n(h),className:"inline-flex items-center gap-1 rounded border border-mono-800/70 bg-bg/60 px-1.5 py-0.5 text-[10px] text-secondary opacity-0 transition hover:border-strong hover:text-heading group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:d,children:l?p.jsxs(p.Fragment,{children:[p.jsx(E0,{className:"h-2.5 w-2.5 text-positive-400","aria-hidden":"true"}),"Copied"]}):p.jsxs(p.Fragment,{children:[p.jsx(zC,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),p.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function VL(e,n,i,r){const l=["canonry","agent","ask",Vv(e),Vv(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Vv(e){return`'${e.replace(/'/g,"'\\''")}'`}function GL(e,n,i){const r=[];for(const l of e.content){if(l.type!=="toolCall")continue;const c=l,d=n.get(c.id);r.push({id:c.id,name:c.name,args:c.arguments,startedAt:i,endedAt:d?.timestamp,isError:d?.isError,result:d?.content})}return r}function L1({trail:e}){const[n,i]=q.useState(!1),r=e.endedAt===void 0,l=!r&&e.isError===!0,c=e.endedAt!=null?e.endedAt-e.startedAt:null,d=c==null||c<0?null:c<1e3?`${c}ms`:`${(c/1e3).toFixed(1)}s`,h=l?"border-negative-800/50":r?"border-positive-800/50":"border-mono-800/70",g=l?"bg-negative-950/20":r?"bg-positive-950/20":"bg-surface-hover";return p.jsxs("div",{className:`rounded-md border ${h} ${g} font-mono`,children:[p.jsxs("button",{type:"button",onClick:()=>i(b=>!b),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":n,children:[p.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?p.jsx(D0,{className:"h-3 w-3 animate-spin text-positive-400","aria-hidden":"true"}):l?p.jsx(R0,{className:"h-3 w-3 text-negative-400","aria-hidden":"true"}):p.jsx(m2,{className:"h-3 w-3 text-muted","aria-hidden":"true"})}),p.jsx("span",{className:"text-[11px] font-semibold text-heading",children:e.name}),p.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-muted",children:[r?p.jsx("span",{className:"text-positive-400",children:"running…"}):p.jsxs(p.Fragment,{children:[p.jsx("span",{children:l?"failed":"ok"}),d&&p.jsx("span",{children:d})]}),p.jsx(Op,{className:`h-3 w-3 transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]}),n&&p.jsxs("div",{className:"border-t border-default px-2.5 py-2 text-[11px] text-secondary",children:[p.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-faint",children:"Args"}),p.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-neutral",children:Gv(e.args)}),!r&&e.result!==void 0&&p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-faint",children:l?"Error":"Result"}),p.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-neutral",children:Gv(e.result)})]})]})]})}function Gv(e){try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);return n.length>2e3?`${n.slice(0,2e3)}
|
|
64
|
-
… (${n.length-2e3} more chars)`:n}catch{return String(e)}}function q1({content:e}){return p.jsx("div",{className:"aero-markdown text-heading",children:p.jsx(Qj,{components:{h1:n=>p.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-primary"}),h2:n=>p.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-primary"}),h3:n=>p.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-heading"}),h4:n=>p.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-neutral"}),p:n=>p.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>p.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>p.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>p.jsx("li",{...n,className:"marker:text-mono-600"}),strong:n=>p.jsx("strong",{...n,className:"font-semibold text-primary"}),em:n=>p.jsx("em",{...n,className:"text-strong"}),code:({children:n,...i})=>p.jsx("code",{...i,className:"rounded bg-mono-800/70 px-1 py-0.5 font-mono text-[12px] text-positive-200",children:n}),pre:n=>p.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-base bg-bg-elevated/70 p-3 font-mono text-xs text-strong"}),a:n=>p.jsx("a",{...n,className:"text-positive-400 underline decoration-positive-700 hover:decoration-positive-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>p.jsx("div",{className:"mb-2 overflow-x-auto",children:p.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>p.jsx("thead",{...n,className:"border-b border-base"}),th:n=>p.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-neutral"}),tr:n=>p.jsx("tr",{...n,className:"border-b border-mono-900"}),td:n=>p.jsx("td",{...n,className:"px-2 py-1 text-strong"}),blockquote:n=>p.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-strong pl-3 italic text-secondary"}),hr:()=>p.jsx("hr",{className:"my-3 border-base"})},children:e})})}function HL(){return p.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[p.jsx("div",{className:"text-[10px] uppercase tracking-wider text-positive-400",children:"Aero"}),p.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[p.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-positive-400/80"}),p.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-positive-400/60"}),p.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-positive-400/40"})]})]})}function KL(){const e=r0(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=on({...Hc({client:ne}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?p.jsx(ML,{projectName:c.name},c.name):null}function Sa(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function No(e,n,i){switch(e.invalidateQueries({queryKey:cm({client:ne})}),e.invalidateQueries({queryKey:Vi({client:ne})}),Sa(e,"getApiV1ProjectsByNameRuns"),n){case Ce["answer-visibility"]:return;case Ce["backlink-extract"]:return;case Ce["site-audit"]:Sa(e,"getApiV1ProjectsByNameTechnicalAeo");return;case Ce["gsc-sync"]:case Ce["inspect-sitemap"]:Sa(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ce["ga-sync"]:Sa(e,"getApiV1ProjectsByNameGa");return;case Ce["traffic-sync"]:Sa(e,"getApiV1ProjectsByNameGa"),Sa(e,"getApiV1ProjectsByNameTraffic");return;case Ce["bing-inspect"]:case Ce["bing-inspect-sitemap"]:Sa(e,"getApiV1ProjectsByNameBing");return;case Ce["aeo-discover-seed"]:case Ce["aeo-discover-probe"]:return;case Ce["gbp-sync"]:Sa(e,"getApiV1ProjectsByNameGbp");return;case Ce["ads-sync"]:Sa(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Hv=[{label:"GitHub",href:"https://github.com/Canonry/canonry",Icon:LC},{label:"Docs",href:"https://github.com/Canonry/canonry/tree/main/docs",Icon:_C},{label:"Changelog",href:"https://github.com/Canonry/canonry/releases",Icon:MC}],Kv=e=>({label:e,state:"checking",detail:"Checking service health"}),QL={apiStatus:Kv("API"),workerStatus:Kv("Worker")};function ZL(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function YL(e){const n=bo(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function FL(e,n){return e.error?`${n}: ${Pp(e.error)}`:e.location?`${n} · ${e.location}`:n}function Qv(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function XL(e,n){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function JL(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function WL(){const e=ka(),n=q.useSyncExternalStore(u1,Na,Na),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=on({...um({client:ne}),enabled:i,staleTime:Xs,refetchInterval:3e3}),l=on({...Hc({client:ne}),enabled:i}),c=q.useRef({}),d=q.useCallback(()=>{r.refetch()},[r.refetch]);return q.useEffect(()=>{i&&d()},[i,d]),q.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),q.useEffect(()=>{const h=r.data??[],g=l.data??[],b=Object.fromEntries(h.map(w=>[w.id,w])),x=Object.fromEntries(h.map(w=>[w.id,w.status]));for(const w of Object.values(n.runs)){const N=b[w.runId];if(!N||!MM(N.status)||(c.current[N.id]??w.lastAnnouncedStatus)===N.status)continue;const D=g.find(E=>E.id===N.projectId);if(D&&No(e,N.kind,D.name),w.sourceAction==="run-all"){Bf(N.id);continue}const A=Qv(N.projectId,w.projectLabel,g);Ft({title:YL(N),detail:FL(N,A),tone:ZL(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),Bf(N.id)}if(r.data!==void 0){const w=new Set(h.map(C=>C.id)),N=LM(Object.values(n.runs),w,Date.now(),BM);for(const C of N){const D=g.find(A=>A.id===C.projectId);D&&No(e,C.kind,D.name),C.sourceAction!=="run-all"&&Ft({title:`${bo(C.kind)} status unavailable`,detail:Qv(C.projectId,C.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${C.runId}`,dedupeMode:"replace"}),Bf(C.runId)}}for(const w of Object.values(n.batches)){const N=qM(w.runIds,b);N.finished&&(Ft({title:"Run-all batch finished",detail:XL(N,w.skippedCount),tone:JL(N),dedupeKey:`batch:${w.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),RM(w.batchId))}c.current=x},[l.data,r.data,n,e]),null}function e5(){const e=Eo(),n=q.useMemo(()=>N0(),[]),{dashboard:i,isLoading:r,refetch:l}=Fc(void 0,{includeSettings:!n}),h=hm(!e,e?.health).data??e?.health??QL,g=r0(),{runId:b,evidenceId:x,closeDrawer:w}=gm(),[N,C]=q.useState(!1),[D,A]=q.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[E]=q.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),R=E?{current:h.apiStatus.version??"0.0.0",latest:E,url:"https://www.npmjs.com/package/@canonry/canonry",upgradeCommand:"npm install -g @canonry/canonry"}:h.apiStatus.updateAvailable,G=R&&R.latest!==D,X=()=>{if(R){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",R.latest)}catch{}A(R.latest)}},V=NL(b),P=V.data??null,re=V.isLoading;q.useEffect(()=>{P&&P.status!=="running"&&P.status!=="queued"&&l()},[P?.status,l]),q.useEffect(()=>{C(!1)},[g.pathname]),q.useEffect(()=>{if(typeof window>"u"||!b&&!x)return;const oe=fe=>{fe.key==="Escape"&&w()};return window.addEventListener("keydown",oe),()=>{window.removeEventListener("keydown",oe)}},[b,x,w]);const O=i??e?.dashboard??null,L=g.pathname==="/setup"&&O!==null&&O.portfolioOverview.projects.length===0,ae=b?(O?FB(O,b):void 0)??(P?Yc(P,O?.projects.find(oe=>oe.project.id===P.projectId)?.project.displayName??O?.projects.find(oe=>oe.project.id===P.projectId)?.project.name??"Unknown project"):void 0):void 0,_e=q.useMemo(()=>GB(g.pathname,O),[g.pathname,O]),{commandCenter:Me}=xL(_e),ve=q.useMemo(()=>{if(x)return JB(Me,O,x)},[x,Me,O]),it=(()=>{const oe=g.pathname;if(oe==="/")return"Portfolio";if(oe==="/projects")return"Projects";if(oe==="/runs")return"Runs";if(oe==="/history")return"History";if(oe==="/settings")return"Settings";if(oe==="/setup")return"Setup";if(oe==="/backlinks")return"Backlinks";if(oe==="/traffic"||oe.startsWith("/traffic/"))return"Server traffic";if(oe.startsWith("/projects/")){const $=oe.split("/").filter(Boolean)[1];if($&&O){const W=O.projects.find(pe=>pe.project.id===$);if(W)return W.project.name}return"Project"}return"Not found"})();if(q.useEffect(()=>{const oe=T3(n?.theme);if(!oe)return;const fe=document.createElement("link");return fe.rel="stylesheet",fe.href=oe,document.head.appendChild(fe),()=>{document.head.removeChild(fe)}},[n]),n){const oe=!n.views||n.views.includes(j3(g.pathname));return p.jsxs("div",{className:"app-shell app-shell-embed","data-theme":C3(n.theme),style:_3(n.theme),children:[p.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),p.jsx("main",{id:"content",className:"page-shell",children:oe?p.jsx(Qf,{}):p.jsx("div",{className:"embed-view-unavailable",role:"status",children:"This view is not available in embed mode."})})]})}return p.jsxs("div",{className:`app-shell ${L?"app-shell-focus":""}`,children:[p.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!L&&p.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[p.jsx("div",{className:"sidebar-brand",children:p.jsx(Rv,{version:h.apiStatus.version,updateAvailable:G?R:null,onDismissUpdate:X})}),p.jsxs("nav",{className:"sidebar-nav",children:[p.jsxs(tt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(VC,{className:"sidebar-icon"}),p.jsx("span",{children:"Overview"})]}),p.jsxs(tt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[p.jsx(UC,{className:"sidebar-icon"}),p.jsx("span",{children:"Projects"})]}),p.jsxs(tt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(e2,{className:"sidebar-icon"}),p.jsx("span",{children:"Runs"})]}),p.jsxs(tt,{to:"/history",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(IC,{className:"sidebar-icon"}),p.jsx("span",{children:"History"})]}),p.jsxs(tt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[p.jsx(a2,{className:"sidebar-icon"}),p.jsx("span",{children:"Server traffic"})]}),p.jsxs(tt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(HC,{className:"sidebar-icon"}),p.jsx("span",{children:"Backlinks"})]}),p.jsxs(tt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(d2,{className:"sidebar-icon"}),p.jsx("span",{children:"Settings"})]}),r?p.jsxs(p.Fragment,{children:[p.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(oe=>p.jsxs("div",{className:"sidebar-skeleton-item",children:[p.jsx("span",{className:"skeleton-circle size-2"}),p.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+oe*15}%`}})]},oe))]}):O&&O.projects.length>0?p.jsxs(p.Fragment,{children:[p.jsx("p",{className:"sidebar-section-title",children:"Projects"}),O.projects.map(oe=>{const fe=oe.visibilitySummary.tone;return p.jsxs(tt,{to:"/projects/$projectName",params:{projectName:oe.project.name},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[p.jsx("span",{className:`sidebar-dot sidebar-dot-${fe}`}),p.jsx("span",{children:oe.project.displayName||oe.project.name})]},oe.project.id)})]}):r?null:p.jsxs(p.Fragment,{children:[p.jsx("p",{className:"sidebar-section-title",children:"Resources"}),p.jsxs(tt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[p.jsx(r2,{className:"sidebar-icon"}),p.jsx("span",{children:"Setup"})]})]})]}),p.jsx("div",{className:"sidebar-footer",children:Hv.map(({label:oe,href:fe,Icon:$})=>p.jsx("a",{className:"sidebar-footer-icon",href:fe,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,children:p.jsx($,{className:"size-4"})},fe))})]}),p.jsxs("div",{className:"main-area",children:[p.jsxs("header",{className:"topbar",children:[p.jsxs("div",{className:"topbar-left",children:[p.jsx("div",{className:"topbar-brand-mobile",children:p.jsx(Rv,{compact:!0})}),p.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[p.jsx(tt,{to:"/",children:"Home"}),p.jsx(Op,{className:"breadcrumb-sep size-3"}),p.jsx("span",{className:"breadcrumb-current",children:it})]})]}),p.jsxs("div",{className:"topbar-actions",children:[p.jsx(_L,{}),p.jsxs("div",{className:"health-pill-row",children:[p.jsxs("span",{className:`health-pill health-pill-${h.apiStatus.state}`,title:ar(h.apiStatus),children:["API ",h.apiStatus.state==="ok"?"ok":h.apiStatus.state]}),p.jsxs("span",{className:`health-pill health-pill-${h.workerStatus.state}`,title:ar(h.workerStatus),children:["Worker ",h.workerStatus.state==="ok"?"ok":h.workerStatus.state]})]}),p.jsxs(Ie,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":N,"aria-controls":"mobile-nav",onClick:()=>C(oe=>!oe),children:[p.jsx(FC,{className:"size-4"}),p.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),p.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${N?"mobile-nav-open":""}`,children:[p.jsxs(Ie,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>C(!1),children:[p.jsx(rr,{className:"size-5"}),p.jsx("span",{className:"sr-only",children:"Close navigation"})]}),p.jsx(tt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),p.jsx(tt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),p.jsx(tt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),p.jsx(tt,{to:"/history",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"History"}),p.jsx(tt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),p.jsx(tt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),O&&O.projects.length>0?p.jsxs("div",{className:"mobile-nav-section",children:[p.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),O.projects.map(oe=>p.jsx(tt,{to:"/projects/$projectName",params:{projectName:oe.project.name},className:"mobile-nav-link",children:oe.project.name},oe.project.id))]}):null]}),p.jsx("main",{id:"content",className:"page-shell",children:r&&!e?p.jsxs("div",{className:"page-skeleton",children:[p.jsxs("div",{className:"page-skeleton-header",children:[p.jsx("div",{className:"skeleton-text h-6 w-40"}),p.jsx("div",{className:"skeleton-text-sm w-72"})]}),p.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(oe=>p.jsxs("div",{className:"page-skeleton-card",children:[p.jsx("div",{className:"skeleton-text w-24"}),p.jsx("div",{className:"skeleton-text w-full"}),p.jsx("div",{className:"skeleton-text-sm w-3/4"})]},oe))}),p.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(oe=>p.jsxs("div",{className:"page-skeleton-card",children:[p.jsx("div",{className:"skeleton-text w-20"}),p.jsx("div",{className:"space-y-2",children:[1,2,3].map(fe=>p.jsx("div",{className:"skeleton-text-sm w-full"},fe))})]},oe))})]}):p.jsx(Qf,{})}),p.jsxs("footer",{className:"footer",children:[p.jsxs("span",{className:"footer-brand",children:[p.jsx("span",{children:p.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),h.apiStatus.version&&h.apiStatus.version!=="unknown"?p.jsxs("span",{className:"footer-version",children:["v",h.apiStatus.version]}):null]}),p.jsx("div",{className:"footer-links",children:Hv.map(({label:oe,href:fe,Icon:$})=>p.jsx("a",{href:fe,target:"_blank",rel:"noopener noreferrer",title:oe,"aria-label":oe,className:"footer-icon",children:p.jsx($,{className:"size-3.5"})},fe))})]})]}),b&&!ae&&re?p.jsx(qf,{open:!0,title:"Loading run details",subtitle:"Fetching the durable run record",onClose:w,children:p.jsx("p",{className:"text-sm text-muted",role:"status",children:"Loading run details…"})}):null,b&&!ae&&V.isError?p.jsx(qf,{open:!0,title:"Run unavailable",subtitle:"The run could not be loaded",onClose:w,children:p.jsx("p",{className:"text-sm text-negative",children:V.error instanceof Error?V.error.message:"Run details are unavailable."})}):null,ae?p.jsxs(qf,{open:!0,title:ae.summary,subtitle:`${ae.projectName} · ${ae.kindLabel}`,onClose:w,children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[p.jsx(mm,{status:ae.status}),p.jsx("span",{className:"text-secondary",children:ae.startedAt}),p.jsx("span",{className:"text-muted",children:ae.duration}),p.jsx("span",{className:"text-faint",children:ae.triggerLabel})]}),ae.status==="failed"&&ae.statusDetail&&p.jsx("p",{className:"text-sm text-negative/80 mt-2",children:ae.statusDetail}),p.jsxs("div",{className:"mt-4",children:[p.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted mb-2",children:"Activity Log"}),re?p.jsx("p",{className:"text-sm text-muted",children:"Loading run details..."}):P?.snapshots&&P.snapshots.length>0?p.jsxs("div",{className:"space-y-2",children:[P.snapshots.map(oe=>p.jsxs("div",{className:"rounded-lg border border-default bg-surface p-3",children:[p.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[p.jsx("p",{className:"text-sm font-medium text-strong truncate",children:oe.query??"Unknown query"}),p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(OB,{provider:oe.provider}),p.jsx(A1,{variant:oe.citationState===kc.cited?"success":"neutral",children:oe.citationState})]})]}),oe.model&&p.jsx("p",{className:"text-[11px] text-muted font-mono",children:oe.model}),oe.citedDomains.length>0&&p.jsxs("p",{className:"text-xs text-muted mt-1",children:[p.jsx("span",{className:"text-secondary",children:"Sources:"})," ",oe.citedDomains.join(", ")]}),oe.competitorOverlap.length>0&&p.jsxs("p",{className:"text-xs text-negative-400/80 mt-0.5",children:["Competitor cited: ",oe.competitorOverlap.join(", ")]}),oe.groundingSources&&oe.groundingSources.length>0&&p.jsxs("details",{className:"mt-2",children:[p.jsxs("summary",{className:"text-xs text-muted cursor-pointer hover:text-secondary",children:[oe.groundingSources.length," grounding source",oe.groundingSources.length!==1?"s":""]}),p.jsx("ul",{className:"mt-1 space-y-0.5",children:oe.groundingSources.map((fe,$)=>{const W=up(fe.uri),pe=fe.title||fe.uri;return p.jsx("li",{className:"text-xs text-muted truncate",children:W?p.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"hover:text-neutral",children:pe}):p.jsx("span",{children:pe})},$)})})]}),oe.answerText&&p.jsxs("details",{className:"mt-1",children:[p.jsx("summary",{className:"text-xs text-muted cursor-pointer hover:text-secondary",children:"Answer preview"}),p.jsx("p",{className:"mt-1 text-xs text-secondary leading-relaxed whitespace-pre-wrap",children:oe.answerText})]})]},oe.id)),P.status==="running"&&p.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-muted",children:[p.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-caution-500 animate-pulse"}),"Running remaining queries..."]})]}):P&&P.status==="running"?p.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-muted",children:[p.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-caution-500 animate-pulse"}),"Waiting for first query result..."]}):P&&P.status==="queued"?p.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-muted",children:[p.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-mono-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):P&&P.error?p.jsxs("div",{className:"rounded-lg border border-negative-800/40 bg-negative-950/20 p-3",children:[p.jsx("p",{className:"text-sm font-medium text-negative mb-2",children:"Run failed"}),p.jsx("pre",{className:"text-xs text-negative/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:S3(P.error)})]}):p.jsx("p",{className:"text-sm text-muted",children:"No snapshot data available."})]})]}):null,ve?p.jsx(IB,{evidence:ve.evidence,project:ve.project,onClose:w}):null,p.jsx(WL,{}),p.jsx(CL,{}),p.jsx(KL,{})]})}class t5 extends q.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?p.jsx("div",{className:"page-container",children:p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[p.jsx("div",{className:"rounded-full bg-negative-950/40 p-3",children:p.jsx(R0,{className:"size-6 text-negative-400"})}),p.jsx("h2",{className:"text-lg font-semibold text-heading",children:"Something went wrong"}),p.jsx("p",{className:"text-sm text-secondary max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),p.jsxs("div",{className:"flex gap-3 mt-2",children:[p.jsxs(Ie,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[p.jsx(z0,{className:"size-3.5 mr-1.5"}),"Try again"]}),p.jsx(Ie,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const Tn=q.forwardRef(({className:e,...n},i)=>p.jsx("div",{ref:i,className:Mn("rounded-xl border border-base bg-bg/75 shadow-[0_0_0_1px_var(--color-shadow-hairline)]",e),...n}));Tn.displayName="Card";const dp=q.forwardRef(({className:e,...n},i)=>p.jsx("div",{ref:i,className:Mn("flex flex-col gap-1.5 p-5",e),...n}));dp.displayName="CardHeader";const fp=q.forwardRef(({className:e,...n},i)=>p.jsx("h3",{ref:i,className:Mn("font-medium tracking-tight text-primary",e),...n}));fp.displayName="CardTitle";const pp=q.forwardRef(({className:e,...n},i)=>p.jsx("p",{ref:i,className:Mn("text-sm text-muted",e),...n}));pp.displayName="CardDescription";const hc=q.forwardRef(({className:e,...n},i)=>p.jsx("div",{ref:i,className:Mn("p-5 pt-0",e),...n}));hc.displayName="CardContent";function n5({points:e,tone:n}){const i=q.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,b=l-c*2,x=r-c*2,w=e.map((N,C)=>{const D=c+C/Math.max(e.length-1,1)*b,A=c+(1-(N-d)/g)*x;return`${D},${A}`}).join(" ");return p.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[p.jsx("defs",{children:p.jsx("clipPath",{id:i,children:p.jsx("rect",{x:c,y:c,width:b,height:x,rx:"8"})})}),p.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),p.jsx("polyline",{clipPath:`url(#${i})`,points:w,vectorEffect:"non-scaling-stroke"})]})}function a5({project:e}){return p.jsxs(tt,{to:"/projects/$projectName",params:{projectName:e.project.name},className:"project-row cursor-pointer",children:[p.jsx("div",{className:"project-row-chart",children:p.jsx(n5,{points:e.trend,tone:o1(e.lastRun.status)})}),p.jsxs("div",{className:"project-row-primary",children:[p.jsxs("div",{children:[p.jsx("p",{className:"project-name",children:e.project.name}),p.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),p.jsx("p",{className:"project-insight",children:e.insight})]}),p.jsx("div",{className:"project-row-stat",children:p.jsxs("div",{className:"metric-inline-block",children:[p.jsx("p",{className:"metric-inline-label",children:"Mentioned"}),p.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-caution-400":""}`,children:e.mentionScore}),p.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),e.providerCoverage&&p.jsx("p",{className:"text-[10px] font-medium text-caution-400/80",children:e.providerCoverage})]})}),p.jsx("div",{className:"project-row-stat",children:p.jsxs("div",{className:"metric-inline-block",children:[p.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),p.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel})]})}),p.jsx("span",{className:"project-row-link",children:p.jsx(Op,{className:"h-4 w-4 text-muted"})})]})}function i5(){const e=Eo(),{dashboard:n,isLoading:i}=Fc(),r=n??e?.dashboard;if(!r||i)return p.jsxs("div",{className:"page-skeleton",children:[p.jsxs("div",{className:"page-skeleton-header",children:[p.jsx("div",{className:"skeleton-text h-6 w-32"}),p.jsx("div",{className:"skeleton-text-sm w-64"})]}),p.jsx("div",{className:"space-y-3",children:[1,2,3].map(x=>p.jsxs("div",{className:"rounded-xl border border-default bg-surface p-4 flex items-center gap-4",children:[p.jsxs("div",{className:"flex-1 space-y-2",children:[p.jsx("div",{className:"skeleton-text w-36"}),p.jsx("div",{className:"skeleton-text-sm w-48"})]}),p.jsx("div",{className:"skeleton-text w-16"}),p.jsx("div",{className:"skeleton-text w-16"}),p.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},x))})]});const l=r.portfolioOverview,h=hm(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=AM(l.systemHealth,h,r.settings),{openRun:b}=gm();return p.jsxs("div",{className:"page-container",children:[p.jsxs("div",{className:"page-header",children:[p.jsxs("div",{className:"page-header-left",children:[p.jsx("h1",{className:"page-title",children:"Portfolio"}),p.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),p.jsx("div",{className:"page-header-right",children:p.jsx("p",{className:"text-[11px] text-faint",children:l.lastUpdatedAt})})]}),l.projects.length>0?p.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(x=>p.jsx(a5,{project:x},x.project.id))}):p.jsxs(Tn,{className:"surface-card empty-card",children:[p.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),p.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),p.jsx(Ie,{size:"sm",asChild:!0,children:p.jsx(tt,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),p.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&p.jsxs("section",{className:"overview-secondary-section",children:[p.jsx("div",{className:"section-head section-head-inline",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),p.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),p.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(x=>x.href?p.jsxs(tt,{to:x.href,className:`attention-item attention-item-${x.tone}`,children:[p.jsxs("div",{children:[p.jsx("p",{className:"attention-title",children:x.title}),p.jsx("p",{className:"attention-detail",children:x.detail})]}),x.actionLabel&&p.jsx("span",{className:"attention-action",children:x.actionLabel})]},x.id):p.jsxs("div",{className:`attention-item attention-item-static attention-item-${x.tone}`,children:[p.jsxs("div",{children:[p.jsx("p",{className:"attention-title",children:x.title}),p.jsx("p",{className:"attention-detail",children:x.detail})]}),x.actionLabel&&p.jsx("span",{className:"attention-action",children:x.actionLabel})]},x.id))})]}),p.jsxs("section",{className:"overview-secondary-section",children:[p.jsx("div",{className:"section-head section-head-inline",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),p.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),p.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(x=>p.jsxs("button",{className:"compact-run",type:"button",onClick:()=>b(x.id),children:[p.jsxs("div",{children:[p.jsx("p",{className:"compact-run-title",children:x.projectName}),p.jsx("p",{className:"compact-run-detail",children:x.summary})]}),p.jsx(mm,{status:x.status})]},x.id)):p.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),p.jsxs("section",{className:"page-section",children:[p.jsx("div",{className:"section-head section-head-inline",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),p.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),p.jsx("div",{className:"health-grid",children:g.map(x=>p.jsxs(Tn,{className:"surface-card compact-card",children:[p.jsxs("div",{className:"section-head",children:[p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:x.label}),p.jsx("h3",{children:x.detail})]}),p.jsx(Cn,{tone:x.tone,title:x.id==="api"?ar(h.apiStatus):x.id==="worker"?ar(h.workerStatus):void 0,children:x.label})]}),p.jsx("p",{className:"supporting-copy",children:x.meta})]},x.id))})]})]})}const Sm=Symbol.for("yaml.alias"),mp=Symbol.for("yaml.document"),ii=Symbol.for("yaml.map"),U1=Symbol.for("yaml.pair"),Xn=Symbol.for("yaml.scalar"),dr=Symbol.for("yaml.seq"),zn=Symbol.for("yaml.node.type"),Hi=e=>!!e&&typeof e=="object"&&e[zn]===Sm,Xc=e=>!!e&&typeof e=="object"&&e[zn]===mp,Oo=e=>!!e&&typeof e=="object"&&e[zn]===ii,Nt=e=>!!e&&typeof e=="object"&&e[zn]===U1,ot=e=>!!e&&typeof e=="object"&&e[zn]===Xn,Do=e=>!!e&&typeof e=="object"&&e[zn]===dr;function wt(e){if(e&&typeof e=="object")switch(e[zn]){case ii:case dr:return!0}return!1}function jt(e){if(e&&typeof e=="object")switch(e[zn]){case Sm:case ii:case Xn:case dr:return!0}return!1}const $1=e=>(ot(e)||wt(e))&&!!e.anchor,Ri=Symbol("break visit"),s5=Symbol("skip children"),vo=Symbol("remove node");function fr(e,n){const i=r5(n);Xc(e)?Vs(null,e.contents,i,Object.freeze([e]))===vo&&(e.contents=null):Vs(null,e,i,Object.freeze([]))}fr.BREAK=Ri;fr.SKIP=s5;fr.REMOVE=vo;function Vs(e,n,i,r){const l=o5(e,n,i,r);if(jt(l)||Nt(l))return l5(e,r,l),Vs(e,l,i,r);if(typeof l!="symbol"){if(wt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Vs(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===Ri)return Ri;d===vo&&(n.items.splice(c,1),c-=1)}}}else if(Nt(n)){r=Object.freeze(r.concat(n));const c=Vs("key",n.key,i,r);if(c===Ri)return Ri;c===vo&&(n.key=null);const d=Vs("value",n.value,i,r);if(d===Ri)return Ri;d===vo&&(n.value=null)}}return l}function r5(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function o5(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(Oo(n))return i.Map?.(e,n,r);if(Do(n))return i.Seq?.(e,n,r);if(Nt(n))return i.Pair?.(e,n,r);if(ot(n))return i.Scalar?.(e,n,r);if(Hi(n))return i.Alias?.(e,n,r)}function l5(e,n,i){const r=n[n.length-1];if(wt(r))r.items[e]=i;else if(Nt(r))e==="key"?r.key=i:r.value=i;else if(Xc(r))r.contents=i;else{const l=Hi(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const c5={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},u5=e=>e.replace(/[!,[\]{}]/g,n=>c5[n]);class Zt{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Zt.defaultYaml,n),this.tags=Object.assign({},Zt.defaultTags,i)}clone(){const n=new Zt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Zt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Zt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Zt.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Zt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Zt.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+u5(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&jt(n.contents)){const c={};fr(n.contents,(d,h)=>{jt(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
|
|
65
|
-
`)}}Zt.defaultYaml={explicit:!1,version:"1.2"};Zt.defaultTags={"!!":"tag:yaml.org,2002:"};function I1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function P1(e){const n=new Set;return fr(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function V1(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function d5(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=P1(e));const d=V1(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(ot(d.node)||wt(d.node)))d.node.anchor=d.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:r}}function Gs(e,n,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l){const d=r[l],h=Gs(e,r,String(l),d);h===void 0?delete r[l]:h!==d&&(r[l]=h)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Gs(e,r,l,c);d===void 0?r.delete(l):d!==c&&r.set(l,d)}else if(r instanceof Set)for(const l of Array.from(r)){const c=Gs(e,r,l,l);c===void 0?r.delete(l):c!==l&&(r.delete(l),r.add(c))}else for(const[l,c]of Object.entries(r)){const d=Gs(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function On(e,n,i){if(Array.isArray(e))return e.map((r,l)=>On(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!$1(e))return e.toJSON(n,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=c=>{r.res=c,delete i.onCreate};const l=e.toJSON(n,i);return i.onCreate&&i.onCreate(l),l}return typeof e=="bigint"&&!i?.keep?Number(e):e}class xm{constructor(n){Object.defineProperty(this,zn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:i,maxAliasCount:r,onAnchor:l,reviver:c}={}){if(!Xc(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=On(this,"",d);if(typeof l=="function")for(const{count:g,res:b}of d.anchors.values())l(b,g);return typeof c=="function"?Gs(c,{"":h},"",h):h}}class wm extends xm{constructor(n){super(Sm),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,i){let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],fr(n,{Node:(c,d)=>{(Hi(d)||$1(d))&&r.push(d)}}),i&&(i.aliasResolveCache=r));let l;for(const c of r){if(c===this)break;c.anchor===this.source&&(l=c)}return l}toJSON(n,i){if(!i)return{source:this.source};const{anchors:r,doc:l,maxAliasCount:c}=i,d=this.resolve(l,i);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let h=r.get(d);if(h||(On(d,null,i),h=r.get(d)),h?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=gc(l,d,r)),h.count*h.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return h.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(I1(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${l} `}return l}}function gc(e,n,i){if(Hi(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(wt(n)){let r=0;for(const l of n.items){const c=gc(e,l,i);c>r&&(r=c)}return r}else if(Nt(n)){const r=gc(e,n.key,i),l=gc(e,n.value,i);return Math.max(r,l)}return 1}const G1=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends xm{constructor(n){super(Xn),this.value=n}toJSON(n,i){return i?.keep?this.value:On(this.value,n,i)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const f5="tag:yaml.org,2002:";function p5(e,n,i){if(n){const r=i.filter(c=>c.tag===n),l=r.find(c=>!c.format)??r[0];if(!l)throw new Error(`Tag ${n} not found`);return l}return i.find(r=>r.identify?.(e)&&!r.format)}function ko(e,n,i){if(Xc(e)&&(e=e.contents),jt(e))return e;if(Nt(e)){const w=i.schema[ii].createNode?.(i.schema,null,i);return w.items.push(e),w}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:l,onTagObj:c,schema:d,sourceObjects:h}=i;let g;if(r&&e&&typeof e=="object"){if(g=h.get(e),g)return g.anchor??(g.anchor=l(e)),new wm(g.anchor);g={anchor:null,node:null},h.set(e,g)}n?.startsWith("!!")&&(n=f5+n.slice(2));let b=p5(e,n,d.tags);if(!b){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const w=new Te(e);return g&&(g.node=w),w}b=e instanceof Map?d[ii]:Symbol.iterator in Object(e)?d[dr]:d[ii]}c&&(c(b),delete i.onTagObj);const x=b?.createNode?b.createNode(i.schema,e,i):typeof b?.nodeClass?.from=="function"?b.nodeClass.from(i.schema,e,i):new Te(e);return n?x.tag=n:b.default||(x.tag=b.tag),g&&(g.node=x),x}function Ec(e,n,i){let r=i;for(let l=n.length-1;l>=0;--l){const c=n[l];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=r,r=d}else r=new Map([[c,r]])}return ko(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const yo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class H1 extends xm{constructor(n,i){super(n),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(n){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(i.schema=n),i.items=i.items.map(r=>jt(r)||Nt(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(yo(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(wt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,Ec(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}deleteIn(n){const[i,...r]=n;if(r.length===0)return this.delete(i);const l=this.get(i,!0);if(wt(l))return l.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(n,i){const[r,...l]=n,c=this.get(r,!0);return l.length===0?!i&&ot(c)?c.value:c:wt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!Nt(i))return!1;const r=i.value;return r==null||n&&ot(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(n){const[i,...r]=n;if(r.length===0)return this.has(i);const l=this.get(i,!0);return wt(l)?l.hasIn(r):!1}setIn(n,i){const[r,...l]=n;if(l.length===0)this.set(r,i);else{const c=this.get(r,!0);if(wt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,Ec(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const m5=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function xa(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Mi=(e,n,i)=>e.endsWith(`
|
|
66
|
-
`)?xa(i,n):i.includes(`
|
|
67
|
-
`)?`
|
|
68
|
-
`+xa(i,n):(e.endsWith(" ")?"":" ")+i,K1="flow",hp="block",yc="quoted";function Jc(e,n,i="flow",{indentAtStart:r,lineWidth:l=80,minContentWidth:c=20,onFold:d,onOverflow:h}={}){if(!l||l<0)return e;l<c&&(c=0);const g=Math.max(1+c,1+l-n.length);if(e.length<=g)return e;const b=[],x={};let w=l-n.length;typeof r=="number"&&(r>l-Math.max(2,c)?b.push(0):w=l-r);let N,C,D=!1,A=-1,E=-1,R=-1;i===hp&&(A=Zv(e,A,n.length),A!==-1&&(w=A+g));for(let X;X=e[A+=1];){if(i===yc&&X==="\\"){switch(E=A,e[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}R=A}if(X===`
|
|
69
|
-
`)i===hp&&(A=Zv(e,A,n.length)),w=A+n.length+g,N=void 0;else{if(X===" "&&C&&C!==" "&&C!==`
|
|
70
|
-
`&&C!==" "){const V=e[A+1];V&&V!==" "&&V!==`
|
|
71
|
-
`&&V!==" "&&(N=A)}if(A>=w)if(N)b.push(N),w=N+g,N=void 0;else if(i===yc){for(;C===" "||C===" ";)C=X,X=e[A+=1],D=!0;const V=A>R+1?A-2:E-1;if(x[V])return e;b.push(V),x[V]=!0,w=V+g,N=void 0}else D=!0}C=X}if(D&&h&&h(),b.length===0)return e;d&&d();let G=e.slice(0,b[0]);for(let X=0;X<b.length;++X){const V=b[X],P=b[X+1]||e.length;V===0?G=`
|
|
72
|
-
${n}${e.slice(0,P)}`:(i===yc&&x[V]&&(G+=`${e[V]}\\`),G+=`
|
|
73
|
-
${n}${e.slice(V+1,P)}`)}return G}function Zv(e,n,i){let r=n,l=n+1,c=e[l];for(;c===" "||c===" ";)if(n<l+i)c=e[++n];else{do c=e[++n];while(c&&c!==`
|
|
74
|
-
`);r=n,l=n+1,c=e[l]}return r}const Wc=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),eu=e=>/^(%|---|\.\.\.)/m.test(e);function h5(e,n,i){if(!n||n<0)return!1;const r=n-i,l=e.length;if(l<=r)return!1;for(let c=0,d=0;c<l;++c)if(e[c]===`
|
|
75
|
-
`){if(c-d>r)return!0;if(d=c+1,l-d<=r)return!1}return!0}function So(e,n){const i=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return i;const{implicitKey:r}=n,l=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(eu(e)?" ":"");let d="",h=0;for(let g=0,b=i[g];b;b=i[++g])if(b===" "&&i[g+1]==="\\"&&i[g+2]==="n"&&(d+=i.slice(h,g)+"\\ ",g+=1,h=g,b="\\"),b==="\\")switch(i[g+1]){case"u":{d+=i.slice(h,g);const x=i.substr(g+2,4);switch(x){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:x.substr(0,2)==="00"?d+="\\x"+x.substr(2):d+=i.substr(g,6)}g+=5,h=g+1}break;case"n":if(r||i[g+2]==='"'||i.length<l)g+=1;else{for(d+=i.slice(h,g)+`
|
|
76
|
-
|
|
77
|
-
`;i[g+2]==="\\"&&i[g+3]==="n"&&i[g+4]!=='"';)d+=`
|
|
78
|
-
`,g+=2;d+=c,i[g+2]===" "&&(d+="\\"),g+=1,h=g+1}break;default:g+=1}return d=h?d+i.slice(h):i,r?d:Jc(d,c,yc,Wc(n,!1))}function gp(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
|
|
79
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return So(e,n);const i=n.indent||(eu(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
80
|
-
${i}`)+"'";return n.implicitKey?r:Jc(r,i,K1,Wc(n,!1))}function Hs(e,n){const{singleQuote:i}=n.options;let r;if(i===!1)r=So;else{const l=e.includes('"'),c=e.includes("'");l&&!c?r=gp:c&&!l?r=So:r=i?gp:So}return r(e,n)}let yp;try{yp=new RegExp(`(^|(?<!
|
|
81
|
-
))
|
|
82
|
-
+(?!
|
|
83
|
-
|$)`,"g")}catch{yp=/\n+(?!\n|$)/g}function bc({comment:e,type:n,value:i},r,l,c){const{blockQuote:d,commentString:h,lineWidth:g}=r.options;if(!d||/\n[\t ]+$/.test(i))return Hs(i,r);const b=r.indent||(r.forceBlockIndent||eu(i)?" ":""),x=d==="literal"?!0:d==="folded"||n===Te.BLOCK_FOLDED?!1:n===Te.BLOCK_LITERAL?!0:!h5(i,g,b.length);if(!i)return x?`|
|
|
84
|
-
`:`>
|
|
85
|
-
`;let w,N;for(N=i.length;N>0;--N){const P=i[N-1];if(P!==`
|
|
86
|
-
`&&P!==" "&&P!==" ")break}let C=i.substring(N);const D=C.indexOf(`
|
|
87
|
-
`);D===-1?w="-":i===C||D!==C.length-1?(w="+",c&&c()):w="",C&&(i=i.slice(0,-C.length),C[C.length-1]===`
|
|
88
|
-
`&&(C=C.slice(0,-1)),C=C.replace(yp,`$&${b}`));let A=!1,E,R=-1;for(E=0;E<i.length;++E){const P=i[E];if(P===" ")A=!0;else if(P===`
|
|
89
|
-
`)R=E;else break}let G=i.substring(0,R<E?R+1:E);G&&(i=i.substring(G.length),G=G.replace(/\n+/g,`$&${b}`));let V=(A?b?"2":"1":"")+w;if(e&&(V+=" "+h(e.replace(/ ?[\r\n]+/g," ")),l&&l()),!x){const P=i.replace(/\n+/g,`
|
|
90
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${b}`);let re=!1;const O=Wc(r,!0);d!=="folded"&&n!==Te.BLOCK_FOLDED&&(O.onOverflow=()=>{re=!0});const L=Jc(`${G}${P}${C}`,b,hp,O);if(!re)return`>${V}
|
|
91
|
-
${b}${L}`}return i=i.replace(/\n+/g,`$&${b}`),`|${V}
|
|
92
|
-
${b}${G}${i}${C}`}function g5(e,n,i,r){const{type:l,value:c}=e,{actualString:d,implicitKey:h,indent:g,indentStep:b,inFlow:x}=n;if(h&&c.includes(`
|
|
93
|
-
`)||x&&/[[\]{},]/.test(c))return Hs(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return h||x||!c.includes(`
|
|
94
|
-
`)?Hs(c,n):bc(e,n,i,r);if(!h&&!x&&l!==Te.PLAIN&&c.includes(`
|
|
95
|
-
`))return bc(e,n,i,r);if(eu(c)){if(g==="")return n.forceBlockIndent=!0,bc(e,n,i,r);if(h&&g===b)return Hs(c,n)}const w=c.replace(/\n+/g,`$&
|
|
96
|
-
${g}`);if(d){const N=A=>A.default&&A.tag!=="tag:yaml.org,2002:str"&&A.test?.test(w),{compat:C,tags:D}=n.doc.schema;if(D.some(N)||C?.some(N))return Hs(c,n)}return h?w:Jc(w,g,K1,Wc(n,!1))}function jm(e,n,i,r){const{implicitKey:l,inFlow:c}=n,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:h}=e;h!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(h=Te.QUOTE_DOUBLE);const g=x=>{switch(x){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return l||c?Hs(d.value,n):bc(d,n,i,r);case Te.QUOTE_DOUBLE:return So(d.value,n);case Te.QUOTE_SINGLE:return gp(d.value,n);case Te.PLAIN:return g5(d,n,i,r);default:return null}};let b=g(h);if(b===null){const{defaultKeyType:x,defaultStringType:w}=n.options,N=l&&x||w;if(b=g(N),b===null)throw new Error(`Unsupported default string type ${N}`)}return b}function Q1(e,n){const i=Object.assign({blockQuote:!0,commentString:m5,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,n);let r;switch(i.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:i.flowCollectionPadding?" ":"",indent:"",indentStep:typeof i.indent=="number"?" ".repeat(i.indent):" ",inFlow:r,options:i}}function y5(e,n){if(n.tag){const l=e.filter(c=>c.tag===n.tag);if(l.length>0)return l.find(c=>c.format===n.format)??l[0]}let i,r;if(ot(n)){r=n.value;let l=e.filter(c=>c.identify?.(r));if(l.length>1){const c=l.filter(d=>d.test);c.length>0&&(l=c)}i=l.find(c=>c.format===n.format)??l.find(c=>!c.format)}else r=n,i=e.find(l=>l.nodeClass&&r instanceof l.nodeClass);if(!i){const l=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${l} value`)}return i}function b5(e,n,{anchors:i,doc:r}){if(!r.directives)return"";const l=[],c=(ot(e)||wt(e))&&e.anchor;c&&I1(c)&&(i.add(c),l.push(`&${c}`));const d=e.tag??(n.default?null:n.tag);return d&&l.push(r.directives.tagString(d)),l.join(" ")}function ir(e,n,i,r){if(Nt(e))return e.toString(n,i,r);if(Hi(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let l;const c=jt(e)?e:n.doc.createNode(e,{onTagObj:g=>l=g});l??(l=y5(n.doc.schema.tags,c));const d=b5(c,l,n);d.length>0&&(n.indentAtStart=(n.indentAtStart??0)+d.length+1);const h=typeof l.stringify=="function"?l.stringify(c,n,i,r):ot(c)?jm(c,n,i,r):c.toString(n,i,r);return d?ot(c)||h[0]==="{"||h[0]==="["?`${d} ${h}`:`${d}
|
|
97
|
-
${n.indent}${h}`:h}function v5({key:e,value:n},i,r,l){const{allNullValues:c,doc:d,indent:h,indentStep:g,options:{commentString:b,indentSeq:x,simpleKeys:w}}=i;let N=jt(e)&&e.comment||null;if(w){if(N)throw new Error("With simple keys, key nodes cannot have comments");if(wt(e)||!jt(e)&&typeof e=="object"){const O="With simple keys, collection cannot be used as a key value";throw new Error(O)}}let C=!w&&(!e||N&&n==null&&!i.inFlow||wt(e)||(ot(e)?e.type===Te.BLOCK_FOLDED||e.type===Te.BLOCK_LITERAL:typeof e=="object"));i=Object.assign({},i,{allNullValues:!1,implicitKey:!C&&(w||!c),indent:h+g});let D=!1,A=!1,E=ir(e,i,()=>D=!0,()=>A=!0);if(!C&&!i.inFlow&&E.length>1024){if(w)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");C=!0}if(i.inFlow){if(c||n==null)return D&&r&&r(),E===""?"?":C?`? ${E}`:E}else if(c&&!w||n==null&&C)return E=`? ${E}`,N&&!D?E+=Mi(E,i.indent,b(N)):A&&l&&l(),E;D&&(N=null),C?(N&&(E+=Mi(E,i.indent,b(N))),E=`? ${E}
|
|
98
|
-
${h}:`):(E=`${E}:`,N&&(E+=Mi(E,i.indent,b(N))));let R,G,X;jt(n)?(R=!!n.spaceBefore,G=n.commentBefore,X=n.comment):(R=!1,G=null,X=null,n&&typeof n=="object"&&(n=d.createNode(n))),i.implicitKey=!1,!C&&!N&&ot(n)&&(i.indentAtStart=E.length+1),A=!1,!x&&g.length>=2&&!i.inFlow&&!C&&Do(n)&&!n.flow&&!n.tag&&!n.anchor&&(i.indent=i.indent.substring(2));let V=!1;const P=ir(n,i,()=>V=!0,()=>A=!0);let re=" ";if(N||R||G){if(re=R?`
|
|
99
|
-
`:"",G){const O=b(G);re+=`
|
|
100
|
-
${xa(O,i.indent)}`}P===""&&!i.inFlow?re===`
|
|
101
|
-
`&&X&&(re=`
|
|
102
|
-
|
|
103
|
-
`):re+=`
|
|
104
|
-
${i.indent}`}else if(!C&&wt(n)){const O=P[0],L=P.indexOf(`
|
|
105
|
-
`),ae=L!==-1,_e=i.inFlow??n.flow??n.items.length===0;if(ae||!_e){let Me=!1;if(ae&&(O==="&"||O==="!")){let ve=P.indexOf(" ");O==="&"&&ve!==-1&&ve<L&&P[ve+1]==="!"&&(ve=P.indexOf(" ",ve+1)),(ve===-1||L<ve)&&(Me=!0)}Me||(re=`
|
|
106
|
-
${i.indent}`)}}else(P===""||P[0]===`
|
|
107
|
-
`)&&(re="");return E+=re+P,i.inFlow?V&&r&&r():X&&!V?E+=Mi(E,i.indent,b(X)):A&&l&&l(),E}function S5(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const cc="<<",ja={identify:e=>e===cc||typeof e=="symbol"&&e.description===cc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(cc)),{addToJSMap:Z1}),stringify:()=>cc},x5=(e,n)=>(ja.identify(n)||ot(n)&&(!n.type||n.type===Te.PLAIN)&&ja.identify(n.value))&&e?.doc.schema.tags.some(i=>i.tag===ja.tag&&i.default);function Z1(e,n,i){if(i=e&&Hi(i)?i.resolve(e.doc):i,Do(i))for(const r of i.items)If(e,n,r);else if(Array.isArray(i))for(const r of i)If(e,n,r);else If(e,n,i)}function If(e,n,i){const r=e&&Hi(i)?i.resolve(e.doc):i;if(!Oo(r))throw new Error("Merge sources must be maps or map aliases");const l=r.toJSON(null,e,Map);for(const[c,d]of l)n instanceof Map?n.has(c)||n.set(c,d):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return n}function Y1(e,n,{key:i,value:r}){if(jt(i)&&i.addToJSMap)i.addToJSMap(e,n,r);else if(x5(e,i))Z1(e,n,r);else{const l=On(i,"",e);if(n instanceof Map)n.set(l,On(r,l,e));else if(n instanceof Set)n.add(l);else{const c=w5(i,l,e),d=On(r,c,e);c in n?Object.defineProperty(n,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):n[c]=d}}return n}function w5(e,n,i){if(n===null)return"";if(typeof n!="object")return String(n);if(jt(e)&&i?.doc){const r=Q1(i.doc,{});r.anchors=new Set;for(const c of i.anchors.keys())r.anchors.add(c.anchor);r.inFlow=!0,r.inStringifyKey=!0;const l=e.toString(r);if(!i.mapKeyWarned){let c=JSON.stringify(l);c.length>40&&(c=c.substring(0,36)+'..."'),S5(i.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),i.mapKeyWarned=!0}return l}return JSON.stringify(n)}function Nm(e,n,i){const r=ko(e,void 0,i),l=ko(n,void 0,i);return new Xt(r,l)}class Xt{constructor(n,i=null){Object.defineProperty(this,zn,{value:U1}),this.key=n,this.value=i}clone(n){let{key:i,value:r}=this;return jt(i)&&(i=i.clone(n)),jt(r)&&(r=r.clone(n)),new Xt(i,r)}toJSON(n,i){const r=i?.mapAsMap?new Map:{};return Y1(i,r,this)}toString(n,i,r){return n?.doc?v5(this,n,i,r):JSON.stringify(this)}}function F1(e,n,i){return(n.inFlow??e.flow?N5:j5)(e,n,i)}function j5({comment:e,items:n},i,{blockItemPrefix:r,flowChars:l,itemIndent:c,onChompKeep:d,onComment:h}){const{indent:g,options:{commentString:b}}=i,x=Object.assign({},i,{indent:c,type:null});let w=!1;const N=[];for(let D=0;D<n.length;++D){const A=n[D];let E=null;if(jt(A))!w&&A.spaceBefore&&N.push(""),Oc(i,N,A.commentBefore,w),A.comment&&(E=A.comment);else if(Nt(A)){const G=jt(A.key)?A.key:null;G&&(!w&&G.spaceBefore&&N.push(""),Oc(i,N,G.commentBefore,w))}w=!1;let R=ir(A,x,()=>E=null,()=>w=!0);E&&(R+=Mi(R,c,b(E))),w&&E&&(w=!1),N.push(r+R)}let C;if(N.length===0)C=l.start+l.end;else{C=N[0];for(let D=1;D<N.length;++D){const A=N[D];C+=A?`
|
|
108
|
-
${g}${A}`:`
|
|
109
|
-
`}}return e?(C+=`
|
|
110
|
-
`+xa(b(e),g),h&&h()):w&&d&&d(),C}function N5({items:e},n,{flowChars:i,itemIndent:r}){const{indent:l,indentStep:c,flowCollectionPadding:d,options:{commentString:h}}=n;r+=c;const g=Object.assign({},n,{indent:r,inFlow:!0,type:null});let b=!1,x=0;const w=[];for(let D=0;D<e.length;++D){const A=e[D];let E=null;if(jt(A))A.spaceBefore&&w.push(""),Oc(n,w,A.commentBefore,!1),A.comment&&(E=A.comment);else if(Nt(A)){const G=jt(A.key)?A.key:null;G&&(G.spaceBefore&&w.push(""),Oc(n,w,G.commentBefore,!1),G.comment&&(b=!0));const X=jt(A.value)?A.value:null;X?(X.comment&&(E=X.comment),X.commentBefore&&(b=!0)):A.value==null&&G?.comment&&(E=G.comment)}E&&(b=!0);let R=ir(A,g,()=>E=null);D<e.length-1&&(R+=","),E&&(R+=Mi(R,r,h(E))),!b&&(w.length>x||R.includes(`
|
|
111
|
-
`))&&(b=!0),w.push(R),x=w.length}const{start:N,end:C}=i;if(w.length===0)return N+C;if(!b){const D=w.reduce((A,E)=>A+E.length+2,2);b=n.options.lineWidth>0&&D>n.options.lineWidth}if(b){let D=N;for(const A of w)D+=A?`
|
|
112
|
-
${c}${l}${A}`:`
|
|
113
|
-
`;return`${D}
|
|
114
|
-
${l}${C}`}else return`${N}${d}${w.join(" ")}${d}${C}`}function Oc({indent:e,options:{commentString:n}},i,r,l){if(r&&l&&(r=r.replace(/^\n+/,"")),r){const c=xa(n(r),e);i.push(c.trimStart())}}function Bi(e,n){const i=ot(n)?n.value:n;for(const r of e)if(Nt(r)&&(r.key===n||r.key===i||ot(r.key)&&r.key.value===i))return r}class En extends H1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(ii,n),this.items=[]}static from(n,i,r){const{keepUndefined:l,replacer:c}=r,d=new this(n),h=(g,b)=>{if(typeof c=="function")b=c.call(i,g,b);else if(Array.isArray(c)&&!c.includes(g))return;(b!==void 0||l)&&d.items.push(Nm(g,b,r))};if(i instanceof Map)for(const[g,b]of i)h(g,b);else if(i&&typeof i=="object")for(const g of Object.keys(i))h(g,i[g]);return typeof n.sortMapEntries=="function"&&d.items.sort(n.sortMapEntries),d}add(n,i){let r;Nt(n)?r=n:!n||typeof n!="object"||!("key"in n)?r=new Xt(n,n?.value):r=new Xt(n.key,n.value);const l=Bi(this.items,r.key),c=this.schema?.sortMapEntries;if(l){if(!i)throw new Error(`Key ${r.key} already set`);ot(l.value)&&G1(r.value)?l.value.value=r.value:l.value=r.value}else if(c){const d=this.items.findIndex(h=>c(r,h)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(n){const i=Bi(this.items,n);return i?this.items.splice(this.items.indexOf(i),1).length>0:!1}get(n,i){const l=Bi(this.items,n)?.value;return(!i&&ot(l)?l.value:l)??void 0}has(n){return!!Bi(this.items,n)}set(n,i){this.add(new Xt(n,i),!0)}toJSON(n,i,r){const l=r?new r:i?.mapAsMap?new Map:{};i?.onCreate&&i.onCreate(l);for(const c of this.items)Y1(i,l,c);return l}toString(n,i,r){if(!n)return JSON.stringify(this);for(const l of this.items)if(!Nt(l))throw new Error(`Map items must all be pairs; found ${JSON.stringify(l)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),F1(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:r,onComment:i})}}const pr={collection:"map",default:!0,nodeClass:En,tag:"tag:yaml.org,2002:map",resolve(e,n){return Oo(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,i)=>En.from(e,n,i)};class Li extends H1{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(dr,n),this.items=[]}add(n){this.items.push(n)}delete(n){const i=uc(n);return typeof i!="number"?!1:this.items.splice(i,1).length>0}get(n,i){const r=uc(n);if(typeof r!="number")return;const l=this.items[r];return!i&&ot(l)?l.value:l}has(n){const i=uc(n);return typeof i=="number"&&i<this.items.length}set(n,i){const r=uc(n);if(typeof r!="number")throw new Error(`Expected a valid index, not ${n}.`);const l=this.items[r];ot(l)&&G1(i)?l.value=i:this.items[r]=i}toJSON(n,i){const r=[];i?.onCreate&&i.onCreate(r);let l=0;for(const c of this.items)r.push(On(c,String(l++),i));return r}toString(n,i,r){return n?F1(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:r,onComment:i}):JSON.stringify(this)}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i)){let d=0;for(let h of i){if(typeof l=="function"){const g=i instanceof Set?h:String(d++);h=l.call(i,g,h)}c.items.push(ko(h,void 0,r))}}return c}}function uc(e){let n=ot(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const mr={collection:"seq",default:!0,nodeClass:Li,tag:"tag:yaml.org,2002:seq",resolve(e,n){return Do(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,i)=>Li.from(e,n,i)},tu={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,i,r){return n=Object.assign({actualString:!0},n),jm(e,n,i,r)}},nu={identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:e},n)=>typeof e=="string"&&nu.test.test(e)?e:n.options.nullStr},km={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Te(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},i){if(e&&km.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(n===r)return e}return n?i.options.trueStr:i.options.falseStr}};function Vn({format:e,minFractionDigits:n,tag:i,value:r}){if(typeof r=="bigint")return String(r);const l=typeof r=="number"?r:Number(r);if(!isFinite(l))return isNaN(l)?".nan":l<0?"-.inf":".inf";let c=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&n&&(!i||i==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let h=n-(c.length-d-1);for(;h-- >0;)c+="0"}return c}const X1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Vn},J1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Vn(e)}},W1={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new Te(parseFloat(e)),i=e.indexOf(".");return i!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-i-1),n},stringify:Vn},au=e=>typeof e=="bigint"||Number.isInteger(e),Am=(e,n,i,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(n),i);function ex(e,n,i){const{value:r}=e;return au(r)&&r>=0?i+r.toString(n):Vn(e)}const tx={identify:e=>au(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,i)=>Am(e,2,8,i),stringify:e=>ex(e,8,"0o")},nx={identify:au,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,i)=>Am(e,0,10,i),stringify:Vn},ax={identify:e=>au(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,i)=>Am(e,2,16,i),stringify:e=>ex(e,16,"0x")},k5=[pr,mr,tu,nu,km,tx,nx,ax,X1,J1,W1];function Yv(e){return typeof e=="bigint"||Number.isInteger(e)}const dc=({value:e})=>JSON.stringify(e),A5=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:dc},{identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:dc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:dc},{identify:Yv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:i})=>i?BigInt(e):parseInt(e,10),stringify:({value:e})=>Yv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:dc}],C5={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},_5=[pr,mr].concat(A5,C5),Cm={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const i=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(i.length);for(let l=0;l<i.length;++l)r[l]=i.charCodeAt(l);return r}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:i},r,l,c){if(!i)return"";const d=i;let h;if(typeof btoa=="function"){let g="";for(let b=0;b<d.length;++b)g+=String.fromCharCode(d[b]);h=btoa(g)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Te.BLOCK_LITERAL),n!==Te.QUOTE_DOUBLE){const g=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),b=Math.ceil(h.length/g),x=new Array(b);for(let w=0,N=0;w<b;++w,N+=g)x[w]=h.substr(N,g);h=x.join(n===Te.BLOCK_LITERAL?`
|
|
115
|
-
`:" ")}return jm({comment:e,type:n,value:h},r,l,c)}};function ix(e,n){if(Do(e))for(let i=0;i<e.items.length;++i){let r=e.items[i];if(!Nt(r)){if(Oo(r)){r.items.length>1&&n("Each pair must have its own sequence indicator");const l=r.items[0]||new Xt(new Te(null));if(r.commentBefore&&(l.key.commentBefore=l.key.commentBefore?`${r.commentBefore}
|
|
116
|
-
${l.key.commentBefore}`:r.commentBefore),r.comment){const c=l.value??l.key;c.comment=c.comment?`${r.comment}
|
|
117
|
-
${c.comment}`:r.comment}r=l}e.items[i]=Nt(r)?r:new Xt(r)}}else n("Expected a sequence for this tag");return e}function sx(e,n,i){const{replacer:r}=i,l=new Li(e);l.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let d of n){typeof r=="function"&&(d=r.call(n,String(c++),d));let h,g;if(Array.isArray(d))if(d.length===2)h=d[0],g=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const b=Object.keys(d);if(b.length===1)h=b[0],g=d[h];else throw new TypeError(`Expected tuple with one key, not ${b.length} keys`)}else h=d;l.items.push(Nm(h,g,i))}return l}const _m={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:ix,createNode:sx};class Ys extends Li{constructor(){super(),this.add=En.prototype.add.bind(this),this.delete=En.prototype.delete.bind(this),this.get=En.prototype.get.bind(this),this.has=En.prototype.has.bind(this),this.set=En.prototype.set.bind(this),this.tag=Ys.tag}toJSON(n,i){if(!i)return super.toJSON(n);const r=new Map;i?.onCreate&&i.onCreate(r);for(const l of this.items){let c,d;if(Nt(l)?(c=On(l.key,"",i),d=On(l.value,c,i)):c=On(l,"",i),r.has(c))throw new Error("Ordered maps must not include duplicate keys");r.set(c,d)}return r}static from(n,i,r){const l=sx(n,i,r),c=new this;return c.items=l.items,c}}Ys.tag="tag:yaml.org,2002:omap";const Tm={collection:"seq",identify:e=>e instanceof Map,nodeClass:Ys,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const i=ix(e,n),r=[];for(const{key:l}of i.items)ot(l)&&(r.includes(l.value)?n(`Ordered maps must not include duplicate keys: ${l.value}`):r.push(l.value));return Object.assign(new Ys,i)},createNode:(e,n,i)=>Ys.from(e,n,i)};function rx({value:e,source:n},i){return n&&(e?ox:lx).test.test(n)?n:e?i.options.trueStr:i.options.falseStr}const ox={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Te(!0),stringify:rx},lx={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Te(!1),stringify:rx},T5={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Vn},E5={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():Vn(e)}},O5={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new Te(parseFloat(e.replace(/_/g,""))),i=e.indexOf(".");if(i!==-1){const r=e.substring(i+1).replace(/_/g,"");r[r.length-1]==="0"&&(n.minFractionDigits=r.length)}return n},stringify:Vn},zo=e=>typeof e=="bigint"||Number.isInteger(e);function iu(e,n,i,{intAsBigInt:r}){const l=e[0];if((l==="-"||l==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),r){switch(i){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return l==="-"?BigInt(-1)*d:d}const c=parseInt(e,i);return l==="-"?-1*c:c}function Em(e,n,i){const{value:r}=e;if(zo(r)){const l=r.toString(n);return r<0?"-"+i+l.substr(1):i+l}return Vn(e)}const D5={identify:zo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,i)=>iu(e,2,2,i),stringify:e=>Em(e,2,"0b")},z5={identify:zo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,i)=>iu(e,1,8,i),stringify:e=>Em(e,8,"0")},R5={identify:zo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,i)=>iu(e,0,10,i),stringify:Vn},M5={identify:zo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,i)=>iu(e,2,16,i),stringify:e=>Em(e,16,"0x")};class Fs extends En{constructor(n){super(n),this.tag=Fs.tag}add(n){let i;Nt(n)?i=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?i=new Xt(n.key,null):i=new Xt(n,null),Bi(this.items,i.key)||this.items.push(i)}get(n,i){const r=Bi(this.items,n);return!i&&Nt(r)?ot(r.key)?r.key.value:r.key:r}set(n,i){if(typeof i!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof i}`);const r=Bi(this.items,n);r&&!i?this.items.splice(this.items.indexOf(r),1):!r&&i&&this.items.push(new Xt(n))}toJSON(n,i){return super.toJSON(n,i,Set)}toString(n,i,r){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),i,r);throw new Error("Set items must all have null values")}static from(n,i,r){const{replacer:l}=r,c=new this(n);if(i&&Symbol.iterator in Object(i))for(let d of i)typeof l=="function"&&(d=l.call(i,d,d)),c.items.push(Nm(d,null,r));return c}}Fs.tag="tag:yaml.org,2002:set";const Om={collection:"map",identify:e=>e instanceof Set,nodeClass:Fs,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,i)=>Fs.from(e,n,i),resolve(e,n){if(Oo(e)){if(e.hasAllNullValues(!0))return Object.assign(new Fs,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Dm(e,n){const i=e[0],r=i==="-"||i==="+"?e.substring(1):e,l=d=>n?BigInt(d):Number(d),c=r.replace(/_/g,"").split(":").reduce((d,h)=>d*l(60)+l(h),l(0));return i==="-"?l(-1)*c:c}function cx(e){let{value:n}=e,i=d=>d;if(typeof n=="bigint")i=d=>BigInt(d);else if(isNaN(n)||!isFinite(n))return Vn(e);let r="";n<0&&(r="-",n*=i(-1));const l=i(60),c=[n%l];return n<60?c.unshift(0):(n=(n-c[0])/l,c.unshift(n%l),n>=60&&(n=(n-c[0])/l,c.unshift(n))),r+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const ux={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:i})=>Dm(e,i),stringify:cx},dx={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Dm(e,!1),stringify:cx},su={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const n=e.match(su.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,i,r,l,c,d,h]=n.map(Number),g=n[7]?Number((n[7]+"00").substr(1,3)):0;let b=Date.UTC(i,r-1,l,c||0,d||0,h||0,g);const x=n[8];if(x&&x!=="Z"){let w=Dm(x,!1);Math.abs(w)<30&&(w*=60),b-=6e4*w}return new Date(b)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Fv=[pr,mr,tu,nu,ox,lx,D5,z5,R5,M5,T5,E5,O5,Cm,ja,Tm,_m,Om,ux,dx,su],Xv=new Map([["core",k5],["failsafe",[pr,mr,tu]],["json",_5],["yaml11",Fv],["yaml-1.1",Fv]]),Jv={binary:Cm,bool:km,float:W1,floatExp:J1,floatNaN:X1,floatTime:dx,int:nx,intHex:ax,intOct:tx,intTime:ux,map:pr,merge:ja,null:nu,omap:Tm,pairs:_m,seq:mr,set:Om,timestamp:su},B5={"tag:yaml.org,2002:binary":Cm,"tag:yaml.org,2002:merge":ja,"tag:yaml.org,2002:omap":Tm,"tag:yaml.org,2002:pairs":_m,"tag:yaml.org,2002:set":Om,"tag:yaml.org,2002:timestamp":su};function Pf(e,n,i){const r=Xv.get(n);if(r&&!e)return i&&!r.includes(ja)?r.concat(ja):r.slice();let l=r;if(!l)if(Array.isArray(e))l=[];else{const c=Array.from(Xv.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)l=l.concat(c);else typeof e=="function"&&(l=e(l.slice()));return i&&(l=l.concat(ja)),l.reduce((c,d)=>{const h=typeof d=="string"?Jv[d]:d;if(!h){const g=JSON.stringify(d),b=Object.keys(Jv).map(x=>JSON.stringify(x)).join(", ");throw new Error(`Unknown custom tag ${g}; use one of ${b}`)}return c.includes(h)||c.push(h),c},[])}const L5=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class zm{constructor({compat:n,customTags:i,merge:r,resolveKnownTags:l,schema:c,sortMapEntries:d,toStringDefaults:h}){this.compat=Array.isArray(n)?Pf(n,"compat"):n?Pf(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=l?B5:{},this.tags=Pf(i,this.name,r),this.toStringOptions=h??null,Object.defineProperty(this,ii,{value:pr}),Object.defineProperty(this,Xn,{value:tu}),Object.defineProperty(this,dr,{value:mr}),this.sortMapEntries=typeof d=="function"?d:d===!0?L5:null}clone(){const n=Object.create(zm.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function q5(e,n){const i=[];let r=n.directives===!0;if(n.directives!==!1&&e.directives){const g=e.directives.toString(e);g?(i.push(g),r=!0):e.directives.docStart&&(r=!0)}r&&i.push("---");const l=Q1(e,n),{commentString:c}=l.options;if(e.commentBefore){i.length!==1&&i.unshift("");const g=c(e.commentBefore);i.unshift(xa(g,""))}let d=!1,h=null;if(e.contents){if(jt(e.contents)){if(e.contents.spaceBefore&&r&&i.push(""),e.contents.commentBefore){const x=c(e.contents.commentBefore);i.push(xa(x,""))}l.forceBlockIndent=!!e.comment,h=e.contents.comment}const g=h?void 0:()=>d=!0;let b=ir(e.contents,l,()=>h=null,g);h&&(b+=Mi(b,"",c(h))),(b[0]==="|"||b[0]===">")&&i[i.length-1]==="---"?i[i.length-1]=`--- ${b}`:i.push(b)}else i.push(ir(e.contents,l));if(e.directives?.docEnd)if(e.comment){const g=c(e.comment);g.includes(`
|
|
118
|
-
`)?(i.push("..."),i.push(xa(g,""))):i.push(`... ${g}`)}else i.push("...");else{let g=e.comment;g&&d&&(g=g.replace(/^\n+/,"")),g&&((!d||h)&&i[i.length-1]!==""&&i.push(""),i.push(xa(c(g),"")))}return i.join(`
|
|
119
|
-
`)+`
|
|
120
|
-
`}class ru{constructor(n,i,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,zn,{value:mp});let l=null;typeof i=="function"||Array.isArray(i)?l=i:r===void 0&&i&&(r=i,i=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=c;let{version:d}=c;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new Zt({version:d}),this.setSchema(d,r),this.contents=n===void 0?null:this.createNode(n,l,r)}clone(){const n=Object.create(ru.prototype,{[zn]:{value:mp}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=jt(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Us(this.contents)&&this.contents.add(n)}addIn(n,i){Us(this.contents)&&this.contents.addIn(n,i)}createAlias(n,i){if(!n.anchor){const r=P1(this);n.anchor=!i||r.has(i)?V1(i||"a",r):i}return new wm(n.anchor)}createNode(n,i,r){let l;if(typeof i=="function")n=i.call({"":n},"",n),l=i;else if(Array.isArray(i)){const E=G=>typeof G=="number"||G instanceof String||G instanceof Number,R=i.filter(E).map(String);R.length>0&&(i=i.concat(R)),l=i}else r===void 0&&i&&(r=i,i=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:h,keepUndefined:g,onTagObj:b,tag:x}=r??{},{onAnchor:w,setAnchors:N,sourceObjects:C}=d5(this,d||"a"),D={aliasDuplicateObjects:c??!0,keepUndefined:g??!1,onAnchor:w,onTagObj:b,replacer:l,schema:this.schema,sourceObjects:C},A=ko(n,x,D);return h&&wt(A)&&(A.flow=!0),N(),A}createPair(n,i,r={}){const l=this.createNode(n,null,r),c=this.createNode(i,null,r);return new Xt(l,c)}delete(n){return Us(this.contents)?this.contents.delete(n):!1}deleteIn(n){return yo(n)?this.contents==null?!1:(this.contents=null,!0):Us(this.contents)?this.contents.deleteIn(n):!1}get(n,i){return wt(this.contents)?this.contents.get(n,i):void 0}getIn(n,i){return yo(n)?!i&&ot(this.contents)?this.contents.value:this.contents:wt(this.contents)?this.contents.getIn(n,i):void 0}has(n){return wt(this.contents)?this.contents.has(n):!1}hasIn(n){return yo(n)?this.contents!==void 0:wt(this.contents)?this.contents.hasIn(n):!1}set(n,i){this.contents==null?this.contents=Ec(this.schema,[n],i):Us(this.contents)&&this.contents.set(n,i)}setIn(n,i){yo(n)?this.contents=i:this.contents==null?this.contents=Ec(this.schema,Array.from(n),i):Us(this.contents)&&this.contents.setIn(n,i)}setSchema(n,i={}){typeof n=="number"&&(n=String(n));let r;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Zt({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new Zt({version:n}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const l=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${l}`)}}if(i.schema instanceof Object)this.schema=i.schema;else if(r)this.schema=new zm(Object.assign(r,i));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:i,mapAsMap:r,maxAliasCount:l,onAnchor:c,reviver:d}={}){const h={anchors:new Map,doc:this,keep:!n,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof l=="number"?l:100},g=On(this.contents,i??"",h);if(typeof c=="function")for(const{count:b,res:x}of h.anchors.values())c(x,b);return typeof d=="function"?Gs(d,{"":g},"",g):g}toJSON(n,i){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:i})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const i=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${i}`)}return q5(this,n)}}function Us(e){if(wt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class fx extends Error{constructor(n,i,r,l){super(),this.name=n,this.code=r,this.message=l,this.pos=i}}class fc extends fx{constructor(n,i,r){super("YAMLParseError",n,i,r)}}class U5 extends fx{constructor(n,i,r){super("YAMLWarning",n,i,r)}}const Wv=(e,n)=>i=>{if(i.pos[0]===-1)return;i.linePos=i.pos.map(h=>n.linePos(h));const{line:r,col:l}=i.linePos[0];i.message+=` at line ${r}, column ${l}`;let c=l-1,d=e.substring(n.lineStarts[r-1],n.lineStarts[r]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const h=Math.min(c-39,d.length-79);d="…"+d.substring(h),c-=h-1}if(d.length>80&&(d=d.substring(0,79)+"…"),r>1&&/^ *$/.test(d.substring(0,c))){let h=e.substring(n.lineStarts[r-2],n.lineStarts[r-1]);h.length>80&&(h=h.substring(0,79)+`…
|
|
121
|
-
`),d=h+d}if(/[^ ]/.test(d)){let h=1;const g=i.linePos[1];g?.line===r&&g.col>l&&(h=Math.max(1,Math.min(g.col-l,80-c)));const b=" ".repeat(c)+"^".repeat(h);i.message+=`:
|
|
122
|
-
|
|
123
|
-
${d}
|
|
124
|
-
${b}
|
|
125
|
-
`}};function sr(e,{flow:n,indicator:i,next:r,offset:l,onError:c,parentIndent:d,startOnNewline:h}){let g=!1,b=h,x=h,w="",N="",C=!1,D=!1,A=null,E=null,R=null,G=null,X=null,V=null,P=null;for(const L of e)switch(D&&(L.type!=="space"&&L.type!=="newline"&&L.type!=="comma"&&c(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),D=!1),A&&(b&&L.type!=="comment"&&L.type!=="newline"&&c(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),A=null),L.type){case"space":!n&&(i!=="doc-start"||r?.type!=="flow-collection")&&L.source.includes(" ")&&(A=L),x=!0;break;case"comment":{x||c(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const ae=L.source.substring(1)||" ";w?w+=N+ae:w=ae,N="",b=!1;break}case"newline":b?w?w+=L.source:(!V||i!=="seq-item-ind")&&(g=!0):N+=L.source,b=!0,C=!0,(E||R)&&(G=L),x=!0;break;case"anchor":E&&c(L,"MULTIPLE_ANCHORS","A node can have at most one anchor"),L.source.endsWith(":")&&c(L.offset+L.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),E=L,P??(P=L.offset),b=!1,x=!1,D=!0;break;case"tag":{R&&c(L,"MULTIPLE_TAGS","A node can have at most one tag"),R=L,P??(P=L.offset),b=!1,x=!1,D=!0;break}case i:(E||R)&&c(L,"BAD_PROP_ORDER",`Anchors and tags must be after the ${L.source} indicator`),V&&c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.source} in ${n??"collection"}`),V=L,b=i==="seq-item-ind"||i==="explicit-key-ind",x=!1;break;case"comma":if(n){X&&c(L,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),X=L,b=!1,x=!1;break}default:c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.type} token`),b=!1,x=!1}const re=e[e.length-1],O=re?re.offset+re.source.length:l;return D&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&c(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A&&(b&&A.indent<=d||r?.type==="block-map"||r?.type==="block-seq")&&c(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:X,found:V,spaceBefore:g,comment:w,hasNewline:C,anchor:E,tag:R,newlineAfterProp:G,end:O,start:P??O}}function Ao(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
126
|
-
`))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const i of n.start)if(i.type==="newline")return!0;if(n.sep){for(const i of n.sep)if(i.type==="newline")return!0}if(Ao(n.key)||Ao(n.value))return!0}return!1;default:return!0}}function bp(e,n,i){if(n?.type==="flow-collection"){const r=n.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ao(n)&&i(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function px(e,n,i){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const l=typeof r=="function"?r:(c,d)=>c===d||ot(c)&&ot(d)&&c.value===d.value;return n.some(c=>l(c.key,i))}const e0="All mapping items must start at the same column";function $5({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??En,h=new d(i.schema);i.atRoot&&(i.atRoot=!1);let g=r.offset,b=null;for(const x of r.items){const{start:w,key:N,sep:C,value:D}=x,A=sr(w,{indicator:"explicit-key-ind",next:N??C?.[0],offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0}),E=!A.found;if(E){if(N&&(N.type==="block-seq"?l(g,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in N&&N.indent!==r.indent&&l(g,"BAD_INDENT",e0)),!A.anchor&&!A.tag&&!C){b=A.end,A.comment&&(h.comment?h.comment+=`
|
|
127
|
-
`+A.comment:h.comment=A.comment);continue}(A.newlineAfterProp||Ao(N))&&l(N??w[w.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else A.found?.indent!==r.indent&&l(g,"BAD_INDENT",e0);i.atKey=!0;const R=A.end,G=N?e(i,N,A,l):n(i,R,w,null,A,l);i.schema.compat&&bp(r.indent,N,l),i.atKey=!1,px(i,h.items,G)&&l(R,"DUPLICATE_KEY","Map keys must be unique");const X=sr(C??[],{indicator:"map-value-ind",next:D,offset:G.range[2],onError:l,parentIndent:r.indent,startOnNewline:!N||N.type==="block-scalar"});if(g=X.end,X.found){E&&(D?.type==="block-map"&&!X.hasNewline&&l(g,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),i.options.strict&&A.start<X.found.offset-1024&&l(G.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const V=D?e(i,D,X,l):n(i,g,C,null,X,l);i.schema.compat&&bp(r.indent,D,l),g=V.range[2];const P=new Xt(G,V);i.options.keepSourceTokens&&(P.srcToken=x),h.items.push(P)}else{E&&l(G.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),X.comment&&(G.comment?G.comment+=`
|
|
128
|
-
`+X.comment:G.comment=X.comment);const V=new Xt(G);i.options.keepSourceTokens&&(V.srcToken=x),h.items.push(V)}}return b&&b<g&&l(b,"IMPOSSIBLE","Map comment with trailing content"),h.range=[r.offset,g,b??g],h}function I5({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=c?.nodeClass??Li,h=new d(i.schema);i.atRoot&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let g=r.offset,b=null;for(const{start:x,value:w}of r.items){const N=sr(x,{indicator:"seq-item-ind",next:w,offset:g,onError:l,parentIndent:r.indent,startOnNewline:!0});if(!N.found)if(N.anchor||N.tag||w)w?.type==="block-seq"?l(N.end,"BAD_INDENT","All sequence items must start at the same column"):l(g,"MISSING_CHAR","Sequence item without - indicator");else{b=N.end,N.comment&&(h.comment=N.comment);continue}const C=w?e(i,w,N,l):n(i,N.end,x,null,N,l);i.schema.compat&&bp(r.indent,w,l),g=C.range[2],h.items.push(C)}return h.range=[r.offset,g,b??g],h}function Ro(e,n,i,r){let l="";if(e){let c=!1,d="";for(const h of e){const{source:g,type:b}=h;switch(b){case"space":c=!0;break;case"comment":{i&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const x=g.substring(1)||" ";l?l+=d+x:l=x,d="";break}case"newline":l&&(d+=g),c=!0;break;default:r(h,"UNEXPECTED_TOKEN",`Unexpected ${b} at node end`)}n+=g.length}}return{comment:l,offset:n}}const Vf="Block collections are not allowed within flow collections",Gf=e=>e&&(e.type==="block-map"||e.type==="block-seq");function P5({composeNode:e,composeEmptyNode:n},i,r,l,c){const d=r.start.source==="{",h=d?"flow map":"flow sequence",g=c?.nodeClass??(d?En:Li),b=new g(i.schema);b.flow=!0;const x=i.atRoot;x&&(i.atRoot=!1),i.atKey&&(i.atKey=!1);let w=r.offset+r.start.source.length;for(let E=0;E<r.items.length;++E){const R=r.items[E],{start:G,key:X,sep:V,value:P}=R,re=sr(G,{flow:h,indicator:"explicit-key-ind",next:X??V?.[0],offset:w,onError:l,parentIndent:r.indent,startOnNewline:!1});if(!re.found){if(!re.anchor&&!re.tag&&!V&&!P){E===0&&re.comma?l(re.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`):E<r.items.length-1&&l(re.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${h}`),re.comment&&(b.comment?b.comment+=`
|
|
129
|
-
`+re.comment:b.comment=re.comment),w=re.end;continue}!d&&i.options.strict&&Ao(X)&&l(X,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)re.comma&&l(re.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${h}`);else if(re.comma||l(re.start,"MISSING_CHAR",`Missing , between ${h} items`),re.comment){let O="";e:for(const L of G)switch(L.type){case"comma":case"space":break;case"comment":O=L.source.substring(1);break e;default:break e}if(O){let L=b.items[b.items.length-1];Nt(L)&&(L=L.value??L.key),L.comment?L.comment+=`
|
|
130
|
-
`+O:L.comment=O,re.comment=re.comment.substring(O.length+1)}}if(!d&&!V&&!re.found){const O=P?e(i,P,re,l):n(i,re.end,V,null,re,l);b.items.push(O),w=O.range[2],Gf(P)&&l(O.range,"BLOCK_IN_FLOW",Vf)}else{i.atKey=!0;const O=re.end,L=X?e(i,X,re,l):n(i,O,G,null,re,l);Gf(X)&&l(L.range,"BLOCK_IN_FLOW",Vf),i.atKey=!1;const ae=sr(V??[],{flow:h,indicator:"map-value-ind",next:P,offset:L.range[2],onError:l,parentIndent:r.indent,startOnNewline:!1});if(ae.found){if(!d&&!re.found&&i.options.strict){if(V)for(const ve of V){if(ve===ae.found)break;if(ve.type==="newline"){l(ve,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}re.start<ae.found.offset-1024&&l(ae.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else P&&("source"in P&&P.source?.[0]===":"?l(P,"MISSING_CHAR",`Missing space after : in ${h}`):l(ae.start,"MISSING_CHAR",`Missing , or : between ${h} items`));const _e=P?e(i,P,ae,l):ae.found?n(i,ae.end,V,null,ae,l):null;_e?Gf(P)&&l(_e.range,"BLOCK_IN_FLOW",Vf):ae.comment&&(L.comment?L.comment+=`
|
|
131
|
-
`+ae.comment:L.comment=ae.comment);const Me=new Xt(L,_e);if(i.options.keepSourceTokens&&(Me.srcToken=R),d){const ve=b;px(i,ve.items,L)&&l(O,"DUPLICATE_KEY","Map keys must be unique"),ve.items.push(Me)}else{const ve=new En(i.schema);ve.flow=!0,ve.items.push(Me);const it=(_e??L).range;ve.range=[L.range[0],it[1],it[2]],b.items.push(ve)}w=_e?_e.range[2]:ae.end}}const N=d?"}":"]",[C,...D]=r.end;let A=w;if(C?.source===N)A=C.offset+C.source.length;else{const E=h[0].toUpperCase()+h.substring(1),R=x?`${E} must end with a ${N}`:`${E} in block collection must be sufficiently indented and end with a ${N}`;l(w,x?"MISSING_CHAR":"BAD_INDENT",R),C&&C.source.length!==1&&D.unshift(C)}if(D.length>0){const E=Ro(D,A,i.options.strict,l);E.comment&&(b.comment?b.comment+=`
|
|
132
|
-
`+E.comment:b.comment=E.comment),b.range=[r.offset,A,E.offset]}else b.range=[r.offset,A,A];return b}function Hf(e,n,i,r,l,c){const d=i.type==="block-map"?$5(e,n,i,r,c):i.type==="block-seq"?I5(e,n,i,r,c):P5(e,n,i,r,c),h=d.constructor;return l==="!"||l===h.tagName?(d.tag=h.tagName,d):(l&&(d.tag=l),d)}function V5(e,n,i,r,l){const c=r.tag,d=c?n.directives.tagName(c.source,N=>l(c,"TAG_RESOLVE_FAILED",N)):null;if(i.type==="block-seq"){const{anchor:N,newlineAfterProp:C}=r,D=N&&c?N.offset>c.offset?N:c:N??c;D&&(!C||C.offset<D.offset)&&l(D,"MISSING_CHAR","Missing newline after block sequence props")}const h=i.type==="block-map"?"map":i.type==="block-seq"?"seq":i.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===En.tagName&&h==="map"||d===Li.tagName&&h==="seq")return Hf(e,n,i,l,d);let g=n.schema.tags.find(N=>N.tag===d&&N.collection===h);if(!g){const N=n.schema.knownTags[d];if(N?.collection===h)n.schema.tags.push(Object.assign({},N,{default:!1})),g=N;else return N?l(c,"BAD_COLLECTION_TYPE",`${N.tag} used for ${h} collection, but expects ${N.collection??"scalar"}`,!0):l(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),Hf(e,n,i,l,d)}const b=Hf(e,n,i,l,d,g),x=g.resolve?.(b,N=>l(c,"TAG_RESOLVE_FAILED",N),n.options)??b,w=jt(x)?x:new Te(x);return w.range=b.range,w.tag=d,g?.format&&(w.format=g.format),w}function G5(e,n,i){const r=n.offset,l=H5(n,e.options.strict,i);if(!l)return{value:"",type:null,comment:"",range:[r,r,r]};const c=l.mode===">"?Te.BLOCK_FOLDED:Te.BLOCK_LITERAL,d=n.source?K5(n.source):[];let h=d.length;for(let A=d.length-1;A>=0;--A){const E=d[A][1];if(E===""||E==="\r")h=A;else break}if(h===0){const A=l.chomp==="+"&&d.length>0?`
|
|
133
|
-
`.repeat(Math.max(1,d.length-1)):"";let E=r+l.length;return n.source&&(E+=n.source.length),{value:A,type:c,comment:l.comment,range:[r,E,E]}}let g=n.indent+l.indent,b=n.offset+l.length,x=0;for(let A=0;A<h;++A){const[E,R]=d[A];if(R===""||R==="\r")l.indent===0&&E.length>g&&(g=E.length);else{E.length<g&&i(b+E.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),l.indent===0&&(g=E.length),x=A,g===0&&!e.atRoot&&i(b,"BAD_INDENT","Block scalar values in collections must be indented");break}b+=E.length+R.length+1}for(let A=d.length-1;A>=h;--A)d[A][0].length>g&&(h=A+1);let w="",N="",C=!1;for(let A=0;A<x;++A)w+=d[A][0].slice(g)+`
|
|
134
|
-
`;for(let A=x;A<h;++A){let[E,R]=d[A];b+=E.length+R.length+1;const G=R[R.length-1]==="\r";if(G&&(R=R.slice(0,-1)),R&&E.length<g){const V=`Block scalar lines must not be less indented than their ${l.indent?"explicit indentation indicator":"first line"}`;i(b-R.length-(G?2:1),"BAD_INDENT",V),E=""}c===Te.BLOCK_LITERAL?(w+=N+E.slice(g)+R,N=`
|
|
135
|
-
`):E.length>g||R[0]===" "?(N===" "?N=`
|
|
136
|
-
`:!C&&N===`
|
|
137
|
-
`&&(N=`
|
|
138
|
-
|
|
139
|
-
`),w+=N+E.slice(g)+R,N=`
|
|
140
|
-
`,C=!0):R===""?N===`
|
|
141
|
-
`?w+=`
|
|
142
|
-
`:N=`
|
|
143
|
-
`:(w+=N+R,N=" ",C=!1)}switch(l.chomp){case"-":break;case"+":for(let A=h;A<d.length;++A)w+=`
|
|
144
|
-
`+d[A][0].slice(g);w[w.length-1]!==`
|
|
145
|
-
`&&(w+=`
|
|
146
|
-
`);break;default:w+=`
|
|
147
|
-
`}const D=r+l.length+n.source.length;return{value:w,type:c,comment:l.comment,range:[r,D,D]}}function H5({offset:e,props:n},i,r){if(n[0].type!=="block-scalar-header")return r(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:l}=n[0],c=l[0];let d=0,h="",g=-1;for(let N=1;N<l.length;++N){const C=l[N];if(!h&&(C==="-"||C==="+"))h=C;else{const D=Number(C);!d&&D?d=D:g===-1&&(g=e+N)}}g!==-1&&r(g,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${l}`);let b=!1,x="",w=l.length;for(let N=1;N<n.length;++N){const C=n[N];switch(C.type){case"space":b=!0;case"newline":w+=C.source.length;break;case"comment":i&&!b&&r(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),w+=C.source.length,x=C.source.substring(1);break;case"error":r(C,"UNEXPECTED_TOKEN",C.message),w+=C.source.length;break;default:{const D=`Unexpected token in block scalar header: ${C.type}`;r(C,"UNEXPECTED_TOKEN",D);const A=C.source;A&&typeof A=="string"&&(w+=A.length)}}}return{mode:c,indent:d,chomp:h,comment:x,length:w}}function K5(e){const n=e.split(/\n( *)/),i=n[0],r=i.match(/^( *)/),c=[r?.[1]?[r[1],i.slice(r[1].length)]:["",i]];for(let d=1;d<n.length;d+=2)c.push([n[d],n[d+1]]);return c}function Q5(e,n,i){const{offset:r,type:l,source:c,end:d}=e;let h,g;const b=(N,C,D)=>i(r+N,C,D);switch(l){case"scalar":h=Te.PLAIN,g=Z5(c,b);break;case"single-quoted-scalar":h=Te.QUOTE_SINGLE,g=Y5(c,b);break;case"double-quoted-scalar":h=Te.QUOTE_DOUBLE,g=F5(c,b);break;default:return i(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${l}`),{value:"",type:null,comment:"",range:[r,r+c.length,r+c.length]}}const x=r+c.length,w=Ro(d,x,n,i);return{value:g,type:h,comment:w.comment,range:[r,x,w.offset]}}function Z5(e,n){let i="";switch(e[0]){case" ":i="a tab character";break;case",":i="flow indicator character ,";break;case"%":i="directive indicator character %";break;case"|":case">":{i=`block scalar indicator ${e[0]}`;break}case"@":case"`":{i=`reserved character ${e[0]}`;break}}return i&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${i}`),mx(e)}function Y5(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),mx(e.slice(1,-1)).replace(/''/g,"'")}function mx(e){let n,i;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
148
|
-
`,"sy"),i=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
149
|
-
`,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,i=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=n.exec(e);if(!r)return e;let l=r[1],c=" ",d=n.lastIndex;for(i.lastIndex=d;r=i.exec(e);)r[1]===""?c===`
|
|
150
|
-
`?l+=c:c=`
|
|
151
|
-
`:(l+=c+r[1],c=" "),d=i.lastIndex;const h=/[ \t]*(.*)/sy;return h.lastIndex=d,r=h.exec(e),l+c+(r?.[1]??"")}function F5(e,n){let i="";for(let r=1;r<e.length-1;++r){const l=e[r];if(!(l==="\r"&&e[r+1]===`
|
|
152
|
-
`))if(l===`
|
|
153
|
-
`){const{fold:c,offset:d}=X5(e,r);i+=c,r=d}else if(l==="\\"){let c=e[++r];const d=J5[c];if(d)i+=d;else if(c===`
|
|
154
|
-
`)for(c=e[r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="\r"&&e[r+1]===`
|
|
155
|
-
`)for(c=e[++r+1];c===" "||c===" ";)c=e[++r+1];else if(c==="x"||c==="u"||c==="U"){const h={x:2,u:4,U:8}[c];i+=W5(e,r+1,h,n),r+=h}else{const h=e.substr(r-1,2);n(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),i+=h}}else if(l===" "||l===" "){const c=r;let d=e[r+1];for(;d===" "||d===" ";)d=e[++r+1];d!==`
|
|
156
|
-
`&&!(d==="\r"&&e[r+2]===`
|
|
157
|
-
`)&&(i+=r>c?e.slice(c,r+1):l)}else i+=l}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),i}function X5(e,n){let i="",r=e[n+1];for(;(r===" "||r===" "||r===`
|
|
158
|
-
`||r==="\r")&&!(r==="\r"&&e[n+2]!==`
|
|
159
|
-
`);)r===`
|
|
160
|
-
`&&(i+=`
|
|
161
|
-
`),n+=1,r=e[n+1];return i||(i=" "),{fold:i,offset:n}}const J5={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
162
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function W5(e,n,i,r){const l=e.substr(n,i),d=l.length===i&&/^[0-9a-fA-F]+$/.test(l)?parseInt(l,16):NaN;if(isNaN(d)){const h=e.substr(n-2,i+2);return r(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${h}`),h}return String.fromCodePoint(d)}function hx(e,n,i,r){const{value:l,type:c,comment:d,range:h}=n.type==="block-scalar"?G5(e,n,r):Q5(n,e.options.strict,r),g=i?e.directives.tagName(i.source,w=>r(i,"TAG_RESOLVE_FAILED",w)):null;let b;e.options.stringKeys&&e.atKey?b=e.schema[Xn]:g?b=e6(e.schema,l,g,i,r):n.type==="scalar"?b=t6(e,l,n,r):b=e.schema[Xn];let x;try{const w=b.resolve(l,N=>r(i??n,"TAG_RESOLVE_FAILED",N),e.options);x=ot(w)?w:new Te(w)}catch(w){const N=w instanceof Error?w.message:String(w);r(i??n,"TAG_RESOLVE_FAILED",N),x=new Te(l)}return x.range=h,x.source=l,c&&(x.type=c),g&&(x.tag=g),b.format&&(x.format=b.format),d&&(x.comment=d),x}function e6(e,n,i,r,l){if(i==="!")return e[Xn];const c=[];for(const h of e.tags)if(!h.collection&&h.tag===i)if(h.default&&h.test)c.push(h);else return h;for(const h of c)if(h.test?.test(n))return h;const d=e.knownTags[i];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(l(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${i}`,i!=="tag:yaml.org,2002:str"),e[Xn])}function t6({atKey:e,directives:n,schema:i},r,l,c){const d=i.tags.find(h=>(h.default===!0||e&&h.default==="key")&&h.test?.test(r))||i[Xn];if(i.compat){const h=i.compat.find(g=>g.default&&g.test?.test(r))??i[Xn];if(d.tag!==h.tag){const g=n.tagString(d.tag),b=n.tagString(h.tag),x=`Value may be parsed as either ${g} or ${b}`;c(l,"TAG_RESOLVE_FAILED",x,!0)}}return d}function n6(e,n,i){if(n){i??(i=n.length);for(let r=i-1;r>=0;--r){let l=n[r];switch(l.type){case"space":case"comment":case"newline":e-=l.source.length;continue}for(l=n[++r];l?.type==="space";)e+=l.source.length,l=n[++r];break}}return e}const a6={composeNode:gx,composeEmptyNode:Rm};function gx(e,n,i,r){const l=e.atKey,{spaceBefore:c,comment:d,anchor:h,tag:g}=i;let b,x=!0;switch(n.type){case"alias":b=i6(e,n,r),(h||g)&&r(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":b=hx(e,n,g,r),h&&(b.anchor=h.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":b=V5(a6,e,n,i,r),h&&(b.anchor=h.source.substring(1));break;default:{const w=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;r(n,"UNEXPECTED_TOKEN",w),b=Rm(e,n.offset,void 0,null,i,r),x=!1}}return h&&b.anchor===""&&r(h,"BAD_ALIAS","Anchor cannot be an empty string"),l&&e.options.stringKeys&&(!ot(b)||typeof b.value!="string"||b.tag&&b.tag!=="tag:yaml.org,2002:str")&&r(g??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(b.spaceBefore=!0),d&&(n.type==="scalar"&&n.source===""?b.comment=d:b.commentBefore=d),e.options.keepSourceTokens&&x&&(b.srcToken=n),b}function Rm(e,n,i,r,{spaceBefore:l,comment:c,anchor:d,tag:h,end:g},b){const x={type:"scalar",offset:n6(n,i,r),indent:-1,source:""},w=hx(e,x,h,b);return d&&(w.anchor=d.source.substring(1),w.anchor===""&&b(d,"BAD_ALIAS","Anchor cannot be an empty string")),l&&(w.spaceBefore=!0),c&&(w.comment=c,w.range[2]=g),w}function i6({options:e},{offset:n,source:i,end:r},l){const c=new wm(i.substring(1));c.source===""&&l(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&l(n+i.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=n+i.length,h=Ro(r,d,e.strict,l);return c.range=[n,d,h.offset],h.comment&&(c.comment=h.comment),c}function s6(e,n,{offset:i,start:r,value:l,end:c},d){const h=Object.assign({_directives:n},e),g=new ru(void 0,h),b={atKey:!1,atRoot:!0,directives:g.directives,options:g.options,schema:g.schema},x=sr(r,{indicator:"doc-start",next:l??c?.[0],offset:i,onError:d,parentIndent:0,startOnNewline:!0});x.found&&(g.directives.docStart=!0,l&&(l.type==="block-map"||l.type==="block-seq")&&!x.hasNewline&&d(x.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),g.contents=l?gx(b,l,x,d):Rm(b,x.end,r,null,x,d);const w=g.contents.range[2],N=Ro(c,w,!1,d);return N.comment&&(g.comment=N.comment),g.range=[i,w,N.offset],g}function ho(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:i}=e;return[n,n+(typeof i=="string"?i.length:1)]}function t0(e){let n="",i=!1,r=!1;for(let l=0;l<e.length;++l){const c=e[l];switch(c[0]){case"#":n+=(n===""?"":r?`
|
|
163
|
-
|
|
164
|
-
`:`
|
|
165
|
-
`)+(c.substring(1)||" "),i=!0,r=!1;break;case"%":e[l+1]?.[0]!=="#"&&(l+=1),i=!1;break;default:i||(r=!0),i=!1}}return{comment:n,afterEmptyLine:r}}class r6{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(i,r,l,c)=>{const d=ho(i);c?this.warnings.push(new U5(d,r,l)):this.errors.push(new fc(d,r,l))},this.directives=new Zt({version:n.version||"1.2"}),this.options=n}decorate(n,i){const{comment:r,afterEmptyLine:l}=t0(this.prelude);if(r){const c=n.contents;if(i)n.comment=n.comment?`${n.comment}
|
|
166
|
-
${r}`:r;else if(l||n.directives.docStart||!c)n.commentBefore=r;else if(wt(c)&&!c.flow&&c.items.length>0){let d=c.items[0];Nt(d)&&(d=d.key);const h=d.commentBefore;d.commentBefore=h?`${r}
|
|
167
|
-
${h}`:r}else{const d=c.commentBefore;c.commentBefore=d?`${r}
|
|
168
|
-
${d}`:r}}i?(Array.prototype.push.apply(n.errors,this.errors),Array.prototype.push.apply(n.warnings,this.warnings)):(n.errors=this.errors,n.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:t0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,i=!1,r=-1){for(const l of n)yield*this.next(l);yield*this.end(i,r)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(i,r,l)=>{const c=ho(n);c[0]+=i,this.onError(c,"BAD_DIRECTIVE",r,l)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const i=s6(this.options,this.directives,n,this.onError);this.atDirectives&&!i.directives.docStart&&this.onError(n,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(i,!1),this.doc&&(yield this.doc),this.doc=i,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(n.source);break;case"error":{const i=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,r=new fc(ho(n),"UNEXPECTED_TOKEN",i);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new fc(ho(n),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const i=Ro(n.end,n.offset+n.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),i.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
169
|
-
${i.comment}`:i.comment}this.doc.range[2]=i.offset;break}default:this.errors.push(new fc(ho(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,i=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const r=Object.assign({_directives:this.directives},this.options),l=new ru(void 0,r);this.atDirectives&&this.onError(i,"MISSING_CHAR","Missing directives-end indicator line"),l.range=[0,i,i],this.decorate(l,!1),yield l}}}const yx="\uFEFF",bx="",vx="",vp="";function o6(e){switch(e){case yx:return"byte-order-mark";case bx:return"doc-mode";case vx:return"flow-error-end";case vp:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
170
|
-
`:case`\r
|
|
171
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Un(e){switch(e){case void 0:case" ":case`
|
|
172
|
-
`:case"\r":case" ":return!0;default:return!1}}const n0=new Set("0123456789ABCDEFabcdef"),l6=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pc=new Set(",[]{}"),c6=new Set(` ,[]{}
|
|
173
|
-
\r `),Kf=e=>!e||c6.has(e);class u6{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(n,i=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!i;let r=this.next??"stream";for(;r&&(i||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let n=this.pos,i=this.buffer[n];for(;i===" "||i===" ";)i=this.buffer[++n];return!i||i==="#"||i===`
|
|
174
|
-
`?!0:i==="\r"?this.buffer[n+1]===`
|
|
175
|
-
`:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let i=this.buffer[n];if(this.indentNext>0){let r=0;for(;i===" ";)i=this.buffer[++r+n];if(i==="\r"){const l=this.buffer[r+n+1];if(l===`
|
|
176
|
-
`||!l&&!this.atEnd)return n+r+1}return i===`
|
|
177
|
-
`||r>=this.indentNext||!i&&!this.atEnd?n+r:-1}if(i==="-"||i==="."){const r=this.buffer.substr(n,3);if((r==="---"||r==="...")&&Un(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
|
|
178
|
-
`,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===yx&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let i=n.length,r=n.indexOf("#");for(;r!==-1;){const c=n[r-1];if(c===" "||c===" "){i=r-1;break}else r=n.indexOf("#",r+1)}for(;;){const c=n[i-1];if(c===" "||c===" ")i-=1;else break}const l=(yield*this.pushCount(i))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-l),this.pushNewline(),"stream"}if(this.atLineEnd()){const i=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-i),yield*this.pushNewline(),"stream"}return yield bx,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const i=this.peek(3);if((i==="---"||i==="...")&&Un(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,i==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Un(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,i]=this.peek(2);if(!i&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&Un(i)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const n=this.getLine();if(n===null)return this.setNext("doc");let i=yield*this.pushIndicators();switch(n[i]){case"#":yield*this.pushCount(n.length-i);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Kf),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return i+=yield*this.parseBlockScalarHeader(),i+=yield*this.pushSpaces(!0),yield*this.pushCount(n.length-i),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,i,r=-1;do n=yield*this.pushNewline(),n>0?(i=yield*this.pushSpaces(!1),this.indentValue=r=i):i=0,i+=yield*this.pushSpaces(!0);while(n+i>0);const l=this.getLine();if(l===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&l[0]!=="#"||r===0&&(l.startsWith("---")||l.startsWith("..."))&&Un(l[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(l[0]==="]"||l[0]==="}")))return this.flowLevel=0,yield vx,yield*this.parseLineStart();let c=0;for(;l[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),l[c]){case void 0:return"flow";case"#":return yield*this.pushCount(l.length-c),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Kf),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||Un(d)||d===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const n=this.charAt(0);let i=this.buffer.indexOf(n,this.pos+1);if(n==="'")for(;i!==-1&&this.buffer[i+1]==="'";)i=this.buffer.indexOf("'",i+2);else for(;i!==-1;){let c=0;for(;this.buffer[i-1-c]==="\\";)c+=1;if(c%2===0)break;i=this.buffer.indexOf('"',i+1)}const r=this.buffer.substring(0,i);let l=r.indexOf(`
|
|
179
|
-
`,this.pos);if(l!==-1){for(;l!==-1;){const c=this.continueScalar(l+1);if(c===-1)break;l=r.indexOf(`
|
|
180
|
-
`,c)}l!==-1&&(i=l-(r[l-1]==="\r"?2:1))}if(i===-1){if(!this.atEnd)return this.setNext("quoted-scalar");i=this.buffer.length}return yield*this.pushToIndex(i+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let n=this.pos;for(;;){const i=this.buffer[++n];if(i==="+")this.blockScalarKeep=!0;else if(i>"0"&&i<="9")this.blockScalarIndent=Number(i)-1;else if(i!=="-")break}return yield*this.pushUntil(i=>Un(i)||i==="#")}*parseBlockScalar(){let n=this.pos-1,i=0,r;e:for(let c=this.pos;r=this.buffer[c];++c)switch(r){case" ":i+=1;break;case`
|
|
181
|
-
`:n=c,i=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
|
|
182
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(i>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=i:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(n+1);if(c===-1)break;n=this.buffer.indexOf(`
|
|
183
|
-
`,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let l=n+1;for(r=this.buffer[l];r===" ";)r=this.buffer[++l];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
184
|
-
`;)r=this.buffer[++l];n=l-1}else if(!this.blockScalarKeep)do{let c=n-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const h=c;for(;d===" ";)d=this.buffer[--c];if(d===`
|
|
185
|
-
`&&c>=this.pos&&c+1+i>h)n=c;else break}while(!0);return yield vp,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let i=this.pos-1,r=this.pos-1,l;for(;l=this.buffer[++r];)if(l===":"){const c=this.buffer[r+1];if(Un(c)||n&&pc.has(c))break;i=r}else if(Un(l)){let c=this.buffer[r+1];if(l==="\r"&&(c===`
|
|
186
|
-
`?(r+=1,l=`
|
|
187
|
-
`,c=this.buffer[r+1]):i=r),c==="#"||n&&pc.has(c))break;if(l===`
|
|
188
|
-
`){const d=this.continueScalar(r+1);if(d===-1)break;r=Math.max(r,d-2)}}else{if(n&&pc.has(l))break;i=r}return!l&&!this.atEnd?this.setNext("plain-scalar"):(yield vp,yield*this.pushToIndex(i+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,i){const r=this.buffer.slice(this.pos,n);return r?(yield r,this.pos+=r.length,r.length):(i&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Kf))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const n=this.flowLevel>0,i=this.charAt(1);if(Un(i)||n&&pc.has(i))return n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,i=this.buffer[n];for(;!Un(i)&&i!==">";)i=this.buffer[++n];return yield*this.pushToIndex(i===">"?n+1:n,!1)}else{let n=this.pos+1,i=this.buffer[n];for(;i;)if(l6.has(i))i=this.buffer[++n];else if(i==="%"&&n0.has(this.buffer[n+1])&&n0.has(this.buffer[n+2]))i=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
|
|
189
|
-
`?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
|
|
190
|
-
`?yield*this.pushCount(2):0}*pushSpaces(n){let i=this.pos-1,r;do r=this.buffer[++i];while(r===" "||n&&r===" ");const l=i-this.pos;return l>0&&(yield this.buffer.substr(this.pos,l),this.pos=i),l}*pushUntil(n){let i=this.pos,r=this.buffer[i];for(;!n(r);)r=this.buffer[++i];return yield*this.pushToIndex(i,!1)}}class d6{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let i=0,r=this.lineStarts.length;for(;i<r;){const c=i+r>>1;this.lineStarts[c]<n?i=c+1:r=c}if(this.lineStarts[i]===n)return{line:i+1,col:1};if(i===0)return{line:0,col:n};const l=this.lineStarts[i-1];return{line:i,col:n-l+1}}}}function ai(e,n){for(let i=0;i<e.length;++i)if(e[i].type===n)return!0;return!1}function a0(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function Sx(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function mc(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function $s(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function i0(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!ai(n.start,"explicit-key-ind")&&!ai(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,Sx(n.value)?n.value.end?Array.prototype.push.apply(n.value.end,n.sep):n.value.end=n.sep:Array.prototype.push.apply(n.start,n.sep),delete n.sep)}class f6{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new u6,this.onNewLine=n}*parse(n,i=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(n,i))yield*this.next(r);i||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const i=o6(n);if(i)if(i==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=i,yield*this.step(),i){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const r=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:n}),this.offset+=n.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const n=this.peek(1);if(this.type==="doc-end"&&n?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const i=n??this.stack.pop();if(!i)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield i;else{const r=this.peek(1);switch(i.type==="block-scalar"?i.indent="indent"in r?r.indent:0:i.type==="flow-collection"&&r.type==="document"&&(i.indent=0),i.type==="flow-collection"&&i0(i),r.type){case"document":r.value=i;break;case"block-scalar":r.props.push(i);break;case"block-map":{const l=r.items[r.items.length-1];if(l.value){r.items.push({start:[],key:i,sep:[]}),this.onKeyLine=!0;return}else if(l.sep)l.value=i;else{Object.assign(l,{key:i,sep:[]}),this.onKeyLine=!l.explicitKey;return}break}case"block-seq":{const l=r.items[r.items.length-1];l.value?r.items.push({start:[],value:i}):l.value=i;break}case"flow-collection":{const l=r.items[r.items.length-1];!l||l.value?r.items.push({start:[],key:i,sep:[]}):l.sep?l.value=i:Object.assign(l,{key:i,sep:[]});return}default:yield*this.pop(),yield*this.pop(i)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(i.type==="block-map"||i.type==="block-seq")){const l=i.items[i.items.length-1];l&&!l.sep&&!l.value&&l.start.length>0&&a0(l.start)===-1&&(i.indent===0||l.start.every(c=>c.type!=="comment"||c.indent<i.indent))&&(r.type==="document"?r.end=l.start:r.items.push({start:l.start}),i.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{a0(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const i=this.startBlockValue(n);i?this.stack.push(i):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const i=mc(this.peek(2)),r=$s(i);let l;n.end?(l=n.end,l.push(this.sourceToken),delete n.end):l=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:r,key:n,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let i=this.source.indexOf(`
|
|
191
|
-
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
|
|
192
|
-
`,i)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else if(i.sep)i.sep.push(this.sourceToken);else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const r=!this.onKeyLine&&this.indent===n.indent,l=r&&(i.sep||i.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(l&&i.sep&&!i.value){const d=[];for(let h=0;h<i.sep.length;++h){const g=i.sep[h];switch(g.type){case"newline":d.push(h);break;case"space":break;case"comment":g.indent>n.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(c=i.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":l||i.value?(c.push(this.sourceToken),n.items.push({start:c}),this.onKeyLine=!0):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"explicit-key-ind":!i.sep&&!i.explicitKey?(i.start.push(this.sourceToken),i.explicitKey=!0):l||i.value?(c.push(this.sourceToken),n.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(i.explicitKey)if(i.sep)if(i.value)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ai(i.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(Sx(i.key)&&!ai(i.sep,"newline")){const d=$s(i.start),h=i.key,g=i.sep;g.push(this.sourceToken),delete i.key,delete i.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:h,sep:g}]})}else c.length>0?i.sep=i.sep.concat(c,this.sourceToken):i.sep.push(this.sourceToken);else if(ai(i.start,"newline"))Object.assign(i,{key:null,sep:[this.sourceToken]});else{const d=$s(i.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else i.sep?i.value||l?n.items.push({start:c,key:null,sep:[this.sourceToken]}):ai(i.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);l||i.value?(n.items.push({start:c,key:d,sep:[]}),this.onKeyLine=!0):i.sep?this.stack.push(d):(Object.assign(i,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(n);if(d){if(d.type==="block-seq"){if(!i.explicitKey&&i.sep&&!ai(i.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&n.items.push({start:c});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const i=n.items[n.items.length-1];switch(this.type){case"newline":if(i.value){const r="end"in i.value?i.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):n.items.push({start:[this.sourceToken]})}else i.start.push(this.sourceToken);return;case"space":case"comment":if(i.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(i.start,n.indent)){const l=n.items[n.items.length-2]?.value?.end;if(Array.isArray(l)){Array.prototype.push.apply(l,i.start),l.push(this.sourceToken),n.items.pop();return}}i.start.push(this.sourceToken)}return;case"anchor":case"tag":if(i.value||this.indent<=n.indent)break;i.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;i.value||ai(i.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return}if(this.indent>n.indent){const r=this.startBlockValue(n);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const i=n.items[n.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!i||i.sep?n.items.push({start:[this.sourceToken]}):i.start.push(this.sourceToken);return;case"map-value-ind":!i||i.value?n.items.push({start:[],key:null,sep:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):Object.assign(i,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!i||i.value?n.items.push({start:[this.sourceToken]}):i.sep?i.sep.push(this.sourceToken):i.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);!i||i.value?n.items.push({start:[],key:l,sep:[]}):i.sep?this.stack.push(l):Object.assign(i,{key:l,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const r=this.startBlockValue(n);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===n.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const l=mc(r),c=$s(l);i0(n);const d=n.end.splice(1,n.end.length);d.push(this.sourceToken);const h={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:d}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=h}else yield*this.lineEnd(n)}}flowScalar(n){if(this.onNewLine){let i=this.source.indexOf(`
|
|
193
|
-
`)+1;for(;i!==0;)this.onNewLine(this.offset+i),i=this.source.indexOf(`
|
|
194
|
-
`,i)+1}return{type:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const i=mc(n),r=$s(i);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const i=mc(n),r=$s(i);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,i){return this.type!=="comment"||this.indent<=i?!1:n.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function p6(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new d6||null,prettyErrors:n}}function m6(e,n={}){const{lineCounter:i,prettyErrors:r}=p6(n),l=new f6(i?.addNewLine),c=new r6(n),d=Array.from(c.compose(l.parse(e)));if(r&&i)for(const h of d)h.errors.forEach(Wv(e,i)),h.warnings.forEach(Wv(e,i));return d.length>0?d:Object.assign([],{empty:!0},c.streamInfo())}function h6({onApplied:e}){const[n,i]=q.useState(""),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState([]);if(TA())return null;const b=async()=>{if(!n.trim())return;l(!0),d([]),g([]);const x=m6(n),w=[],N=[];for(let C=0;C<x.length;C++){const D=x[C];if(D.errors.length>0){w.push(`Document ${C+1}: ${D.errors[0]?.message}`);continue}const A=D.toJSON();if(!(!A||typeof A!="object"))try{const E=await FA(A);N.push(`Applied "${E.displayName||E.name}" (revision ${E.configRevision})`)}catch(E){w.push(`Document ${C+1}: ${E instanceof Error?E.message:String(E)}`)}}d(N),g(w),l(!1),N.length>0&&(Ft({title:"YAML applied",detail:`Applied ${N.length} document${N.length===1?"":"s"} successfully.`,tone:w.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return p.jsxs("section",{className:"mt-8",children:[p.jsx("div",{className:"page-section-divider"}),p.jsx("div",{className:"section-head mt-6",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),p.jsx("h2",{className:"text-sm font-medium text-strong",children:"Apply YAML"})]})}),p.jsxs("p",{className:"text-muted text-sm mb-3",children:["Paste a ",p.jsx("code",{className:"text-secondary",children:"canonry.yaml"})," config (multi-document YAML with ",p.jsx("code",{className:"text-secondary",children:"---"})," separators supported)."]}),p.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
195
|
-
kind: Project
|
|
196
|
-
metadata:
|
|
197
|
-
name: my-project
|
|
198
|
-
spec:
|
|
199
|
-
canonicalDomain: example.com
|
|
200
|
-
country: US
|
|
201
|
-
language: en
|
|
202
|
-
queries: []`,value:n,onChange:x=>i(x.target.value)}),c.length>0&&p.jsx("ul",{className:"mt-2 space-y-1",children:c.map((x,w)=>p.jsx("li",{className:"text-positive-400 text-sm",children:x},w))}),h.length>0&&p.jsx("ul",{className:"mt-2 space-y-1",children:h.map((x,w)=>p.jsx("li",{className:"text-negative-400 text-sm",children:x},w))}),p.jsx("div",{className:"mt-3",children:p.jsx(Ie,{type:"button",disabled:!n.trim()||r,onClick:_n(b),children:r?"Applying...":"Apply"})})]})}function g6(){const{dashboard:e,isLoading:n,refetch:i}=Fc();if(!e||n)return p.jsxs("div",{className:"page-skeleton",children:[p.jsxs("div",{className:"page-skeleton-header",children:[p.jsx("div",{className:"skeleton-text h-6 w-28"}),p.jsx("div",{className:"skeleton-text-sm w-40"})]}),p.jsxs("div",{className:"rounded-xl border border-default bg-surface overflow-hidden",children:[p.jsx("div",{className:"p-3 border-b border-default flex gap-8",children:["Name","Domain","Mentions","Last run","Country"].map(O=>p.jsx("div",{className:"skeleton-text-sm w-16"},O))}),[1,2,3].map(O=>p.jsxs("div",{className:"p-3 border-b border-subtle flex gap-8 items-center",children:[p.jsxs("div",{className:"flex-1 space-y-1",children:[p.jsx("div",{className:"skeleton-text w-28"}),p.jsx("div",{className:"skeleton-text-sm w-16"})]}),p.jsx("div",{className:"skeleton-text w-24"}),p.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),p.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),p.jsx("div",{className:"skeleton-text-sm w-8"})]},O))]})]});const r=e.projects,l=Dc(),[c,d]=q.useState(!1),[h,g]=q.useState(""),[b,x]=q.useState(""),[w,N]=q.useState(""),[C,D]=q.useState("US"),[A,E]=q.useState("en"),[R,G]=q.useState(!1),[X,V]=q.useState(null),P=h.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),re=async()=>{if(!(!P||!w)){G(!0),V(null);try{const O=await Co(P,{displayName:b||h,canonicalDomain:w,country:C,language:A});Ft({title:"Project created",detail:`${O.displayName||O.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${O.name}`,dedupeMode:"drop"}),i(),g(""),x(""),N(""),D("US"),E("en"),d(!1),l({to:"/projects/$projectName",params:{projectName:O.name}})}catch(O){V(O instanceof Error?O.message:"Failed to create project")}finally{G(!1)}}};return p.jsxs("div",{className:"page-container",children:[p.jsxs("div",{className:"page-header",children:[p.jsxs("div",{className:"page-header-left",children:[p.jsx("h1",{className:"page-title",children:"Projects"}),p.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),p.jsx("div",{className:"page-header-right",children:p.jsxs(Ie,{type:"button",onClick:()=>d(O=>!O),children:[p.jsx($b,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?p.jsxs(Tn,{className:"surface-card mb-6",children:[p.jsx("div",{className:"section-head",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),p.jsx("h2",{className:"text-sm font-medium text-strong",children:"Create a new monitoring project"})]})}),p.jsxs("div",{className:"compact-stack mt-4",children:[p.jsxs("div",{className:"setup-field-row",children:[p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),p.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:h,onChange:O=>g(O.target.value)}),P&&P!==h?p.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),p.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:b,onChange:O=>x(O.target.value)})]})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),p.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:w,onChange:O=>N(O.target.value)})]}),p.jsxs("div",{className:"setup-field-row",children:[p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),p.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:O=>D(O.target.value.toUpperCase())})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),p.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:A,onChange:O=>E(O.target.value.toLowerCase())})]})]})]}),X?p.jsx("p",{className:"text-negative-400 text-sm mt-3",children:X}):null,p.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[p.jsx(Ie,{type:"button",disabled:!P||!w||R,onClick:_n(re),children:R?"Creating...":"Create project"}),p.jsx(Ie,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,r.length>0?p.jsx("div",{className:"data-table-wrapper",children:p.jsxs("table",{className:"data-table",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{children:"Name"}),p.jsx("th",{children:"Domain"}),p.jsx("th",{children:"Mentions"}),p.jsx("th",{children:"Last run"}),p.jsx("th",{className:"text-right",children:"Country"})]})}),p.jsx("tbody",{children:r.map(O=>{const L=O.recentRuns[0];return p.jsxs("tr",{className:"cursor-pointer",onClick:()=>{l({to:"/projects/$projectName",params:{projectName:O.project.name}})},children:[p.jsxs("td",{children:[p.jsx(tt,{to:"/projects/$projectName",params:{projectName:O.project.name},className:"text-heading font-medium hover:underline",onClick:ae=>ae.stopPropagation(),children:O.project.displayName||O.project.name}),p.jsx("p",{className:"text-[11px] text-muted",children:O.project.name})]}),p.jsx("td",{className:"text-secondary",children:O.project.canonicalDomain}),p.jsx("td",{children:p.jsx(Cn,{tone:O.mentionSummary.tone,children:O.mentionSummary.value})}),p.jsx("td",{className:"text-muted text-sm",children:L?p.jsx(mm,{status:L.status}):p.jsx("span",{className:"text-faint",children:"No runs"})}),p.jsx("td",{className:"text-right text-muted",children:O.project.country})]},O.project.id)})})]})}):c?null:p.jsxs(Tn,{className:"surface-card empty-card",children:[p.jsx("h3",{children:"No projects yet"}),p.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),p.jsxs(Ie,{type:"button",onClick:()=>d(!0),children:[p.jsx($b,{className:"size-4 mr-1.5"}),"Add project"]})]}),p.jsx(h6,{onApplied:()=>{i()}})]})}function Mm(e){e.invalidateQueries({queryKey:cm({client:ne})}),e.invalidateQueries({queryKey:Vi({client:ne})})}function y6(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function b6(e,n){const i=e??"Project";return n==="gsc-sync"?`${i} will refresh after the sync completes.`:n==="inspect-sitemap"?`${i} will notify you when sitemap inspection finishes.`:`${i} will notify you when the run finishes.`}function ou(e,n){dm({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:n.projectLabel,sourceAction:n.sourceAction,lastAnnouncedStatus:"queued"}),Ft({title:y6(e.kind),detail:b6(n.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function v6(e){const n=e.filter(l=>l.status!=="conflict"),i=e.filter(l=>l.status==="conflict");if(n.length===0){Ft({title:"No runs queued",detail:i.length>0?`${i.length} project${i.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const l of n)dm({id:l.id,projectId:l.projectId,kind:l.kind,projectLabel:l.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=zM({runIds:n.map(l=>l.id),queuedCount:n.length,skippedCount:i.length});Ft({title:"Run-all batch queued",detail:i.length>0?`${n.length} project${n.length===1?"":"s"} queued, ${i.length} skipped because a run is already active.`:`${n.length} project${n.length===1?"":"s"} queued.`,tone:i.length>0?"caution":"neutral",dedupeKey:`batch:${r}`,dedupeMode:"replace"})}function Mo(e,n){if(e instanceof In&&e.code==="RUN_IN_PROGRESS"){Ft({title:"Run already in progress",detail:n?.projectLabel?`${n.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${n?.projectKey??"project"}:${n?.sourceAction??"run"}`,dedupeMode:"replace"});return}Ft({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function S6(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>HA(n,i),onSuccess:(n,i)=>{Mm(e),ou(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})},onError:(n,i)=>{Mo(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:i.sourceAction})}})}function B$(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:n=>XA(n),onSuccess:n=>{Mm(e),v6(n)},onError:n=>{Ft({title:n instanceof Error?n.message:"Failed to queue runs",tone:"negative"})}})}function L$(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,body:i})=>nC(n,i),onSuccess:(n,i)=>{Mm(e),dm({id:n.runId,projectId:i.projectId,kind:Ce["site-audit"],projectLabel:i.projectLabel??i.projectName,sourceAction:"site-audit",lastAnnouncedStatus:n.status}),Ft({title:n.status==="running"?"Technical audit already running":"Technical audit queued",detail:`${i.projectLabel??i.projectName} will refresh automatically when the audit finishes.`,tone:"neutral",dedupeKey:`run:${n.runId}`,dedupeMode:"replace"})},onError:(n,i)=>{Mo(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"site-audit"})}})}function q$(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>JA(n,i),onSuccess:(n,i)=>{No(e,Ce["gsc-sync"],i.projectName),ou(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})},onError:(n,i)=>{Mo(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"gsc-sync"})}})}function U$(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n})=>tC(n),onSuccess:(n,i)=>{No(e,n.run.kind,i.projectName),ou(n.run,{projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})},onError:(n,i)=>{Mo(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"discover-sitemaps"})}})}function $$(){const e=ka();return li({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:n,opts:i})=>eC(n,i),onSuccess:(n,i)=>{No(e,Ce["inspect-sitemap"],i.projectName),ou(n,{projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})},onError:(n,i)=>{Mo(n,{projectKey:i.projectName,projectLabel:i.projectLabel??i.projectName,sourceAction:"inspect-sitemap"})}})}function xx(e){if(!Array.isArray(e.queryKey)||e.queryKey.length<=1)return!1;const n=e.queryKey[0];return n==="projects"||n==="project-dashboard-full"}function I$(){const e=ka();return li({mutationFn:({projectName:n,queries:i})=>PA(n,i),onSuccess:()=>{e.invalidateQueries({queryKey:Vi({client:ne})}),e.invalidateQueries({predicate:xx})}})}function P$(){const e=ka();return li({mutationFn:({projectName:n,body:i})=>VA(n,i),onSuccess:()=>{e.invalidateQueries({predicate:n=>Array.isArray(n.queryKey)&&typeof n.queryKey[0]=="object"&&n.queryKey[0]!==null&&"_id"in n.queryKey[0]&&typeof n.queryKey[0]._id=="string"&&n.queryKey[0]._id.startsWith("getApiV1ProjectsByName")}),e.invalidateQueries({predicate:xx})}})}const x6=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function w6({current:e,labels:n}){return p.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:n.map((i,r)=>{const l=r<e,c=r===e;return p.jsxs("div",{className:`setup-step ${l?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[p.jsx("span",{className:"setup-step-number",children:l?"✓":r+1}),p.jsx("span",{className:"setup-step-label",children:i.label})]},i.label)})})}function j6(){const e=Eo(),{dashboard:n,isLoading:i,refetch:r}=Fc(),l=n??e?.dashboard;if(!l||i)return p.jsxs("div",{className:"page-skeleton",children:[p.jsxs("div",{className:"page-skeleton-header",children:[p.jsx("div",{className:"skeleton-text h-6 w-24"}),p.jsx("div",{className:"skeleton-text-sm w-80"})]}),p.jsxs("div",{className:"page-skeleton-card",children:[p.jsx("div",{className:"skeleton-text w-32"}),p.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(se=>p.jsxs("div",{className:"flex items-center justify-between",children:[p.jsxs("div",{className:"space-y-1 flex-1",children:[p.jsx("div",{className:"skeleton-text w-24"}),p.jsx("div",{className:"skeleton-text-sm w-48"})]}),p.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},se))})]})]});const c=l.settings,g=hm(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},b=_M(l.setup,g,c),x=Dc(),[w,N]=q.useState(0),[C,D]=q.useState(""),[A,E]=q.useState(""),[R,G]=q.useState(""),[X,V]=q.useState("US"),[P,re]=q.useState("en"),[O,L]=q.useState(!1),[ae,_e]=q.useState(null),[Me,ve]=q.useState(null),[it,oe]=q.useState(!1),[fe,$]=q.useState(""),[W,pe]=q.useState(!1),[je,le]=q.useState(null),[Xe,J]=q.useState(!1),ue=c.providerStatuses.filter(se=>se.state==="ready"),[ee,de]=q.useState(ue[0]?.name??""),[ie,Ae]=q.useState(5),[st,xe]=q.useState(!1),[Pe,Ze]=q.useState(null),[Bt,Hn]=q.useState(""),[Lt,hr]=q.useState(!1),[Ki,Bo]=q.useState(null),[gr,Qi]=q.useState(!1),[Zi,yr]=q.useState(!1),[Lo,qo]=q.useState(!1),[Gt,lu]=q.useState(null),Uo=S6(),$o=on({...r1({client:ne,path:{id:Gt??""}}),enabled:!!Gt,refetchInterval:({state:se})=>{const ut=se.data?.status;return ut==="completed"||ut==="partial"||ut==="failed"||ut==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[_a,Io]=q.useState(""),[Yi,Po]=q.useState(!1),[Vo,Ta]=q.useState(null),vt=C.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),qt=fe.split(`
|
|
203
|
-
`).map(se=>se.trim()).filter(Boolean),Ot=Bt.split(`
|
|
204
|
-
`).map(se=>se.trim()).filter(Boolean),cu=b.healthChecks.some(se=>se.id==="api"&&se.state==="ready"),uu=async()=>{if(!(!vt||!R)){oe(!0),ve(null);try{const se=await Co(vt,{displayName:A||C,canonicalDomain:R,country:X,language:P,autoExtractBacklinks:O});_e(vt),Ft({title:"Project created",detail:`${se.displayName||se.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${se.name}`,dedupeMode:"drop"}),await r(),N(2)}catch(se){ve(se instanceof Error?se.message:"Failed to create project")}finally{oe(!1)}}},du=async()=>{if(!ae)return;const se=qt;if(se.length!==0){J(!0),le(null);try{await IA(ae,se),pe(!0),await r(),N(3)}catch(ut){le(ut instanceof Error?ut.message:"Failed to save queries")}finally{J(!1)}}},Fi=async()=>{if(!(!ae||!ee)){xe(!0),Ze(null);try{const se=await YA(ae,ee,ie);if(se.queries.length>0){const ut=fe?fe.trimEnd()+`
|
|
205
|
-
`+se.queries.join(`
|
|
206
|
-
`):se.queries.join(`
|
|
207
|
-
`);$(ut)}}catch(se){Ze(se instanceof Error?se.message:"Failed to generate queries")}finally{xe(!1)}}},Xi=async()=>{if(!ae)return;const se=Ot;if(se.length!==0){Qi(!0),Bo(null);try{await GA(ae,se),hr(!0),await r(),N(4)}catch(ut){Bo(ut instanceof Error?ut.message:"Failed to save competitors")}finally{Qi(!1)}}},Ji=async()=>{const se=_a.trim();if(se){Po(!0),Ta(null);try{await ZA("gemini",{apiKey:se}),Ft({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),Io(""),await r()}catch(ut){Ta(ut instanceof Error?ut.message:"Failed to save Gemini key")}finally{Po(!1)}}},Wn=async()=>{if(ae){qo(!0);try{const se=await Uo.mutateAsync({projectName:ae,projectLabel:A||C||ae,sourceAction:"setup-launch"});lu(se.id),yr(!0),await r()}catch{}finally{qo(!1)}}},gn=()=>N(se=>Math.max(0,se-1)),mi=(()=>{switch(w){case 0:return p.jsxs(Tn,{className:"surface-card step-card",children:[p.jsx("div",{className:"section-head",children:p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),p.jsx("h2",{children:"System ready"})]})}),p.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),p.jsx("div",{className:"compact-stack",children:b.healthChecks.map(se=>p.jsxs("div",{className:"health-check-row",children:[p.jsxs("div",{children:[p.jsx("p",{className:"run-row-title",children:se.label}),p.jsx("p",{className:"supporting-copy",children:se.detail}),se.id==="provider"&&se.state!=="ready"&&p.jsxs("div",{className:"mt-3 rounded-md border border-default bg-bg-elevated/40 p-3 space-y-2",children:[p.jsxs("p",{className:"text-xs text-secondary",children:["Paste a Gemini key to enable visibility checks (free at"," ",p.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"aistudio.google.com"}),")."]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("input",{type:"password",value:_a,onChange:ut=>Io(ut.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-sm text-heading placeholder:text-faint focus:border-mono-600 focus:outline-none font-mono",disabled:Yi}),p.jsx(Ie,{type:"button",size:"sm",disabled:Yi||!_a.trim(),onClick:_n(Ji),children:Yi?"Saving...":"Save"})]}),Vo&&p.jsx("p",{className:"text-xs text-negative-400",children:Vo}),p.jsxs("p",{className:"text-[11px] text-faint",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",p.jsx(tt,{to:"/settings",className:"text-muted hover:text-neutral underline underline-offset-2",children:"/settings"}),"."]})]})]}),p.jsx(Cn,{tone:se.state==="ready"?"positive":"caution",title:se.id==="api"?ar(g.apiStatus):se.id==="worker"?ar(g.workerStatus):se.detail,children:se.state==="ready"?"Ready":"Attention"})]},se.id))}),p.jsxs("div",{className:"setup-nav",children:[p.jsx("span",{}),p.jsx(Ie,{type:"button",disabled:!cu,onClick:()=>N(1),children:"Continue"})]})]});case 1:return p.jsxs(Tn,{className:"surface-card step-card",children:[p.jsxs("div",{className:"section-head",children:[p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),p.jsx("h2",{children:"Create project"})]}),ae?p.jsx(Cn,{tone:"positive",children:"Created"}):null]}),ae?p.jsxs("div",{className:"compact-stack",children:[p.jsxs("p",{className:"text-neutral",children:["Project ",p.jsx("span",{className:"text-heading font-medium",children:ae})," created successfully."]}),p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",onClick:()=>N(2),children:"Continue"})]})]}):p.jsxs("div",{className:"compact-stack",children:[p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),p.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:C,onChange:se=>D(se.target.value)}),vt&&vt!==C?p.jsxs("p",{className:"supporting-copy",children:["Slug: ",vt]}):null]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),p.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:A,onChange:se=>E(se.target.value)})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),p.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:se=>G(se.target.value)})]}),p.jsxs("div",{className:"setup-field-row",children:[p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),p.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:X,onChange:se=>V(se.target.value.toUpperCase())})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),p.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:se=>re(se.target.value.toLowerCase())})]})]}),p.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-default bg-surface p-3 cursor-pointer hover:border-strong",children:[p.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-strong bg-bg",checked:O,onChange:se=>L(se.target.checked)}),p.jsxs("span",{className:"flex-1",children:[p.jsx("span",{className:"block text-sm text-heading",children:"Auto-extract backlinks"}),p.jsxs("span",{className:"block text-xs text-muted mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",p.jsx(tt,{to:"/backlinks",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"Manage backlinks"})]})]})]}),Me?p.jsx("p",{className:"text-negative-400 text-sm",children:Me}):null,p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",disabled:!vt||!R||it,onClick:_n(uu),children:it?"Creating...":"Create project"})]})]})]});case 2:return p.jsxs(Tn,{className:"surface-card step-card",children:[p.jsxs("div",{className:"section-head",children:[p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),p.jsx("h2",{children:"Add queries"})]}),W?p.jsxs(Cn,{tone:"positive",children:[qt.length," saved"]}):p.jsxs(Cn,{tone:"neutral",children:[qt.length," quer",qt.length!==1?"ies":"y"]})]}),p.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),W?p.jsxs("div",{className:"compact-stack",children:[p.jsx("ul",{className:"detail-list",children:qt.map(se=>p.jsx("li",{children:se},se))}),p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):p.jsxs("div",{className:"compact-stack",children:[ue.length>0?p.jsxs("div",{className:"compact-stack",children:[p.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[p.jsx("span",{className:"flex-1 border-t border-base"}),"auto-generate",p.jsx("span",{className:"flex-1 border-t border-base"})]}),p.jsxs("div",{className:"flex items-end gap-2",children:[p.jsxs("div",{className:"setup-field flex-1",children:[p.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),p.jsx("select",{id:"gen-provider",className:"setup-input",value:ee,onChange:se=>de(se.target.value),children:ue.map(se=>p.jsxs("option",{value:se.name,children:[se.displayName??se.name,se.model?` (${se.model})`:""]},se.name))})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),p.jsx("select",{id:"gen-count",className:"setup-input",value:ie,onChange:se=>Ae(Number(se.target.value)),children:[3,5,10,15,20].map(se=>p.jsx("option",{value:se,children:se},se))})]}),p.jsx(Ie,{type:"button",variant:"outline",disabled:st||!ee,onClick:_n(Fi),children:st?"Analyzing site...":"Generate"})]}),Pe?p.jsx("p",{className:"text-negative-400 text-sm",children:Pe}):null]}):null,p.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[p.jsx("span",{className:"flex-1 border-t border-base"}),"or type manually",p.jsx("span",{className:"flex-1 border-t border-base"})]}),p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),p.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
208
|
-
best invisalign downtown brooklyn
|
|
209
|
-
pediatric dentist brooklyn heights`,value:fe,onChange:se=>$(se.target.value)})]}),je?p.jsx("p",{className:"text-negative-400 text-sm",children:je}):null,p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",disabled:qt.length===0||Xe,onClick:_n(du),children:Xe?"Saving...":`Save ${qt.length} quer${qt.length!==1?"ies":"y"}`})]})]})]});case 3:return p.jsxs(Tn,{className:"surface-card step-card",children:[p.jsxs("div",{className:"section-head",children:[p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),p.jsx("h2",{children:"Add competitors"})]}),Lt?p.jsx(Cn,{tone:"positive",children:"Saved"}):null]}),p.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Lt?p.jsxs("div",{className:"compact-stack",children:[p.jsx("ul",{className:"detail-list",children:Ot.map(se=>p.jsx("li",{children:se},se))}),p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",onClick:()=>N(4),children:"Continue"})]})]}):p.jsxs("div",{className:"compact-stack",children:[p.jsxs("div",{className:"setup-field",children:[p.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),p.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
210
|
-
competitor2.com`,value:Bt,onChange:se=>Hn(se.target.value)})]}),Ki?p.jsx("p",{className:"text-negative-400 text-sm",children:Ki}):null,p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),p.jsx(Ie,{type:"button",disabled:Ot.length===0||gr,onClick:_n(Xi),children:gr?"Saving...":`Save ${Ot.length} competitor${Ot.length!==1?"s":""}`})]})]})]})]});case 4:{const se=$o.data,ut=se?.status==="completed"||se?.status==="partial"||se?.status==="failed"||se?.status==="cancelled",ea=se?.snapshots??[],hi=ea.filter(Kn=>Kn.citationState==="cited").length,fu=ea.filter(Kn=>Kn.answerMentioned===!0).length,br=new Set(ea.map(Kn=>Kn.query).filter(Kn=>!!Kn)).size,Go=Zi?ut&&(se?.status==="completed"||se?.status==="partial")?p.jsx(Cn,{tone:"positive",children:"Complete"}):ut?p.jsx(Cn,{tone:"negative",children:"Failed"}):p.jsx(Cn,{tone:"caution",children:"Running"}):null;return p.jsxs(Tn,{className:"surface-card step-card",children:[p.jsxs("div",{className:"section-head",children:[p.jsxs("div",{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),p.jsx("h2",{children:"Launch first run"})]}),Go]}),Zi?ut?se?.status==="failed"?p.jsxs("div",{className:"compact-stack",children:[p.jsx("p",{className:"text-negative-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),p.jsxs("div",{className:"setup-nav",children:[p.jsx("span",{}),p.jsx(Ie,{type:"button",onClick:()=>{x({to:ae?`/projects/${encodeURIComponent(ae)}`:"/"})},children:"Open project"})]})]}):p.jsxs("div",{className:"compact-stack",children:[p.jsxs("p",{className:"text-neutral",children:["Sweep complete. Your first answer-visibility snapshot for"," ",p.jsx("span",{className:"text-heading font-medium",children:ae}),":"]}),p.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[p.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted",children:"Mentioned"}),p.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[fu,p.jsxs("span",{className:"text-faint text-lg",children:[" / ",br]})]}),p.jsx("p",{className:"text-[11px] text-muted mt-0.5",children:"queries with brand in answer"})]}),p.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted",children:"Cited"}),p.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[hi,p.jsxs("span",{className:"text-faint text-lg",children:[" / ",br]})]}),p.jsx("p",{className:"text-[11px] text-muted mt-0.5",children:"queries with domain in sources"})]}),p.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[p.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted",children:"Snapshots"}),p.jsx("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:ea.length}),p.jsx("p",{className:"text-[11px] text-muted mt-0.5",children:"total (query × provider)"})]})]}),p.jsx("p",{className:"text-[11px] text-muted mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),p.jsxs("div",{className:"setup-nav",children:[p.jsx("span",{}),p.jsx(Ie,{type:"button",onClick:()=>{x({to:ae?`/projects/${encodeURIComponent(ae)}`:"/"})},children:"Open project dashboard →"})]})]}):p.jsxs("div",{className:"compact-stack",children:[p.jsx("p",{className:"text-neutral",children:"Sweep running — typically 30-60s. Polling every 2s…"}),p.jsx("div",{className:"rounded-md border border-default bg-surface p-3 text-xs text-muted",children:p.jsxs("p",{children:["Status: ",p.jsx("span",{className:"text-neutral",children:se?.status??"queued"})]})}),p.jsxs("div",{className:"setup-nav",children:[p.jsx("span",{}),p.jsx(Ie,{type:"button",variant:"outline",onClick:()=>{x({to:ae?`/projects/${encodeURIComponent(ae)}`:"/"})},children:"Watch on project page"})]})]}):p.jsxs("div",{className:"compact-stack",children:[p.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",p.jsx("span",{className:"text-heading font-medium",children:ae}),"."]}),p.jsxs("div",{className:"setup-nav",children:[p.jsx(Ie,{type:"button",variant:"outline",onClick:gn,children:"Back"}),p.jsx(Ie,{type:"button",disabled:Lo,onClick:_n(Wn),children:Lo?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return p.jsxs("div",{className:"page-container",children:[p.jsx("div",{className:"page-header",children:p.jsxs("div",{className:"page-header-left",children:[p.jsx("h1",{className:"page-title",children:"Setup"}),p.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),p.jsx(w6,{current:w,labels:x6}),p.jsx("section",{className:"setup-wizard",children:mi})]})}function N6(){return p.jsx("div",{className:"page-container",children:p.jsx("section",{className:"page-section",children:p.jsxs(Tn,{className:"surface-card empty-card",children:[p.jsx("h1",{children:"Route not found"}),p.jsx("p",{children:"The current path does not map to a dashboard view."}),p.jsx(Ie,{asChild:!0,children:p.jsx(tt,{to:"/",children:"Return to overview"})})]})})})}const Jn=qi(()=>Ui(()=>import("./ProjectPage-BuaSDSwf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),"ProjectPage"),k6=qi(()=>Ui(()=>import("./RunsPage-C1Sqd7AN.js"),__vite__mapDeps([10,1,2,8,5,9]),import.meta.url),"RunsPage"),A6=qi(()=>Ui(()=>import("./HistoryPage-Ca-GGnTI.js"),__vite__mapDeps([11,1,7,8,5,9]),import.meta.url),"HistoryPage"),C6=qi(()=>Ui(()=>import("./SettingsPage-DPFh62BV.js"),__vite__mapDeps([12,1,8,5,9]),import.meta.url),"SettingsPage"),_6=qi(()=>Ui(()=>import("./BacklinksPage-BBDExYo_.js"),__vite__mapDeps([13,1,6,8,5,9]),import.meta.url),"BacklinksPage"),T6=qi(()=>Ui(()=>import("./TrafficPage-5vKoQyoP.js"),__vite__mapDeps([14,1,4,15,8,5,9]),import.meta.url),"TrafficPage"),E6=qi(()=>Ui(()=>import("./TrafficSourceDetailPage-D17oADs8.js"),__vite__mapDeps([16,1,4,3,5,15,8,9]),import.meta.url),"TrafficSourceDetailPage");function O6(){return p.jsx(t5,{children:p.jsx(e5,{})})}const Jt=Pj()({component:O6,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0,runStatus:typeof e.runStatus=="string"?e.runStatus:void 0,runKind:typeof e.runKind=="string"?e.runKind:void 0,runProject:typeof e.runProject=="string"?e.runProject:void 0,runWindow:typeof e.runWindow=="string"?e.runWindow:void 0,runQuery:typeof e.runQuery=="string"?e.runQuery:void 0})}),D6=kt({getParentRoute:()=>Jt,path:"/",component:i5,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Vi({client:ne}));if(n&&n.length===0)throw Sp({to:"/setup"})}}),z6=kt({getParentRoute:()=>Jt,path:"/projects",component:g6}),R6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Gn=kt({getParentRoute:()=>Jt,path:"/projects/$projectName",component:()=>p.jsx(Qf,{}),beforeLoad:async({context:e,params:n,location:i})=>{const r=n.projectName;if(!R6.test(r))return;let l=e.queryClient.getQueryData(Vi({client:ne}));if(!l)try{l=await e.queryClient.ensureQueryData(Hc({client:ne}))}catch{return}const c=l.find(d=>d.id===r);if(c)throw Sp({to:i.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(c.name)}`),replace:!0})}}),M6=kt({getParentRoute:()=>Gn,path:"/",component:()=>p.jsx(Jn,{tab:"overview"})}),B6=kt({getParentRoute:()=>Gn,path:"/search-console",component:()=>p.jsx(Jn,{tab:"search-console"})}),L6=kt({getParentRoute:()=>Gn,path:"/local",component:()=>p.jsx(Jn,{tab:"local"})}),q6=kt({getParentRoute:()=>Gn,path:"/discovery",component:()=>p.jsx(Jn,{tab:"discovery"})}),U6=kt({getParentRoute:()=>Gn,path:"/report",component:()=>p.jsx(Jn,{tab:"report"})}),$6=kt({getParentRoute:()=>Gn,path:"/activity",component:()=>p.jsx(Jn,{tab:"activity"})}),I6=kt({getParentRoute:()=>Gn,path:"/backlinks",component:()=>p.jsx(Jn,{tab:"backlinks"})}),P6=kt({getParentRoute:()=>Gn,path:"/technical-aeo",component:()=>p.jsx(Jn,{tab:"technical-aeo"})}),V6=kt({getParentRoute:()=>Gn,path:"/history",component:()=>p.jsx(Jn,{tab:"history"})}),G6=kt({getParentRoute:()=>Gn,path:"/settings",component:()=>p.jsx(Jn,{tab:"settings"})}),H6=kt({getParentRoute:()=>Jt,path:"/runs",component:k6}),K6=kt({getParentRoute:()=>Jt,path:"/history",component:A6}),Q6=kt({getParentRoute:()=>Jt,path:"/settings",component:C6,beforeLoad:({context:e})=>{}}),Z6=kt({getParentRoute:()=>Jt,path:"/setup",component:j6,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Vi({client:ne}));if(n&&n.length>0)throw Sp({to:"/"})}}),Y6=kt({getParentRoute:()=>Jt,path:"/backlinks",component:_6}),F6=kt({getParentRoute:()=>Jt,path:"/traffic",component:T6}),X6=kt({getParentRoute:()=>Jt,path:"/traffic/$projectName/$sourceId",component:E6}),J6=kt({getParentRoute:()=>Jt,path:"*",component:N6}),W6=Jt.addChildren([D6,z6,Gn.addChildren([M6,B6,L6,q6,U6,$6,I6,P6,V6,G6]),H6,K6,Q6,Z6,Y6,F6,X6,J6]);function eq(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const s0=eq(),tq=s0==="/"?"":s0.replace(/\/$/,"");function nq(e,n){return Vj({routeTree:W6,basepath:tq||"/",context:{queryClient:e},...n?.initialEntries})}const aq=6e4;function iq(){const[e,n]=q.useState(Tf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,b]=q.useState(!1),[x,w]=q.useState(!1),N=q.useRef(null),C=q.useRef(null),D=()=>{if(!N.current){const R=hC();C.current=R,N.current=nq(R)}return{queryClient:C.current,router:N.current}};q.useEffect(()=>{if(Tf())return;let R=!1;return Mb().then(G=>{R||(G.authenticated?n("ready"):n(G.setupRequired?"setup":"login"))}).catch(G=>{R||(h(G instanceof Error?G.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||Tf())return;const R=setInterval(()=>{Mb().then(G=>{G.authenticated||(w(!0),n(G.setupRequired?"setup":"login"))}).catch(()=>{})},aq);return Rb(()=>{w(!0),n("login")}),()=>{clearInterval(R),Rb(null)}},[e]);const A=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 KA(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),w(!1),n("ready")}catch(G){h(G instanceof In||G instanceof Error?G.message:"Setup failed")}finally{b(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){b(!0),h(null);try{if(!(await QA(i.trim())).authenticated){h("Incorrect password");return}r(""),w(!1),n("ready")}catch(G){h(G instanceof In||G instanceof Error?G.message:"Authentication failed")}finally{b(!1)}}};if(e==="ready"){const{queryClient:R,router:G}=D();return p.jsx(Gj,{client:R,children:p.jsx(Hj,{router:G})})}return p.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:p.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:p.jsx(Tn,{className:"surface-card w-full",children:e==="checking"?p.jsx(hc,{className:"py-8",children:p.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?p.jsxs(p.Fragment,{children:[p.jsxs(dp,{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),p.jsx(fp,{children:"Create a dashboard password"}),p.jsx(pp,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),p.jsx(hc,{children:p.jsxs("form",{className:"space-y-4",onSubmit:_n(A),children:[p.jsxs("label",{className:"block space-y-1.5",children:[p.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),p.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),p.jsxs("label",{className:"block space-y-1.5",children:[p.jsx("span",{className:"text-xs font-medium text-secondary",children:"Confirm password"}),p.jsx("input",{className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?p.jsx("p",{className:"text-sm text-negative-400",children:d}):null,p.jsx(Ie,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):p.jsxs(p.Fragment,{children:[p.jsxs(dp,{children:[p.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),p.jsx(fp,{children:"Sign in to Canonry"}),p.jsx(pp,{children:"Enter your dashboard password to continue."})]}),p.jsxs(hc,{children:[x?p.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,p.jsxs("form",{className:"space-y-4",onSubmit:_n(E),children:[p.jsxs("label",{className:"block space-y-1.5",children:[p.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),p.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?p.jsx("p",{className:"text-sm text-negative-400",children:d}):null,p.jsx(Ie,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const wx=document.getElementById("root");if(!wx)throw new Error("Expected #root element for web app bootstrap.");Jj.createRoot(wx).render(p.jsx(q.StrictMode,{children:p.jsx(iq,{})}));export{n$ as $,RU as A,Ie as B,kc as C,qU as D,xq as E,QU as F,SU as G,YU as H,po as I,FU as J,Oq as K,Eq as L,zq as M,Ft as N,Iq as O,OB as P,WU as Q,e$ as R,v3 as S,Cn as T,Mq as U,XU as V,JU as W,ZU as X,Dq as Y,Bq as Z,t$ as _,z$ as a,bq as a$,c$ as a0,s$ as a1,o$ as a2,r$ as a3,l$ as a4,iC as a5,dm as a6,Ce as a7,i$ as a8,u1 as a9,_$ as aA,T$ as aB,Lq as aC,Vi as aD,qq as aE,cm as aF,E$ as aG,D$ as aH,O$ as aI,z3 as aJ,L$ as aK,O0 as aL,R0 as aM,x$ as aN,KU as aO,AU as aP,S$ as aQ,kU as aR,Yq as aS,P$ as aT,TU as aU,CU as aV,EU as aW,OU as aX,NU as aY,_U as aZ,vq as a_,Na as aa,a$ as ab,HD as ac,KD as ad,jU as ae,wU as af,gU as ag,oU as ah,pU as ai,mU as aj,In as ak,hU as al,uq as am,D0 as an,BU as ao,HC as ap,e2 as aq,MM as ar,vc as as,bU as at,yU as au,Jf as av,w$ as aw,Rq as ax,xU as ay,C$ as az,Op as b,ar as b$,yq as b0,Fq as b1,jq as b2,IU as b3,wv as b4,$U as b5,Nq as b6,kq as b7,UU as b8,Aq as b9,JA as bA,p$ as bB,Kq as bC,Hq as bD,m$ as bE,d$ as bF,MU as bG,Pq as bH,Vq as bI,Gq as bJ,Qq as bK,Xs as bL,um as bM,B$ as bN,Yc as bO,mm as bP,GU as bQ,HU as bR,ZA as bS,zA as bT,cq as bU,wq as bV,Uq as bW,$q as bX,Fc as bY,hm as bZ,Zq as b_,Cq as ba,Tq as bb,_q as bc,Eo as bd,Hc as be,xL as bf,N0 as bg,VU as bh,S6 as bi,Yt as bj,$A as bk,N3 as bl,Sq as bm,mq as bn,hq as bo,M$ as bp,fq as bq,pq as br,dq as bs,PA as bt,gq as bu,E3 as bv,I$ as bw,U3 as bx,u$ as by,f$ as bz,nt as c,Nv as c0,sU as c1,lU as c2,uU as c3,dU as c4,rU as c5,cU as c6,fU as c7,DB as c8,_1 as c9,LB as ca,T1 as cb,E1 as cc,UC as cd,iU as ce,$b as cf,k$ as cg,DU as ch,zU as ci,im as cj,PU as ck,rr as cl,j$ as cm,A$ as cn,aU as co,tU as cp,nU as cq,eU as cr,N$ as cs,cD as d,R$ as e,LU as f,Tn as g,Mv as h,TA as i,_n as j,vU as k,h$ as l,ne as m,g$ as n,y$ as o,v$ as p,b$ as q,Xq as r,Wq as s,x3 as t,gm as u,Jq as v,q$ as w,U$ as x,$$ as y,up as z};
|