PageSourceSearch

https://axonhub.onrender.com/assets/route-CUW3aJgQ.js

js axonhub.onrender.com collected 2026-10-03 11:39:08 UTC 44,052 bytes, 23 lines download raw bytes

1import{a as ge,b as w,k as U,r as u,u as X,t as S,i as B,g as H,j as e,c as m,B as k,S as F,n as be,av as xe,I as f,a_ as fe,a$ as je,ac as ye,d as ve,e as we,ar as D,aT as Ne,b0 as Ce,b1 as ke,F as J,am as ee,ao as te,ap as se,aq as ae,an as ne,b2 as Se,a0 as _e,$ as Me,l as De,b3 as Te,Y as E}from"./index-DHw9oA_9.js";import{D as Ee,e as Oe,E as qe,F as Ie,G as Re}from"./system-7Tzze9qo.js";import{u as ze}from"./use-mobile-B8_QH0R7.js";import{S as Ae,a as Pe,b as Le,c as Be,d as $e}from"./sheet-BzqtQGp8.js";import{T as Ue,a as He,b as Fe,c as Ve}from"./tooltip-DrbA_q--.js";import{P as Qe}from"./panel-left-OKD_lZod.js";import{L as re}from"./language-switch-BOJ3nyFE.js";import{D as R,a as z,b as A,c as v,d as _,h as We,i as Ke,j as Ge,f as V,k as Ye,l as Ze}from"./dropdown-menu-CYcatU4d.js";import{I as O}from"./IconCheck-D4ZfUWK-.js";import{P as Xe,a as Je,b as et}from"./popover-BsOz1jcH.js";import{L as tt}from"./loader-circle-Ur2C-bA_.js";import{R as st}from"./refresh-cw-HpjJfzkN.js";import{P as at}from"./permission-guard-CTE2kIhR.js";import{u as nt}from"./projects-BI7BU8R_.js";import{C as ie}from"./chevrons-up-down-DXwgQkLi.js";import{C as rt,a as it,b as ot}from"./collapsible-BO7pgjTu.js";import{B as lt}from"./badge-B6qX-S9N.js";import{C as oe}from"./chevron-right-Cda121HX.js";import{A as Q,a as W,b as K}from"./avatar-hdN5u66_.js";import{A as le}from"./driver-B4w0q6_T.js";import"./use-error-handler-DNWpwRYc.js";import"./schemas-Dk9VIjIk.js";import"./index-CPF_HSnu.js";import"./index-CYhYchP8.js";import"./index-y6pprLpS.js";import"./index-DkWmRZBc.js";import"./index-B2zW4HOT.js";import"./check-9LYngghg.js";import"./usePermissions-DSf1KNJ8.js";import"./pagination-A-lnj4Ev.js";import"./coerce-CPg-xoCJ.js";import"./index-A0nSl2ET.js";const dt=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],ct=ge("outline","palette","Palette",dt);const ut=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],mt=w("badge-check",ut);const pt=[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],ht=w("battery-low",pt);const gt=[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],bt=w("battery-full",gt);const xt=[["path",{d:"M10 14v-4",key:"suye4c"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],ft=w("battery-medium",xt);const jt=[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]],yt=w("battery-warning",jt);const vt=[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],wt=w("battery",vt);const Nt=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],Ct=w("folder-kanban",Nt);const kt=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],St=w("log-out",kt);function q(s){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)s[n]=i[n]}return s}var _t={read:function(s){return s[0]==='"'&&(s=s.slice(1,-1)),s.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(s){return encodeURIComponent(s).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decode
1URIComponent)}};function $(s,t){function i(a,o,r){if(!(typeof document>"u")){r=q({},t,r),typeof r.expires=="number"&&(r.expires=new Date(Date.now()+r.expires*864e5)),r.expires&&(r.expires=r.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in r)r[c]&&(l+="; "+c,r[c]!==!0&&(l+="="+r[c].split(";")[0]));return document.cookie=a+"="+s.write(o,a)+l}}function n(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var o=document.cookie?document.cookie.split("; "):[],r={},l=0;l<o.length;l++){var c=o[l].split("="),d=c.slice(1).join("=");try{var p=decodeURIComponent(c[0]);if(r[p]=s.read(d,p),a===p)break}catch{}}return a?r[a]:r}}return Object.create({set:i,get:n,remove:function(a,o){i(a,"",q({},o,{expires:-1}))},withAttributes:function(a){return $(this.converter,q({},this.attributes,a))},withConverter:function(a){return $(q({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(s)}})}var Mt=$(_t,{path:"/"});const G="axonhub_dismissed_version",Y="axonhub_version_check_timestamp",Dt=600*1e3;function Tt(){const t=U(o=>o.auth.user)?.isOwner??!1,i=u.useCallback(()=>{if(!t)return!1;const o=localStorage.getItem(Y);return o?Date.now()-parseInt(o,10)>=Dt:!0},[t]),{data:n}=X({queryKey:["versionCheck"],queryFn:async()=>(await H(Ee)).checkForUpdate,onSuccess:()=>{localStorage.setItem(Y,Date.now().toString())},enabled:i(),retry:!1,staleTime:1/0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1}),a=u.useCallback((o,r)=>{S.info(B.t("system.about.updateCheck.newVersionAvailable"),{description:`${B.t("system.about.updateCheck.latestVersion")}: ${o}`,duration:1e4,action:{label:B.t("system.about.updateCheck.viewRelease"),onClick:()=>{window.open(r,"_blank","noopener,noreferrer")}}})},[]);u.useEffect(()=>{!t||!n||!n.hasUpdate||localStorage.getItem(G)===n.latestVersion||(a(n.latestVersion,n.releaseUrl),localStorage.setItem(G,n.latestVersion))},[t,n,a])}const Et="sidebar_state",Ot=3600*24*7,qt="14rem",It="16rem",Rt="3rem",zt="b",de=u.createContext(null);function j(){const s=u.useContext(de);if(!s)throw new Error("useSidebar must be used within a SidebarProvider.");return s}function At({defaultOpen:s=!0,open:t,onOpenChange:i,className:n,style:a,children:o,...r}){const l=ze(),[c,d]=u.useState(!1),[p,y]=u.useState(s),N=t??p,b=u.useCallback(h=>{const x=typeof h=="function"?h(N):h;i?i(x):y(x),document.cookie=`${Et}=${x}; path=/; max-age=${Ot}`},[i,N]),g=u.useCallback(()=>l?d(h=>!h):b(h=>!h),[l,b,d]);u.useEffect(()=>{const h=x=>{x.key===zt&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),g())};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[g]);const C=N?"expanded":"collapsed",T=u.useMemo(()=>({state:C,open:N,setOpen:b,isMobile:l,openMobile:c,setOpenMobile:d,toggleSidebar:g}),[C,N,b,l,c,d,g]);return e.jsx(de.Provider,{value:T,children:e.jsx(Ue,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":qt,"--sidebar-width-icon":Rt,...a},className:m("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...r,children:o})})})}function Pt({side:s="left",variant:t="sidebar",collapsible:i="offcanvas",className:n,children:a,...o}){const{isMobile:r,state:l,openMobile:c,setOpenMobile:d}=j();return i==="none"?e.jsx("div",{"data-slot":"sidebar",className:m("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:a}):r?e.jsx(Ae,{open:c,onOpenChange:d,...o,children:e.jsxs(Pe,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":It},side:s,children:[e.jsxs(Le,{className:"sr-only",children:[e.jsx(Be,{children:"Sidebar"}),e.jsx($e,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:a})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?i:"","data-variant":t,"data-side":s,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:m("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:m("fixed top-14 bottom-0 z-10 hidden h-[calc(100vh-3.5rem)] w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",s==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm",children:a})})]})}function Lt({className:s,onClick:t,...i}){const{toggleSidebar:n}=j();return e.jsxs(k,{"data-sidebar":"trigger","data-slot":"sidebar-tr
1igger",variant:"ghost",size:"icon",className:m("size-7",s),onClick:a=>{t?.(a),n()},...i,children:[e.jsx(Qe,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Bt({className:s,...t}){const{toggleSidebar:i}=j();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:m("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",s),...t})}function $t({className:s,...t}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:m("flex flex-col gap-2 p-2",s),...t})}function Ut({className:s,...t}){const i=u.useRef(null),[n,a]=u.useState(!1),o=u.useCallback(()=>{const r=i.current;if(!r)return;const l=r.scrollHeight>r.clientHeight,c=r.scrollTop+r.clientHeight>=r.scrollHeight-10;a(l&&!c)},[]);return u.useEffect(()=>{const r=i.current;if(!r)return;o();const l=new ResizeObserver(o);return l.observe(r),r.addEventListener("scroll",o),()=>{l.disconnect(),r.removeEventListener("scroll",o)}},[o]),e.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col",children:[e.jsx("div",{ref:i,"data-slot":"sidebar-content","data-sidebar":"content",className:m("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",s),...t}),e.jsx("div",{className:m("absolute bottom-0 left-0 right-0 h-8 pointer-events-none transition-opacity duration-300 bg-gradient-to-t from-sidebar to-transparent",n?"opacity-100":"opacity-0")})]})}function Ht({className:s,...t}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:m("relative flex w-full min-w-0 flex-col p-2",s),...t})}function Ft({className:s,asChild:t=!1,...i}){const n=t?F:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:m("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",s),...i})}function ce({className:s,...t}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:m("flex w-full min-w-0 flex-col gap-1",s),...t})}function P({className:s,...t}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:m("group/menu-item relative",s),...t})}const Vt=be("flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-primary data-[active=true]:font-medium data-[active=true]:text-primary-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function L({asChild:s=!1,isActive:t=!1,variant:i="default",size:n="default",tooltip:a,className:o,...r}){const l=s?F:"button",{isMobile:c,state:d}=j(),p=e.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":t,className:m(Vt({variant:i,size:n}),o),...r});
1return a?(typeof a=="string"&&(a={children:a}),e.jsxs(He,{children:[e.jsx(Fe,{asChild:!0,children:p}),e.jsx(Ve,{side:"right",align:"center",hidden:d!=="collapsed"||c,...a})]})):p}function Qt({className:s,...t}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:m("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",s),...t})}function Wt({className:s,...t}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:m("group/menu-sub-item relative",s),...t})}function Kt({asChild:s=!1,size:t="md",isActive:i=!1,className:n,...a}){const o=s?F:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":i,className:m("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-primary data-[active=true]:text-primary-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})}function ue(){const{theme:s,setTheme:t,colorScheme:i,setColorScheme:n}=xe(),{t:a}=f(),o=[{name:"blue",label:a("theme.colors.blue"),color:"bg-blue-500"},{name:"green",label:a("theme.colors.green"),color:"bg-green-500"},{name:"purple",label:a("theme.colors.purple"),color:"bg-purple-500"},{name:"orange",label:a("theme.colors.orange"),color:"bg-orange-500"},{name:"red",label:a("theme.colors.red"),color:"bg-red-500"},{name:"black",label:a("theme.colors.black"),color:"bg-black"},{name:"cream",label:a("theme.colors.cream"),color:"bg-amber-100"},{name:"claude",label:a("theme.colors.claude"),color:"bg-amber-600"},{name:"starry",label:a("theme.colors.starry"),color:"bg-blue-600"}];return u.useEffect(()=>{const r=s==="dark"?"#020817":"#fff",l=document.querySelector("meta[name='theme-color']");l&&l.setAttribute("content",r)},[s]),e.jsxs(R,{modal:!1,children:[e.jsx(z,{asChild:!0,children:e.jsxs(k,{variant:"ghost",size:"icon",className:"scale-95 rounded-full",children:[e.jsx(fe,{className:"size-[1.2rem] scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"}),e.jsx(je,{className:"absolute size-[1.2rem] scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"}),e.jsx("span",{className:"sr-only",children:a("theme.toggle")})]})}),e.jsxs(A,{align:"end",children:[e.jsxs(v,{onClick:()=>t("light"),children:[a("theme.light")," ",e.jsx(O,{size:14,className:m("ml-auto",s!=="light"&&"hidden")})]}),e.jsxs(v,{onClick:()=>t("dark"),children:[a("theme.dark"),e.jsx(O,{size:14,className:m("ml-auto",s!=="dark"&&"hidden")})]}),e.jsxs(v,{onClick:()=>t("system"),children:[a("theme.system"),e.jsx(O,{size:14,className:m("ml-auto",s!=="system"&&"hidden")})]}),e.jsx(_,{}),e.jsxs(We,{children:[e.jsxs(Ke,{children:[e.jsx(ct,{size:14,className:"mr-2"}),a("theme.colorScheme"),e.jsx("div",{className:m("ml-auto h-3 w-3 rounded-full",o.find(r=>r.name===i)?.color||"bg-blue-500")})]}),e.jsx(Ge,{children:o.map(r=>e.jsxs(v,{onClick:()=>n(r.name),className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:m("mr-2 h-3 w-3 rounded-full",r.color)}),r.label]}),e.jsx(O,{size:14,className:m("ml-auto",i!==r.name&&"hidden")})]},r.name))})]})]})]})}const Gt=`
2  mutation CheckProviderQuotas {
3    checkProviderQuotas
4  }
5`,Yt=`
6  query ProviderQuotaStatuses($input: QueryChannelInput!) {
7    queryChannels(input: $input) {
8      edges {
9        node {
10          id
11          name
12          type
13          providerQuotaStatus {
14            status
15            nextResetAt
16            ready
17            quotaData
18          }
19        }
20      }
21    }
22  }
23`;async function Zt(){return H(Gt)}function Xt(){const{data:s,error:t}=X({queryKey:["provider-quotas"],queryFn:async()=>
23H(Yt,{input:{where:{statusIn:["enabled"]}}}),refetchInterval:6e4});return(s?.queryChannels?.edges?.map(a=>a.node)||[]).filter(a=>{const o=a.type?.toLowerCase();return["claudecode","codex"].includes(o)}).map(a=>{const o=a.providerQuotaStatus;return{id:a.id,name:a.name,type:a.type,quotaStatus:o}})}const Z={available:"bg-green-500 hover:bg-green-600 text-white",warning:"bg-yellow-500 hover:bg-yellow-600 text-white",exhausted:"bg-red-500 hover:bg-red-600 text-white",unknown:"bg-gray-500 hover:bg-gray-600 text-white"},Jt={available:"quota.status.available",warning:"quota.status.warning",exhausted:"quota.status.exhausted",unknown:"quota.status.unknown"};function me(s){switch(s){case"full":return bt;case"medium":return ft;case"low":return ht;case"warning":return yt;default:return wt}}function pe(s,t){if(t==="exhausted")return"warning";const i=100-s;return i<5?"empty":i<20?"low":i<80?"medium":"full"}function he(s,t){let i=0;if(s.type==="claudecode"){const n=t.windows?.["5h"]?.utilization||0,a=t.windows?.["7d"]?.utilization||0;i=Math.max(n,a)*100}else s.type==="codex"&&(i=t.rate_limit?.primary_window?.used_percent||0);return i}function es({channel:s}){const{t}=f(),i=s.quotaStatus;if(!i)return null;const n=i.status||"unknown",a=Z[n]||Z.unknown,o=t(Jt[n]),r=i.quotaData,l=he(s,r),c=pe(l,n),d=me(c),p=n==="unknown"?"?":Math.round(l),y=b=>{if(!b)return t("quota.unknown");const g=Math.floor(b/3600),C=g>=24?Math.floor(g/24):0;return C>0?`${C} day${C>1?"s":""}`:g>0?`${g} hour${g>1?"s":""}`:`${Math.floor(b/60)} min`},N=b=>{if(!b)return t("quota.unknown");const g=Date.now(),T=new Date(b).getTime()-g;if(T<0)return"Reset now";const h=Math.floor(T/6e4),x=Math.floor(h/60);return x>0?`${x}h ${h%60}m`:`${h}m`};return e.jsxs("div",{className:"space-y-2 text-sm py-3 first:pt-0 border-b last:border-0 last:pb-0 pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{className:`w-4 h-4 ${n==="exhausted"?"text-red-500":n==="warning"?"text-yellow-500":"text-muted-foreground"}`}),e.jsx("span",{className:"font-medium",children:s.name})]}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded ${a}`,children:o})]}),r.error&&e.jsxs("div",{className:"ml-6 text-xs text-red-500 break-words",children:[e.jsxs("span",{className:"font-medium",children:[t("quota.label.error"),":"]})," ",r.error]}),s.type==="claudecode"&&e.jsx("div",{className:"ml-6 mt-2",children:e.jsxs("div",{className:"space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.used")}),e.jsxs("span",{className:`font-medium ${c==="warning"||c==="low"?"text-red-500":"text-foreground"}`,children:[p,"%"]})]}),e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.window.5h")}),e.jsxs("span",{className:"font-medium",children:[Math.round((r.windows?.["5h"]?.utilization||0)*100),"%"]})]}),e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.window.7d")}),e.jsxs("span",{className:"font-medium",children:[Math.round((r.windows?.["7d"]?.utilization||0)*100),"%"]})]}),r.representative_claim&&e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.limiting_bucket")}),e.jsx("span",{children:r.representative_claim==="five_hour"?"5h":"7d"})]}),e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.reset_in")}),e.jsx("span",{children:N(i.nextResetAt)})]})]})}),s.type==="codex"&&e.jsx("div",{className:"ml-6 mt-2",children:e.jsxs("div",{className:"space-y-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.used")}),e.jsxs("span",{className:`font-medium ${c==="warning"||c==="low"?"text-red-500":"text-foreground"}`,children:[p,"%"]})]}),e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.primary_window")}),e.jsxs("span",{className:"font-medium",children:[Math.round(r.rate_limit?.primary_window?.used_percent||0),"%"]})]}),e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.primary_duration")}),e.jsx("span",{children:y(r.rate_limit?.primary_window?.limit_window_seconds)})]}),r.rate_limit?.primary_window?.reset_at&&e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.resets_at")}),e.jsx("span",{children:new Date(r.rate_limit.primary_window.reset_at*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),r.plan_type&&e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.plan")}),e.jsx("span",{children:r.plan_type})]}),r.rate_limit?.secondary_window?.used_percent!==void 0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.secondary_window")}),e.jsxs("span",{className:"font-medium",children:[Math.round(r.rate_limit.secondary_window.used_percent),"%"]})]}),r.rate_limit?.secondary_window?.limit_window_seconds&&e.jsxs("div",{className:"flex justify-between items-center text-muted-foreground",children:[e.jsx("span",{children:t("quota.label.secondary_duration")}),e.jsx("span",{children:y(r.rate_limit.secondary_window.limit_window_seconds)})]})]})]})})]})}function ts({channels:s}){const{t}=f(),i=Math.max(...s.map(d=>{const p=d.quotaStatus;if(!p)return 0;const y=p.quotaData;return he(d,y)})),n=s.some(d=>d.quotaStatus?.status==="exhausted"),a=s.some(d=>d.quotaStatus?.status==="warning");let o="full";n?o="warning":a?o="low":o=pe(i,"available");const r=me(o),c=o==="warning"?"text-red-500":o==="low"?"text-yellow-500":"text-muted-foreground";return e.jsx(r,{className:`w-5 h-5 ${c} transition-colors`})}function ss({isRefreshing:s,onRefresh:t}){const{t:i}=f(),n=Xt();return n.length===0?null:e.jsxs(Xe,{children:[e.jsx(Je,{asChild:!0,children:e.jsx("button",{type:"button",className:"p-2 hover:bg-muted rounded-md transition-colors relative",children:e.jsx(ts,{channels:n})})}),e.jsx(et,{className:n.length>4?"w-[640px]":"w-80",align:"end",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:i("system.providerQuota.title")}),e.jsx("button",{onClick:t,disabled:s,className:"text-muted-foreground hover:text-foreground transition-colors","aria-label":"Refresh quotas",children:s?e.jsx(tt,{className:"w-4 h-4 animate-spin"}):e.jsx(st,{className:"w-4 h-4"})})]}),e.jsx("div",{className:`max-h-[60vh] overflow-y-auto ${n.length>4?"grid grid-cols-2 gap-x-4":""}`,children:n.map(a=>e.jsx(es,{channel:a},a.id))})]})})]})}function as(){const{data:s,isLoading:t}=nt(),{t:i}=f(),{selectedProjectId:n,setSelectedProjectId:a}=ye();u.useEffect(()=>{if(!s)return;if(s.length===0){n&&a(null);return}if(n&&s.some(y=>y.id===n))return;const d=s[0];a(d.id)},[s,n,a]);const o=d=>{a(d)},r=u.useMemo(()=>
23s?.find(d=>d.id===n),[s,n]);if(!(!t&&s&&s.length>0))return null;const c=r?.name||i("sidebar.projectSwitcher.selectProject");return e.jsxs(R,{children:[e.jsx(z,{asChild:!0,children:e.jsxs("button",{className:"hover:bg-accent/50 inline-flex items-center gap-1 rounded-md px-2 py-1 text-sm leading-none transition-colors",children:[e.jsx("span",{className:"text-sm leading-none font-medium",children:c}),e.jsx(ie,{className:"text-muted-foreground size-3"})]})}),e.jsxs(A,{className:"min-w-56 rounded-lg",align:"start",sideOffset:4,children:[e.jsx(V,{className:"text-muted-foreground text-xs",children:i("sidebar.projectSwitcher.projects")}),s.map(d=>e.jsxs(v,{onClick:()=>o(d.id),className:"gap-2 p-2",children:[e.jsx("div",{className:"flex size-6 items-center justify-center rounded-sm border",children:e.jsx(Ct,{className:"size-4 shrink-0"})}),e.jsx("div",{className:"flex flex-col",children:e.jsx("span",{className:"text-sm font-medium",children:d.name})}),n===d.id&&e.jsx(Ye,{children:"✓"})]},d.id))]})]})}function ns(){const{data:s}=Oe(),{t}=f(),[i,n]=u.useState(!1),a=ve(),{isMobile:o}=j(),r=s?.brandName||"AxonHub",l=we({mutationFn:async()=>Zt(),onSuccess:()=>{a.refetchQueries({queryKey:["provider-quotas"]}),S.success(t("system.providerQuota.refresh.success"))},onError:d=>{S.error(d.message||t("system.providerQuota.refresh.failure"))}}),c=u.useCallback(()=>{n(!0),l.mutate(void 0,{onSettled:()=>n(!1)})},[l]);return e.jsx("header",{className:"bg-background/95 supports-[backdrop-filter]:bg-background/60 fixed top-0 z-50 w-full backdrop-blur",children:e.jsxs("div",{className:"flex h-14 items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[e.jsx(Lt,{className:"-ml-4 size-8"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded",children:s?.brandLogo?e.jsx("img",{src:s.brandLogo,alt:"Brand Logo",width:24,height:24,className:"size-8 object-cover",onError:d=>{d.currentTarget.src="/logo.jpg"}}):e.jsx("img",{src:"/logo.jpg",alt:"Default Logo",width:24,height:24,className:"size-8 object-cover"})}),e.jsx("span",{className:"text-sm leading-none font-semibold",children:r})]}),e.jsx("div",{className:"bg-border mx-0.5 h-3.5 w-px"}),e.jsx(as,{})]}),e.jsxs("div",{className:"flex items-center gap-2 pr-6",children:[e.jsx(ss,{onRefresh:c,isRefreshing:i}),!o&&e.jsxs(e.Fragment,{children:[e.jsx(at,{requiredSystemScope:"read_system",children:e.jsx(D,{to:"/system",children:e.jsx(k,{variant:"ghost",size:"icon",className:"size-8",children:e.jsx(Ne,{className:"h-4 w-4"})})})}),e.jsx(re,{}),e.jsx(ue,{})]})]})]})})}function rs({title:s,items:t}){const{state:i,isMobile:n}=j(),a=Ce({select:r=>r.href}),o=t.filter(r=>r.items?r.items.some(c=>!c.isDisabled)&&!r.isDisabled:!(r.isDisabled||r.mobileOnly&&!n));return o.length===0?null:e.jsxs(Ht,{children:[e.jsx(Ft,{children:s}),e.jsx(ce,{children:o.map(r=>{const l=`${r.title}-${r.url}`;return r.items?i==="collapsed"&&!n?e.jsx(ls,{item:r,href:a},l):e.jsx(os,{item:r,href:a},l):e.jsx(is,{item:r,href:a},l)})})]})}const I=({children:s})=>e.jsx(lt,{className:"rounded-full px-1 py-0 text-xs",children:s}),is=({item:s,href:t})=>{const{setOpenMobile:i}=j();return e.jsx(P,{children:e.jsx(L,{asChild:!0,isActive:M(t,s),tooltip:s.title,className:"h-12 rounded-2xl transition-all",children:e.jsxs(D,{to:s.url,onClick:()=>i(!1),children:[s.icon&&e.jsx(s.icon,{className:"text-xl"}),e.jsx("span",{children:s.title}),s.badge&&e.jsx(I,{children:s.badge})]})})})},os=({item:s,href:t})=>{const{setOpenMobile:i}=j(),n=s.items.filter(a=>!a.isDisabled);return e.jsx(rt,{asChild:!0,defaultOpen:M(t,s,!0),className:"group/collapsible",children:e.jsxs(P,{children:[e.jsx(it,{asChild:!0,children:e.jsxs(L,{tooltip:s.title,className:"h-12 rounded-2xl transition-all",children:[s.icon&&e.jsx(s.icon,{className:"text-xl"}),e.jsx("span",{children:s.title}),s.badge&&e.jsx(I,{children:s.badge}),e.jsx(oe,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(ot,{className:"CollapsibleContent",children:e.jsx(Qt,{children:n.map(a=>e.jsx(Wt,{children:e.jsx(Kt,{asChild:!0,isActive:M(t,a),children:e.jsxs(D,{to:a.url,onClick:()=>i(!1),children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title}),a.badge&&e.jsx(I,{children:a.badge})]})})},a.title))})})]})})},ls=({item:s,href:t})=>{const i=s.items.filter(n=>!n.isDisabled);return e.jsx(P,{children:e.jsxs(R,{children:[e.jsx(z,{asChild:!0,children:e.jsxs(L,{tooltip:s.title,isActive:M(t,
23s),className:"h-12 rounded-2xl transition-all",children:[s.icon&&e.jsx(s.icon,{className:"text-xl"}),e.jsx("span",{children:s.title}),s.badge&&e.jsx(I,{children:s.badge}),e.jsx(oe,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsxs(A,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(V,{children:[s.title," ",s.badge?`(${s.badge})`:""]}),e.jsx(_,{}),i.map(n=>e.jsx(v,{asChild:!0,children:e.jsxs(D,{to:n.url,className:`${M(t,n)?"bg-secondary":""}`,children:[n.icon&&e.jsx(n.icon,{}),e.jsx("span",{className:"max-w-52 text-wrap",children:n.title}),n.badge&&e.jsx("span",{className:"ml-auto text-xs",children:n.badge})]})},`${n.title}-${n.url}`))]})]})})};function M(s,t,i=!1){return s===t.url||s.split("?")[0]===t.url||!!t?.items?.filter(n=>n.url===s).length||i&&s.split("/")[1]!==""&&s.split("/")[1]===t?.url?.split("/")[1]}function ds({user:s}){const{isMobile:t}=j(),i=ke(),{t:n}=f(),a=s.avatar.startsWith("http")||s.avatar.startsWith("/")||s.avatar.startsWith("data:"),o=a?s.name.charAt(0).toUpperCase():s.avatar;return e.jsx(ce,{children:e.jsx(P,{children:e.jsxs(R,{children:[e.jsx(z,{asChild:!0,children:e.jsxs(L,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[e.jsxs(Q,{className:"h-8 w-8 rounded-lg",children:[a&&e.jsx(W,{src:s.avatar,alt:s.name}),e.jsx(K,{className:"rounded-lg",children:o})]}),e.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[e.jsx("span",{className:"truncate font-semibold",children:s.name}),e.jsx("span",{className:"truncate text-xs",children:s.email})]}),e.jsx(ie,{className:"ml-auto size-4"})]})}),e.jsxs(A,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",align:"end",sideOffset:4,children:[e.jsx(V,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[e.jsxs(Q,{className:"h-8 w-8 rounded-lg",children:[a&&e.jsx(W,{src:s.avatar,alt:s.name}),e.jsx(K,{className:"rounded-lg",children:o})]}),e.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[e.jsx("span",{className:"truncate font-semibold",children:s.name}),e.jsx("span",{className:"truncate text-xs",children:s.email})]})]})}),e.jsx(_,{}),e.jsx(_,{}),e.jsx(Ze,{children:e.jsx(v,{asChild:!0,children:e.jsxs(D,{to:"/settings/profile",children:[e.jsx(mt,{}),n("sidebar.userMenu.account")]})})}),e.jsx(_,{}),e.jsxs(v,{onClick:i,children:[e.jsx(St,{}),n("sidebar.userMenu.logOut")]})]})]})})})}function cs(){const{t:s}=f();return e.jsxs("div",{role:"toolbar","aria-label":s("sidebar.settingsControls"),className:"flex flex-row items-center justify-end gap-2","data-testid":"mobile-header-controls",children:[e.jsx("div",{"data-testid":"mobile-language-switch",children:e.jsx(re,{})}),e.jsx("div",{"data-testid":"mobile-theme-switch",children:e.jsx(ue,{})})]})}function us({sidebarData:s,...t}){const{isMobile:i}=j();return e.jsxs(Pt,{collapsible:"icon",variant:"floating",...t,children:[e.jsx(Ut,{children:s.navGroups.map(n=>e.jsx(rs,{...n},n.title))}),e.jsxs($t,{children:[i&&e.jsx(cs,{}),e.jsx(ds,{user:s.user})]}),e.jsx(Bt,{})]})}const ms=()=>e.jsx("a",{className:"bg-primary text-primary-foreground hover:bg-primary/90 focus-visible:ring-ring fixed left-44 z-999 -translate-y-52 px-4 py-2 text-sm font-medium whitespace-nowrap opacity-95 shadow-sm transition focus:translate-y-3 focus:transform focus-visible:ring-1",href:"#content",children:"Skip to Main"});function ps({onComplete:s}){const{t}=f(),i=J(),n=qe(),[a,o]=u.useState(!0),r=u.useRef(!1);u.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]);const l=u.useCallback(()=>{r.current||n.isPending||(r.current=!0,n.mutate(void 0,{onSuccess:()=>{s?.()},onError:()=>{r.current=!1,S.error(t("common.errors.onboardingFailed"))}}))},[n,s,t]),c=u.useCallback(()=>{o(!1),i({to:"/system",search:{tab:"retry"}}).then(()=>{setTimeout(()=>{const p=le({showProgress:!0,steps:[{popover:{title:t("system.onboarding.steps.autoDisableIntro.title"),description:t("system.onboarding.steps.autoDisableIntro.description")}},{element:"#auto-disable-channel",popover:{title:t("system.onboarding.steps.autoDisableToggle.title"),description:t("system.onboarding.steps.autoDisableToggle.description"),side:"right",align:"start"}},{popover:{title:t("system.onboarding.steps.autoDisableComplete.title"),description:t("system.onboarding.steps.autoDisableComplete.de
23scription")}}],onDestroyStarted:()=>{l(),p.destroy()},onDestroyed:()=>{l()}});p.drive()},500)})},[i,t,l]),d=u.useCallback(()=>{o(!1),l()},[l]);return a===!1?null:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black/50",children:[e.jsx("div",{className:"absolute inset-0",onClick:()=>{}}),e.jsxs(ee,{className:"relative z-10 mx-4 w-full max-w-md",children:[e.jsxs(te,{className:"text-center",children:[e.jsx(se,{className:"text-2xl",children:t("system.onboarding.autoDisableChannel.title")}),e.jsx(ae,{className:"text-lg",children:t("system.onboarding.autoDisableChannel.description")})]}),e.jsx(ne,{className:"space-y-4",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(k,{onClick:c,className:"w-full",size:"lg","data-testid":"auto-disable-onboarding-start-tour",children:t("system.onboarding.autoDisableChannel.startTour")}),e.jsx(k,{variant:"outline",onClick:d,className:"w-full",size:"lg","data-testid":"auto-disable-onboarding-skip-tour",children:t("system.onboarding.autoDisableChannel.skipTour")})]})})]})]})}function hs({onComplete:s}){const{t}=f(),i=J(),n=Ie(),[a,o]=u.useState(!0);u.useEffect(()=>(a?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[a]);const r=u.useCallback(()=>{o(!1),i({to:"/system"}).then(()=>{setTimeout(()=>{const c=le({showProgress:!0,steps:[{element:"#system-title",popover:{title:t("system.onboarding.steps.welcome.title"),description:t("system.onboarding.steps.welcome.description"),side:"bottom",align:"start"}},{element:"#brand-name",popover:{title:t("system.onboarding.steps.brandName.title"),description:t("system.onboarding.steps.brandName.description"),side:"bottom",align:"start"}},{element:"#brand-logo-upload",popover:{title:t("system.onboarding.steps.brandLogo.title"),description:t("system.onboarding.steps.brandLogo.description"),side:"bottom",align:"start"}},{element:'[data-value="retry"]',popover:{title:t("system.onboarding.steps.retryPolicy.title"),description:t("system.onboarding.steps.retryPolicy.description"),side:"bottom",align:"center"},onHighlighted:()=>{setTimeout(()=>{i({to:"/system",search:{tab:"retry"}})},300)}},{element:"#retry-enabled-switch",popover:{title:t("system.onboarding.steps.retryEnabled.title"),description:t("system.onboarding.steps.retryEnabled.description"),side:"right",align:"start"}},{element:"#retry-max-retries",popover:{title:t("system.onboarding.steps.retryMaxRetries.title"),description:t("system.onboarding.steps.retryMaxRetries.description"),side:"right",align:"start"}},{element:"#max-single-channel-retries",popover:{title:t("system.onboarding.steps.retrySingleChannel.title"),description:t("system.onboarding.steps.retrySingleChannel.description"),side:"right",align:"start"}},{element:"#retry-delay",popover:{title:t("system.onboarding.steps.retryDelay.title"),description:t("system.onboarding.steps.retryDelay.description"),side:"right",align:"start"}},{popover:{title:t("system.onboarding.steps.autoDisableIntro.title"),description:t("system.onboarding.steps.autoDisableIntro.description")}},{element:"#auto-disable-channel",popover:{title:t("system.onboarding.steps.autoDisableToggle.title"),description:t("system.onboarding.steps.autoDisableToggle.description"),side:"right",align:"start"}},{popover:{title:t("system.onboarding.steps.autoDisableComplete.title"),description:t("system.onboarding.steps.autoDisableComplete.description")}},{element:'[data-value="storage"]',popover:{title:t("system.onboarding.steps.dataStorage.title"),description:t("system.onboarding.steps.dataStorage.description"),side:"bottom",align:"center"},onHighlighted:()=>{setTimeout(()=>{i({to:"/system",search:{tab:"storage"}})},300)}},{element:"#default-data-storage",popover:{title:t("system.onboarding.steps.dataStorageSelection.title"),description:t("system.onboarding.steps.dataStorageSelection.description"),side:"right",align:"start"}},{element:"#storage-policy-store-chunks",popover:{title:t("system.onboarding.steps.storageChunks.title"),description:t("system.onboarding.steps.storageChunks.description"),side:"right",align:"start"}},{element:"#storage-policy-store-request-body",popover:{title:t("system.onboarding.steps.storageRequestBody.title"),description:t("system.onboarding.steps.storageRequestBody.description"),side:"right",align:"start"}},{element:"#storage-policy-store-response-body",popover:{title:t("system.onboarding.steps.storageResponseBody.title"),description:t("system.onboarding.steps.storageResponseBody.description"),side:"right",align:"start"}},{element:"#storage-cleanup-option-requests",popover:{title:t("system.onboarding.steps.storageCleanupRequests.title"),description:t("system.onboarding.steps.storageCleanupRequests.description"),side:"right",align:"start"}},{element:"#storage-cleanup-option-usage_logs",popover:{title:t("system.onboarding.steps.storageCleanupUsageLogs.title"),description:t("system.onboarding.steps.storageCleanupUsageLogs.description"),side:"right",align:"start"}},{element:"#data-storages-link",popover:{title:t("system.onboarding.steps.complete.title"),description:t("system.onboarding.steps.complete.de
23scription"),side:"bottom",align:"start"},onHighlighted:()=>{n.mutate(void 0,{onSuccess:()=>{S.success(t("system.onboarding.completeTour")),s?.(),i({to:"/data-storages"})}})}}],onDestroyStarted:()=>{n.mutate(void 0,{onSuccess:()=>{S.success(t("system.onboarding.completeTour")),s?.()}}),c.destroy()}});c.drive()},500)})},[n,i,t]),l=u.useCallback(()=>{o(!1),n.mutate(void 0,{onSuccess:()=>{s?.()}})},[n,s]);return a===!1?null:e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center overflow-hidden bg-black/50",children:[e.jsx("div",{className:"absolute inset-0",onClick:()=>{}}),e.jsxs(ee,{className:"relative z-10 mx-4 w-full max-w-md",children:[e.jsxs(te,{className:"text-center",children:[e.jsx(se,{className:"text-2xl",children:t("system.onboarding.title")}),e.jsx(ae,{className:"text-lg",children:t("system.onboarding.description")})]}),e.jsx(ne,{className:"space-y-4",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(k,{onClick:r,className:"w-full",size:"lg","data-testid":"onboarding-start-tour",children:t("system.onboarding.startTour")}),e.jsx(k,{variant:"outline",onClick:l,className:"w-full",size:"lg","data-testid":"onboarding-skip-tour",children:t("system.onboarding.skipTour")})]})})]})]})}function gs({children:s,showOnboarding:t=!0,onComplete:i}){const{data:n,isLoading:a}=Re(),[o,r]=u.useState("none"),c=U(p=>p.auth.user)?.isOwner??!1;u.useEffect(()=>{!a&&t&&c&&(!n||!n.onboarded?r("main"):n.autoDisableChannel?.onboarded?r("none"):r("autoDisableChannel"))},[n,a,t,c]);const d=()=>{r("none"),i?.()};return e.jsxs(e.Fragment,{children:[s,o==="main"&&e.jsx(hs,{onComplete:d}),o==="autoDisableChannel"&&e.jsx(ps,{onComplete:d})]})}function bs({children:s}){const t=Mt.get("sidebar_state")!=="false",i=Se();return Tt(),e.jsxs(At,{defaultOpen:t,className:"h-screen flex-col overflow-hidden",children:[e.jsx(ns,{}),e.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[e.jsx(ms,{}),e.jsx(us,{sidebarData:i}),e.jsx("div",{id:"content",className:m("ml-auto w-full max-w-full","peer-data-[state=collapsed]:w-[calc(100%-var(--sidebar-width-icon)-1rem)]","peer-data-[state=expanded]:w-[calc(100%-var(--sidebar-width))]","sm:transition-[width] sm:duration-200 sm:ease-linear","flex min-h-0 min-w-0 flex-1 flex-col overflow-auto pt-14 has-[main.fixed-main]:overflow-hidden","group-data-[scroll-locked=1]/body:h-full","has-[main.fixed-main]:group-data-[scroll-locked=1]/body:h-svh"),children:e.jsx(gs,{children:s||e.jsx(_e,{})})})]})]})}function xs({children:s}){const t=Me(),{accessToken:i}=U(o=>o.auth),{isLoading:n,error:a}=De();if(u.useEffect(()=>{if(!i){const o=window.location.pathname;!o.startsWith("/sign-in")&&!o.startsWith("/sign-up")&&!o.startsWith("/initialization")&&!o.startsWith("/forgot-password")&&!o.startsWith("/otp")&&t.navigate({to:"/sign-in"})}},[i,t]),u.useEffect(()=>{a&&i&&Te(a)&&t.navigate({to:"/sign-in"})},[a,i,t]),!i){const o=window.location.pathname;return o.startsWith("/sign-in")||o.startsWith("/sign-up")||o.startsWith("/initialization")||o.startsWith("/forgot-password")||o.startsWith("/otp")?e.jsx(e.Fragment,{children:s}):e.jsx("div",{className:"flex h-screen items-center justify-center",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(E,{className:"h-8 w-48"}),e.jsx(E,{className:"h-4 w-32"})]})})}return i&&n?e.jsx("div",{className:"flex h-screen items-center justify-center",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(E,{className:"h-8 w-48"}),e.jsx(E,{className:"h-4 w-32"})]})}):e.jsx(e.Fragment,{children:s})}const Ys=()=>e.jsx(xs,{children:e.jsx(bs,{})});export{Ys as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.